[dockers] Build stretch dockers only once and only in stretch slave docker (#2678)

Signed-off-by: Stepan Blyschak <stepanb@mellanox.com>
This commit is contained in:
Stepan Blyshchak 2019-03-19 18:16:33 +02:00 committed by lguohan
parent 145c1348b3
commit c0caf0c372
5 changed files with 15 additions and 7 deletions

View File

@ -6,9 +6,9 @@ $(DOCKER_SYNCD_MLNX_RPC)_DEPENDS += $(SYNCD_RPC) $(LIBTHRIFT)
$(DOCKER_SYNCD_MLNX_RPC)_PYTHON_DEBS += $(MLNX_SFPD) $(DOCKER_SYNCD_MLNX_RPC)_PYTHON_DEBS += $(MLNX_SFPD)
$(DOCKER_SYNCD_MLNX_RPC)_LOAD_DOCKERS += $(DOCKER_SYNCD_MLNX) $(DOCKER_SYNCD_MLNX_RPC)_LOAD_DOCKERS += $(DOCKER_SYNCD_MLNX)
SONIC_DOCKER_IMAGES += $(DOCKER_SYNCD_MLNX_RPC) SONIC_DOCKER_IMAGES += $(DOCKER_SYNCD_MLNX_RPC)
SONIC_STRETCH_DOCKERS += $(DOCKER_SYNCD_MLNX_RPC)
ifeq ($(ENABLE_SYNCD_RPC),y) ifeq ($(ENABLE_SYNCD_RPC),y)
SONIC_INSTALL_DOCKER_IMAGES += $(DOCKER_SYNCD_MLNX_RPC) SONIC_INSTALL_DOCKER_IMAGES += $(DOCKER_SYNCD_MLNX_RPC)
SONIC_STRETCH_DOCKERS += $(DOCKER_SYNCD_MLNX_RPC)
endif endif
$(DOCKER_SYNCD_MLNX_RPC)_CONTAINER_NAME = syncd $(DOCKER_SYNCD_MLNX_RPC)_CONTAINER_NAME = syncd

View File

@ -6,9 +6,9 @@ $(DOCKER_SYNCD_MLNX)_DEPENDS += $(SYNCD) $(PYTHON_SDK_API)
$(DOCKER_SYNCD_MLNX)_PYTHON_DEBS += $(MLNX_SFPD) $(DOCKER_SYNCD_MLNX)_PYTHON_DEBS += $(MLNX_SFPD)
$(DOCKER_SYNCD_MLNX)_LOAD_DOCKERS += $(DOCKER_CONFIG_ENGINE_STRETCH) $(DOCKER_SYNCD_MLNX)_LOAD_DOCKERS += $(DOCKER_CONFIG_ENGINE_STRETCH)
SONIC_DOCKER_IMAGES += $(DOCKER_SYNCD_MLNX) SONIC_DOCKER_IMAGES += $(DOCKER_SYNCD_MLNX)
SONIC_STRETCH_DOCKERS += $(DOCKER_SYNCD_MLNX)
ifneq ($(ENABLE_SYNCD_RPC),y) ifneq ($(ENABLE_SYNCD_RPC),y)
SONIC_INSTALL_DOCKER_IMAGES += $(DOCKER_SYNCD_MLNX) SONIC_INSTALL_DOCKER_IMAGES += $(DOCKER_SYNCD_MLNX)
SONIC_STRETCH_DOCKERS += $(DOCKER_SYNCD_MLNX)
endif endif
$(DOCKER_SYNCD_MLNX)_CONTAINER_NAME = syncd $(DOCKER_SYNCD_MLNX)_CONTAINER_NAME = syncd

View File

@ -15,4 +15,4 @@ STRACE = strace
$(DOCKER_BASE_STRETCH)_DBG_PACKAGES += $(GDB) $(GDBSERVER) $(VIM) $(OPENSSH) $(SSHPASS) $(STRACE) $(DOCKER_BASE_STRETCH)_DBG_PACKAGES += $(GDB) $(GDBSERVER) $(VIM) $(OPENSSH) $(SSHPASS) $(STRACE)
endif endif
SONIC_DOCKER_IMAGES += $(DOCKER_BASE_STRETCH) SONIC_STRETCH_DOCKERS += $(DOCKER_BASE_STRETCH)

View File

@ -5,4 +5,4 @@ $(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 += $(SWSSSDK_PY2)
$(DOCKER_CONFIG_ENGINE_STRETCH)_PYTHON_WHEELS += $(SONIC_CONFIG_ENGINE) $(DOCKER_CONFIG_ENGINE_STRETCH)_PYTHON_WHEELS += $(SONIC_CONFIG_ENGINE)
$(DOCKER_CONFIG_ENGINE_STRETCH)_LOAD_DOCKERS += $(DOCKER_BASE_STRETCH) $(DOCKER_CONFIG_ENGINE_STRETCH)_LOAD_DOCKERS += $(DOCKER_BASE_STRETCH)
SONIC_DOCKER_IMAGES += $(DOCKER_CONFIG_ENGINE_STRETCH) SONIC_STRETCH_DOCKERS += $(DOCKER_CONFIG_ENGINE_STRETCH)

View File

@ -464,8 +464,16 @@ $(addprefix $(TARGET_PATH)/, $(SONIC_SIMPLE_DOCKER_IMAGES)) : $(TARGET_PATH)/%.g
SONIC_TARGET_LIST += $(addprefix $(TARGET_PATH)/, $(SONIC_SIMPLE_DOCKER_IMAGES)) 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
ifeq ($(BLDENV),stretch)
DOCKER_IMAGES := $(SONIC_STRETCH_DOCKERS)
else
DOCKER_IMAGES := $(filter-out $(SONIC_STRETCH_DOCKERS), $(SONIC_DOCKER_IMAGES))
endif
# Targets for building docker images # Targets for building docker images
$(addprefix $(TARGET_PATH)/, $(SONIC_DOCKER_IMAGES)) : $(TARGET_PATH)/%.gz : .platform docker-start \ $(addprefix $(TARGET_PATH)/, $(DOCKER_IMAGES)) : $(TARGET_PATH)/%.gz : .platform docker-start \
$$(addprefix $(DEBS_PATH)/,$$($$*.gz_DEPENDS)) \ $$(addprefix $(DEBS_PATH)/,$$($$*.gz_DEPENDS)) \
$$(addprefix $(FILES_PATH)/,$$($$*.gz_FILES)) \ $$(addprefix $(FILES_PATH)/,$$($$*.gz_FILES)) \
$$(addprefix $(PYTHON_DEBS_PATH)/,$$($$*.gz_PYTHON_DEBS)) \ $$(addprefix $(PYTHON_DEBS_PATH)/,$$($$*.gz_PYTHON_DEBS)) \
@ -506,11 +514,11 @@ $(addprefix $(TARGET_PATH)/, $(SONIC_DOCKER_IMAGES)) : $(TARGET_PATH)/%.gz : .pl
if [ -f $($*.gz_PATH).patch/series ]; then pushd $($*.gz_PATH) && quilt pop -a -f; popd; fi if [ -f $($*.gz_PATH).patch/series ]; then pushd $($*.gz_PATH) && quilt pop -a -f; popd; fi
$(FOOTER) $(FOOTER)
SONIC_TARGET_LIST += $(addprefix $(TARGET_PATH)/, $(SONIC_DOCKER_IMAGES)) SONIC_TARGET_LIST += $(addprefix $(TARGET_PATH)/, $(DOCKER_IMAGES))
DOCKER_LOAD_TARGETS = $(addsuffix -load,$(addprefix $(TARGET_PATH)/, \ DOCKER_LOAD_TARGETS = $(addsuffix -load,$(addprefix $(TARGET_PATH)/, \
$(SONIC_SIMPLE_DOCKER_IMAGES) \ $(SONIC_SIMPLE_DOCKER_IMAGES) \
$(SONIC_DOCKER_IMAGES))) $(DOCKER_IMAGES)))
$(DOCKER_LOAD_TARGETS) : $(TARGET_PATH)/%.gz-load : .platform docker-start $$(TARGET_PATH)/$$*.gz $(DOCKER_LOAD_TARGETS) : $(TARGET_PATH)/%.gz-load : .platform docker-start $$(TARGET_PATH)/$$*.gz
$(HEADER) $(HEADER)
docker load -i $(TARGET_PATH)/$*.gz $(LOG) docker load -i $(TARGET_PATH)/$*.gz $(LOG)