From 0e61db9f84b736f2ab599901db03e6074ce8a442 Mon Sep 17 00:00:00 2001 From: Lawrence Lee Date: Wed, 6 Apr 2022 17:37:18 +0000 Subject: [PATCH 1/8] [swss]: Convert swss docker to bullseye Signed-off-by: Lawrence Lee --- dockers/docker-orchagent/Dockerfile.j2 | 2 +- .../docker-swss-layer-bullseye/Dockerfile.j2 | 22 +++++++++++++++++++ rules/docker-orchagent.mk | 10 ++++----- rules/docker-swss-layer-bullseye.dep | 9 ++++++++ rules/docker-swss-layer-bullseye.mk | 14 ++++++++++++ 5 files changed, 51 insertions(+), 6 deletions(-) create mode 100644 dockers/docker-swss-layer-bullseye/Dockerfile.j2 create mode 100644 rules/docker-swss-layer-bullseye.dep create mode 100644 rules/docker-swss-layer-bullseye.mk diff --git a/dockers/docker-orchagent/Dockerfile.j2 b/dockers/docker-orchagent/Dockerfile.j2 index f71f31cfc0ac..d83eb2fa5e4d 100755 --- a/dockers/docker-orchagent/Dockerfile.j2 +++ b/dockers/docker-orchagent/Dockerfile.j2 @@ -1,5 +1,5 @@ {% from "dockers/dockerfile-macros.j2" import install_debian_packages, install_python_wheels, copy_files %} -FROM docker-swss-layer-buster +FROM docker-swss-layer-bullseye ARG docker_container_name RUN [ -f /etc/rsyslog.conf ] && sed -ri "s/%syslogtag%/$docker_container_name#%syslogtag%/;" /etc/rsyslog.conf diff --git a/dockers/docker-swss-layer-bullseye/Dockerfile.j2 b/dockers/docker-swss-layer-bullseye/Dockerfile.j2 new file mode 100644 index 000000000000..85d17b89982e --- /dev/null +++ b/dockers/docker-swss-layer-bullseye/Dockerfile.j2 @@ -0,0 +1,22 @@ +{% from "dockers/dockerfile-macros.j2" import install_debian_packages, install_python_wheels, copy_files %} +FROM docker-config-engine-bullseye + +## Make apt-get non-interactive +ENV DEBIAN_FRONTEND=noninteractive + +RUN apt-get update + +{% if docker_swss_layer_bullseye_debs.strip() -%} +# Copy locally-built Debian package dependencies +{{ copy_files("debs/", docker_swss_layer_bullseye_debs.split(' '), "/debs/") }} + +# Install locally-built Debian packages and implicitly install their dependencies +{{ install_debian_packages(docker_swss_layer_bullseye_debs.split(' ')) }} +{%- endif %} + +RUN apt-get clean -y && \ + apt-get autoclean -y && \ + apt-get autoremove -y && \ + rm -rf /debs + +ENTRYPOINT ["/usr/local/bin/supervisord"] diff --git a/rules/docker-orchagent.mk b/rules/docker-orchagent.mk index d9453465c702..881a8076cffe 100644 --- a/rules/docker-orchagent.mk +++ b/rules/docker-orchagent.mk @@ -6,16 +6,16 @@ DOCKER_ORCHAGENT_DBG = $(DOCKER_ORCHAGENT_STEM)-$(DBG_IMAGE_MARK).gz $(DOCKER_ORCHAGENT)_DEPENDS += $(SWSS) -$(DOCKER_ORCHAGENT)_DBG_DEPENDS = $($(DOCKER_SWSS_LAYER_BUSTER)_DBG_DEPENDS) +$(DOCKER_ORCHAGENT)_DBG_DEPENDS = $($(DOCKER_SWSS_LAYER_BULLSEYE)_DBG_DEPENDS) $(DOCKER_ORCHAGENT)_DBG_DEPENDS += $(SWSS_DBG) \ $(LIBSWSSCOMMON_DBG) \ $(LIBSAIREDIS_DBG) -$(DOCKER_ORCHAGENT)_DBG_IMAGE_PACKAGES = $($(DOCKER_SWSS_LAYER_BUSTER)_DBG_IMAGE_PACKAGES) +$(DOCKER_ORCHAGENT)_DBG_IMAGE_PACKAGES = $($(DOCKER_SWSS_LAYER_BULLSEYE)_DBG_IMAGE_PACKAGES) $(DOCKER_ORCHAGENT)_PATH = $(DOCKERS_PATH)/$(DOCKER_ORCHAGENT_STEM) -$(DOCKER_ORCHAGENT)_LOAD_DOCKERS += $(DOCKER_SWSS_LAYER_BUSTER) +$(DOCKER_ORCHAGENT)_LOAD_DOCKERS += $(DOCKER_SWSS_LAYER_BULLSEYE) $(DOCKER_ORCHAGENT)_VERSION = 1.0.0 $(DOCKER_ORCHAGENT)_PACKAGE_NAME = swss @@ -39,5 +39,5 @@ $(DOCKER_ORCHAGENT)_RUN_OPT += -v /var/log/swss:/var/log/swss:rw $(DOCKER_ORCHAGENT)_BASE_IMAGE_FILES += swssloglevel:/usr/bin/swssloglevel $(DOCKER_ORCHAGENT)_FILES += $(ARP_UPDATE_SCRIPT) $(ARP_UPDATE_VARS_TEMPLATE) $(SUPERVISOR_PROC_EXIT_LISTENER_SCRIPT) -SONIC_BUSTER_DOCKERS += $(DOCKER_ORCHAGENT) -SONIC_BUSTER_DBG_DOCKERS += $(DOCKER_ORCHAGENT_DBG) +SONIC_BULLSEYE_DOCKERS += $(DOCKER_ORCHAGENT) +SONIC_BULLSEYE_DBG_DOCKERS += $(DOCKER_ORCHAGENT_DBG) diff --git a/rules/docker-swss-layer-bullseye.dep b/rules/docker-swss-layer-bullseye.dep new file mode 100644 index 000000000000..102405a467ed --- /dev/null +++ b/rules/docker-swss-layer-bullseye.dep @@ -0,0 +1,9 @@ + +DPATH := $($(DOCKER_SWSS_LAYER_BULLSEYE)_PATH) +DEP_FILES := $(SONIC_COMMON_FILES_LIST) rules/docker-swss-layer-bullseye.mk rules/docker-swss-layer-bullseye.dep +DEP_FILES += $(SONIC_COMMON_BASE_FILES_LIST) +DEP_FILES += $(shell git ls-files $(DPATH)) + +$(DOCKER_SWSS_LAYER_BULLSEYE)_CACHE_MODE := GIT_CONTENT_SHA +$(DOCKER_SWSS_LAYER_BULLSEYE)_DEP_FLAGS := $(SONIC_COMMON_FLAGS_LIST) +$(DOCKER_SWSS_LAYER_BULLSEYE)_DEP_FILES := $(DEP_FILES) diff --git a/rules/docker-swss-layer-bullseye.mk b/rules/docker-swss-layer-bullseye.mk new file mode 100644 index 000000000000..aebbbc122a68 --- /dev/null +++ b/rules/docker-swss-layer-bullseye.mk @@ -0,0 +1,14 @@ +# bullseye-based docker image for sonic swss layer + +DOCKER_SWSS_LAYER_BULLSEYE= docker-swss-layer-bullseye.gz +$(DOCKER_SWSS_LAYER_BULLSEYE)_PATH = $(DOCKERS_PATH)/docker-swss-layer-bullseye + +$(DOCKER_SWSS_LAYER_BULLSEYE)_DEPENDS += $(SWSS) +$(DOCKER_SWSS_LAYER_BULLSEYE)_LOAD_DOCKERS += $(DOCKER_CONFIG_ENGINE_BULLSEYE) + +$(DOCKER_SWSS_LAYER_BULLSEYE)_DBG_DEPENDS = $($(DOCKER_CONFIG_ENGINE_BULLSEYE)_DBG_DEPENDS) \ + $(SWSS) +$(DOCKER_SWSS_LAYER_BULLSEYE)_DBG_IMAGE_PACKAGES = $($(DOCKER_CONFIG_ENGINE_BULLSEYE)_DBG_IMAGE_PACKAGES) + +SONIC_DOCKER_IMAGES += $(DOCKER_SWSS_LAYER_BULLSEYE) +SONIC_BULLSEYE_DOCKERS += $(DOCKER_SWSS_LAYER_BULLSEYE) From 81a746a23233a80bbb8744e71ae2ef99a9cf02c1 Mon Sep 17 00:00:00 2001 From: Lawrence Lee Date: Wed, 6 Apr 2022 21:09:22 +0000 Subject: [PATCH 2/8] [swss]: Submodule update: 50d5be2 (HEAD, origin/master, origin/HEAD) Make changes to support compiling on Bullseye with GCC 10 (#2216) 0870cf5 [mirrororch]: Implement HW resources availability validation for SPAN/ERSPAN (#2187) f4ec565 [vlanmgrd] fix use-after-free memory issue (#2211) c2de7fc [QosOrch] The notifications cannot be drained in QosOrch in case the first one needs to retry (#2206) 5575935 [neighsyncd] increase neighsyncd timeout (#2209) 0f06910 (master) [PBH] Implement Edit Flows (#2169) 6241bbf Remove redundant and problematic code to skip "pool" field in buffer profile handling (#2197) a55343c [azp]: Set diff coverage threshhold to 80% (#2188) 390cae1 [portsorch]: Prevent LAG member configuration when port has active ACL binding (#2165) c1d47e6 [VNET]Fixing nexthop group delete during route change (#2198) 8941cc0 [BFD]Registering BFD state change callback during session creation (#2202) 680c539 [vxlan] Remove tunnel map objects on VNET tunnel removal (#2150) 20dde0c Fix for handling broadcom DNX ASIC to have ipv4 and ipv6 ACL rules in separate tables. (#2178) 5b7c949 [FdbOrch] SAI_FDB_EVENT_MOVE generates update with empty update.entry.port_name (#2200) 7350d49 [Vxlanmgr] vnet netdev cleanup during config reload fix (#2191) 2bef62b Validate LAG has members before mirror session create (#2130) 1e4d4ce [VS test] Increase VS test time, skip dpb flaky test (#2195) 6eda965 [vstest]Migrating vs tests from using click commands to direct DB access (#2179) Signed-off-by: Lawrence Lee --- src/sonic-swss | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sonic-swss b/src/sonic-swss index d80094b248e7..50d5be2b399e 160000 --- a/src/sonic-swss +++ b/src/sonic-swss @@ -1 +1 @@ -Subproject commit d80094b248e7df5ac9df309d785ddf21e0ab92d7 +Subproject commit 50d5be2b399e9bcc43973f99d72d76e4effd8cc0 From f854fcbc5bc9f81bf6d6eb847856dcbca72eb42a Mon Sep 17 00:00:00 2001 From: Lawrence Lee Date: Wed, 6 Apr 2022 21:31:13 +0000 Subject: [PATCH 3/8] [swss]: Remove unused vars Signed-off-by: Lawrence Lee --- rules/docker-orchagent.mk | 3 --- 1 file changed, 3 deletions(-) diff --git a/rules/docker-orchagent.mk b/rules/docker-orchagent.mk index 881a8076cffe..7d2b9e125524 100644 --- a/rules/docker-orchagent.mk +++ b/rules/docker-orchagent.mk @@ -38,6 +38,3 @@ $(DOCKER_ORCHAGENT)_RUN_OPT += -v /var/log/swss:/var/log/swss:rw $(DOCKER_ORCHAGENT)_BASE_IMAGE_FILES += swssloglevel:/usr/bin/swssloglevel $(DOCKER_ORCHAGENT)_FILES += $(ARP_UPDATE_SCRIPT) $(ARP_UPDATE_VARS_TEMPLATE) $(SUPERVISOR_PROC_EXIT_LISTENER_SCRIPT) - -SONIC_BULLSEYE_DOCKERS += $(DOCKER_ORCHAGENT) -SONIC_BULLSEYE_DBG_DOCKERS += $(DOCKER_ORCHAGENT_DBG) From e0a741f6f3dfcf8c6ac38ba4922cb7b980be3d0d Mon Sep 17 00:00:00 2001 From: Lawrence Lee Date: Wed, 6 Apr 2022 23:27:43 +0000 Subject: [PATCH 4/8] [swss]: Switch to gcc10 Signed-off-by: Lawrence Lee --- dockers/docker-orchagent/Dockerfile.j2 | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/dockers/docker-orchagent/Dockerfile.j2 b/dockers/docker-orchagent/Dockerfile.j2 index d83eb2fa5e4d..718925dde0eb 100755 --- a/dockers/docker-orchagent/Dockerfile.j2 +++ b/dockers/docker-orchagent/Dockerfile.j2 @@ -28,14 +28,14 @@ RUN apt-get update && \ # Fix for gcc/python/iputils-ping not found in arm docker RUN apt-get install -f -y python2.7 python2.7-dev RUN apt-get install -y \ - gcc-8 \ + gcc-10 \ iputils-ping {% endif %} {% if CONFIGURED_ARCH == "armhf" %} -RUN ln -s -f /usr/bin/gcc-8 /usr/bin/arm-linux-gnueabihf-gcc +RUN ln -s -f /usr/bin/gcc-10 /usr/bin/arm-linux-gnueabihf-gcc {% endif %} {% if CONFIGURED_ARCH == "arm64" %} -RUN ln -s -f /usr/bin/gcc-8 /usr/bin/aarch64-linux-gnu-gcc +RUN ln -s -f /usr/bin/gcc-10 /usr/bin/aarch64-linux-gnu-gcc {% endif %} # Dependencies of restore_neighbors.py @@ -46,7 +46,7 @@ RUN pip3 install \ {% if ( CONFIGURED_ARCH == "armhf" or CONFIGURED_ARCH == "arm64" ) %} # Remove installed gcc -RUN apt-get remove -y gcc-8 +RUN apt-get remove -y gcc-10 {% endif %} {% if docker_orchagent_debs.strip() -%} From 8ee9f28aa3fd6eb46259c412e6af8d84eff4b99e Mon Sep 17 00:00:00 2001 From: Lawrence Lee Date: Fri, 8 Apr 2022 21:50:39 +0000 Subject: [PATCH 5/8] Revert "[swss]: Submodule update:" This reverts commit 81a746a23233a80bbb8744e71ae2ef99a9cf02c1. --- src/sonic-swss | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sonic-swss b/src/sonic-swss index 50d5be2b399e..d80094b248e7 160000 --- a/src/sonic-swss +++ b/src/sonic-swss @@ -1 +1 @@ -Subproject commit 50d5be2b399e9bcc43973f99d72d76e4effd8cc0 +Subproject commit d80094b248e7df5ac9df309d785ddf21e0ab92d7 From 8247cf617ef86588d07368cbecc52b3fb0fc7874 Mon Sep 17 00:00:00 2001 From: Lawrence Lee Date: Tue, 12 Apr 2022 22:13:59 +0000 Subject: [PATCH 6/8] [swss]: Use default gcc version Signed-off-by: Lawrence Lee --- dockers/docker-orchagent/Dockerfile.j2 | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/dockers/docker-orchagent/Dockerfile.j2 b/dockers/docker-orchagent/Dockerfile.j2 index 718925dde0eb..fbd9ff941577 100755 --- a/dockers/docker-orchagent/Dockerfile.j2 +++ b/dockers/docker-orchagent/Dockerfile.j2 @@ -28,15 +28,9 @@ RUN apt-get update && \ # Fix for gcc/python/iputils-ping not found in arm docker RUN apt-get install -f -y python2.7 python2.7-dev RUN apt-get install -y \ - gcc-10 \ + gcc \ iputils-ping {% endif %} -{% if CONFIGURED_ARCH == "armhf" %} -RUN ln -s -f /usr/bin/gcc-10 /usr/bin/arm-linux-gnueabihf-gcc -{% endif %} -{% if CONFIGURED_ARCH == "arm64" %} -RUN ln -s -f /usr/bin/gcc-10 /usr/bin/aarch64-linux-gnu-gcc -{% endif %} # Dependencies of restore_neighbors.py RUN pip3 install \ @@ -46,7 +40,7 @@ RUN pip3 install \ {% if ( CONFIGURED_ARCH == "armhf" or CONFIGURED_ARCH == "arm64" ) %} # Remove installed gcc -RUN apt-get remove -y gcc-10 +RUN apt-get remove -y gcc {% endif %} {% if docker_orchagent_debs.strip() -%} From 59e53fdc55a6d07a795e8d55eb7fc8b92dd21ff2 Mon Sep 17 00:00:00 2001 From: Lawrence Lee Date: Mon, 9 May 2022 21:07:56 +0000 Subject: [PATCH 7/8] [swss]: Test removing python2 for ARM builds Signed-off-by: Lawrence Lee --- dockers/docker-orchagent/Dockerfile.j2 | 1 - 1 file changed, 1 deletion(-) diff --git a/dockers/docker-orchagent/Dockerfile.j2 b/dockers/docker-orchagent/Dockerfile.j2 index fbd9ff941577..3d2c2fcd6cbd 100755 --- a/dockers/docker-orchagent/Dockerfile.j2 +++ b/dockers/docker-orchagent/Dockerfile.j2 @@ -26,7 +26,6 @@ RUN apt-get update && \ {% if ( CONFIGURED_ARCH == "armhf" or CONFIGURED_ARCH == "arm64" ) %} # Fix for gcc/python/iputils-ping not found in arm docker -RUN apt-get install -f -y python2.7 python2.7-dev RUN apt-get install -y \ gcc \ iputils-ping From 46904f1b990d7e707f6e84b68964c0f1a662888f Mon Sep 17 00:00:00 2001 From: Lawrence Lee Date: Thu, 12 May 2022 21:12:34 +0000 Subject: [PATCH 8/8] [docker]: Update bullseye swss layer to use new tagging Signed-off-by: Lawrence Lee --- dockers/docker-swss-layer-bullseye/Dockerfile.j2 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dockers/docker-swss-layer-bullseye/Dockerfile.j2 b/dockers/docker-swss-layer-bullseye/Dockerfile.j2 index 85d17b89982e..15f0e0edcc4a 100644 --- a/dockers/docker-swss-layer-bullseye/Dockerfile.j2 +++ b/dockers/docker-swss-layer-bullseye/Dockerfile.j2 @@ -1,5 +1,5 @@ {% from "dockers/dockerfile-macros.j2" import install_debian_packages, install_python_wheels, copy_files %} -FROM docker-config-engine-bullseye +FROM docker-config-engine-bullseye-{{DOCKER_USERNAME}}:{{DOCKER_USERTAG}} ## Make apt-get non-interactive ENV DEBIAN_FRONTEND=noninteractive