Skip to content

Commit 19284b8

Browse files
noaOrMlnxbratashXtahmed-devSuvarnaMeenakshijleveque
authored
merge from azure to fork (#9)
* [BFN] Add support pcied daemon for Montara and Newport (sonic-net#5199) Signed-off-by: Petro Bratash <[email protected]> * [cfggen] Allow Write To Redis DB With Template/Batch Mode (sonic-net#5203) Argument to write to config-db is not allowed when using template. This PR allows cfggen to write to redis db when using template mode. signed-off-by: Tamer Ahmed <[email protected]> * [submodule]: Advance sonic-snmpagent. (sonic-net#5213) Update sonic-snmpagent submodule to include below commits: 1a2b62a [Namespace]: Fix SAI_ID key used in cpfcIfTable and csqIfQosGroupStatsTable implementation (sonic-net#138) d06f00c [pytest/coverage]: add coverage support (sonic-net#156) 90e9f2e [Namespace]: Simplify sync_d functions to use higher order (sonic-net#154) b5815d9 [LLDP]: Modify OID index of LLDPRemTableUpdater MIB (sonic-net#155) d5f2b92 [Multiasic]: Provide namespace support for ipNetToMediaPhysAddress (sonic-net#129) 166c221 [Namespace]: Fix interface counters in RFC 1213 (sonic-net#145) Signed-off-by: SuvarnaMeenakshi <[email protected]> * [cfggen] Conform With Python 3 Syntax (sonic-net#5154) Preparing sonic-cfggen for migration to Python 3. signed-off-by: Tamer Ahmed <[email protected]> * [redis-dump-load] Update submodule (sonic-net#5215) * src/redis-dump-load 832a645...7585497 (2): > Merge pull request sonic-net#63 from jleveque/update_gitignore > Merge pull request #59 from breser/redis-load-empty * [services] Fix Delay Start of SNMP And Telemetry (sonic-net#5211) SNMP and Telemetry services are not critical to switch startup. They also cause fast-reboot not to meet timing requirements. In order to delay start those service are associated with systemd timer units, however when hostcfgd initiate service start, it start the service and not the timer. This PR fixes this issue by starting the timer associated with systemd unit. signed-off-by: Tamer Ahmed <[email protected]> * [sonic-py-common][multi ASIC] API to get a list of frontend ports (sonic-net#5221) * [sonic-py-common][multi ASIC] utility to get a list of frontend ports from a given list of ports * [sonic-config-engine] Update .gitignore (sonic-net#5223) - Ignore directories generated by building Python wheel package - Move all sonic-config-engine ignores from the root .gitignore to src/sonic-config-engine/.gitignore * Advance swss-common submodule. (sonic-net#5222) 9a7c9d Dbconnector namespace support (sonic-net#376) c32f0b5 add state db entry for fgnhg route entry (sonic-net#374) * [caclmgrd] Add support for multi-ASIC platforms (sonic-net#5022) * Support for Control Plane ACL's for Multi-asic Platforms. Following changes were done: 1) Moved from using blocking listen() on Config DB to the select() model via python-swsscommon since we have to wait on event from multiple config db's 2) Since python-swsscommon is not available on host added libswsscommon and python-swsscommon and dependent packages in the base image (host enviroment) 3) Made iptables programmed in all namespace using ip netns exec Signed-off-by: Abhishek Dosi <[email protected]> * Address Review Comments Signed-off-by: Abhishek Dosi <[email protected]> * Fix Review Comments * Fix Comments * Added Change for Multi-asic to have iptables rules to accept internal docker tcp/udp traffic needed for syslog and redis-tcp connection. Signed-off-by: Abhishek Dosi <[email protected]> * Fix Review Comments * Added more comments on logic. * Fixed all warning/errors reported by http://pep8online.com/ other than line > 80 characters. * Fix Comment Signed-off-by: Abhishek Dosi <[email protected]> * Verified with swsscommon package. Fix issue for single asic platforms. * Moved to new python package * Address Review Comments. Signed-off-by: Abhishek Dosi <[email protected]> * Address Review Comments. * Add support to VS platform for platform.json and DPB CLI Tests (sonic-net#5192) - Reverts commit 457674c - Creates "platform.json" for vs docker - Adds test case for port breakout CLI - Explicitly sets admin status of all the VS interfaces to down to be compatible with SWSS test cases, specifically vnet tests and sflow tests Signed-off-by: Sangita Maity <[email protected]> * [iccpd] Fix uninitialized variable. (sonic-net#5112) To declare *tb[] but do not initialize it, it might be very risky. We get iccpd exception during processing arp/nd event. Initialize it to {0}; * Fix unwanted python exception in syslog during database container (sonic-net#5227) startup when doing redis PING since database_config.json getting generated from jinja2 template is still not ready. Signed-off-by: Abhishek Dosi <[email protected]> * [hostcfgd] Handle Both Service And Timer Units (sonic-net#5228) Commit e484ae9 introduced systemd .timer unit to hostcfgd. However, when stopping service that has timer, there is possibility that timer is not running and the service would not be stopped. This PR address this situation by handling both .timer and .service units. signed-off-by: Tamer Ahmed <[email protected]> * [arista] Update driver submodules (sonic-net#5147) - fix watchdog timeout units - fix import path for thermal_manager - remove arista bind mounts for docker-snmp - improve arista bind mounts for pmon * [docker-radv] Fix startup issues (sonic-net#5230) **- Why I did it** PR sonic-net#4599 introduced two bugs in the startup of the router advertiser container: 1. References to the `wait_for_intf.sh` script were changed to `wait_for_link.sh`, but the actual script was not renamed 2. The `ipv6_found` Jinja2 variable added to the supervisor config file goes out of scope before it is read. **- How I did it** 1. Rename the `wait_for_intf.sh` script to `wait_for_link.sh` 2. Use the Jinja2 "namespace" construct to fix the scope issue **- How to verify it** Ensure all processes in the radv container start properly under the correct conditions (i.e., whether or not there is at least one VLAN with an IPv6 address assigned). * [sonic-utilities] Update submodule (sonic-net#5233) * src/sonic-utilities d5fdd74...17fb378 (7): > [sonic-installer] Import re module (sonic-net#1061) > [fast-reboot]: Fix fail to execute fast-reboot problem (sonic-net#1047) > [config] Reduce Calls to SONiC Cfggen (sonic-net#1052) > [filter-fdb] Call Filter FDB Main From Within Test Code (sonic-net#1051) > [sflow_test.py]: Fix show sflow display. (sonic-net#1054) > Change fast-reboot script to use swss and radv service script (sonic-net#1036) > Common functions for show CLI support on multi ASIC (sonic-net#999) * [sonic-host-service]: Add SONiC Host Services infrastructure (sonic-net#4840) - Why I did it When SONiC is configured with the management framework and/or telemetry services, the applications running inside those containers need to access some functionality on the host system. The following is a non-exhaustive list of such functionality: Image management Configuration save and load ZTP enable/disable and status Show tech support - How I did it The host service is a Python process that listens for requests via D-Bus. It will then service those requests and send a response back to the requestor. This PR only introduces the host service infrastructure. Applications that need access to the host services must add applets that will register on D-Bus endpoints to service the appropriate functionality. - How to verify it - Description for the changelog Add SONiC Host Service for container to execute select commands in host Signed-off-by: Nirenjan Krishnan <[email protected]> * Add common functions applicable to single/multi asic platforms (sonic-net#5224) * Add common functions applicable to single/multi asic platforms * Raise exception if invalid namespace is given as input. * [sonic-swss] Update submodule (sonic-net#5231) * src/sonic-swss d2bab10...c4949a2 (34): > [dvs] Add new common issues and TOC to DVS README (sonic-net#1405) > Avoid adding loopback interface (ip link add) when setting nat zone on loopback interface (sonic-net#1411) > [portsorch] add buffer drop FC group (sonic-net#1368) > [dvs/chassis] Bring up SONiC interfaces in virtual chassis (sonic-net#1410) > [chassis/dvs] Add support for virtual chassis to DVS testbed (sonic-net#1345) > [sonic-swsss] Fix the issue of field "next_hop_ip" not getting updated in state DB in ERSPAN Mirror (sonic-net#1375) > [intfmgr] Fix OA crash issue due to link local configurations (sonic-net#1195) > Fix the issue when persistent DVS is used to run pytest which has number of front-panel ports < 32 (sonic-net#1373) > [dvs] Refactor AsicDbValidator (sonic-net#1402) > [fec] Get FEC mode when port is already admin down (sonic-net#1403) > [fec] added logic that put port down before applying fec onfiguration (sonic-net#1399) > [dvs] Add performance test for adding and deleting routes (sonic-net#1392) > Ignore IPv6 link-local and multicast entries as Vnet routes (sonic-net#1401) > [vlanmgr] Support Jumbo Frame By Default (sonic-net#1393) > Fix log/syslog not being correct when last test fails for given module (sonic-net#1395) > Get initial speed from ASIC DB (sonic-net#1390) > [dvs] Add options to limit CPU usage (sonic-net#1394) > [intfsorch] Retrieve Port object before setting NAT zone on router interfaces. (sonic-net#1372) > [.gitignore] Ignore gearsyncd binary (sonic-net#1381) > Added Max Nexthopgroup/ECMP Count supported by device into State DB. (sonic-net#1383) > [dvs] Upload logs even if failure occurs during startup (sonic-net#1389) > [rates] fix issue with rates init (sonic-net#1387) > [dvs] Validate that SWSS is ready to receive input before starting tests (sonic-net#1385) > [dvs] Convert sflow and speed tests to use dvslib (sonic-net#1382) > [dvs_acl] Refactor and document dvs_acl library (sonic-net#1378) > [dvs] Fix install instructions in README (sonic-net#1379) > [dvs] Update README with new flags, options, and known issues (sonic-net#1380) > swss: gearsyncd should return 0 on exit (sonic-net#1376) > Remove 00-copp.config.json from swss debian package. (sonic-net#1366) > fix undefined var in rates lua scripts (sonic-net#1365) > [fdborch] Fixed Orchagent crash in FDB flush on port disable. (sonic-net#1369) > [tlm_teamd]: Try to add LAG again, when teamd is not ready first time (sonic-net#1347) > [vs] Incorporate python3 best practices into DVSLib (sonic-net#1357) > [dvs] Mark unstable tests as xfail (sonic-net#1356) * [arista/aboot]: Zero out 1st MB before repartitioning (sonic-net#5220) The first partition starting point was changed to be 1M as part of this commit: 6ba2f97. On systems that are misaligned before conversion (partition start is the first sector), the relica partition that is left in the first MB can cause problems in Aboot and result in corruption of the filesystem on the new aligned partition. Zeroing this old relica makes sure that there is nothing left of the old partition lying around. There won't be any risk of having Aboot corrupt the new filesystem because of the old relica. Signed-off-by: Baptiste Covolato <[email protected]> * [sonic-py-common] Add unit test framework (sonic-net#5238) **- Why I did it** To install the framework for adding unit tests to the sonic-py-common package and report coverage. ** How I did it ** - Incorporate pytest and pytest-cov into sonic-py-common package build - Updgrade version of 'mock' installed to version 3.0.5, the last version which supports Python 2. This fixes a bug where the file object returned from `mock_open()` was not iterable (see https://bugs.python.org/issue32933) - Add support for Python 3 setuptools and pytest in sonic-slave-buster environment - Add tests for `device_info.get_machine_info()` and `device_info.get_platform()` functions - Also add a .gitignore in the root of the sonic-py-common directory, move all related ignores from main .gitignore file, and add ignores for files and dirs generated by pytest-cov * Add switch for synchronous mode (sonic-net#5237) Add a master switch so that the sync/async mode can be configured. Example usage of the switch: 1. Configure mode while building an image `make ENABLE_SYNCHRONOUS_MODE=y <target>` 2. Configure when the device is running Change CONFIG_DB with `sonic-cfggen -a '{"DEVICE_METADATA":{"localhost": {"synchronous_mode": "enable"}}}' --write-to-db` Restart swss with `systemctl restart swss` * [enable counters] Enable port buffer drops by default and update MLNX SAI submodule (sonic-net#5059) * Enable port buffer drops by default * [Mellanox] Update SAI_Implementation Signed-off-by: Mykola Faryma <[email protected]> * Platform monitor changes in daemon_base for multi_asic (sonic-net#4932) Adding namespace support for db connect API. Co-authored-by: Petro Bratash <[email protected]> Co-authored-by: Tamer Ahmed <[email protected]> Co-authored-by: SuvarnaMeenakshi <[email protected]> Co-authored-by: Joe LeVeque <[email protected]> Co-authored-by: Mahesh Maddikayala <[email protected]> Co-authored-by: judyjoseph <[email protected]> Co-authored-by: abdosi <[email protected]> Co-authored-by: Sangita Maity <[email protected]> Co-authored-by: Kelly Chen <[email protected]> Co-authored-by: Samuel Angebault <[email protected]> Co-authored-by: nirenjan <[email protected]> Co-authored-by: Baptiste Covolato <[email protected]> Co-authored-by: shi-su <[email protected]> Co-authored-by: Mykola F <[email protected]>
1 parent bdcd478 commit 19284b8

File tree

85 files changed

+2848
-680
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

85 files changed

+2848
-680
lines changed

.gitignore

+2-11
Original file line numberDiff line numberDiff line change
@@ -28,17 +28,6 @@ platform/*/docker-*/Dockerfile
2828
# Installer-related files and directories
2929
installer/x86_64/platforms/
3030

31-
# Config engine
32-
src/sonic-config-engine/**/*.pyc
33-
src/sonic-config-engine/build
34-
src/sonic-config-engine/sonic_config_engine.egg-info
35-
36-
src/sonic-py-common/**/*.pyc
37-
src/sonic-py-common/.eggs/
38-
src/sonic-py-common/build
39-
src/sonic-py-common/dist
40-
src/sonic-py-common/sonic_py_common.egg-info
41-
4231
# Misc. files
4332
asic_config_checksum
4433
files/Aboot/boot0
@@ -71,3 +60,5 @@ platform/broadcom/sonic-platform-modules-dell/s6100/modules/dell_s6100_lpc.c
7160
platform/broadcom/sonic-platform-modules-dell/z9100/modules/dell_ich.c
7261
platform/broadcom/sonic-platform-modules-dell/z9100/modules/dell_mailbox.c
7362
platform/broadcom/sonic-platform-modules-dell/z9264f/sonic_platform/ipmihelper.py
63+
platform/vs/docker-sonic-vs/init_cfg.json
64+
platform/p4/docker-sonic-p4/init_cfg.json

Makefile.work

+2
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@
3838
# * SONIC_DPKG_CACHE_METHOD: Specifying method of obtaining the Debian packages from cache: none or cache
3939
# * SONIC_DPKG_CACHE_SOURCE: Debian package cache location when cache enabled for debian packages
4040
# * BUILD_LOG_TIMESTAMP: Set timestamp in the build log (simple/none)
41+
# * ENABLE_SYNCHRONOUS_MODE: Enable synchronous mode between orchagent and syncd
4142
#
4243
###############################################################################
4344

@@ -212,6 +213,7 @@ SONIC_BUILD_INSTRUCTION := make \
212213
EXTRA_DOCKER_TARGETS=$(EXTRA_DOCKER_TARGETS) \
213214
BUILD_LOG_TIMESTAMP=$(BUILD_LOG_TIMESTAMP) \
214215
SONIC_ENABLE_IMAGE_SIGNATURE=$(ENABLE_IMAGE_SIGNATURE) \
216+
ENABLE_SYNCHRONOUS_MODE=$(ENABLE_SYNCHRONOUS_MODE) \
215217
$(SONIC_OVERRIDE_BUILD_VARS)
216218

217219
.PHONY: sonic-slave-build sonic-slave-bash init reset

device/barefoot/x86_64-accton_as9516bf_32d-r0/pmon_daemon_control.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"skip_pcied": true,
2+
"skip_pcied": false,
33
"skip_fancontrol": true,
44
"skip_thermalctld": true,
55
"skip_ledd": true,

device/barefoot/x86_64-accton_wedge100bf_32x-r0/pmon_daemon_control.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"skip_pcied": true,
2+
"skip_pcied": false,
33
"skip_fancontrol": true,
44
"skip_thermalctld": true,
55
"skip_ledd": true,

dockers/docker-orchagent/enable_counters.py

+1
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ def enable_counters():
1818
enable_counter_group(db, 'PG_WATERMARK')
1919
enable_counter_group(db, 'QUEUE_WATERMARK')
2020
enable_counter_group(db, 'BUFFER_POOL_WATERMARK')
21+
enable_counter_group(db, 'PORT_BUFFER_DROP')
2122

2223
def get_uptime():
2324
with open('/proc/uptime') as fp:

dockers/docker-orchagent/orchagent.sh

+6
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,12 @@ ORCHAGENT_ARGS="-d /var/log/swss "
2525
# Set orchagent pop batch size to 8192
2626
ORCHAGENT_ARGS+="-b 8192 "
2727

28+
# Set synchronous mode if it is enabled in CONFIG_DB
29+
SYNC_MODE=$(echo $SWSS_VARS | jq -r '.synchronous_mode')
30+
if [ "$SYNC_MODE" == "enable" ]; then
31+
ORCHAGENT_ARGS+="-s "
32+
fi
33+
2834
# Check if there is an "asic_id field" in the DEVICE_METADATA in configDB.
2935
#"DEVICE_METADATA": {
3036
# "localhost": {

dockers/docker-orchagent/swss_vars.j2

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
{
22
"asic_type": "{{ asic_type }}",
33
"asic_id": "{{ DEVICE_METADATA.localhost.asic_id }}",
4-
"mac": "{{ DEVICE_METADATA.localhost.mac }}"
4+
"mac": "{{ DEVICE_METADATA.localhost.mac }}",
5+
"synchronous_mode": "{{ DEVICE_METADATA.localhost.synchronous_mode }}"
56
}
67

dockers/docker-router-advertiser/Dockerfile.j2

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ RUN apt-get clean -y && \
2525
rm -rf /debs
2626

2727
COPY ["docker-init.sh", "/usr/bin/"]
28-
COPY ["radvd.conf.j2", "wait_for_intf.sh.j2", "docker-router-advertiser.supervisord.conf.j2", "/usr/share/sonic/templates/"]
28+
COPY ["radvd.conf.j2", "wait_for_link.sh.j2", "docker-router-advertiser.supervisord.conf.j2", "/usr/share/sonic/templates/"]
2929
COPY ["files/supervisor-proc-exit-listener", "/usr/bin"]
3030
COPY ["critical_processes", "/etc/supervisor"]
3131

dockers/docker-router-advertiser/docker-init.sh

+2-2
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,10 @@ CFGGEN_PARAMS=" \
88
-d \
99
-t /usr/share/sonic/templates/docker-router-advertiser.supervisord.conf.j2,/etc/supervisor/conf.d/supervisord.conf \
1010
-t /usr/share/sonic/templates/radvd.conf.j2,/etc/radvd.conf \
11-
-t /usr/share/sonic/templates/wait_for_intf.sh.j2,/usr/bin/wait_for_intf.sh \
11+
-t /usr/share/sonic/templates/wait_for_link.sh.j2,/usr/bin/wait_for_link.sh \
1212
"
1313
sonic-cfggen $CFGGEN_PARAMS
1414

15-
chmod +x /usr/bin/wait_for_intf.sh
15+
chmod +x /usr/bin/wait_for_link.sh
1616

1717
exec /usr/bin/supervisord

dockers/docker-router-advertiser/docker-router-advertiser.supervisord.conf.j2

+14-15
Original file line numberDiff line numberDiff line change
@@ -26,20 +26,21 @@ stdout_logfile=syslog
2626
stderr_logfile=syslog
2727
dependent_startup=true
2828

29-
{# Router advertiser should only run on ToR (T0) devices #}
30-
{% if DEVICE_METADATA.localhost.type == "ToRRouter" %}
31-
32-
{% if VLAN_INTERFACE %}
33-
{% for (name, prefix) in VLAN_INTERFACE|pfx_filter %}
29+
{# Router advertiser should only run on ToR (T0) devices which have #}
30+
{# at least one VLAN interface which has an IPv6 address asigned #}
31+
{%- set vlan_v6 = namespace(count=0) -%}
32+
{%- if DEVICE_METADATA.localhost.type == "ToRRouter" -%}
33+
{%- if VLAN_INTERFACE -%}
34+
{%- for (name, prefix) in VLAN_INTERFACE|pfx_filter -%}
3435
{# If this VLAN has an IPv6 address... #}
35-
{% if prefix | ipv6 %}
36-
{% set ipv6_found = true %}
37-
{% endif %}
38-
{% endfor %}
39-
{% endif %}
36+
{%- if prefix | ipv6 -%}
37+
{%- set vlan_v6.count = vlan_v6.count + 1 -%}
38+
{%- endif -%}
39+
{%- endfor -%}
40+
{%- endif -%}
41+
{%- endif -%}
4042

41-
{# Enusre at least one ipv6 vlan interface #}
42-
{% if ipv6_found == true %}
43+
{%- if vlan_v6.count > 0 %}
4344
[program:wait_for_link]
4445
command=/usr/bin/wait_for_link.sh
4546
priority=3
@@ -60,6 +61,4 @@ stdout_logfile=syslog
6061
stderr_logfile=syslog
6162
dependent_startup=true
6263
dependent_startup_wait_for=wait_for_link:exited
63-
{% endif %}
64-
65-
{% endif %}
64+
{% endif -%}

files/build_templates/docker_image_ctl.j2

+7-2
Original file line numberDiff line numberDiff line change
@@ -95,8 +95,13 @@ function postStartAction()
9595
link_namespace $DEV
9696
fi
9797

98-
# Wait until redis starts
99-
until [[ $($SONIC_DB_CLI PING | grep -c PONG) -gt 0 ]]; do
98+
# Wait until supervisord and redis starts. This change is needed
99+
# because now database_config.json is jinja2 templated based
100+
# and by the time file gets generated if we do redis ping
101+
# then we catch python exception of file not valid
102+
# that comes to syslog which is unwanted so wait till database
103+
# config is ready and then ping
104+
until [[ ($(docker exec -i database$DEV pgrep -x -c supervisord) -gt 0) && ($($SONIC_DB_CLI PING | grep -c PONG) -gt 0) ]]; do
100105
sleep 1;
101106
done
102107

files/build_templates/init_cfg.json.j2

+21-18
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22
"DEVICE_METADATA": {
33
"localhost": {
44
"default_bgp_status": {% if shutdown_bgp_on_start == "y" %}"down"{% else %}"up"{% endif %},
5-
"default_pfcwd_status": {% if enable_pfcwd_on_start == "y" %}"enable"{% else %}"disable"{% endif %}
5+
"default_pfcwd_status": {% if enable_pfcwd_on_start == "y" %}"enable"{% else %}"disable"{% endif %},
6+
"synchronous_mode": {% if enable_synchronous_mode == "y" %}"enable"{% else %}"disable"{% endif %}
67
}
78
},
89
"CRM": {
@@ -17,26 +18,28 @@
1718
{% endfor %}
1819
}
1920
},
20-
{%- set features = [("bgp", "enabled", "enabled"),
21-
("database", "enabled", "disabled"),
22-
("dhcp_relay", "enabled", "enabled"),
23-
("lldp", "enabled", "enabled"),
24-
("pmon", "enabled", "enabled"),
25-
("radv", "enabled", "enabled"),
26-
("snmp", "enabled", "enabled"),
27-
("swss", "enabled", "enabled"),
28-
("syncd", "enabled", "enabled"),
29-
("teamd", "enabled", "enabled")] %}
30-
{%- if include_iccpd == "y" %}{% do features.append(("iccpd", "disabled", "enabled")) %}{% endif %}
31-
{%- if include_mgmt_framework == "y" %}{% do features.append(("mgmt-framework", "enabled", "enabled")) %}{% endif %}
32-
{%- if include_nat == "y" %}{% do features.append(("nat", "disabled", "enabled")) %}{% endif %}
33-
{%- if include_restapi == "y" %}{% do features.append(("restapi", "enabled", "enabled")) %}{% endif %}
34-
{%- if include_sflow == "y" %}{% do features.append(("sflow", "disabled", "enabled")) %}{% endif %}
35-
{%- if include_system_telemetry == "y" %}{% do features.append(("telemetry", "enabled", "enabled")) %}{% endif %}
21+
{%- set features = [("bgp", "enabled", false, "enabled"),
22+
("database", "enabled", false, "disabled"),
23+
("dhcp_relay", "enabled", false, "enabled"),
24+
("lldp", "enabled", false, "enabled"),
25+
("pmon", "enabled", false, "enabled"),
26+
("radv", "enabled", false, "enabled"),
27+
("snmp", "enabled", true, "enabled"),
28+
("swss", "enabled", false, "enabled"),
29+
("syncd", "enabled", false, "enabled"),
30+
("teamd", "enabled", false, "enabled")] %}
31+
{%- if include_iccpd == "y" %}{% do features.append(("iccpd", "disabled", false, "enabled")) %}{% endif %}
32+
{%- if include_mgmt_framework == "y" %}{% do features.append(("mgmt-framework", "enabled", false, "enabled")) %}{% endif %}
33+
{%- if include_nat == "y" %}{% do features.append(("nat", "disabled", false, "enabled")) %}{% endif %}
34+
{%- if include_restapi == "y" %}{% do features.append(("restapi", "enabled", false, "enabled")) %}{% endif %}
35+
{%- if include_sflow == "y" %}{% do features.append(("sflow", "disabled", false, "enabled")) %}{% endif %}
36+
{%- if include_system_telemetry == "y" %}{% do features.append(("telemetry", "enabled", true, "enabled")) %}{% endif %}
3637
"FEATURE": {
37-
{%- for feature, state, autorestart in features %}
38+
{# has_timer field if set, will start the feature systemd .timer unit instead of .service unit #}
39+
{%- for feature, state, has_timer, autorestart in features %}
3840
"{{feature}}": {
3941
"state": "{{state}}",
42+
"has_timer" : {{has_timer | lower()}},
4043
"auto_restart": "{{autorestart}}",
4144
"high_mem_alert": "disabled"
4245
}{% if not loop.last %},{% endif -%}

files/build_templates/sonic_debian_extension.j2

+13
Original file line numberDiff line numberDiff line change
@@ -196,6 +196,12 @@ sudo dpkg --root=$FILESYSTEM_ROOT -i $debs_path/sonic-ztp_*.deb || \
196196
sudo LANG=C DEBIAN_FRONTEND=noninteractive chroot $FILESYSTEM_ROOT apt-get -y install -f
197197
{% endif %}
198198

199+
{% if include_host_service == "y" %}
200+
# Install SONiC Host Service (and its dependencies via 'apt-get -y install -f')
201+
sudo dpkg --root=$FILESYSTEM_ROOT -i $debs_path/sonic-host-service_*.deb || \
202+
sudo LANG=C DEBIAN_FRONTEND=noninteractive chroot $FILESYSTEM_ROOT apt-get -y install -f
203+
{% endif %}
204+
199205
# SONiC utilities installs bash-completion as a dependency. However, it is disabled by default
200206
# in bash.bashrc, so we copy a version of the file with it enabled here.
201207
sudo cp -f $IMAGE_CONFIGS/bash/bash.bashrc $FILESYSTEM_ROOT/etc/
@@ -221,6 +227,13 @@ sudo DEBIAN_FRONTEND=noninteractive dpkg --root=$FILESYSTEM_ROOT -i $debs_path/k
221227
sudo LANG=C DEBIAN_FRONTEND=noninteractive DEBCONF_NONINTERACTIVE_SEEN=true chroot $FILESYSTEM_ROOT apt-get -q --no-install-suggests --no-install-recommends --force-no install
222228
fi
223229

230+
# Install python-swss-common package and all its dependent packages
231+
{% if python_swss_debs.strip() -%}
232+
{% for deb in python_swss_debs.strip().split(' ') -%}
233+
sudo dpkg --root=$FILESYSTEM_ROOT -i {{deb}} || sudo LANG=C DEBIAN_FRONTEND=noninteractive chroot $FILESYSTEM_ROOT apt-get -y install -f
234+
{% endfor %}
235+
{% endif %}
236+
224237
# Install custom-built monit package and SONiC configuration files
225238
sudo dpkg --root=$FILESYSTEM_ROOT -i $debs_path/monit_*.deb || \
226239
sudo LANG=C DEBIAN_FRONTEND=noninteractive chroot $FILESYSTEM_ROOT apt-get -y install -f

0 commit comments

Comments
 (0)