From 941eb7da2f82af052d45df98872602bfbd6038dd Mon Sep 17 00:00:00 2001 From: Renuka Manavalan Date: Fri, 5 Apr 2019 23:16:45 +0000 Subject: [PATCH 01/13] Updated Makefile infrastructure to build debug images. As a sample, platform/broadcom/docker-orchagent-brcm.mk is updated to add a docker-orchagent-brcm-dbg.gz target. Now "BLDENV=stretch make target/docker-orchagent-brcm-dbg.gz" will build the debug image. NOTE: If you don't specify NOSTRETcH=1, it implicitly calls "make stretch", which builds all stretch targets and that would include debug dockers too. This debug image can be used in any linux box to inspect core file. If your module's external dependency can be suitably mocked, you my even manually run it inside. "docker run -it --entrypoint=/bin/bash e47a8fb8ed38" You may map the core file path to this docker run. --- build_dbg_j2.sh | 45 ++++++++++++++++++++++ platform/broadcom/docker-orchagent-brcm.mk | 16 ++++++-- rules/docker-base-stretch.mk | 2 - rules/docker-config-engine-stretch.mk | 4 ++ slave.mk | 40 ++++++++++++++++++- 5 files changed, 100 insertions(+), 7 deletions(-) create mode 100755 build_dbg_j2.sh diff --git a/build_dbg_j2.sh b/build_dbg_j2.sh new file mode 100755 index 000000000000..20735e4882de --- /dev/null +++ b/build_dbg_j2.sh @@ -0,0 +1,45 @@ +#! /bin/bash + +echo " +FROM $1 + +ARG docker_container_name + +## Make apt-get non-interactive +ENV DEBIAN_FRONTEND=noninteractive + +{% if $2 is defined %} +{% if $2|length %} + +COPY \ +{% for deb in $2.split(' ') -%} +debs/{{ deb }}{{' '}} +{%- endfor -%} +debs/ + +RUN dpkg -i \ +{% for deb in $2.split(' ') -%} +debs/{{ deb }}{{' '}} +{%- endfor %} + +{% endif %} +{% endif %} + +{% if $3 is defined %} +{% if $3|length %} + +RUN apt-get install -f -y \ +{% for dbg in $3.split(' ') -%} +{{ dbg }}{{' '}} +{%- endfor %} + +{% endif %} +{% endif %} + + +## Clean up +RUN apt-get clean -y; apt-get autoclean -y; apt-get autoremove -y +RUN rm -rf /debs + +CMD ["/usr/bin/supervisord"] +" diff --git a/platform/broadcom/docker-orchagent-brcm.mk b/platform/broadcom/docker-orchagent-brcm.mk index 6957ca09ce08..f7487dbc86a9 100644 --- a/platform/broadcom/docker-orchagent-brcm.mk +++ b/platform/broadcom/docker-orchagent-brcm.mk @@ -1,18 +1,26 @@ # docker image for orchagent -DOCKER_ORCHAGENT_BRCM = docker-orchagent-brcm.gz +DOCKER_ORCHAGENT_BRCM_STEM = docker-orchagent-brcm +DOCKER_ORCHAGENT_BRCM = $(DOCKER_ORCHAGENT_BRCM_STEM).gz +DOCKER_ORCHAGENT_BRCM_DBG = $(DOCKER_ORCHAGENT_BRCM_STEM)$(DBG_IMAGE_MARK).gz + $(DOCKER_ORCHAGENT_BRCM)_PATH = $(DOCKERS_PATH)/docker-orchagent $(DOCKER_ORCHAGENT_BRCM)_DEPENDS += $(SWSS) $(REDIS_TOOLS) -ifeq ($(INSTALL_DEBUG_TOOLS), y) -$(DOCKER_ORCHAGENT_BRCM)_DEPENDS += $(SWSS_DBG) \ +$(DOCKER_ORCHAGENT_BRCM)_DBG_DEPENDS = $($(DOCKER_CONFIG_ENGINE_STRETCH)_DBG_DEPENDS) +$(DOCKER_ORCHAGENT_BRCM)_DBG_DEPENDS += $(SWSS_DBG) \ $(LIBSWSSCOMMON_DBG) \ $(LIBSAIREDIS_DBG) -endif $(DOCKER_ORCHAGENT_BRCM)_LOAD_DOCKERS += $(DOCKER_CONFIG_ENGINE_STRETCH) +$(DOCKER_ORCHAGENT_BRCM)_DBG_PACKAGES = $($(DOCKER_CONFIG_ENGINE_STRETCH)_DBG_PACKAGES) + SONIC_DOCKER_IMAGES += $(DOCKER_ORCHAGENT_BRCM) SONIC_STRETCH_DOCKERS += $(DOCKER_ORCHAGENT_BRCM) SONIC_INSTALL_DOCKER_IMAGES += $(DOCKER_ORCHAGENT_BRCM) +SONIC_DOCKER_DBG_IMAGES += $(DOCKER_ORCHAGENT_BRCM_DBG) +SONIC_STRETCH_DBG_DOCKERS += $(DOCKER_ORCHAGENT_BRCM_DBG) +SONIC_INSTALL_DOCKER_DBG_IMAGES += $(DOCKER_ORCHAGENT_BRCM_DBG) + $(DOCKER_ORCHAGENT_BRCM)_CONTAINER_NAME = swss $(DOCKER_ORCHAGENT_BRCM)_RUN_OPT += --net=host --privileged -t $(DOCKER_ORCHAGENT_BRCM)_RUN_OPT += -v /etc/network/interfaces:/etc/network/interfaces:ro diff --git a/rules/docker-base-stretch.mk b/rules/docker-base-stretch.mk index adfc53ad49eb..94aa2a6d3bd4 100644 --- a/rules/docker-base-stretch.mk +++ b/rules/docker-base-stretch.mk @@ -5,7 +5,6 @@ $(DOCKER_BASE_STRETCH)_PATH = $(DOCKERS_PATH)/docker-base-stretch $(DOCKER_BASE_STRETCH)_DEPENDS += $(SUPERVISOR) $(DOCKER_BASE_STRETCH)_DEPENDS += $(SOCAT) -ifeq ($(INSTALL_DEBUG_TOOLS),y) GDB = gdb GDBSERVER = gdbserver VIM = vim @@ -13,6 +12,5 @@ OPENSSH = openssh-client SSHPASS = sshpass STRACE = strace $(DOCKER_BASE_STRETCH)_DBG_PACKAGES += $(GDB) $(GDBSERVER) $(VIM) $(OPENSSH) $(SSHPASS) $(STRACE) -endif SONIC_STRETCH_DOCKERS += $(DOCKER_BASE_STRETCH) diff --git a/rules/docker-config-engine-stretch.mk b/rules/docker-config-engine-stretch.mk index eef67dfa14aa..22f1efabd62a 100644 --- a/rules/docker-config-engine-stretch.mk +++ b/rules/docker-config-engine-stretch.mk @@ -5,4 +5,8 @@ $(DOCKER_CONFIG_ENGINE_STRETCH)_PATH = $(DOCKERS_PATH)/docker-config-engine-stre $(DOCKER_CONFIG_ENGINE_STRETCH)_PYTHON_WHEELS += $(SWSSSDK_PY2) $(DOCKER_CONFIG_ENGINE_STRETCH)_PYTHON_WHEELS += $(SONIC_CONFIG_ENGINE) $(DOCKER_CONFIG_ENGINE_STRETCH)_LOAD_DOCKERS += $(DOCKER_BASE_STRETCH) + +$(DOCKER_CONFIG_ENGINE_STRETCH)_DBG_DEPENDS = $($(DOCKER_BASE_STRETCH)_DBG_DEPENDS) +$(DOCKER_CONFIG_ENGINE_STRETCH)_DBG_PACKAGES = $($(DOCKER_BASE_STRETCH)_DBG_PACKAGES) + SONIC_STRETCH_DOCKERS += $(DOCKER_CONFIG_ENGINE_STRETCH) diff --git a/slave.mk b/slave.mk index 294cf85ac887..ee64e9256ab6 100644 --- a/slave.mk +++ b/slave.mk @@ -36,6 +36,7 @@ PYTHON_WHEELS_PATH = $(TARGET_PATH)/python-wheels PROJECT_ROOT = $(shell pwd) STRETCH_DEBS_PATH = $(TARGET_PATH)/debs/stretch STRETCH_FILES_PATH = $(TARGET_PATH)/files/stretch +DBG_IMAGE_MARK = -dbg CONFIGURED_PLATFORM := $(shell [ -f .platform ] && cat .platform || echo generic) PLATFORM_PATH = platform/$(CONFIGURED_PLATFORM) @@ -474,8 +475,10 @@ SONIC_TARGET_LIST += $(addprefix $(TARGET_PATH)/, $(SONIC_SIMPLE_DOCKER_IMAGES)) # jessie docker images only in jessie slave docker ifeq ($(BLDENV),stretch) DOCKER_IMAGES := $(SONIC_STRETCH_DOCKERS) + DOCKER_DBG_IMAGES := $(SONIC_STRETCH_DBG_DOCKERS) else DOCKER_IMAGES := $(filter-out $(SONIC_STRETCH_DOCKERS), $(SONIC_DOCKER_IMAGES)) + DOCKER_DBG_IMAGES := $(filter-out $(SONIC_STRETCH_DBG_DOCKERS), $(SONIC_DOCKER_DBG_IMAGES)) endif # Targets for building docker images @@ -522,9 +525,42 @@ $(addprefix $(TARGET_PATH)/, $(DOCKER_IMAGES)) : $(TARGET_PATH)/%.gz : .platform SONIC_TARGET_LIST += $(addprefix $(TARGET_PATH)/, $(DOCKER_IMAGES)) +# Targets for building docker images +$(addprefix $(TARGET_PATH)/, $(DOCKER_DBG_IMAGES)) : $(TARGET_PATH)/%$(DBG_IMAGE_MARK).gz : .platform docker-start \ + $$(addprefix $(DEBS_PATH)/,$$($$*.gz_DBG_DEPENDS)) \ + $$(addsuffix -load,$$(addprefix $(TARGET_PATH)/,$$*.gz)) + $(HEADER) + mkdir -p $($*.gz_PATH)/debs $(LOG) + sudo mount --bind $(DEBS_PATH) $($*.gz_PATH)/debs $(LOG) + # Export variables for j2. Use path for unique variable names, e.g. docker_orchagent_debs + $(eval export $(subst -,_,$(notdir $($*.gz_PATH)))_debs=$(shell printf "$(subst $(SPACE),\n,$(call expand,$($*.gz_DBG_DEPENDS),RDEPENDS))\n" | awk '!a[$$0]++')) + $(eval export $(subst -,_,$(notdir $($*.gz_PATH)))_dbgs=$(shell printf "$(subst $(SPACE),\n,$(call expand,$($*.gz_DBG_PACKAGES)))\n" | awk '!a[$$0]++')) + ./build_dbg_j2.sh $* $(subst -,_,$(notdir $($*.gz_PATH)))_debs $(subst -,_,$(notdir $($*.gz_PATH)))_dbgs > $($*.gz_PATH)/Dockerfile-dbg.j2 + j2 $($*.gz_PATH)/Dockerfile-dbg.j2 > $($*.gz_PATH)/Dockerfile-dbg + docker info $(LOG) + docker build --squash --no-cache \ + --build-arg http_proxy=$(HTTP_PROXY) \ + --build-arg https_proxy=$(HTTPS_PROXY) \ + --build-arg user=$(USER) \ + --build-arg uid=$(UID) \ + --build-arg guid=$(GUID) \ + --build-arg docker_container_name=$($*.gz_CONTAINER_NAME) \ + --build-arg frr_user_uid=$(FRR_USER_UID) \ + --build-arg frr_user_gid=$(FRR_USER_GID) \ + --label Tag=$(SONIC_GET_VERSION) \ + --file $($*.gz_PATH)/Dockerfile-dbg \ + -t $*-dbg $($*.gz_PATH) $(LOG) + docker save $*-dbg | gzip -c > $@ + # Clean up + if [ -f $($*.gz_PATH).patch/series ]; then pushd $($*.gz_PATH) && quilt pop -a -f; popd; fi + $(FOOTER) + +SONIC_TARGET_LIST += $(addprefix $(TARGET_PATH)/, $(DOCKER_DBG_IMAGES)) + DOCKER_LOAD_TARGETS = $(addsuffix -load,$(addprefix $(TARGET_PATH)/, \ $(SONIC_SIMPLE_DOCKER_IMAGES) \ $(DOCKER_IMAGES))) + $(DOCKER_LOAD_TARGETS) : $(TARGET_PATH)/%.gz-load : .platform docker-start $$(TARGET_PATH)/$$*.gz $(HEADER) docker load -i $(TARGET_PATH)/$*.gz $(LOG) @@ -658,6 +694,7 @@ $(SONIC_CLEAN_FILES) : $(FILES_PATH)/%-clean : .platform SONIC_CLEAN_TARGETS += $(addsuffix -clean,$(addprefix $(TARGET_PATH)/, \ $(SONIC_DOCKER_IMAGES) \ + $(SONIC_DOCKER_DBG_IMAGES) \ $(SONIC_SIMPLE_DOCKER_IMAGES) \ $(SONIC_INSTALLERS))) $(SONIC_CLEAN_TARGETS) : $(TARGET_PATH)/%-clean : .platform @@ -681,7 +718,8 @@ all : .platform $$(addprefix $(TARGET_PATH)/,$$(SONIC_ALL)) stretch : $$(addprefix $(DEBS_PATH)/,$$(SONIC_STRETCH_DEBS)) \ $$(addprefix $(FILES_PATH)/,$$(SONIC_STRETCH_FILES)) \ - $$(addprefix $(TARGET_PATH)/,$$(SONIC_STRETCH_DOCKERS)) + $$(addprefix $(TARGET_PATH)/,$$(SONIC_STRETCH_DOCKERS)) \ + $$(addprefix $(TARGET_PATH)/,$$(SONIC_STRETCH_DBG_DOCKERS)) ############################################################################### From 042d51e192ae612b70d4846e9f1d8f0724de4345 Mon Sep 17 00:00:00 2001 From: Renuka Manavalan Date: Sat, 6 Apr 2019 02:03:38 +0000 Subject: [PATCH 02/13] Dropped the regular binary using DBG_PACKAGES and a small name change to help readability. --- slave.mk | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/slave.mk b/slave.mk index ee64e9256ab6..d0a6dc3bfb3e 100644 --- a/slave.mk +++ b/slave.mk @@ -504,7 +504,6 @@ $(addprefix $(TARGET_PATH)/, $(DOCKER_IMAGES)) : $(TARGET_PATH)/%.gz : .platform $(eval export $(subst -,_,$(notdir $($*.gz_PATH)))_debs=$(shell printf "$(subst $(SPACE),\n,$(call expand,$($*.gz_DEPENDS),RDEPENDS))\n" | awk '!a[$$0]++')) $(eval export $(subst -,_,$(notdir $($*.gz_PATH)))_pydebs=$(shell printf "$(subst $(SPACE),\n,$(call expand,$($*.gz_PYTHON_DEBS)))\n" | awk '!a[$$0]++')) $(eval export $(subst -,_,$(notdir $($*.gz_PATH)))_whls=$(shell printf "$(subst $(SPACE),\n,$(call expand,$($*.gz_PYTHON_WHEELS)))\n" | awk '!a[$$0]++')) - $(eval export $(subst -,_,$(notdir $($*.gz_PATH)))_dbgs=$(shell printf "$(subst $(SPACE),\n,$(call expand,$($*.gz_DBG_PACKAGES)))\n" | awk '!a[$$0]++')) j2 $($*.gz_PATH)/Dockerfile.j2 > $($*.gz_PATH)/Dockerfile docker info $(LOG) docker build --squash --no-cache \ @@ -533,9 +532,9 @@ $(addprefix $(TARGET_PATH)/, $(DOCKER_DBG_IMAGES)) : $(TARGET_PATH)/%$(DBG_IMAGE mkdir -p $($*.gz_PATH)/debs $(LOG) sudo mount --bind $(DEBS_PATH) $($*.gz_PATH)/debs $(LOG) # Export variables for j2. Use path for unique variable names, e.g. docker_orchagent_debs - $(eval export $(subst -,_,$(notdir $($*.gz_PATH)))_debs=$(shell printf "$(subst $(SPACE),\n,$(call expand,$($*.gz_DBG_DEPENDS),RDEPENDS))\n" | awk '!a[$$0]++')) + $(eval export $(subst -,_,$(notdir $($*.gz_PATH)))_dbg_debs=$(shell printf "$(subst $(SPACE),\n,$(call expand,$($*.gz_DBG_DEPENDS),RDEPENDS))\n" | awk '!a[$$0]++')) $(eval export $(subst -,_,$(notdir $($*.gz_PATH)))_dbgs=$(shell printf "$(subst $(SPACE),\n,$(call expand,$($*.gz_DBG_PACKAGES)))\n" | awk '!a[$$0]++')) - ./build_dbg_j2.sh $* $(subst -,_,$(notdir $($*.gz_PATH)))_debs $(subst -,_,$(notdir $($*.gz_PATH)))_dbgs > $($*.gz_PATH)/Dockerfile-dbg.j2 + ./build_dbg_j2.sh $* $(subst -,_,$(notdir $($*.gz_PATH)))_dbg_debs $(subst -,_,$(notdir $($*.gz_PATH)))_dbgs > $($*.gz_PATH)/Dockerfile-dbg.j2 j2 $($*.gz_PATH)/Dockerfile-dbg.j2 > $($*.gz_PATH)/Dockerfile-dbg docker info $(LOG) docker build --squash --no-cache \ From 24f38f29a88915aec44b071c2cf5db5337a020ae Mon Sep 17 00:00:00 2001 From: Renuka Manavalan Date: Mon, 8 Apr 2019 02:41:01 +0000 Subject: [PATCH 03/13] Tweaked the changes to retain the existing behavior w.r.t INSTALL_DEBUG_TOOLS=y. When this change ('building debug docker image transparently') is extended to all dockers, this flag would become redundant. Yet, there can be some test based use cases that rely on this flag. Until after all the dockers gets their debug images by default and we switch all use cases of this flag to use the newly built debug images, we need to maintain the existing behavior. --- platform/broadcom/docker-orchagent-brcm.mk | 10 +++++++--- rules/docker-base-stretch.mk | 5 ++++- rules/docker-config-engine-stretch.mk | 2 +- slave.mk | 5 +++-- 4 files changed, 15 insertions(+), 7 deletions(-) diff --git a/platform/broadcom/docker-orchagent-brcm.mk b/platform/broadcom/docker-orchagent-brcm.mk index f7487dbc86a9..a0f6e83b82c8 100644 --- a/platform/broadcom/docker-orchagent-brcm.mk +++ b/platform/broadcom/docker-orchagent-brcm.mk @@ -6,12 +6,16 @@ DOCKER_ORCHAGENT_BRCM_DBG = $(DOCKER_ORCHAGENT_BRCM_STEM)$(DBG_IMAGE_MARK).gz $(DOCKER_ORCHAGENT_BRCM)_PATH = $(DOCKERS_PATH)/docker-orchagent $(DOCKER_ORCHAGENT_BRCM)_DEPENDS += $(SWSS) $(REDIS_TOOLS) -$(DOCKER_ORCHAGENT_BRCM)_DBG_DEPENDS = $($(DOCKER_CONFIG_ENGINE_STRETCH)_DBG_DEPENDS) -$(DOCKER_ORCHAGENT_BRCM)_DBG_DEPENDS += $(SWSS_DBG) \ +$(DOCKER_ORCHAGENT_BRCM)_DBG_DEPENDS = $(SWSS_DBG) \ $(LIBSWSSCOMMON_DBG) \ $(LIBSAIREDIS_DBG) +ifeq ($(INSTALL_DEBUG_TOOLS), y) +$(DOCKER_ORCHAGENT_BRCM)_DEPENDS += $($(DOCKER_ORCHAGENT_BRCM)_DBG_DEPENDS) +endif +$(DOCKER_ORCHAGENT_BRCM)_DBG_DEPENDS += $($(DOCKER_CONFIG_ENGINE_STRETCH)_DBG_DEPENDS) + $(DOCKER_ORCHAGENT_BRCM)_LOAD_DOCKERS += $(DOCKER_CONFIG_ENGINE_STRETCH) -$(DOCKER_ORCHAGENT_BRCM)_DBG_PACKAGES = $($(DOCKER_CONFIG_ENGINE_STRETCH)_DBG_PACKAGES) +$(DOCKER_ORCHAGENT_BRCM)_DBG_IMAGE_PACKAGES = $($(DOCKER_CONFIG_ENGINE_STRETCH)_DBG_IMAGE_PACKAGES) SONIC_DOCKER_IMAGES += $(DOCKER_ORCHAGENT_BRCM) SONIC_STRETCH_DOCKERS += $(DOCKER_ORCHAGENT_BRCM) diff --git a/rules/docker-base-stretch.mk b/rules/docker-base-stretch.mk index 94aa2a6d3bd4..898e018f9b10 100644 --- a/rules/docker-base-stretch.mk +++ b/rules/docker-base-stretch.mk @@ -11,6 +11,9 @@ VIM = vim OPENSSH = openssh-client SSHPASS = sshpass STRACE = strace -$(DOCKER_BASE_STRETCH)_DBG_PACKAGES += $(GDB) $(GDBSERVER) $(VIM) $(OPENSSH) $(SSHPASS) $(STRACE) +$(DOCKER_BASE_STRETCH)_DBG_IMAGE_PACKAGES += $(GDB) $(GDBSERVER) $(VIM) $(OPENSSH) $(SSHPASS) $(STRACE) +ifeq ($(INSTALL_DEBUG_TOOLS),y) +$(DOCKER_BASE_STRETCH)_DBG_PACKAGES += $($(DOCKER_BASE_STRETCH)_DBG_IMAGE_PACKAGES) +endif SONIC_STRETCH_DOCKERS += $(DOCKER_BASE_STRETCH) diff --git a/rules/docker-config-engine-stretch.mk b/rules/docker-config-engine-stretch.mk index 22f1efabd62a..a18ed380f6f2 100644 --- a/rules/docker-config-engine-stretch.mk +++ b/rules/docker-config-engine-stretch.mk @@ -7,6 +7,6 @@ $(DOCKER_CONFIG_ENGINE_STRETCH)_PYTHON_WHEELS += $(SONIC_CONFIG_ENGINE) $(DOCKER_CONFIG_ENGINE_STRETCH)_LOAD_DOCKERS += $(DOCKER_BASE_STRETCH) $(DOCKER_CONFIG_ENGINE_STRETCH)_DBG_DEPENDS = $($(DOCKER_BASE_STRETCH)_DBG_DEPENDS) -$(DOCKER_CONFIG_ENGINE_STRETCH)_DBG_PACKAGES = $($(DOCKER_BASE_STRETCH)_DBG_PACKAGES) +$(DOCKER_CONFIG_ENGINE_STRETCH)_DBG_IMAGE_PACKAGES = $($(DOCKER_BASE_STRETCH)_DBG_IMAGE_PACKAGES) SONIC_STRETCH_DOCKERS += $(DOCKER_CONFIG_ENGINE_STRETCH) diff --git a/slave.mk b/slave.mk index d0a6dc3bfb3e..f7ce9de4f056 100644 --- a/slave.mk +++ b/slave.mk @@ -504,6 +504,7 @@ $(addprefix $(TARGET_PATH)/, $(DOCKER_IMAGES)) : $(TARGET_PATH)/%.gz : .platform $(eval export $(subst -,_,$(notdir $($*.gz_PATH)))_debs=$(shell printf "$(subst $(SPACE),\n,$(call expand,$($*.gz_DEPENDS),RDEPENDS))\n" | awk '!a[$$0]++')) $(eval export $(subst -,_,$(notdir $($*.gz_PATH)))_pydebs=$(shell printf "$(subst $(SPACE),\n,$(call expand,$($*.gz_PYTHON_DEBS)))\n" | awk '!a[$$0]++')) $(eval export $(subst -,_,$(notdir $($*.gz_PATH)))_whls=$(shell printf "$(subst $(SPACE),\n,$(call expand,$($*.gz_PYTHON_WHEELS)))\n" | awk '!a[$$0]++')) + $(eval export $(subst -,_,$(notdir $($*.gz_PATH)))_dbgs=$(shell printf "$(subst $(SPACE),\n,$(call expand,$($*.gz_DBG_PACKAGES)))\n" | awk '!a[$$0]++')) j2 $($*.gz_PATH)/Dockerfile.j2 > $($*.gz_PATH)/Dockerfile docker info $(LOG) docker build --squash --no-cache \ @@ -533,8 +534,8 @@ $(addprefix $(TARGET_PATH)/, $(DOCKER_DBG_IMAGES)) : $(TARGET_PATH)/%$(DBG_IMAGE sudo mount --bind $(DEBS_PATH) $($*.gz_PATH)/debs $(LOG) # Export variables for j2. Use path for unique variable names, e.g. docker_orchagent_debs $(eval export $(subst -,_,$(notdir $($*.gz_PATH)))_dbg_debs=$(shell printf "$(subst $(SPACE),\n,$(call expand,$($*.gz_DBG_DEPENDS),RDEPENDS))\n" | awk '!a[$$0]++')) - $(eval export $(subst -,_,$(notdir $($*.gz_PATH)))_dbgs=$(shell printf "$(subst $(SPACE),\n,$(call expand,$($*.gz_DBG_PACKAGES)))\n" | awk '!a[$$0]++')) - ./build_dbg_j2.sh $* $(subst -,_,$(notdir $($*.gz_PATH)))_dbg_debs $(subst -,_,$(notdir $($*.gz_PATH)))_dbgs > $($*.gz_PATH)/Dockerfile-dbg.j2 + $(eval export $(subst -,_,$(notdir $($*.gz_PATH)))_image_dbgs=$(shell printf "$(subst $(SPACE),\n,$(call expand,$($*.gz_DBG_IMAGE_PACKAGES)))\n" | awk '!a[$$0]++')) + ./build_dbg_j2.sh $* $(subst -,_,$(notdir $($*.gz_PATH)))_dbg_debs $(subst -,_,$(notdir $($*.gz_PATH)))_image_dbgs > $($*.gz_PATH)/Dockerfile-dbg.j2 j2 $($*.gz_PATH)/Dockerfile-dbg.j2 > $($*.gz_PATH)/Dockerfile-dbg docker info $(LOG) docker build --squash --no-cache \ From 4443c70ef3275d0cf8e62acd5891927c9eabc2b3 Mon Sep 17 00:00:00 2001 From: Renuka Manavalan Date: Thu, 11 Apr 2019 01:18:54 +0000 Subject: [PATCH 04/13] 1) slave.mk - Dropped unused Docker build args 2) Debug template builder: renamed build_dbg_j2.sh to build_debug_docker_j2.sh 3) Dropped insignifcant statement CMD from debug Docker file, as base docker has Entrypoint. --- build_dbg_j2.sh => build_debug_docker_j2.sh | 1 - slave.mk | 18 +----------------- 2 files changed, 1 insertion(+), 18 deletions(-) rename build_dbg_j2.sh => build_debug_docker_j2.sh (95%) diff --git a/build_dbg_j2.sh b/build_debug_docker_j2.sh similarity index 95% rename from build_dbg_j2.sh rename to build_debug_docker_j2.sh index 20735e4882de..3655ac037bd6 100755 --- a/build_dbg_j2.sh +++ b/build_debug_docker_j2.sh @@ -41,5 +41,4 @@ RUN apt-get install -f -y \ RUN apt-get clean -y; apt-get autoclean -y; apt-get autoremove -y RUN rm -rf /debs -CMD ["/usr/bin/supervisord"] " diff --git a/slave.mk b/slave.mk index f7ce9de4f056..87f893c77911 100644 --- a/slave.mk +++ b/slave.mk @@ -137,8 +137,6 @@ export SONIC_CONFIG_MAKE_JOBS ############################################################################### export SONIC_ROUTING_STACK -export FRR_USER_UID -export FRR_USER_GID ############################################################################### ## Dumping key config attributes associated to current building exercise @@ -158,10 +156,6 @@ $(info "SHUTDOWN_BGP_ON_START" : "$(SHUTDOWN_BGP_ON_START)") $(info "ENABLE_PFCWD_ON_START" : "$(ENABLE_PFCWD_ON_START)") $(info "INSTALL_DEBUG_TOOLS" : "$(INSTALL_DEBUG_TOOLS)") $(info "ROUTING_STACK" : "$(SONIC_ROUTING_STACK)") -ifeq ($(SONIC_ROUTING_STACK),frr) -$(info "FRR_USER_UID" : "$(FRR_USER_UID)") -$(info "FRR_USER_GID" : "$(FRR_USER_GID)") -endif $(info "ENABLE_SYNCD_RPC" : "$(ENABLE_SYNCD_RPC)") $(info "ENABLE_ORGANIZATION_EXTENSIONS" : "$(ENABLE_ORGANIZATION_EXTENSIONS)") $(info "HTTP_PROXY" : "$(HTTP_PROXY)") @@ -510,12 +504,7 @@ $(addprefix $(TARGET_PATH)/, $(DOCKER_IMAGES)) : $(TARGET_PATH)/%.gz : .platform docker build --squash --no-cache \ --build-arg http_proxy=$(HTTP_PROXY) \ --build-arg https_proxy=$(HTTPS_PROXY) \ - --build-arg user=$(USER) \ - --build-arg uid=$(UID) \ - --build-arg guid=$(GUID) \ --build-arg docker_container_name=$($*.gz_CONTAINER_NAME) \ - --build-arg frr_user_uid=$(FRR_USER_UID) \ - --build-arg frr_user_gid=$(FRR_USER_GID) \ --label Tag=$(SONIC_GET_VERSION) \ -t $* $($*.gz_PATH) $(LOG) docker save $* | gzip -c > $@ @@ -535,18 +524,13 @@ $(addprefix $(TARGET_PATH)/, $(DOCKER_DBG_IMAGES)) : $(TARGET_PATH)/%$(DBG_IMAGE # Export variables for j2. Use path for unique variable names, e.g. docker_orchagent_debs $(eval export $(subst -,_,$(notdir $($*.gz_PATH)))_dbg_debs=$(shell printf "$(subst $(SPACE),\n,$(call expand,$($*.gz_DBG_DEPENDS),RDEPENDS))\n" | awk '!a[$$0]++')) $(eval export $(subst -,_,$(notdir $($*.gz_PATH)))_image_dbgs=$(shell printf "$(subst $(SPACE),\n,$(call expand,$($*.gz_DBG_IMAGE_PACKAGES)))\n" | awk '!a[$$0]++')) - ./build_dbg_j2.sh $* $(subst -,_,$(notdir $($*.gz_PATH)))_dbg_debs $(subst -,_,$(notdir $($*.gz_PATH)))_image_dbgs > $($*.gz_PATH)/Dockerfile-dbg.j2 + ./build_debug_docker_j2.sh $* $(subst -,_,$(notdir $($*.gz_PATH)))_dbg_debs $(subst -,_,$(notdir $($*.gz_PATH)))_image_dbgs > $($*.gz_PATH)/Dockerfile-dbg.j2 j2 $($*.gz_PATH)/Dockerfile-dbg.j2 > $($*.gz_PATH)/Dockerfile-dbg docker info $(LOG) docker build --squash --no-cache \ --build-arg http_proxy=$(HTTP_PROXY) \ --build-arg https_proxy=$(HTTPS_PROXY) \ - --build-arg user=$(USER) \ - --build-arg uid=$(UID) \ - --build-arg guid=$(GUID) \ --build-arg docker_container_name=$($*.gz_CONTAINER_NAME) \ - --build-arg frr_user_uid=$(FRR_USER_UID) \ - --build-arg frr_user_gid=$(FRR_USER_GID) \ --label Tag=$(SONIC_GET_VERSION) \ --file $($*.gz_PATH)/Dockerfile-dbg \ -t $*-dbg $($*.gz_PATH) $(LOG) From 7b84e64823e1330f39dc9854f77d006ff97bc492 Mon Sep 17 00:00:00 2001 From: Renuka Manavalan Date: Thu, 11 Apr 2019 17:05:14 +0000 Subject: [PATCH 05/13] Reverted some changes, per review comments. "User, uid, guid, frr-uid & frr-guid" are required for all docker images, with exception of debug images. --- slave.mk | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/slave.mk b/slave.mk index 87f893c77911..88c4dbfafcbf 100644 --- a/slave.mk +++ b/slave.mk @@ -137,6 +137,8 @@ export SONIC_CONFIG_MAKE_JOBS ############################################################################### export SONIC_ROUTING_STACK +export FRR_USER_UID +export FRR_USER_GID ############################################################################### ## Dumping key config attributes associated to current building exercise @@ -156,6 +158,10 @@ $(info "SHUTDOWN_BGP_ON_START" : "$(SHUTDOWN_BGP_ON_START)") $(info "ENABLE_PFCWD_ON_START" : "$(ENABLE_PFCWD_ON_START)") $(info "INSTALL_DEBUG_TOOLS" : "$(INSTALL_DEBUG_TOOLS)") $(info "ROUTING_STACK" : "$(SONIC_ROUTING_STACK)") +ifeq ($(SONIC_ROUTING_STACK),frr) +$(info "FRR_USER_UID" : "$(FRR_USER_UID)") +$(info "FRR_USER_GID" : "$(FRR_USER_GID)") +endif $(info "ENABLE_SYNCD_RPC" : "$(ENABLE_SYNCD_RPC)") $(info "ENABLE_ORGANIZATION_EXTENSIONS" : "$(ENABLE_ORGANIZATION_EXTENSIONS)") $(info "HTTP_PROXY" : "$(HTTP_PROXY)") @@ -504,7 +510,12 @@ $(addprefix $(TARGET_PATH)/, $(DOCKER_IMAGES)) : $(TARGET_PATH)/%.gz : .platform docker build --squash --no-cache \ --build-arg http_proxy=$(HTTP_PROXY) \ --build-arg https_proxy=$(HTTPS_PROXY) \ + --build-arg user=$(USER) \ + --build-arg uid=$(UID) \ + --build-arg guid=$(GUID) \ --build-arg docker_container_name=$($*.gz_CONTAINER_NAME) \ + --build-arg frr_user_uid=$(FRR_USER_UID) \ + --build-arg frr_user_gid=$(FRR_USER_GID) \ --label Tag=$(SONIC_GET_VERSION) \ -t $* $($*.gz_PATH) $(LOG) docker save $* | gzip -c > $@ From 60a001c70a203e3d8fa17ec4d6be6c63b912b595 Mon Sep 17 00:00:00 2001 From: Renuka Manavalan Date: Fri, 12 Apr 2019 18:59:09 +0000 Subject: [PATCH 06/13] Get in sync with the new update that filters out dockers to be built (SONIC_STRETCH_DOCKERS_FOR_INSTALLERS) and build debug-dockers only for those to be built and debug target is available. --- slave.mk | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/slave.mk b/slave.mk index f425e421d1ee..3438822899f7 100644 --- a/slave.mk +++ b/slave.mk @@ -478,6 +478,7 @@ ifeq ($(BLDENV),stretch) 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_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)) DOCKER_DBG_IMAGES := $(filter-out $(SONIC_STRETCH_DBG_DOCKERS), $(SONIC_DOCKER_DBG_IMAGES)) @@ -716,7 +717,7 @@ all : .platform $$(addprefix $(TARGET_PATH)/,$$(SONIC_ALL)) stretch : $$(addprefix $(DEBS_PATH)/,$$(SONIC_STRETCH_DEBS)) \ $$(addprefix $(FILES_PATH)/,$$(SONIC_STRETCH_FILES)) \ $$(addprefix $(TARGET_PATH)/,$$(SONIC_STRETCH_DOCKERS_FOR_INSTALLERS)) \ - $$(addprefix $(TARGET_PATH)/,$$(SONIC_STRETCH_DBG_DOCKERS)) + $$(addprefix $(TARGET_PATH)/,$$(SONIC_STRETCH_DBG_DOCKERS_FOR_INSTALLERS)) ############################################################################### From f659917badead9445c33e9d6a113fdb998b28df1 Mon Sep 17 00:00:00 2001 From: Renuka Manavalan Date: Mon, 15 Apr 2019 19:55:47 +0000 Subject: [PATCH 07/13] Mkae a template for each target that can be shared by all platforms. Where needed a platform entry can override the template. This avoids duplication, hence easier to maintain. --- platform/broadcom/docker-orchagent-brcm.mk | 34 +------------------- platform/template/docker-orchagent-base.mk | 36 ++++++++++++++++++++++ 2 files changed, 37 insertions(+), 33 deletions(-) create mode 100644 platform/template/docker-orchagent-base.mk diff --git a/platform/broadcom/docker-orchagent-brcm.mk b/platform/broadcom/docker-orchagent-brcm.mk index a0f6e83b82c8..e289439c9cd0 100644 --- a/platform/broadcom/docker-orchagent-brcm.mk +++ b/platform/broadcom/docker-orchagent-brcm.mk @@ -1,37 +1,5 @@ # docker image for orchagent DOCKER_ORCHAGENT_BRCM_STEM = docker-orchagent-brcm -DOCKER_ORCHAGENT_BRCM = $(DOCKER_ORCHAGENT_BRCM_STEM).gz -DOCKER_ORCHAGENT_BRCM_DBG = $(DOCKER_ORCHAGENT_BRCM_STEM)$(DBG_IMAGE_MARK).gz +include $(PLATFORM_PATH)/../template/docker-orchagent-base.mk -$(DOCKER_ORCHAGENT_BRCM)_PATH = $(DOCKERS_PATH)/docker-orchagent -$(DOCKER_ORCHAGENT_BRCM)_DEPENDS += $(SWSS) $(REDIS_TOOLS) -$(DOCKER_ORCHAGENT_BRCM)_DBG_DEPENDS = $(SWSS_DBG) \ - $(LIBSWSSCOMMON_DBG) \ - $(LIBSAIREDIS_DBG) -ifeq ($(INSTALL_DEBUG_TOOLS), y) -$(DOCKER_ORCHAGENT_BRCM)_DEPENDS += $($(DOCKER_ORCHAGENT_BRCM)_DBG_DEPENDS) -endif -$(DOCKER_ORCHAGENT_BRCM)_DBG_DEPENDS += $($(DOCKER_CONFIG_ENGINE_STRETCH)_DBG_DEPENDS) - -$(DOCKER_ORCHAGENT_BRCM)_LOAD_DOCKERS += $(DOCKER_CONFIG_ENGINE_STRETCH) -$(DOCKER_ORCHAGENT_BRCM)_DBG_IMAGE_PACKAGES = $($(DOCKER_CONFIG_ENGINE_STRETCH)_DBG_IMAGE_PACKAGES) - -SONIC_DOCKER_IMAGES += $(DOCKER_ORCHAGENT_BRCM) -SONIC_STRETCH_DOCKERS += $(DOCKER_ORCHAGENT_BRCM) -SONIC_INSTALL_DOCKER_IMAGES += $(DOCKER_ORCHAGENT_BRCM) - -SONIC_DOCKER_DBG_IMAGES += $(DOCKER_ORCHAGENT_BRCM_DBG) -SONIC_STRETCH_DBG_DOCKERS += $(DOCKER_ORCHAGENT_BRCM_DBG) -SONIC_INSTALL_DOCKER_DBG_IMAGES += $(DOCKER_ORCHAGENT_BRCM_DBG) - -$(DOCKER_ORCHAGENT_BRCM)_CONTAINER_NAME = swss -$(DOCKER_ORCHAGENT_BRCM)_RUN_OPT += --net=host --privileged -t -$(DOCKER_ORCHAGENT_BRCM)_RUN_OPT += -v /etc/network/interfaces:/etc/network/interfaces:ro -$(DOCKER_ORCHAGENT_BRCM)_RUN_OPT += -v /etc/network/interfaces.d/:/etc/network/interfaces.d/:ro -$(DOCKER_ORCHAGENT_BRCM)_RUN_OPT += -v /host/machine.conf:/host/machine.conf:ro -$(DOCKER_ORCHAGENT_BRCM)_RUN_OPT += -v /etc/sonic:/etc/sonic:ro -$(DOCKER_ORCHAGENT_BRCM)_RUN_OPT += -v /var/log/swss:/var/log/swss:rw - -$(DOCKER_ORCHAGENT_BRCM)_BASE_IMAGE_FILES += swssloglevel:/usr/bin/swssloglevel -$(DOCKER_ORCHAGENT_BRCM)_FILES += $(ARP_UPDATE_SCRIPT) diff --git a/platform/template/docker-orchagent-base.mk b/platform/template/docker-orchagent-base.mk new file mode 100644 index 000000000000..abb4cb6cf771 --- /dev/null +++ b/platform/template/docker-orchagent-base.mk @@ -0,0 +1,36 @@ +# docker image for orchagent + +DOCKER_ORCHAGENT_BASE = $(DOCKER_ORCHAGENT_BASE_STEM).gz +DOCKER_ORCHAGENT_BASE_DBG = $(DOCKER_ORCHAGENT_BASE_STEM)$(DBG_IMAGE_MARK).gz + +$(DOCKER_ORCHAGENT_BASE)_PATH = $(DOCKERS_PATH)/docker-orchagent +$(DOCKER_ORCHAGENT_BASE)_DEPENDS += $(SWSS) $(REDIS_TOOLS) +$(DOCKER_ORCHAGENT_BASE)_DBG_DEPENDS = $(SWSS_DBG) \ + $(LIBSWSSCOMMON_DBG) \ + $(LIBSAIREDIS_DBG) +ifeq ($(INSTALL_DEBUG_TOOLS), y) +$(DOCKER_ORCHAGENT_BASE)_DEPENDS += $($(DOCKER_ORCHAGENT_BASE)_DBG_DEPENDS) +endif +$(DOCKER_ORCHAGENT_BASE)_DBG_DEPENDS += $($(DOCKER_CONFIG_ENGINE_STRETCH)_DBG_DEPENDS) + +$(DOCKER_ORCHAGENT_BASE)_LOAD_DOCKERS += $(DOCKER_CONFIG_ENGINE_STRETCH) +$(DOCKER_ORCHAGENT_BASE)_DBG_IMAGE_PACKAGES = $($(DOCKER_CONFIG_ENGINE_STRETCH)_DBG_IMAGE_PACKAGES) + +SONIC_DOCKER_IMAGES += $(DOCKER_ORCHAGENT_BASE) +SONIC_STRETCH_DOCKERS += $(DOCKER_ORCHAGENT_BASE) +SONIC_INSTALL_DOCKER_IMAGES += $(DOCKER_ORCHAGENT_BASE) + +SONIC_DOCKER_DBG_IMAGES += $(DOCKER_ORCHAGENT_BASE_DBG) +SONIC_STRETCH_DBG_DOCKERS += $(DOCKER_ORCHAGENT_BASE_DBG) +SONIC_INSTALL_DOCKER_DBG_IMAGES += $(DOCKER_ORCHAGENT_BASE_DBG) + +$(DOCKER_ORCHAGENT_BASE)_CONTAINER_NAME = swss +$(DOCKER_ORCHAGENT_BASE)_RUN_OPT += --net=host --privileged -t +$(DOCKER_ORCHAGENT_BASE)_RUN_OPT += -v /etc/network/interfaces:/etc/network/interfaces:ro +$(DOCKER_ORCHAGENT_BASE)_RUN_OPT += -v /etc/network/interfaces.d/:/etc/network/interfaces.d/:ro +$(DOCKER_ORCHAGENT_BASE)_RUN_OPT += -v /host/machine.conf:/host/machine.conf:ro +$(DOCKER_ORCHAGENT_BASE)_RUN_OPT += -v /etc/sonic:/etc/sonic:ro +$(DOCKER_ORCHAGENT_BASE)_RUN_OPT += -v /var/log/swss:/var/log/swss:rw + +$(DOCKER_ORCHAGENT_BASE)_BASE_IMAGE_FILES += swssloglevel:/usr/bin/swssloglevel +$(DOCKER_ORCHAGENT_BASE)_FILES += $(ARP_UPDATE_SCRIPT) From 9d7aedb2013f7384575178f81cef81ab2bf0c391 Mon Sep 17 00:00:00 2001 From: Renuka Manavalan Date: Mon, 15 Apr 2019 23:19:40 +0000 Subject: [PATCH 08/13] A small change, that can fit better with other targets too. Just take the platform code and do the rest in template. --- platform/broadcom/docker-orchagent-brcm.mk | 2 +- platform/template/docker-orchagent-base.mk | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/platform/broadcom/docker-orchagent-brcm.mk b/platform/broadcom/docker-orchagent-brcm.mk index e289439c9cd0..4dfa3059c251 100644 --- a/platform/broadcom/docker-orchagent-brcm.mk +++ b/platform/broadcom/docker-orchagent-brcm.mk @@ -1,5 +1,5 @@ # docker image for orchagent -DOCKER_ORCHAGENT_BRCM_STEM = docker-orchagent-brcm +DOCKER_ORCHAGENT_PLATFORM_CODE = brcm include $(PLATFORM_PATH)/../template/docker-orchagent-base.mk diff --git a/platform/template/docker-orchagent-base.mk b/platform/template/docker-orchagent-base.mk index abb4cb6cf771..1597fe4aaa6d 100644 --- a/platform/template/docker-orchagent-base.mk +++ b/platform/template/docker-orchagent-base.mk @@ -1,5 +1,6 @@ # docker image for orchagent +OCKER_ORCHAGENT_BASE_STEM = docker-orchagent-$(DOCKER_ORCHAGENT_PLATFORM_CODE) DOCKER_ORCHAGENT_BASE = $(DOCKER_ORCHAGENT_BASE_STEM).gz DOCKER_ORCHAGENT_BASE_DBG = $(DOCKER_ORCHAGENT_BASE_STEM)$(DBG_IMAGE_MARK).gz From 279084fbeffce1cdbb6da3530c5bf56451a04925 Mon Sep 17 00:00:00 2001 From: Renuka Manavalan Date: Tue, 16 Apr 2019 03:07:14 +0000 Subject: [PATCH 09/13] Extended debug to all stretch based docker images --- platform/barefoot/docker-orchagent-bfn.mk | 25 ++-------------- platform/cavium/docker-orchagent-cavm.mk | 25 ++-------------- platform/centec/docker-orchagent-centec.mk | 25 ++-------------- platform/marvell/docker-orchagent-mrvl.mk | 24 ++------------- platform/mellanox/docker-orchagent-mlnx.mk | 25 ++-------------- platform/mellanox/docker-syncd-mlnx.mk | 19 ++---------- platform/nephos/docker-orchagent-nephos.mk | 24 ++------------- platform/template/docker-orchagent-base.mk | 2 +- platform/template/docker-syncd-base.mk | 35 ++++++++++++++++++++++ platform/vs/docker-orchagent-vs.mk | 25 ++-------------- 10 files changed, 52 insertions(+), 177 deletions(-) create mode 100644 platform/template/docker-syncd-base.mk diff --git a/platform/barefoot/docker-orchagent-bfn.mk b/platform/barefoot/docker-orchagent-bfn.mk index 07565891d0b2..62decd133808 100644 --- a/platform/barefoot/docker-orchagent-bfn.mk +++ b/platform/barefoot/docker-orchagent-bfn.mk @@ -1,25 +1,4 @@ # docker image for orchagent -DOCKER_ORCHAGENT_BFN = docker-orchagent-bfn.gz -$(DOCKER_ORCHAGENT_BFN)_PATH = $(DOCKERS_PATH)/docker-orchagent -$(DOCKER_ORCHAGENT_BFN)_DEPENDS += $(SWSS) $(REDIS_TOOLS) -ifeq ($(INSTALL_DEBUG_TOOLS), y) -$(DOCKER_ORCHAGENT_BFN)_DEPENDS += $(SWSS_DBG) \ - $(LIBSWSSCOMMON_DBG) \ - $(LIBSAIREDIS_DBG) -endif -$(DOCKER_ORCHAGENT_BFN)_LOAD_DOCKERS += $(DOCKER_CONFIG_ENGINE_STRETCH) -SONIC_DOCKER_IMAGES += $(DOCKER_ORCHAGENT_BFN) -SONIC_STRETCH_DOCKERS += $(DOCKER_ORCHAGENT_BFN) -SONIC_INSTALL_DOCKER_IMAGES += $(DOCKER_ORCHAGENT_BFN) - -$(DOCKER_ORCHAGENT_BFN)_CONTAINER_NAME = swss -$(DOCKER_ORCHAGENT_BFN)_RUN_OPT += --net=host --privileged -t -$(DOCKER_ORCHAGENT_BFN)_RUN_OPT += -v /etc/network/interfaces:/etc/network/interfaces:ro -$(DOCKER_ORCHAGENT_BFN)_RUN_OPT += -v /etc/network/interfaces.d/:/etc/network/interfaces.d/:ro -$(DOCKER_ORCHAGENT_BFN)_RUN_OPT += -v /host/machine.conf:/host/machine.conf:ro -$(DOCKER_ORCHAGENT_BFN)_RUN_OPT += -v /etc/sonic:/etc/sonic:ro -$(DOCKER_ORCHAGENT_BFN)_RUN_OPT += -v /var/log/swss:/var/log/swss:rw - -$(DOCKER_ORCHAGENT_BFN)_BASE_IMAGE_FILES += swssloglevel:/usr/bin/swssloglevel -$(DOCKER_ORCHAGENT_BFN)_FILES += $(ARP_UPDATE_SCRIPT) +DOCKER_ORCHAGENT_PLATFORM_CODE = bfn +include $(PLATFORM_PATH)/../template/docker-orchagent-base.mk diff --git a/platform/cavium/docker-orchagent-cavm.mk b/platform/cavium/docker-orchagent-cavm.mk index 6ba614e75108..081a7bc6c335 100644 --- a/platform/cavium/docker-orchagent-cavm.mk +++ b/platform/cavium/docker-orchagent-cavm.mk @@ -1,25 +1,4 @@ # docker image for orchagent -DOCKER_ORCHAGENT_CAVM = docker-orchagent-cavm.gz -$(DOCKER_ORCHAGENT_CAVM)_PATH = $(DOCKERS_PATH)/docker-orchagent -$(DOCKER_ORCHAGENT_CAVM)_DEPENDS += $(SWSS) $(REDIS_TOOLS) -ifeq ($(INSTALL_DEBUG_TOOLS), y) -$(DOCKER_ORCHAGENT_CAVM)_DEPENDS += $(SWSS_DBG) \ - $(LIBSWSSCOMMON_DBG) \ - $(LIBSAIREDIS_DBG) -endif -$(DOCKER_ORCHAGENT_CAVM)_LOAD_DOCKERS += $(DOCKER_CONFIG_ENGINE_STRETCH) -SONIC_DOCKER_IMAGES += $(DOCKER_ORCHAGENT_CAVM) -SONIC_STRETCH_DOCKERS += $(DOCKER_ORCHAGENT_CAVM) -SONIC_INSTALL_DOCKER_IMAGES += $(DOCKER_ORCHAGENT_CAVM) - -$(DOCKER_ORCHAGENT_CAVM)_CONTAINER_NAME = swss -$(DOCKER_ORCHAGENT_CAVM)_RUN_OPT += --net=host --privileged -t -$(DOCKER_ORCHAGENT_CAVM)_RUN_OPT += -v /etc/network/interfaces:/etc/network/interfaces:ro -$(DOCKER_ORCHAGENT_CAVM)_RUN_OPT += -v /etc/network/interfaces.d/:/etc/network/interfaces.d/:ro -$(DOCKER_ORCHAGENT_CAVM)_RUN_OPT += -v /host/machine.conf:/host/machine.conf:ro -$(DOCKER_ORCHAGENT_CAVM)_RUN_OPT += -v /etc/sonic:/etc/sonic:ro -$(DOCKER_ORCHAGENT_CAVM)_RUN_OPT += -v /var/log/swss:/var/log/swss:rw - -$(DOCKER_ORCHAGENT_CAVM)_BASE_IMAGE_FILES += swssloglevel:/usr/bin/swssloglevel -$(DOCKER_ORCHAGENT_CAVM)_FILES += $(ARP_UPDATE_SCRIPT) +DOCKER_ORCHAGENT_PLATFORM_CODE = cavm +include $(PLATFORM_PATH)/../template/docker-orchagent-base.mk diff --git a/platform/centec/docker-orchagent-centec.mk b/platform/centec/docker-orchagent-centec.mk index b44356f65743..08a9c8b98953 100644 --- a/platform/centec/docker-orchagent-centec.mk +++ b/platform/centec/docker-orchagent-centec.mk @@ -1,25 +1,4 @@ # docker image for orchagent -DOCKER_ORCHAGENT_CENTEC = docker-orchagent-centec.gz -$(DOCKER_ORCHAGENT_CENTEC)_PATH = $(DOCKERS_PATH)/docker-orchagent -$(DOCKER_ORCHAGENT_CENTEC)_DEPENDS += $(SWSS) $(REDIS_TOOLS) -ifeq ($(INSTALL_DEBUG_TOOLS), y) -$(DOCKER_ORCHAGENT_CENTEC)_DEPENDS += $(SWSS_DBG) \ - $(LIBSWSSCOMMON_DBG) \ - $(LIBSAIREDIS_DBG) -endif -$(DOCKER_ORCHAGENT_CENTEC)_LOAD_DOCKERS += $(DOCKER_CONFIG_ENGINE_STRETCH) -SONIC_DOCKER_IMAGES += $(DOCKER_ORCHAGENT_CENTEC) -SONIC_STRETCH_DOCKERS += $(DOCKER_ORCHAGENT_CENTEC) -SONIC_INSTALL_DOCKER_IMAGES += $(DOCKER_ORCHAGENT_CENTEC) - -$(DOCKER_ORCHAGENT_CENTEC)_CONTAINER_NAME = swss -$(DOCKER_ORCHAGENT_CENTEC)_RUN_OPT += --net=host --privileged -t -$(DOCKER_ORCHAGENT_CENTEC)_RUN_OPT += -v /etc/network/interfaces:/etc/network/interfaces:ro -$(DOCKER_ORCHAGENT_CENTEC)_RUN_OPT += -v /etc/network/interfaces.d/:/etc/network/interfaces.d/:ro -$(DOCKER_ORCHAGENT_CENTEC)_RUN_OPT += -v /host/machine.conf:/host/machine.conf:ro -$(DOCKER_ORCHAGENT_CENTEC)_RUN_OPT += -v /etc/sonic:/etc/sonic:ro -$(DOCKER_ORCHAGENT_CENTEC)_RUN_OPT += -v /var/log/swss:/var/log/swss:rw - -$(DOCKER_ORCHAGENT_CENTEC)_BASE_IMAGE_FILES += swssloglevel:/usr/bin/swssloglevel -$(DOCKER_ORCHAGENT_CENTEC)_FILES += $(ARP_UPDATE_SCRIPT) +DOCKER_ORCHAGENT_PLATFORM_CODE = centec +include $(PLATFORM_PATH)/../template/docker-orchagent-base.mk diff --git a/platform/marvell/docker-orchagent-mrvl.mk b/platform/marvell/docker-orchagent-mrvl.mk index 3561f8820220..0a362833a8a6 100644 --- a/platform/marvell/docker-orchagent-mrvl.mk +++ b/platform/marvell/docker-orchagent-mrvl.mk @@ -1,24 +1,4 @@ # docker image for orchagent -DOCKER_ORCHAGENT_MRVL = docker-orchagent-mrvl.gz -$(DOCKER_ORCHAGENT_MRVL)_PATH = $(DOCKERS_PATH)/docker-orchagent -$(DOCKER_ORCHAGENT_MRVL)_DEPENDS += $(SWSS) $(REDIS_TOOLS) -ifeq ($(INSTALL_DEBUG_TOOLS), y) -$(DOCKER_ORCHAGENT_MRVL)_DEPENDS += $(SWSS_DBG) \ - $(LIBSWSSCOMMON_DBG) \ - $(LIBSAIREDIS_DBG) -endif -$(DOCKER_ORCHAGENT_MRVL)_LOAD_DOCKERS += $(DOCKER_CONFIG_ENGINE_STRETCH) -SONIC_DOCKER_IMAGES += $(DOCKER_ORCHAGENT_MRVL) -SONIC_STRETCH_DOCKERS += $(DOCKER_ORCHAGENT_MRVL) -SONIC_INSTALL_DOCKER_IMAGES += $(DOCKER_ORCHAGENT_MRVL) - -$(DOCKER_ORCHAGENT_MRVL)_CONTAINER_NAME = swss -$(DOCKER_ORCHAGENT_MRVL)_RUN_OPT += --net=host --privileged -t -$(DOCKER_ORCHAGENT_MRVL)_RUN_OPT += -v /etc/network/interfaces:/etc/network/interfaces:ro -$(DOCKER_ORCHAGENT_MRVL)_RUN_OPT += -v /etc/network/interfaces.d/:/etc/network/interfaces.d/:ro -$(DOCKER_ORCHAGENT_MRVL)_RUN_OPT += -v /host/machine.conf:/host/machine.conf -$(DOCKER_ORCHAGENT_MRVL)_RUN_OPT += -v /etc/sonic:/etc/sonic:ro - -$(DOCKER_ORCHAGENT_MRVL)_BASE_IMAGE_FILES += swssloglevel:/usr/bin/swssloglevel -$(DOCKER_ORCHAGENT_MRVL)_FILES += $(ARP_UPDATE_SCRIPT) +DOCKER_ORCHAGENT_PLATFORM_CODE = mrvl +include $(PLATFORM_PATH)/../template/docker-orchagent-base.mk diff --git a/platform/mellanox/docker-orchagent-mlnx.mk b/platform/mellanox/docker-orchagent-mlnx.mk index 575369746c4e..475218b5c665 100644 --- a/platform/mellanox/docker-orchagent-mlnx.mk +++ b/platform/mellanox/docker-orchagent-mlnx.mk @@ -1,25 +1,4 @@ # docker image for orchagent -DOCKER_ORCHAGENT_MLNX = docker-orchagent-mlnx.gz -$(DOCKER_ORCHAGENT_MLNX)_PATH = $(DOCKERS_PATH)/docker-orchagent -$(DOCKER_ORCHAGENT_MLNX)_DEPENDS += $(SWSS) $(REDIS_TOOLS) -ifeq ($(INSTALL_DEBUG_TOOLS), y) -$(DOCKER_ORCHAGENT_MLNX)_DEPENDS += $(SWSS_DBG) \ - $(LIBSWSSCOMMON_DBG) \ - $(LIBSAIREDIS_DBG) -endif -$(DOCKER_ORCHAGENT_MLNX)_LOAD_DOCKERS += $(DOCKER_CONFIG_ENGINE_STRETCH) -SONIC_DOCKER_IMAGES += $(DOCKER_ORCHAGENT_MLNX) -SONIC_STRETCH_DOCKERS += $(DOCKER_ORCHAGENT_MLNX) -SONIC_INSTALL_DOCKER_IMAGES += $(DOCKER_ORCHAGENT_MLNX) - -$(DOCKER_ORCHAGENT_MLNX)_CONTAINER_NAME = swss -$(DOCKER_ORCHAGENT_MLNX)_RUN_OPT += --net=host --privileged -t -$(DOCKER_ORCHAGENT_MLNX)_RUN_OPT += -v /etc/network/interfaces:/etc/network/interfaces:ro -$(DOCKER_ORCHAGENT_MLNX)_RUN_OPT += -v /etc/network/interfaces.d/:/etc/network/interfaces.d/:ro -$(DOCKER_ORCHAGENT_MLNX)_RUN_OPT += -v /host/machine.conf:/host/machine.conf:ro -$(DOCKER_ORCHAGENT_MLNX)_RUN_OPT += -v /etc/sonic:/etc/sonic:ro -$(DOCKER_ORCHAGENT_MLNX)_RUN_OPT += -v /var/log/swss:/var/log/swss:rw - -$(DOCKER_ORCHAGENT_MLNX)_BASE_IMAGE_FILES += swssloglevel:/usr/bin/swssloglevel -$(DOCKER_ORCHAGENT_MLNX)_FILES += $(ARP_UPDATE_SCRIPT) +DOCKER_ORCHAGENT_PLATFORM_CODE = mlnx +include $(PLATFORM_PATH)/../template/docker-orchagent-base.mk diff --git a/platform/mellanox/docker-syncd-mlnx.mk b/platform/mellanox/docker-syncd-mlnx.mk index e229b822bf2a..fe37635f8b80 100644 --- a/platform/mellanox/docker-syncd-mlnx.mk +++ b/platform/mellanox/docker-syncd-mlnx.mk @@ -1,19 +1,4 @@ # docker image for mlnx syncd -DOCKER_SYNCD_MLNX = docker-syncd-mlnx.gz -$(DOCKER_SYNCD_MLNX)_PATH = $(PLATFORM_PATH)/docker-syncd-mlnx -$(DOCKER_SYNCD_MLNX)_DEPENDS += $(SYNCD) $(PYTHON_SDK_API) -$(DOCKER_SYNCD_MLNX)_PYTHON_DEBS += $(MLNX_SFPD) -$(DOCKER_SYNCD_MLNX)_LOAD_DOCKERS += $(DOCKER_CONFIG_ENGINE_STRETCH) -SONIC_DOCKER_IMAGES += $(DOCKER_SYNCD_MLNX) -SONIC_STRETCH_DOCKERS += $(DOCKER_SYNCD_MLNX) -ifneq ($(ENABLE_SYNCD_RPC),y) -SONIC_INSTALL_DOCKER_IMAGES += $(DOCKER_SYNCD_MLNX) -endif - -$(DOCKER_SYNCD_MLNX)_CONTAINER_NAME = syncd -$(DOCKER_SYNCD_MLNX)_RUN_OPT += --net=host --privileged -t -$(DOCKER_SYNCD_MLNX)_RUN_OPT += -v /host/machine.conf:/etc/machine.conf -$(DOCKER_SYNCD_MLNX)_RUN_OPT += -v /etc/sonic:/etc/sonic:ro -$(DOCKER_SYNCD_MLNX)_RUN_OPT += -v /host/warmboot:/var/warmboot - +DOCKER_SYNCD_PLATFORM_CODE = mlnx +include $(PLATFORM_PATH)/../template/docker-syncd-base.mk diff --git a/platform/nephos/docker-orchagent-nephos.mk b/platform/nephos/docker-orchagent-nephos.mk index f7719b3df5dd..f77b62c77ea7 100644 --- a/platform/nephos/docker-orchagent-nephos.mk +++ b/platform/nephos/docker-orchagent-nephos.mk @@ -1,24 +1,4 @@ # docker image for orchagent -DOCKER_ORCHAGENT_NEPHOS = docker-orchagent-nephos.gz -$(DOCKER_ORCHAGENT_NEPHOS)_PATH = $(DOCKERS_PATH)/docker-orchagent -$(DOCKER_ORCHAGENT_NEPHOS)_DEPENDS += $(SWSS) $(REDIS_TOOLS) $(IPROUTE2) -ifeq ($(INSTALL_DEBUG_TOOLS), y) -$(DOCKER_ORCHAGENT_NEPHOS)_DEPENDS += $(SWSS_DBG) \ - $(LIBSWSSCOMMON_DBG) \ - $(LIBSAIREDIS_DBG) -endif -$(DOCKER_ORCHAGENT_NEPHOS)_LOAD_DOCKERS += $(DOCKER_CONFIG_ENGINE) -SONIC_DOCKER_IMAGES += $(DOCKER_ORCHAGENT_NEPHOS) -SONIC_INSTALL_DOCKER_IMAGES += $(DOCKER_ORCHAGENT_NEPHOS) - -$(DOCKER_ORCHAGENT_NEPHOS)_CONTAINER_NAME = swss -$(DOCKER_ORCHAGENT_NEPHOS)_RUN_OPT += --net=host --privileged -t -$(DOCKER_ORCHAGENT_NEPHOS)_RUN_OPT += -v /etc/network/interfaces:/etc/network/interfaces:ro -$(DOCKER_ORCHAGENT_NEPHOS)_RUN_OPT += -v /etc/network/interfaces.d/:/etc/network/interfaces.d/:ro -$(DOCKER_ORCHAGENT_NEPHOS)_RUN_OPT += -v /host/machine.conf:/host/machine.conf:ro -$(DOCKER_ORCHAGENT_NEPHOS)_RUN_OPT += -v /etc/sonic:/etc/sonic:ro -$(DOCKER_ORCHAGENT_NEPHOS)_RUN_OPT += -v /var/log/swss:/var/log/swss:rw - -$(DOCKER_ORCHAGENT_NEPHOS)_BASE_IMAGE_FILES += swssloglevel:/usr/bin/swssloglevel -$(DOCKER_ORCHAGENT_NEPHOS)_FILES += $(ARP_UPDATE_SCRIPT) +DOCKER_ORCHAGENT_PLATFORM_CODE = nephos +include $(PLATFORM_PATH)/../template/docker-orchagent-base.mk diff --git a/platform/template/docker-orchagent-base.mk b/platform/template/docker-orchagent-base.mk index 1597fe4aaa6d..8bd5883bfd22 100644 --- a/platform/template/docker-orchagent-base.mk +++ b/platform/template/docker-orchagent-base.mk @@ -1,6 +1,6 @@ # docker image for orchagent -OCKER_ORCHAGENT_BASE_STEM = docker-orchagent-$(DOCKER_ORCHAGENT_PLATFORM_CODE) +DOCKER_ORCHAGENT_BASE_STEM = docker-orchagent-$(DOCKER_ORCHAGENT_PLATFORM_CODE) DOCKER_ORCHAGENT_BASE = $(DOCKER_ORCHAGENT_BASE_STEM).gz DOCKER_ORCHAGENT_BASE_DBG = $(DOCKER_ORCHAGENT_BASE_STEM)$(DBG_IMAGE_MARK).gz diff --git a/platform/template/docker-syncd-base.mk b/platform/template/docker-syncd-base.mk new file mode 100644 index 000000000000..864621a2815e --- /dev/null +++ b/platform/template/docker-syncd-base.mk @@ -0,0 +1,35 @@ +# docker image for syncd + + +DOCKER_SYNCD_BASE_STEM = docker-syncd-$(DOCKER_SYNCD_PLATFORM_CODE) +DOCKER_SYNCD_BASE = $(DOCKER_SYNCD_BASE_STEM).gz +DOCKER_SYNCD_BASE_DBG = $(DOCKER_SYNCD_BASE_STEM)$(DBG_IMAGE_MARK).gz + +$(DOCKER_SYNCD_BASE)_PATH = $(PLATFORM_PATH)/docker-syncd-$(DOCKER_SYNCD_PLATFORM_CODE) +$(DOCKER_SYNCD_BASE)_DEPENDS += $(SYNCD) $(PYTHON_SDK_API) +$(DOCKER_SYNCD_BASE)_PYTHON_DEBS += $(MLNX_SFPD) + +$(DOCKER_SYNCD_BASE)_DBG_DEPENDS += $($(DOCKER_CONFIG_ENGINE_STRETCH)_DBG_DEPENDS) + +$(DOCKER_SYNCD_BASE)_LOAD_DOCKERS += $(DOCKER_CONFIG_ENGINE_STRETCH) +$(DOCKER_SYNCD_BASE)_DBG_IMAGE_PACKAGES = $($(DOCKER_CONFIG_ENGINE_STRETCH)_DBG_IMAGE_PACKAGES) + +SONIC_DOCKER_IMAGES += $(DOCKER_SYNCD_BASE) +SONIC_STRETCH_DOCKERS += $(DOCKER_SYNCD_BASE) +ifneq ($(ENABLE_SYNCD_RPC),y) +SONIC_INSTALL_DOCKER_IMAGES += $(DOCKER_SYNCD_BASE) +endif + +SONIC_DOCKER_DBG_IMAGES += $(DOCKER_SYNCD_BASE_DBG) +SONIC_STRETCH_DBG_DOCKERS += $(DOCKER_SYNCD_BASE_DBG) +ifneq ($(ENABLE_SYNCD_RPC),y) +SONIC_INSTALL_DOCKER_DBG_IMAGES += $(DOCKER_SYNCD_BASE_DBG) +endif + + +$(DOCKER_SYNCD_BASE)_CONTAINER_NAME = syncd +$(DOCKER_SYNCD_BASE)_RUN_OPT += --net=host --privileged -t +$(DOCKER_SYNCD_BASE)_RUN_OPT += -v /host/machine.conf:/etc/machine.conf +$(DOCKER_SYNCD_BASE)_RUN_OPT += -v /etc/sonic:/etc/sonic:ro +$(DOCKER_SYNCD_BASE)_RUN_OPT += -v /host/warmboot:/var/warmboot + diff --git a/platform/vs/docker-orchagent-vs.mk b/platform/vs/docker-orchagent-vs.mk index 28794cad25bb..8627c9cb84b3 100644 --- a/platform/vs/docker-orchagent-vs.mk +++ b/platform/vs/docker-orchagent-vs.mk @@ -1,25 +1,4 @@ # docker image for orchagent -DOCKER_ORCHAGENT_VS = docker-orchagent-vs.gz -$(DOCKER_ORCHAGENT_VS)_PATH = $(DOCKERS_PATH)/docker-orchagent -$(DOCKER_ORCHAGENT_VS)_DEPENDS += $(SWSS) $(REDIS_TOOLS) -ifeq ($(INSTALL_DEBUG_TOOLS), y) -$(DOCKER_ORCHAGENT_VS)_DEPENDS += $(SWSS_DBG) \ - $(LIBSWSSCOMMON_DBG) \ - $(LIBSAIREDIS_DBG) -endif -$(DOCKER_ORCHAGENT_VS)_LOAD_DOCKERS += $(DOCKER_CONFIG_ENGINE_STRETCH) -SONIC_DOCKER_IMAGES += $(DOCKER_ORCHAGENT_VS) -SONIC_STRETCH_DOCKERS += $(DOCKER_ORCHAGENT_VS) -SONIC_INSTALL_DOCKER_IMAGES += $(DOCKER_ORCHAGENT_VS) - -$(DOCKER_ORCHAGENT_VS)_CONTAINER_NAME = swss -$(DOCKER_ORCHAGENT_VS)_RUN_OPT += --net=host --privileged -t -$(DOCKER_ORCHAGENT_VS)_RUN_OPT += -v /etc/network/interfaces:/etc/network/interfaces:ro -$(DOCKER_ORCHAGENT_VS)_RUN_OPT += -v /etc/network/interfaces.d/:/etc/network/interfaces.d/:ro -$(DOCKER_ORCHAGENT_VS)_RUN_OPT += -v /host/machine.conf:/host/machine.conf:ro -$(DOCKER_ORCHAGENT_VS)_RUN_OPT += -v /etc/sonic:/etc/sonic:ro -$(DOCKER_ORCHAGENT_VS)_RUN_OPT += -v /var/log/swss:/var/log/swss:rw - -$(DOCKER_ORCHAGENT_VS)_BASE_IMAGE_FILES += swssloglevel:/usr/bin/swssloglevel -$(DOCKER_ORCHAGENT_VS)_FILES += $(ARP_UPDATE_SCRIPT) +DOCKER_ORCHAGENT_PLATFORM_CODE = vs +include $(PLATFORM_PATH)/../template/docker-orchagent-base.mk From a2297a3c81678eb634da968349f5a6c8581b5b19 Mon Sep 17 00:00:00 2001 From: Renuka Manavalan Date: Thu, 18 Apr 2019 01:22:46 +0000 Subject: [PATCH 10/13] 1) Combined all orchagent makefiles into one platform independent make under rules/docker-orchagent.mk 2) Extened debug image to all stretch dockers --- dockers/docker-orchagent-bfn | 1 - dockers/docker-orchagent-cavm | 1 - dockers/docker-orchagent-centec | 1 - dockers/docker-orchagent-mlnx | 1 - dockers/docker-orchagent-nephos | 1 - platform/barefoot/docker-orchagent-bfn.mk | 4 --- platform/barefoot/rules.mk | 1 - platform/broadcom/docker-orchagent-brcm.mk | 5 --- platform/broadcom/rules.mk | 1 - platform/cavium/docker-orchagent-cavm.mk | 4 --- platform/cavium/rules.mk | 1 - platform/centec/docker-orchagent-centec.mk | 4 --- platform/centec/rules.mk | 1 - platform/marvell/docker-orchagent-mrvl.mk | 4 --- platform/marvell/rules.mk | 1 - platform/mellanox/docker-orchagent-mlnx.mk | 4 --- platform/mellanox/rules.mk | 1 - platform/nephos/docker-orchagent-nephos.mk | 4 --- platform/nephos/rules.mk | 1 - platform/template/docker-orchagent-base.mk | 37 ---------------------- platform/template/docker-syncd-base.mk | 2 +- platform/vs/docker-orchagent-vs.mk | 4 --- platform/vs/rules.mk | 1 - rules/docker-database.mk | 18 +++++++++-- rules/docker-orchagent.mk | 37 ++++++++++++++++++++++ rules/docker-platform-monitor.mk | 19 +++++++++-- rules/docker-router-advertiser.mk | 17 ++++++++-- rules/docker-teamd.mk | 17 ++++++++-- rules/docker-telemetry.mk | 19 +++++++++-- slave.mk | 6 ++-- 30 files changed, 120 insertions(+), 98 deletions(-) delete mode 120000 dockers/docker-orchagent-bfn delete mode 120000 dockers/docker-orchagent-cavm delete mode 120000 dockers/docker-orchagent-centec delete mode 120000 dockers/docker-orchagent-mlnx delete mode 120000 dockers/docker-orchagent-nephos delete mode 100644 platform/barefoot/docker-orchagent-bfn.mk delete mode 100644 platform/broadcom/docker-orchagent-brcm.mk delete mode 100644 platform/cavium/docker-orchagent-cavm.mk delete mode 100644 platform/centec/docker-orchagent-centec.mk delete mode 100644 platform/marvell/docker-orchagent-mrvl.mk delete mode 100644 platform/mellanox/docker-orchagent-mlnx.mk delete mode 100644 platform/nephos/docker-orchagent-nephos.mk delete mode 100644 platform/template/docker-orchagent-base.mk delete mode 100644 platform/vs/docker-orchagent-vs.mk create mode 100644 rules/docker-orchagent.mk diff --git a/dockers/docker-orchagent-bfn b/dockers/docker-orchagent-bfn deleted file mode 120000 index 8d52609c56e5..000000000000 --- a/dockers/docker-orchagent-bfn +++ /dev/null @@ -1 +0,0 @@ -docker-orchagent \ No newline at end of file diff --git a/dockers/docker-orchagent-cavm b/dockers/docker-orchagent-cavm deleted file mode 120000 index 8d52609c56e5..000000000000 --- a/dockers/docker-orchagent-cavm +++ /dev/null @@ -1 +0,0 @@ -docker-orchagent \ No newline at end of file diff --git a/dockers/docker-orchagent-centec b/dockers/docker-orchagent-centec deleted file mode 120000 index 8d52609c56e5..000000000000 --- a/dockers/docker-orchagent-centec +++ /dev/null @@ -1 +0,0 @@ -docker-orchagent \ No newline at end of file diff --git a/dockers/docker-orchagent-mlnx b/dockers/docker-orchagent-mlnx deleted file mode 120000 index 8d52609c56e5..000000000000 --- a/dockers/docker-orchagent-mlnx +++ /dev/null @@ -1 +0,0 @@ -docker-orchagent \ No newline at end of file diff --git a/dockers/docker-orchagent-nephos b/dockers/docker-orchagent-nephos deleted file mode 120000 index 8d52609c56e5..000000000000 --- a/dockers/docker-orchagent-nephos +++ /dev/null @@ -1 +0,0 @@ -docker-orchagent \ No newline at end of file diff --git a/platform/barefoot/docker-orchagent-bfn.mk b/platform/barefoot/docker-orchagent-bfn.mk deleted file mode 100644 index 62decd133808..000000000000 --- a/platform/barefoot/docker-orchagent-bfn.mk +++ /dev/null @@ -1,4 +0,0 @@ -# docker image for orchagent - -DOCKER_ORCHAGENT_PLATFORM_CODE = bfn -include $(PLATFORM_PATH)/../template/docker-orchagent-base.mk diff --git a/platform/barefoot/rules.mk b/platform/barefoot/rules.mk index 4c8ec0c23f4d..ea718d10fc96 100644 --- a/platform/barefoot/rules.mk +++ b/platform/barefoot/rules.mk @@ -6,7 +6,6 @@ include $(PLATFORM_PATH)/platform-modules-ingrasys.mk include $(PLATFORM_PATH)/bfn-sai.mk include $(PLATFORM_PATH)/docker-syncd-bfn.mk include $(PLATFORM_PATH)/docker-syncd-bfn-rpc.mk -include $(PLATFORM_PATH)/docker-orchagent-bfn.mk include $(PLATFORM_PATH)/one-aboot.mk include $(PLATFORM_PATH)/one-image.mk include $(PLATFORM_PATH)/libsaithrift-dev.mk diff --git a/platform/broadcom/docker-orchagent-brcm.mk b/platform/broadcom/docker-orchagent-brcm.mk deleted file mode 100644 index 4dfa3059c251..000000000000 --- a/platform/broadcom/docker-orchagent-brcm.mk +++ /dev/null @@ -1,5 +0,0 @@ -# docker image for orchagent - -DOCKER_ORCHAGENT_PLATFORM_CODE = brcm -include $(PLATFORM_PATH)/../template/docker-orchagent-base.mk - diff --git a/platform/broadcom/rules.mk b/platform/broadcom/rules.mk index b8fb9ff4ac96..a4f1d454ff75 100644 --- a/platform/broadcom/rules.mk +++ b/platform/broadcom/rules.mk @@ -11,7 +11,6 @@ include $(PLATFORM_PATH)/platform-modules-cel.mk include $(PLATFORM_PATH)/platform-modules-delta.mk include $(PLATFORM_PATH)/platform-modules-quanta.mk #include $(PLATFORM_PATH)/platform-modules-mitac.mk -include $(PLATFORM_PATH)/docker-orchagent-brcm.mk include $(PLATFORM_PATH)/docker-syncd-brcm.mk include $(PLATFORM_PATH)/docker-syncd-brcm-rpc.mk include $(PLATFORM_PATH)/docker-saiserver-brcm.mk diff --git a/platform/cavium/docker-orchagent-cavm.mk b/platform/cavium/docker-orchagent-cavm.mk deleted file mode 100644 index 081a7bc6c335..000000000000 --- a/platform/cavium/docker-orchagent-cavm.mk +++ /dev/null @@ -1,4 +0,0 @@ -# docker image for orchagent - -DOCKER_ORCHAGENT_PLATFORM_CODE = cavm -include $(PLATFORM_PATH)/../template/docker-orchagent-base.mk diff --git a/platform/cavium/rules.mk b/platform/cavium/rules.mk index 093819c9ce1b..3cdd8d61f6d7 100644 --- a/platform/cavium/rules.mk +++ b/platform/cavium/rules.mk @@ -1,7 +1,6 @@ include $(PLATFORM_PATH)/cavm-sai.mk include $(PLATFORM_PATH)/docker-syncd-cavm.mk include $(PLATFORM_PATH)/docker-syncd-cavm-rpc.mk -include $(PLATFORM_PATH)/docker-orchagent-cavm.mk include $(PLATFORM_PATH)/cavm-platform-modules.mk include $(PLATFORM_PATH)/cavm-xpnet.mk include $(PLATFORM_PATH)/one-image.mk diff --git a/platform/centec/docker-orchagent-centec.mk b/platform/centec/docker-orchagent-centec.mk deleted file mode 100644 index 08a9c8b98953..000000000000 --- a/platform/centec/docker-orchagent-centec.mk +++ /dev/null @@ -1,4 +0,0 @@ -# docker image for orchagent - -DOCKER_ORCHAGENT_PLATFORM_CODE = centec -include $(PLATFORM_PATH)/../template/docker-orchagent-base.mk diff --git a/platform/centec/rules.mk b/platform/centec/rules.mk index 73a1444de3e3..f9d776b61f38 100644 --- a/platform/centec/rules.mk +++ b/platform/centec/rules.mk @@ -1,6 +1,5 @@ include $(PLATFORM_PATH)/platform-modules-centec-e582.mk include $(PLATFORM_PATH)/sdk.mk -include $(PLATFORM_PATH)/docker-orchagent-centec.mk include $(PLATFORM_PATH)/docker-syncd-centec.mk include $(PLATFORM_PATH)/docker-syncd-centec-rpc.mk include $(PLATFORM_PATH)/one-image.mk diff --git a/platform/marvell/docker-orchagent-mrvl.mk b/platform/marvell/docker-orchagent-mrvl.mk deleted file mode 100644 index 0a362833a8a6..000000000000 --- a/platform/marvell/docker-orchagent-mrvl.mk +++ /dev/null @@ -1,4 +0,0 @@ -# docker image for orchagent - -DOCKER_ORCHAGENT_PLATFORM_CODE = mrvl -include $(PLATFORM_PATH)/../template/docker-orchagent-base.mk diff --git a/platform/marvell/rules.mk b/platform/marvell/rules.mk index af3df0239e5d..067e5ee473c1 100644 --- a/platform/marvell/rules.mk +++ b/platform/marvell/rules.mk @@ -2,7 +2,6 @@ include $(PLATFORM_PATH)/sdk.mk include $(PLATFORM_PATH)/sai.mk include $(PLATFORM_PATH)/docker-syncd-mrvl.mk include $(PLATFORM_PATH)/docker-syncd-mrvl-rpc.mk -include $(PLATFORM_PATH)/docker-orchagent-mrvl.mk include $(PLATFORM_PATH)/libsaithrift-dev.mk include $(PLATFORM_PATH)/one-image.mk diff --git a/platform/mellanox/docker-orchagent-mlnx.mk b/platform/mellanox/docker-orchagent-mlnx.mk deleted file mode 100644 index 475218b5c665..000000000000 --- a/platform/mellanox/docker-orchagent-mlnx.mk +++ /dev/null @@ -1,4 +0,0 @@ -# docker image for orchagent - -DOCKER_ORCHAGENT_PLATFORM_CODE = mlnx -include $(PLATFORM_PATH)/../template/docker-orchagent-base.mk diff --git a/platform/mellanox/rules.mk b/platform/mellanox/rules.mk index afd52a3459b1..4d391f44ebcb 100644 --- a/platform/mellanox/rules.mk +++ b/platform/mellanox/rules.mk @@ -6,7 +6,6 @@ include $(PLATFORM_PATH)/hw-management.mk include $(PLATFORM_PATH)/mlnx-platform-api.mk include $(PLATFORM_PATH)/docker-syncd-mlnx.mk include $(PLATFORM_PATH)/docker-syncd-mlnx-rpc.mk -include $(PLATFORM_PATH)/docker-orchagent-mlnx.mk include $(PLATFORM_PATH)/docker-saiserver-mlnx.mk include $(PLATFORM_PATH)/one-image.mk include $(PLATFORM_PATH)/libsaithrift-dev.mk diff --git a/platform/nephos/docker-orchagent-nephos.mk b/platform/nephos/docker-orchagent-nephos.mk deleted file mode 100644 index f77b62c77ea7..000000000000 --- a/platform/nephos/docker-orchagent-nephos.mk +++ /dev/null @@ -1,4 +0,0 @@ -# docker image for orchagent - -DOCKER_ORCHAGENT_PLATFORM_CODE = nephos -include $(PLATFORM_PATH)/../template/docker-orchagent-base.mk diff --git a/platform/nephos/rules.mk b/platform/nephos/rules.mk index c33d75448bab..f728bfb25de7 100644 --- a/platform/nephos/rules.mk +++ b/platform/nephos/rules.mk @@ -2,7 +2,6 @@ include $(PLATFORM_PATH)/sdk.mk include $(PLATFORM_PATH)/sai.mk include $(PLATFORM_PATH)/platform-modules-ingrasys.mk include $(PLATFORM_PATH)/platform-modules-accton.mk -include $(PLATFORM_PATH)/docker-orchagent-nephos.mk include $(PLATFORM_PATH)/docker-syncd-nephos.mk include $(PLATFORM_PATH)/docker-syncd-nephos-rpc.mk include $(PLATFORM_PATH)/one-image.mk diff --git a/platform/template/docker-orchagent-base.mk b/platform/template/docker-orchagent-base.mk deleted file mode 100644 index 8bd5883bfd22..000000000000 --- a/platform/template/docker-orchagent-base.mk +++ /dev/null @@ -1,37 +0,0 @@ -# docker image for orchagent - -DOCKER_ORCHAGENT_BASE_STEM = docker-orchagent-$(DOCKER_ORCHAGENT_PLATFORM_CODE) -DOCKER_ORCHAGENT_BASE = $(DOCKER_ORCHAGENT_BASE_STEM).gz -DOCKER_ORCHAGENT_BASE_DBG = $(DOCKER_ORCHAGENT_BASE_STEM)$(DBG_IMAGE_MARK).gz - -$(DOCKER_ORCHAGENT_BASE)_PATH = $(DOCKERS_PATH)/docker-orchagent -$(DOCKER_ORCHAGENT_BASE)_DEPENDS += $(SWSS) $(REDIS_TOOLS) -$(DOCKER_ORCHAGENT_BASE)_DBG_DEPENDS = $(SWSS_DBG) \ - $(LIBSWSSCOMMON_DBG) \ - $(LIBSAIREDIS_DBG) -ifeq ($(INSTALL_DEBUG_TOOLS), y) -$(DOCKER_ORCHAGENT_BASE)_DEPENDS += $($(DOCKER_ORCHAGENT_BASE)_DBG_DEPENDS) -endif -$(DOCKER_ORCHAGENT_BASE)_DBG_DEPENDS += $($(DOCKER_CONFIG_ENGINE_STRETCH)_DBG_DEPENDS) - -$(DOCKER_ORCHAGENT_BASE)_LOAD_DOCKERS += $(DOCKER_CONFIG_ENGINE_STRETCH) -$(DOCKER_ORCHAGENT_BASE)_DBG_IMAGE_PACKAGES = $($(DOCKER_CONFIG_ENGINE_STRETCH)_DBG_IMAGE_PACKAGES) - -SONIC_DOCKER_IMAGES += $(DOCKER_ORCHAGENT_BASE) -SONIC_STRETCH_DOCKERS += $(DOCKER_ORCHAGENT_BASE) -SONIC_INSTALL_DOCKER_IMAGES += $(DOCKER_ORCHAGENT_BASE) - -SONIC_DOCKER_DBG_IMAGES += $(DOCKER_ORCHAGENT_BASE_DBG) -SONIC_STRETCH_DBG_DOCKERS += $(DOCKER_ORCHAGENT_BASE_DBG) -SONIC_INSTALL_DOCKER_DBG_IMAGES += $(DOCKER_ORCHAGENT_BASE_DBG) - -$(DOCKER_ORCHAGENT_BASE)_CONTAINER_NAME = swss -$(DOCKER_ORCHAGENT_BASE)_RUN_OPT += --net=host --privileged -t -$(DOCKER_ORCHAGENT_BASE)_RUN_OPT += -v /etc/network/interfaces:/etc/network/interfaces:ro -$(DOCKER_ORCHAGENT_BASE)_RUN_OPT += -v /etc/network/interfaces.d/:/etc/network/interfaces.d/:ro -$(DOCKER_ORCHAGENT_BASE)_RUN_OPT += -v /host/machine.conf:/host/machine.conf:ro -$(DOCKER_ORCHAGENT_BASE)_RUN_OPT += -v /etc/sonic:/etc/sonic:ro -$(DOCKER_ORCHAGENT_BASE)_RUN_OPT += -v /var/log/swss:/var/log/swss:rw - -$(DOCKER_ORCHAGENT_BASE)_BASE_IMAGE_FILES += swssloglevel:/usr/bin/swssloglevel -$(DOCKER_ORCHAGENT_BASE)_FILES += $(ARP_UPDATE_SCRIPT) diff --git a/platform/template/docker-syncd-base.mk b/platform/template/docker-syncd-base.mk index 864621a2815e..85839571fc70 100644 --- a/platform/template/docker-syncd-base.mk +++ b/platform/template/docker-syncd-base.mk @@ -3,7 +3,7 @@ DOCKER_SYNCD_BASE_STEM = docker-syncd-$(DOCKER_SYNCD_PLATFORM_CODE) DOCKER_SYNCD_BASE = $(DOCKER_SYNCD_BASE_STEM).gz -DOCKER_SYNCD_BASE_DBG = $(DOCKER_SYNCD_BASE_STEM)$(DBG_IMAGE_MARK).gz +DOCKER_SYNCD_BASE_DBG = $(DOCKER_SYNCD_BASE_STEM)-$(DBG_IMAGE_MARK).gz $(DOCKER_SYNCD_BASE)_PATH = $(PLATFORM_PATH)/docker-syncd-$(DOCKER_SYNCD_PLATFORM_CODE) $(DOCKER_SYNCD_BASE)_DEPENDS += $(SYNCD) $(PYTHON_SDK_API) diff --git a/platform/vs/docker-orchagent-vs.mk b/platform/vs/docker-orchagent-vs.mk deleted file mode 100644 index 8627c9cb84b3..000000000000 --- a/platform/vs/docker-orchagent-vs.mk +++ /dev/null @@ -1,4 +0,0 @@ -# docker image for orchagent - -DOCKER_ORCHAGENT_PLATFORM_CODE = vs -include $(PLATFORM_PATH)/../template/docker-orchagent-base.mk diff --git a/platform/vs/rules.mk b/platform/vs/rules.mk index 7ba2da0db0ff..557604d9ec4d 100644 --- a/platform/vs/rules.mk +++ b/platform/vs/rules.mk @@ -2,7 +2,6 @@ include $(PLATFORM_PATH)/syncd-vs.mk include $(PLATFORM_PATH)/sonic-version.mk include $(PLATFORM_PATH)/docker-sonic-vs.mk include $(PLATFORM_PATH)/docker-syncd-vs.mk -include $(PLATFORM_PATH)/docker-orchagent-vs.mk include $(PLATFORM_PATH)/one-image.mk include $(PLATFORM_PATH)/onie.mk include $(PLATFORM_PATH)/kvm-image.mk diff --git a/rules/docker-database.mk b/rules/docker-database.mk index 9a7f67ceddec..244cce92ceda 100644 --- a/rules/docker-database.mk +++ b/rules/docker-database.mk @@ -1,13 +1,27 @@ # docker image for database -DOCKER_DATABASE = docker-database.gz -$(DOCKER_DATABASE)_PATH = $(DOCKERS_PATH)/docker-database +DOCKER_DATABASE_STEM = docker-database +DOCKER_DATABASE = $(DOCKER_DATABASE_STEM).gz +DOCKER_DATABASE_DBG = $(DOCKER_DATABASE_STEM)-$(DBG_IMAGE_MARK).gz + +$(DOCKER_DATABASE)_PATH = $(DOCKERS_PATH)/$(DOCKER_DATABASE_STEM) + $(DOCKER_DATABASE)_DEPENDS += $(REDIS_TOOLS) $(REDIS_SERVER) +$(DOCKER_DATABASE)_DBG_DEPENDS = $($(DOCKER_CONFIG_ENGINE_STRETCH)_DBG_DEPENDS) +$(DOCKER_DATABASE)_DBG_DEPENDS += $(LIBSAIREDIS_DBG) + +$(DOCKER_DATABASE)_DBG_IMAGE_PACKAGES = $($(DOCKER_CONFIG_ENGINE_STRETCH)_DBG_IMAGE_PACKAGES) + $(DOCKER_DATABASE)_LOAD_DOCKERS += $(DOCKER_CONFIG_ENGINE_STRETCH) + SONIC_DOCKER_IMAGES += $(DOCKER_DATABASE) SONIC_INSTALL_DOCKER_IMAGES += $(DOCKER_DATABASE) SONIC_STRETCH_DOCKERS += $(DOCKER_DATABASE) +SONIC_DOCKER_DBG_IMAGES += $(DOCKER_DATABASE_DBG) +SONIC_INSTALL_DOCKER_DBG_IMAGES += $(DOCKER_DATABASE_DBG) +SONIC_STRETCH_DBG_DOCKERS += $(DOCKER_DATABASE_DBG) + $(DOCKER_DATABASE)_CONTAINER_NAME = database $(DOCKER_DATABASE)_RUN_OPT += --net=host --privileged -t $(DOCKER_DATABASE)_RUN_OPT += -v /etc/sonic:/etc/sonic:ro diff --git a/rules/docker-orchagent.mk b/rules/docker-orchagent.mk new file mode 100644 index 000000000000..a2f9a21d72f3 --- /dev/null +++ b/rules/docker-orchagent.mk @@ -0,0 +1,37 @@ +# docker image for orchagent + +DOCKER_ORCHAGENT_STEM = docker-orchagent +DOCKER_ORCHAGENT = $(DOCKER_ORCHAGENT_STEM).gz +DOCKER_ORCHAGENT_DBG = $(DOCKER_ORCHAGENT_STEM)-$(DBG_IMAGE_MARK).gz + +$(DOCKER_ORCHAGENT)_DEPENDS += $(SWSS) $(REDIS_TOOLS) + +$(DOCKER_ORCHAGENT)_DBG_DEPENDS = $($(DOCKER_CONFIG_ENGINE_STRETCH)_DBG_DEPENDS) +$(DOCKER_ORCHAGENT)_DBG_DEPENDS += $(SWSS_DBG) \ + $(LIBSWSSCOMMON_DBG) \ + $(LIBSAIREDIS_DBG) + +$(DOCKER_ORCHAGENT)_DBG_IMAGE_PACKAGES = $($(DOCKER_CONFIG_ENGINE_STRETCH)_DBG_IMAGE_PACKAGES) + +$(DOCKER_ORCHAGENT)_PATH = $(DOCKERS_PATH)/$(DOCKER_ORCHAGENT_STEM) + +$(DOCKER_ORCHAGENT)_LOAD_DOCKERS += $(DOCKER_CONFIG_ENGINE_STRETCH) + +SONIC_DOCKER_IMAGES += $(DOCKER_ORCHAGENT) +SONIC_STRETCH_DOCKERS += $(DOCKER_ORCHAGENT) +SONIC_INSTALL_DOCKER_IMAGES += $(DOCKER_ORCHAGENT) + +SONIC_DOCKER_DBG_IMAGES += $(DOCKER_ORCHAGENT_DBG) +SONIC_STRETCH_DBG_DOCKERS += $(DOCKER_ORCHAGENT_DBG) +SONIC_INSTALL_DOCKER_DBG_IMAGES += $(DOCKER_ORCHAGENT_DBG) + +$(DOCKER_ORCHAGENT)_CONTAINER_NAME = swss +$(DOCKER_ORCHAGENT)_RUN_OPT += --net=host --privileged -t +$(DOCKER_ORCHAGENT)_RUN_OPT += -v /etc/network/interfaces:/etc/network/interfaces:ro +$(DOCKER_ORCHAGENT)_RUN_OPT += -v /etc/network/interfaces.d/:/etc/network/interfaces.d/:ro +$(DOCKER_ORCHAGENT)_RUN_OPT += -v /host/machine.conf:/host/machine.conf:ro +$(DOCKER_ORCHAGENT)_RUN_OPT += -v /etc/sonic:/etc/sonic:ro +$(DOCKER_ORCHAGENT)_RUN_OPT += -v /var/log/swss:/var/log/swss:rw + +$(DOCKER_ORCHAGENT)_IMAGE_FILES += swssloglevel:/usr/bin/swssloglevel +$(DOCKER_ORCHAGENT)_FILES += $(ARP_UPDATE_SCRIPT) diff --git a/rules/docker-platform-monitor.mk b/rules/docker-platform-monitor.mk index 09017641e413..2f56c71f7740 100644 --- a/rules/docker-platform-monitor.mk +++ b/rules/docker-platform-monitor.mk @@ -1,19 +1,32 @@ # Docker image for SONiC platform monitoring tools -DOCKER_PLATFORM_MONITOR = docker-platform-monitor.gz -$(DOCKER_PLATFORM_MONITOR)_PATH = $(DOCKERS_PATH)/docker-platform-monitor +DOCKER_PLATFORM_MONITOR_STEM = docker-platform-monitor +DOCKER_PLATFORM_MONITOR = $(DOCKER_PLATFORM_MONITOR_STEM).gz +DOCKER_PLATFORM_MONITOR_DBG = $(DOCKER_PLATFORM_MONITOR_STEM)-$(DBG_IMAGE_MARK).gz + +$(DOCKER_PLATFORM_MONITOR)_PATH = $(DOCKERS_PATH)/$(DOCKER_PLATFORM_MONITOR_STEM) + $(DOCKER_PLATFORM_MONITOR)_DEPENDS += $(LIBSENSORS) $(LM_SENSORS) $(FANCONTROL) $(SENSORD) $(LIBSWSSCOMMON) $(PYTHON_SWSSCOMMON) $(SMARTMONTOOLS) $(DOCKER_PLATFORM_MONITOR)_PYTHON_DEBS += $(SONIC_LEDD) $(SONIC_XCVRD) $(SONIC_PSUD) $(DOCKER_PLATFORM_MONITOR)_PYTHON_WHEELS += $(SONIC_PLATFORM_COMMON_PY2) $(DOCKER_PLATFORM_MONITOR)_PYTHON_WHEELS += $(SWSSSDK_PY2) $(DOCKER_PLATFORM_MONITOR)_PYTHON_WHEELS += $(SONIC_PLATFORM_API_PY2) $(DOCKER_PLATFORM_MONITOR)_PYTHON_WHEELS += $(SONIC_DAEMON_BASE_PY2) + +$(DOCKER_PLATFORM_MONITOR)_DBG_DEPENDS = $($(DOCKER_CONFIG_ENGINE_STRETCH)_DBG_DEPENDS) +$(DOCKER_PLATFORM_MONITOR)_DBG_DEPENDS += $(LIBSWSSCOMMON_DBG) $(LIBSAIREDIS_DBG) +$(DOCKER_PLATFORM_MONITOR)_DBG_IMAGE_PACKAGES = $($(DOCKER_CONFIG_ENGINE_STRETCH)_DBG_IMAGE_PACKAGES) + $(DOCKER_PLATFORM_MONITOR)_LOAD_DOCKERS = $(DOCKER_CONFIG_ENGINE_STRETCH) -SONIC_STRETCH_DOCKERS += $(DOCKER_PLATFORM_MONITOR) +SONIC_STRETCH_DOCKERS += $(DOCKER_PLATFORM_MONITOR) SONIC_DOCKER_IMAGES += $(DOCKER_PLATFORM_MONITOR) SONIC_INSTALL_DOCKER_IMAGES += $(DOCKER_PLATFORM_MONITOR) +SONIC_STRETCH_DBG_DOCKERS += $(DOCKER_PLATFORM_MONITOR_DBG) +SONIC_DOCKER_DBG_IMAGES += $(DOCKER_PLATFORM_MONITOR_DBG) +SONIC_INSTALL_DOCKER_DBG_IMAGES += $(DOCKER_PLATFORM_MONITOR_DBG) + $(DOCKER_PLATFORM_MONITOR)_CONTAINER_NAME = pmon $(DOCKER_PLATFORM_MONITOR)_RUN_OPT += --net=host --privileged -t $(DOCKER_PLATFORM_MONITOR)_RUN_OPT += -v /etc/sonic:/etc/sonic:ro diff --git a/rules/docker-router-advertiser.mk b/rules/docker-router-advertiser.mk index 354b14f70c0b..e20e63e90c8e 100644 --- a/rules/docker-router-advertiser.mk +++ b/rules/docker-router-advertiser.mk @@ -1,13 +1,26 @@ # Docker image for router advertiser -DOCKER_ROUTER_ADVERTISER = docker-router-advertiser.gz -$(DOCKER_ROUTER_ADVERTISER)_PATH = $(DOCKERS_PATH)/docker-router-advertiser +DOCKER_ROUTER_ADVERTISER_STEM = docker-router-advertiser +DOCKER_ROUTER_ADVERTISER = $(DOCKER_ROUTER_ADVERTISER_STEM).gz +DOCKER_ROUTER_ADVERTISER_DBG = $(DOCKER_ROUTER_ADVERTISER_STEM)-$(DBG_IMAGE_MARK).gz + +$(DOCKER_ROUTER_ADVERTISER)_PATH = $(DOCKERS_PATH)/$(DOCKER_ROUTER_ADVERTISER_STEM) + $(DOCKER_ROUTER_ADVERTISER)_DEPENDS += $(RADVD) $(REDIS_TOOLS) +$(DOCKER_ROUTER_ADVERTISER)_DBG_DEPENDS = $($(DOCKER_CONFIG_ENGINE_STRETCH)_DBG_DEPENDS) +$(DOCKER_ROUTER_ADVERTISER)_DBG_DEPENDS += $(LIBSAIREDIS_DBG) +$(DOCKER_ROUTER_ADVERTISER)_DBG_IMAGE_PACKAGES = $($(DOCKER_CONFIG_ENGINE_STRETCH)_DBG_IMAGE_PACKAGES) + $(DOCKER_ROUTER_ADVERTISER)_LOAD_DOCKERS = $(DOCKER_CONFIG_ENGINE_STRETCH) + SONIC_DOCKER_IMAGES += $(DOCKER_ROUTER_ADVERTISER) SONIC_INSTALL_DOCKER_IMAGES += $(DOCKER_ROUTER_ADVERTISER) SONIC_STRETCH_DOCKERS += $(DOCKER_ROUTER_ADVERTISER) +SONIC_DOCKER_DBG_IMAGES += $(DOCKER_ROUTER_ADVERTISER_DBG) +SONIC_INSTALL_DOCKER_DBG_IMAGES += $(DOCKER_ROUTER_ADVERTISER_DBG) +SONIC_STRETCH_DBG_DOCKERS += $(DOCKER_ROUTER_ADVERTISER_DBG) + $(DOCKER_ROUTER_ADVERTISER)_CONTAINER_NAME = radv $(DOCKER_ROUTER_ADVERTISER)_RUN_OPT += --net=host --privileged -t $(DOCKER_ROUTER_ADVERTISER)_RUN_OPT += -v /etc/sonic:/etc/sonic:ro diff --git a/rules/docker-teamd.mk b/rules/docker-teamd.mk index 958957cc9c30..1d8ec2a70e41 100644 --- a/rules/docker-teamd.mk +++ b/rules/docker-teamd.mk @@ -1,13 +1,26 @@ # docker image for teamd agent -DOCKER_TEAMD = docker-teamd.gz -$(DOCKER_TEAMD)_PATH = $(DOCKERS_PATH)/docker-teamd +DOCKER_TEAMD_STEM = docker-teamd +DOCKER_TEAMD = $(DOCKER_TEAMD_STEM).gz +DOCKER_TEAMD_DBG = $(DOCKER_TEAMD_STEM)-$(DBG_IMAGE_MARK).gz + +$(DOCKER_TEAMD)_PATH = $(DOCKERS_PATH)/$(DOCKER_TEAMD_STEM) + $(DOCKER_TEAMD)_DEPENDS += $(SWSS) $(LIBTEAMDCT) $(LIBTEAM_UTILS) $(REDIS_TOOLS) +$(DOCKER_TEAMD)_DBG_DEPENDS = $($(DOCKER_CONFIG_ENGINE_STRETCH)_DBG_DEPENDS) +$(DOCKER_TEAMD)_DBG_DEPENDS += $(LIBSAIREDIS_DBG) $(SWSS_DBG) $(LIBSWSSCOMMON_DBG) +$(DOCKER_TEAMD)_DBG_IMAGE_PACKAGES = $($(DOCKER_CONFIG_ENGINE_STRETCH)_DBG_IMAGE_PACKAGES) + $(DOCKER_TEAMD)_LOAD_DOCKERS += $(DOCKER_CONFIG_ENGINE_STRETCH) + SONIC_DOCKER_IMAGES += $(DOCKER_TEAMD) SONIC_INSTALL_DOCKER_IMAGES += $(DOCKER_TEAMD) SONIC_STRETCH_DOCKERS += $(DOCKER_TEAMD) +SONIC_DOCKER_DBG_IMAGES += $(DOCKER_TEAMD_DBG) +SONIC_INSTALL_DOCKER_DBG_IMAGES += $(DOCKER_TEAMD_DBG) +SONIC_STRETCH_DBG_DOCKERS += $(DOCKER_TEAMD_DBG) + $(DOCKER_TEAMD)_CONTAINER_NAME = teamd $(DOCKER_TEAMD)_RUN_OPT += --net=host --privileged -t $(DOCKER_TEAMD)_RUN_OPT += -v /etc/sonic:/etc/sonic:ro diff --git a/rules/docker-telemetry.mk b/rules/docker-telemetry.mk index df279e7033e4..aae81e254cd5 100644 --- a/rules/docker-telemetry.mk +++ b/rules/docker-telemetry.mk @@ -1,15 +1,30 @@ # docker image for telemetry agent -DOCKER_TELEMETRY = docker-sonic-telemetry.gz -$(DOCKER_TELEMETRY)_PATH = $(DOCKERS_PATH)/docker-sonic-telemetry +DOCKER_TELEMETRY_STEM = docker-sonic-telemetry +DOCKER_TELEMETRY = $(DOCKER_TELEMETRY_STEM).gz +DOCKER_TELEMETRY_DBG = $(DOCKER_TELEMETRY_STEM)-$(DBG_IMAGE_MARK).gz + +$(DOCKER_TELEMETRY)_PATH = $(DOCKERS_PATH)/$(DOCKER_TELEMETRY_STEM) + $(DOCKER_TELEMETRY)_DEPENDS += $(REDIS_TOOLS) $(SONIC_TELEMETRY) +$(DOCKER_TELEMETRY)_DBG_DEPENDS = $($(DOCKER_CONFIG_ENGINE_STRETCH)_DBG_DEPENDS) +$(DOCKER_TELEMETRY)_DBG_DEPENDS += $(LIBSAIREDIS_DBG) + $(DOCKER_TELEMETRY)_LOAD_DOCKERS += $(DOCKER_CONFIG_ENGINE_STRETCH) +$(DOCKER_TELEMETRY)_DBG_IMAGE_PACKAGES = $($(DOCKER_CONFIG_ENGINE_STRETCH)_DBG_IMAGE_PACKAGES) + SONIC_DOCKER_IMAGES += $(DOCKER_TELEMETRY) ifeq ($(ENABLE_SYSTEM_TELEMETRY), y) SONIC_INSTALL_DOCKER_IMAGES += $(DOCKER_TELEMETRY) SONIC_STRETCH_DOCKERS += $(DOCKER_TELEMETRY) endif +SONIC_DOCKER_DBG_IMAGES += $(DOCKER_TELEMETRY_DBG) +ifeq ($(ENABLE_SYSTEM_TELEMETRY), y) +SONIC_INSTALL_DOCKER_DBG_IMAGES += $(DOCKER_TELEMETRY_DBG) +SONIC_STRETCH_DBG_DOCKERS += $(DOCKER_TELEMETRY_DBG) +endif + $(DOCKER_TELEMETRY)_CONTAINER_NAME = telemetry $(DOCKER_TELEMETRY)_RUN_OPT += --net=host --privileged -t $(DOCKER_TELEMETRY)_RUN_OPT += -v /etc/sonic:/etc/sonic:ro diff --git a/slave.mk b/slave.mk index 3438822899f7..135667f4a47d 100644 --- a/slave.mk +++ b/slave.mk @@ -36,7 +36,7 @@ PYTHON_WHEELS_PATH = $(TARGET_PATH)/python-wheels PROJECT_ROOT = $(shell pwd) STRETCH_DEBS_PATH = $(TARGET_PATH)/debs/stretch STRETCH_FILES_PATH = $(TARGET_PATH)/files/stretch -DBG_IMAGE_MARK = -dbg +DBG_IMAGE_MARK = dbg CONFIGURED_PLATFORM := $(shell [ -f .platform ] && cat .platform || echo generic) PLATFORM_PATH = platform/$(CONFIGURED_PLATFORM) @@ -478,7 +478,7 @@ ifeq ($(BLDENV),stretch) 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_DBG_DOCKERS_FOR_INSTALLERS = $(filter $(SONIC_STRETCH_DBG_DOCKERS), $(patsubst %.gz,%$(DBG_IMAGE_MARK).gz, $(SONIC_STRETCH_DOCKERS_FOR_INSTALLERS))) + 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)) DOCKER_DBG_IMAGES := $(filter-out $(SONIC_STRETCH_DBG_DOCKERS), $(SONIC_DOCKER_DBG_IMAGES)) @@ -529,7 +529,7 @@ $(addprefix $(TARGET_PATH)/, $(DOCKER_IMAGES)) : $(TARGET_PATH)/%.gz : .platform SONIC_TARGET_LIST += $(addprefix $(TARGET_PATH)/, $(DOCKER_IMAGES)) # Targets for building docker images -$(addprefix $(TARGET_PATH)/, $(DOCKER_DBG_IMAGES)) : $(TARGET_PATH)/%$(DBG_IMAGE_MARK).gz : .platform docker-start \ +$(addprefix $(TARGET_PATH)/, $(DOCKER_DBG_IMAGES)) : $(TARGET_PATH)/%-$(DBG_IMAGE_MARK).gz : .platform docker-start \ $$(addprefix $(DEBS_PATH)/,$$($$*.gz_DBG_DEPENDS)) \ $$(addsuffix -load,$$(addprefix $(TARGET_PATH)/,$$*.gz)) $(HEADER) From b4b30fd88fe27d8bd1a117d9c07e7859c8baf010 Mon Sep 17 00:00:00 2001 From: Renuka Manavalan Date: Thu, 18 Apr 2019 16:22:40 +0000 Subject: [PATCH 11/13] Changes per review comments: 1) Dropped LIBSAIREDIS_DBG from database, teamd, router-advertiser, telemetry, and platform-monitor docker*.mk files from _DBG_DEPENDS list 2) W.r.t docker make for syncd, moved DEPENDS from template to specific makefile and let the template has stuff that is applicable to all. --- platform/mellanox/docker-syncd-mlnx.mk | 7 +++++++ platform/template/docker-syncd-base.mk | 6 ++---- rules/docker-database.mk | 1 - rules/docker-platform-monitor.mk | 2 +- rules/docker-router-advertiser.mk | 1 - rules/docker-teamd.mk | 2 +- rules/docker-telemetry.mk | 1 - 7 files changed, 11 insertions(+), 9 deletions(-) diff --git a/platform/mellanox/docker-syncd-mlnx.mk b/platform/mellanox/docker-syncd-mlnx.mk index fe37635f8b80..1359788dad54 100644 --- a/platform/mellanox/docker-syncd-mlnx.mk +++ b/platform/mellanox/docker-syncd-mlnx.mk @@ -2,3 +2,10 @@ DOCKER_SYNCD_PLATFORM_CODE = mlnx include $(PLATFORM_PATH)/../template/docker-syncd-base.mk + +$(DOCKER_SYNCD_BASE)_DEPENDS += $(SYNCD) $(PYTHON_SDK_API) +$(DOCKER_SYNCD_BASE)_PYTHON_DEBS += $(MLNX_SFPD) + + +$(DOCKER_SYNCD_BASE)_RUN_OPT += -v /host/warmboot:/var/warmboot + diff --git a/platform/template/docker-syncd-base.mk b/platform/template/docker-syncd-base.mk index 85839571fc70..d8776d179a02 100644 --- a/platform/template/docker-syncd-base.mk +++ b/platform/template/docker-syncd-base.mk @@ -6,12 +6,11 @@ DOCKER_SYNCD_BASE = $(DOCKER_SYNCD_BASE_STEM).gz DOCKER_SYNCD_BASE_DBG = $(DOCKER_SYNCD_BASE_STEM)-$(DBG_IMAGE_MARK).gz $(DOCKER_SYNCD_BASE)_PATH = $(PLATFORM_PATH)/docker-syncd-$(DOCKER_SYNCD_PLATFORM_CODE) -$(DOCKER_SYNCD_BASE)_DEPENDS += $(SYNCD) $(PYTHON_SDK_API) -$(DOCKER_SYNCD_BASE)_PYTHON_DEBS += $(MLNX_SFPD) + +$(DOCKER_SYNCD_BASE)_LOAD_DOCKERS += $(DOCKER_CONFIG_ENGINE_STRETCH) $(DOCKER_SYNCD_BASE)_DBG_DEPENDS += $($(DOCKER_CONFIG_ENGINE_STRETCH)_DBG_DEPENDS) -$(DOCKER_SYNCD_BASE)_LOAD_DOCKERS += $(DOCKER_CONFIG_ENGINE_STRETCH) $(DOCKER_SYNCD_BASE)_DBG_IMAGE_PACKAGES = $($(DOCKER_CONFIG_ENGINE_STRETCH)_DBG_IMAGE_PACKAGES) SONIC_DOCKER_IMAGES += $(DOCKER_SYNCD_BASE) @@ -31,5 +30,4 @@ $(DOCKER_SYNCD_BASE)_CONTAINER_NAME = syncd $(DOCKER_SYNCD_BASE)_RUN_OPT += --net=host --privileged -t $(DOCKER_SYNCD_BASE)_RUN_OPT += -v /host/machine.conf:/etc/machine.conf $(DOCKER_SYNCD_BASE)_RUN_OPT += -v /etc/sonic:/etc/sonic:ro -$(DOCKER_SYNCD_BASE)_RUN_OPT += -v /host/warmboot:/var/warmboot diff --git a/rules/docker-database.mk b/rules/docker-database.mk index 244cce92ceda..5cfaabb28df8 100644 --- a/rules/docker-database.mk +++ b/rules/docker-database.mk @@ -8,7 +8,6 @@ $(DOCKER_DATABASE)_PATH = $(DOCKERS_PATH)/$(DOCKER_DATABASE_STEM) $(DOCKER_DATABASE)_DEPENDS += $(REDIS_TOOLS) $(REDIS_SERVER) $(DOCKER_DATABASE)_DBG_DEPENDS = $($(DOCKER_CONFIG_ENGINE_STRETCH)_DBG_DEPENDS) -$(DOCKER_DATABASE)_DBG_DEPENDS += $(LIBSAIREDIS_DBG) $(DOCKER_DATABASE)_DBG_IMAGE_PACKAGES = $($(DOCKER_CONFIG_ENGINE_STRETCH)_DBG_IMAGE_PACKAGES) diff --git a/rules/docker-platform-monitor.mk b/rules/docker-platform-monitor.mk index 2f56c71f7740..e18cda705d0f 100644 --- a/rules/docker-platform-monitor.mk +++ b/rules/docker-platform-monitor.mk @@ -14,7 +14,7 @@ $(DOCKER_PLATFORM_MONITOR)_PYTHON_WHEELS += $(SONIC_PLATFORM_API_PY2) $(DOCKER_PLATFORM_MONITOR)_PYTHON_WHEELS += $(SONIC_DAEMON_BASE_PY2) $(DOCKER_PLATFORM_MONITOR)_DBG_DEPENDS = $($(DOCKER_CONFIG_ENGINE_STRETCH)_DBG_DEPENDS) -$(DOCKER_PLATFORM_MONITOR)_DBG_DEPENDS += $(LIBSWSSCOMMON_DBG) $(LIBSAIREDIS_DBG) +$(DOCKER_PLATFORM_MONITOR)_DBG_DEPENDS += $(LIBSWSSCOMMON_DBG) $(DOCKER_PLATFORM_MONITOR)_DBG_IMAGE_PACKAGES = $($(DOCKER_CONFIG_ENGINE_STRETCH)_DBG_IMAGE_PACKAGES) $(DOCKER_PLATFORM_MONITOR)_LOAD_DOCKERS = $(DOCKER_CONFIG_ENGINE_STRETCH) diff --git a/rules/docker-router-advertiser.mk b/rules/docker-router-advertiser.mk index e20e63e90c8e..29fa46719f6d 100644 --- a/rules/docker-router-advertiser.mk +++ b/rules/docker-router-advertiser.mk @@ -8,7 +8,6 @@ $(DOCKER_ROUTER_ADVERTISER)_PATH = $(DOCKERS_PATH)/$(DOCKER_ROUTER_ADVERTISER_ST $(DOCKER_ROUTER_ADVERTISER)_DEPENDS += $(RADVD) $(REDIS_TOOLS) $(DOCKER_ROUTER_ADVERTISER)_DBG_DEPENDS = $($(DOCKER_CONFIG_ENGINE_STRETCH)_DBG_DEPENDS) -$(DOCKER_ROUTER_ADVERTISER)_DBG_DEPENDS += $(LIBSAIREDIS_DBG) $(DOCKER_ROUTER_ADVERTISER)_DBG_IMAGE_PACKAGES = $($(DOCKER_CONFIG_ENGINE_STRETCH)_DBG_IMAGE_PACKAGES) $(DOCKER_ROUTER_ADVERTISER)_LOAD_DOCKERS = $(DOCKER_CONFIG_ENGINE_STRETCH) diff --git a/rules/docker-teamd.mk b/rules/docker-teamd.mk index 1d8ec2a70e41..f3a371f601fd 100644 --- a/rules/docker-teamd.mk +++ b/rules/docker-teamd.mk @@ -8,7 +8,7 @@ $(DOCKER_TEAMD)_PATH = $(DOCKERS_PATH)/$(DOCKER_TEAMD_STEM) $(DOCKER_TEAMD)_DEPENDS += $(SWSS) $(LIBTEAMDCT) $(LIBTEAM_UTILS) $(REDIS_TOOLS) $(DOCKER_TEAMD)_DBG_DEPENDS = $($(DOCKER_CONFIG_ENGINE_STRETCH)_DBG_DEPENDS) -$(DOCKER_TEAMD)_DBG_DEPENDS += $(LIBSAIREDIS_DBG) $(SWSS_DBG) $(LIBSWSSCOMMON_DBG) +$(DOCKER_TEAMD)_DBG_DEPENDS += $(SWSS_DBG) $(LIBSWSSCOMMON_DBG) $(DOCKER_TEAMD)_DBG_IMAGE_PACKAGES = $($(DOCKER_CONFIG_ENGINE_STRETCH)_DBG_IMAGE_PACKAGES) $(DOCKER_TEAMD)_LOAD_DOCKERS += $(DOCKER_CONFIG_ENGINE_STRETCH) diff --git a/rules/docker-telemetry.mk b/rules/docker-telemetry.mk index aae81e254cd5..94920c464381 100644 --- a/rules/docker-telemetry.mk +++ b/rules/docker-telemetry.mk @@ -8,7 +8,6 @@ $(DOCKER_TELEMETRY)_PATH = $(DOCKERS_PATH)/$(DOCKER_TELEMETRY_STEM) $(DOCKER_TELEMETRY)_DEPENDS += $(REDIS_TOOLS) $(SONIC_TELEMETRY) $(DOCKER_TELEMETRY)_DBG_DEPENDS = $($(DOCKER_CONFIG_ENGINE_STRETCH)_DBG_DEPENDS) -$(DOCKER_TELEMETRY)_DBG_DEPENDS += $(LIBSAIREDIS_DBG) $(DOCKER_TELEMETRY)_LOAD_DOCKERS += $(DOCKER_CONFIG_ENGINE_STRETCH) $(DOCKER_TELEMETRY)_DBG_IMAGE_PACKAGES = $($(DOCKER_CONFIG_ENGINE_STRETCH)_DBG_IMAGE_PACKAGES) From e504eb7b37f7695d02795ae6053fba8d59bd2081 Mon Sep 17 00:00:00 2001 From: Renuka Manavalan Date: Thu, 18 Apr 2019 20:16:25 +0000 Subject: [PATCH 12/13] 1) Corrected a copy/paste mistake --- platform/barefoot/docker-syncd-bfn.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/platform/barefoot/docker-syncd-bfn.mk b/platform/barefoot/docker-syncd-bfn.mk index f195890d5008..eee13a28e4d3 100644 --- a/platform/barefoot/docker-syncd-bfn.mk +++ b/platform/barefoot/docker-syncd-bfn.mk @@ -1,6 +1,6 @@ # docker image for syncd -DOCKER_SYNCD_PLATFORM_CODE = mlnx +DOCKER_SYNCD_PLATFORM_CODE = bfn include $(PLATFORM_PATH)/../template/docker-syncd-base.mk $(DOCKER_SYNCD_BASE)_DEPENDS += $(SYNCD) From 0db6c0f00143cba305122795655605b42e6532d2 Mon Sep 17 00:00:00 2001 From: Renuka Manavalan Date: Fri, 19 Apr 2019 20:38:33 +0000 Subject: [PATCH 13/13] Fixed a copy/paste bug --- platform/barefoot/docker-syncd-bfn.mk | 1 - 1 file changed, 1 deletion(-) diff --git a/platform/barefoot/docker-syncd-bfn.mk b/platform/barefoot/docker-syncd-bfn.mk index eee13a28e4d3..6f3ed59ad285 100644 --- a/platform/barefoot/docker-syncd-bfn.mk +++ b/platform/barefoot/docker-syncd-bfn.mk @@ -4,7 +4,6 @@ DOCKER_SYNCD_PLATFORM_CODE = bfn include $(PLATFORM_PATH)/../template/docker-syncd-base.mk $(DOCKER_SYNCD_BASE)_DEPENDS += $(SYNCD) -$(DOCKER_SYNCD_BASE)_PYTHON_DEBS += $(MLNX_SFPD) $(DOCKER_SYNCD_BASE)_DBG_DEPENDS += $(SYNCD_DBG) \ $(LIBSWSSCOMMON_DBG) \