diff --git a/.gitignore b/.gitignore index 855e940c689..97cc4736424 100644 --- a/.gitignore +++ b/.gitignore @@ -117,3 +117,9 @@ sources.list.* # Generated mirror configs apt-retries-count + +# Python venv +venv/** + +src/protobuf/** +fsroot-vs/** \ No newline at end of file diff --git a/dockers/docker-database/database_config.json.j2 b/dockers/docker-database/database_config.json.j2 index b97589d3733..a79e1a8dc70 100644 --- a/dockers/docker-database/database_config.json.j2 +++ b/dockers/docker-database/database_config.json.j2 @@ -115,7 +115,13 @@ "id" : 14, "separator": ":", "instance" : "redis" - } + }, + "DYNAMIC_DB" : { + "id" : 21, + "separator": "|", + "instance" : "redis" + } + {% if DATABASE_TYPE is defined and DATABASE_TYPE == "dpudb" %} , "DPU_APPL_DB" : { diff --git a/dockers/docker-orchagent/Dockerfile.j2 b/dockers/docker-orchagent/Dockerfile.j2 index fb90b4f09c2..48d5848619e 100755 --- a/dockers/docker-orchagent/Dockerfile.j2 +++ b/dockers/docker-orchagent/Dockerfile.j2 @@ -22,7 +22,9 @@ RUN apt-get update && \ pciutils \ # Needed for installing netifaces Python package build-essential \ - python3-dev + python3-dev \ + # Used for scheduledconfigmgrd + cron {% if ( CONFIGURED_ARCH == "armhf" or CONFIGURED_ARCH == "arm64" ) %} # Fix for gcc/python/iputils-ping not found in arm docker diff --git a/dockers/docker-orchagent/critical_processes.j2 b/dockers/docker-orchagent/critical_processes.j2 index b9bad74089b..bc79f4d5790 100644 --- a/dockers/docker-orchagent/critical_processes.j2 +++ b/dockers/docker-orchagent/critical_processes.j2 @@ -19,4 +19,7 @@ program:nbrmgrd program:vxlanmgrd program:coppmgrd program:tunnelmgrd +program:timerangemgrd +program:scheduledconfigmgrd +program:cron {%- endif %} diff --git a/dockers/docker-orchagent/supervisord.conf.j2 b/dockers/docker-orchagent/supervisord.conf.j2 index eee121f1c68..34b2dbca1ce 100644 --- a/dockers/docker-orchagent/supervisord.conf.j2 +++ b/dockers/docker-orchagent/supervisord.conf.j2 @@ -340,3 +340,48 @@ dependent_startup_wait_for=swssconfig:exited environment=ASAN_OPTIONS="log_path=/var/log/asan/fdbsyncd-asan.log{{ asan_extra_options }}" {% endif %} {%- endif %} + +{% if is_fabric_asic == 0 %} +[program:timerangemgrd] +command=/usr/bin/timerangemgrd +priority=18 +autostart=false +autorestart=false +stdout_logfile=syslog +stderr_logfile=syslog +dependent_startup=true +dependent_startup_wait_for=swssconfig:exited +{% if ENABLE_ASAN == "y" %} +environment=ASAN_OPTIONS="log_path=/var/log/asan/timerangemgrd-asan.log{{ asan_extra_options }}" +{% endif %} +{%- endif %} + +{% if is_fabric_asic == 0 %} +[program:scheduledconfigmgrd] +command=/usr/bin/scheduledconfigmgrd +priority=18 +autostart=false +autorestart=false +stdout_logfile=syslog +stderr_logfile=syslog +dependent_startup=true +dependent_startup_wait_for=swssconfig:exited +{% if ENABLE_ASAN == "y" %} +environment=ASAN_OPTIONS="log_path=/var/log/asan/scheduledconfigmgrd-asan.log{{ asan_extra_options }}" +{% endif %} +{%- endif %} + +{% if is_fabric_asic == 0 %} +[program:cron] +command=/usr/sbin/cron -f -L 15 +priority=18 +autostart=false +autorestart=false +stdout_logfile=syslog +stderr_logfile=syslog +dependent_startup=true +dependent_startup_wait_for=swssconfig:exited +{% if ENABLE_ASAN == "y" %} +environment=ASAN_OPTIONS="log_path=/var/log/asan/cron-asan.log{{ asan_extra_options }}" +{% endif %} +{%- endif %} \ No newline at end of file diff --git a/platform/vs/docker-sonic-vs/database_config.json b/platform/vs/docker-sonic-vs/database_config.json index 04cb3d3aaae..275699d1cd2 100644 --- a/platform/vs/docker-sonic-vs/database_config.json +++ b/platform/vs/docker-sonic-vs/database_config.json @@ -77,7 +77,12 @@ "id" : 14, "separator": ":", "instance" : "redis" - } + }, + "DYNAMIC_DB" : { + "id" : 21, + "separator": "|", + "instance" : "redis" + } }, "VERSION" : "1.0" } diff --git a/platform/vs/docker-sonic-vs/start.sh b/platform/vs/docker-sonic-vs/start.sh index f7dbde8dcff..a202df434d6 100755 --- a/platform/vs/docker-sonic-vs/start.sh +++ b/platform/vs/docker-sonic-vs/start.sh @@ -180,6 +180,12 @@ supervisorctl start tunnelmgrd supervisorctl start fabricmgrd +supervisorctl start timerangemgrd + +supervisorctl start scheduledconfigmgrd + +supervisorctl start cron + # Start arp_update when VLAN exists VLAN=`sonic-cfggen -d -v 'VLAN.keys() | join(" ") if VLAN'` if [ "$VLAN" != "" ]; then diff --git a/platform/vs/docker-sonic-vs/supervisord.conf.j2 b/platform/vs/docker-sonic-vs/supervisord.conf.j2 index a394d29d406..301cd58b7f3 100644 --- a/platform/vs/docker-sonic-vs/supervisord.conf.j2 +++ b/platform/vs/docker-sonic-vs/supervisord.conf.j2 @@ -405,3 +405,37 @@ stderr_syslog=true {% if ENABLE_ASAN == "y" %} environment=ASAN_OPTIONS="log_path=/var/log/asan/fabricmgrd-asan.log{{ asan_extra_options }}" {% endif %} + +[program:timerangemgrd] +command=/usr/bin/timerangemgrd +priority=27 +autostart=false +autorestart=false +stdout_logfile=syslog +stderr_logfile=syslog +{% if ENABLE_ASAN == "y" %} +environment=ASAN_OPTIONS="log_path=/var/log/asan/timerangemgrd-asan.log{{ asan_extra_options }}" +{% endif %} + +[program:scheduledconfigmgrd] +command=/usr/bin/scheduledconfigmgrd +priority=27 +autostart=false +autorestart=false +stdout_logfile=syslog +stderr_logfile=syslog +{% if ENABLE_ASAN == "y" %} +environment=ASAN_OPTIONS="log_path=/var/log/asan/scheduledconfigmgrd-asan.log{{ asan_extra_options }}" +{% endif %} + + +[program:cron] +command=/usr/sbin/cron -f -L 15 +priority=27 +autostart=false +autorestart=false +stdout_logfile=syslog +stderr_logfile=syslog +{% if ENABLE_ASAN == "y" %} +environment=ASAN_OPTIONS="log_path=/var/log/asan/cron-asan.log{{ asan_extra_options }}" +{% endif %} \ No newline at end of file diff --git a/rules/config b/rules/config index 0ab40596ad3..1c55c051449 100644 --- a/rules/config +++ b/rules/config @@ -10,7 +10,7 @@ # SONIC_CONFIG_BUILD_JOBS - set number of jobs for parallel build. # Corresponding -j argument will be passed to make command inside docker # container. -SONIC_CONFIG_BUILD_JOBS = 1 +SONIC_CONFIG_BUILD_JOBS = 12 # SONIC_CONFIG_MAKE_JOBS - set number of parallel make jobs per package. # Corresponding -j argument will be passed to make/dpkg commands that build separate packages @@ -49,7 +49,7 @@ SMARTSWITCH ?= 0 DEFAULT_USERNAME = admin # DEFAULT_PASSWORD - default password for installer build -DEFAULT_PASSWORD = YourPaSsWoRd +DEFAULT_PASSWORD = Marv12\#$ # ENABLE_ZTP - installs Zero Touch Provisioning support. # ENABLE_ZTP = y @@ -153,7 +153,7 @@ INCLUDE_RESTAPI ?= n INCLUDE_NAT = y # INCLUDE_DHCP_RELAY - build and install dhcp-relay package -INCLUDE_DHCP_RELAY = y +INCLUDE_DHCP_RELAY = n # INCLUDE_DHCP_SERVER - build and install dhcp-server package INCLUDE_DHCP_SERVER ?= n diff --git a/src/sonic-yang-models/yang-models/sonic-scheduled-configurations.yang b/src/sonic-yang-models/yang-models/sonic-scheduled-configurations.yang new file mode 100644 index 00000000000..f17a2959617 --- /dev/null +++ b/src/sonic-yang-models/yang-models/sonic-scheduled-configurations.yang @@ -0,0 +1,56 @@ +module sonic-scheduled-configurations { + + yang-version 1.1; + + namespace "http://github.com/sonic-net/sonic-scheduled-configurations"; + prefix scheduled-configurations; + + description "SCHEDULED_CONFIGURATIONS YANG Module for SONiC OS Used for Scheduled Configuration"; + + revision 2024-05-09 { + description "First Revision"; + } + + container sonic-scheduled-configurations { + + container SCHEDULED_CONFIGURATIONS { + + description "TIME_RANGE part of config_db.json"; + + list SCHEDULED_CONFIGURATIONS_LIST { + description "List of scheduled configurations, each identified by unique name"; + + key "name"; + + leaf name { + type string; + description "Unique name for the scheduled configuration"; + } + + leaf time_range { + mandatory true; + type string { + length "1..255"; + } + description "Time range this configuration is bound to"; + } + + leaf configuration { + mandatory true; + type string; + description "Configuration to be applied to CONFIG_DB in JSON format"; + } + + leaf deactivation_configuration { + mandatory true; + type string; + description "A configuration to be applied at deactivation, or the string 'remove' to simply remove the configuration at deactivation"; + + } + } /* end of list SCHEDULED_CONFIGURATIONS_LIST */ + + } /* end of container SCHEDULED_CONFIGURATIONS */ + + } /* end of top level container */ + +} /* end of module sonic-scheduled-configurations */ \ No newline at end of file diff --git a/src/sonic-yang-models/yang-models/sonic-timerange.yang b/src/sonic-yang-models/yang-models/sonic-timerange.yang new file mode 100644 index 00000000000..6cb9be61239 --- /dev/null +++ b/src/sonic-yang-models/yang-models/sonic-timerange.yang @@ -0,0 +1,61 @@ +module sonic-timerange { + + yang-version 1.1; + + namespace "http://github.com/sonic-net/sonic-timerange"; + prefix timerange; + + description "TIME_RANGE YANG Module for SONiC OS Used for Scheduled Configuration"; + + revision 2024-05-09 { + description "First Revision"; + } + + container sonic-timerange { + + container TIME_RANGE { + + description "TIME_RANGE part of config_db.json"; + + list TIME_RANGE_LIST { + description "List of time ranges, each identified by unique name"; + + key "name"; + + leaf name { + type string; + description "Unique name for the time range"; + } + + leaf start { + mandatory true; + type string { + length "1..255"; + } + description "Start time for time range"; + } + + leaf end { + mandatory true; + type string { + length "1..255"; + } + description "End time for time range"; + } + + leaf start_year { + type uint16; + description "Indicates what year this time range will begin running"; + } + + leaf end_year { + type uint16; + description "Indicates what year this time range will end"; + } + } /* end of list TIME_RANGE_LIST */ + + } /* end of container TIME_RANGE */ + + } /* end of top level container */ + +} /* end of module sonic-timerange */