From 8080695ecf91ba008a48830a7c4a549a380e76e6 Mon Sep 17 00:00:00 2001 From: lguohan Date: Mon, 6 May 2019 07:19:36 -0700 Subject: [PATCH] [docker-{sonic,syncd}-vs]: upgrade {sonic,syncd}-vs docker to stretch (#2865) * [docker-{sonic,syncd}-vs]: upgrade sonic-vs and syncd-vs docker to stretch * remove python-click 6.6 Signed-off-by: Guohan Lu --- Makefile | 2 +- Makefile.work | 1 + platform/vs/docker-sonic-vs.mk | 6 ++--- platform/vs/docker-sonic-vs/Dockerfile.j2 | 10 ++++---- platform/vs/docker-syncd-vs.mk | 28 +++++++++-------------- platform/vs/docker-syncd-vs/Dockerfile.j2 | 2 +- slave.mk | 4 ++-- sonic-slave-stretch/Dockerfile | 7 ++++++ 8 files changed, 31 insertions(+), 29 deletions(-) diff --git a/Makefile b/Makefile index 4bc42cd372..f3908ce55c 100644 --- a/Makefile +++ b/Makefile @@ -5,7 +5,7 @@ NOSTRETCH ?= 0 %:: @echo "+++ --- Making $@ --- +++" ifeq ($(NOSTRETCH), 0) - BLDENV=stretch make -f Makefile.work stretch + BLDENV=stretch EXTRA_STRETCH_TARGETS=$(notdir $@) make -f Makefile.work stretch endif make -f Makefile.work $@ diff --git a/Makefile.work b/Makefile.work index ae15b1ec90..95e7a2af44 100644 --- a/Makefile.work +++ b/Makefile.work @@ -123,6 +123,7 @@ SONIC_BUILD_INSTRUCTION := make \ HTTP_PROXY=$(http_proxy) \ HTTPS_PROXY=$(https_proxy) \ SONIC_ENABLE_SYSTEM_TELEMETRY=$(ENABLE_SYSTEM_TELEMETRY) \ + EXTRA_STRETCH_TARGETS=$(EXTRA_STRETCH_TARGETS) \ $(SONIC_OVERRIDE_BUILD_VARS) .PHONY: sonic-slave-build sonic-slave-bash init reset diff --git a/platform/vs/docker-sonic-vs.mk b/platform/vs/docker-sonic-vs.mk index 79f4fe0cdd..7185342316 100644 --- a/platform/vs/docker-sonic-vs.mk +++ b/platform/vs/docker-sonic-vs.mk @@ -9,8 +9,7 @@ $(DOCKER_SONIC_VS)_DEPENDS += $(SWSS) \ $(PYTHON_SWSSCOMMON) \ $(LIBTEAMDCT) \ $(LIBTEAM_UTILS) \ - $(SONIC_DEVICE_DATA) \ - $(IPROUTE2) + $(SONIC_DEVICE_DATA) $(DOCKER_SONIC_VS)_PYTHON_DEBS += $(SONIC_UTILS) @@ -36,5 +35,6 @@ $(DOCKER_SONIC_VS)_FILES += $(CONFIGDB_LOAD_SCRIPT) \ $(QOS_CONFIG_TEMPLATE) \ $(SONIC_VERSION) -$(DOCKER_SONIC_VS)_LOAD_DOCKERS += $(DOCKER_CONFIG_ENGINE) +$(DOCKER_SONIC_VS)_LOAD_DOCKERS += $(DOCKER_CONFIG_ENGINE_STRETCH) SONIC_DOCKER_IMAGES += $(DOCKER_SONIC_VS) +SONIC_STRETCH_DOCKERS += $(DOCKER_SONIC_VS) diff --git a/platform/vs/docker-sonic-vs/Dockerfile.j2 b/platform/vs/docker-sonic-vs/Dockerfile.j2 index dcb62f95ae..34c33a99d0 100644 --- a/platform/vs/docker-sonic-vs/Dockerfile.j2 +++ b/platform/vs/docker-sonic-vs/Dockerfile.j2 @@ -1,4 +1,4 @@ -FROM docker-config-engine +FROM docker-config-engine-stretch ARG docker_container_name RUN [ -f /etc/rsyslog.conf ] && sed -ri "s/%syslogtag%/$docker_container_name#%syslogtag%/;" /etc/rsyslog.conf @@ -6,6 +6,7 @@ RUN [ -f /etc/rsyslog.conf ] && sed -ri "s/%syslogtag%/$docker_container_name#%s ## Make apt-get non-interactive ENV DEBIAN_FRONTEND=noninteractive +RUN apt-get install -y gnupg COPY ["sonic-dev.gpg.key", "/etc/apt/"] RUN apt-key add /etc/apt/sonic-dev.gpg.key RUN echo "deb http://packages.microsoft.com/repos/sonic-dev/ jessie main" >> /etc/apt/sources.list @@ -21,12 +22,11 @@ RUN apt-get install -y net-tools \ python-ply \ libqt5core5a \ libqt5network5 \ - libboost-program-options1.55.0 \ - libboost-system1.55.0 \ - libboost-thread1.55.0 \ + libboost-program-options1.62.0 \ + libboost-system1.62.0 \ + libboost-thread1.62.0 \ libgmp10 \ libjudydebian1 \ - libnanomsg0 \ libdaemon0 \ libjansson4 \ libjemalloc1 \ diff --git a/platform/vs/docker-syncd-vs.mk b/platform/vs/docker-syncd-vs.mk index 66d2aa9fae..15d94c5854 100644 --- a/platform/vs/docker-syncd-vs.mk +++ b/platform/vs/docker-syncd-vs.mk @@ -1,20 +1,14 @@ # docker image for vs syncd -DOCKER_SYNCD_VS = docker-syncd-vs.gz -$(DOCKER_SYNCD_VS)_PATH = $(PLATFORM_PATH)/docker-syncd-vs -$(DOCKER_SYNCD_VS)_DEPENDS += $(SYNCD_VS) -ifeq ($(INSTALL_DEBUG_TOOLS), y) -$(DOCKER_SYNCD_VS)_DEPENDS += $(SYNCD_VS_DBG) \ - $(LIBSWSSCOMMON_DBG) \ - $(LIBSAIREDIS_DBG) \ - $(LIBSAIVS_DBG) -endif -$(DOCKER_SYNCD_VS)_LOAD_DOCKERS += $(DOCKER_CONFIG_ENGINE) -SONIC_DOCKER_IMAGES += $(DOCKER_SYNCD_VS) -SONIC_INSTALL_DOCKER_IMAGES += $(DOCKER_SYNCD_VS) +DOCKER_SYNCD_PLATFORM_CODE = vs +include $(PLATFORM_PATH)/../template/docker-syncd-base.mk -$(DOCKER_SYNCD_VS)_CONTAINER_NAME = syncd -$(DOCKER_SYNCD_VS)_RUN_OPT += --net=host --privileged -t -$(DOCKER_SYNCD_VS)_RUN_OPT += -v /host/machine.conf:/etc/machine.conf -$(DOCKER_SYNCD_VS)_RUN_OPT += -v /etc/sonic:/etc/sonic:ro -$(DOCKER_SYNCD_VS)_RUN_OPT += -v /host/warmboot:/var/warmboot +$(DOCKER_SYNCD_BASE)_DEPENDS += $(SYNCD_VS) + +$(DOCKER_SYNCD_BASE)_DBG_DEPENDS += $(SYNCD_VS_DBG) \ + $(LIBSWSSCOMMON_DBG) \ + $(LIBSAIMETADATA_DBG) \ + $(LIBSAIREDIS_DBG) \ + $(LIBSAIVS_DBG) + +$(DOCKER_SYNCD_BASE)_RUN_OPT += -v /host/warmboot:/var/warmboot diff --git a/platform/vs/docker-syncd-vs/Dockerfile.j2 b/platform/vs/docker-syncd-vs/Dockerfile.j2 index 7bef89fe57..6c5e90fa87 100644 --- a/platform/vs/docker-syncd-vs/Dockerfile.j2 +++ b/platform/vs/docker-syncd-vs/Dockerfile.j2 @@ -1,4 +1,4 @@ -FROM docker-config-engine +FROM docker-config-engine-stretch ARG docker_container_name RUN [ -f /etc/rsyslog.conf ] && sed -ri "s/%syslogtag%/$docker_container_name#%syslogtag%/;" /etc/rsyslog.conf diff --git a/slave.mk b/slave.mk index 135667f4a4..0e6e2adcb3 100644 --- a/slave.mk +++ b/slave.mk @@ -473,11 +473,11 @@ SONIC_TARGET_LIST += $(addprefix $(TARGET_PATH)/, $(SONIC_SIMPLE_DOCKER_IMAGES)) # Build stretch docker images only in stretch slave docker, # jessie docker images only in jessie slave docker -DOCKER_IMAGES_FOR_INSTALLERS := $(sort $(foreach installer,$(SONIC_INSTALLERS),$($(installer)_DOCKERS))) ifeq ($(BLDENV),stretch) + DOCKER_IMAGES_FOR_INSTALLERS := $(sort $(foreach installer,$(SONIC_INSTALLERS),$($(installer)_DOCKERS))) DOCKER_IMAGES := $(SONIC_STRETCH_DOCKERS) DOCKER_DBG_IMAGES := $(SONIC_STRETCH_DBG_DOCKERS) - SONIC_STRETCH_DOCKERS_FOR_INSTALLERS = $(filter $(SONIC_STRETCH_DOCKERS),$(DOCKER_IMAGES_FOR_INSTALLERS)) + SONIC_STRETCH_DOCKERS_FOR_INSTALLERS = $(filter $(SONIC_STRETCH_DOCKERS),$(DOCKER_IMAGES_FOR_INSTALLERS) $(EXTRA_STRETCH_TARGETS)) SONIC_STRETCH_DBG_DOCKERS_FOR_INSTALLERS = $(filter $(SONIC_STRETCH_DBG_DOCKERS), $(patsubst %.gz,%-$(DBG_IMAGE_MARK).gz, $(SONIC_STRETCH_DOCKERS_FOR_INSTALLERS))) else DOCKER_IMAGES := $(filter-out $(SONIC_STRETCH_DOCKERS), $(SONIC_DOCKER_IMAGES)) diff --git a/sonic-slave-stretch/Dockerfile b/sonic-slave-stretch/Dockerfile index 7a1762dfd1..ac41f1e77c 100644 --- a/sonic-slave-stretch/Dockerfile +++ b/sonic-slave-stretch/Dockerfile @@ -262,6 +262,8 @@ RUN pip install --force-reinstall --upgrade jinja2>=2.10 # For templating RUN pip install j2cli +# Remove python-click 6.6 +RUN apt-get purge -y python-click # For sonic utilities testing RUN pip install click-default-group click natsort tabulate netifaces==0.10.7 fastentrypoints @@ -276,6 +278,11 @@ RUN pip3 install redis # For supervisor build RUN pip install meld3 mock +# For sonic-utilities build +RUN pip install mockredispy==2.9.3 +RUN pip install pytest-runner==4.4 +RUN pip install setuptools==40.8.0 + # Install dependencies for isc-dhcp-relay build RUN apt-get -y build-dep isc-dhcp