From 0603accdae1e4672d30179621caeb450120e8e9c Mon Sep 17 00:00:00 2001 From: Renuka Manavalan <47282725+renukamanavalan@users.noreply.github.com> Date: Wed, 17 Jul 2019 08:41:22 -0700 Subject: [PATCH] [build]: Fix docker-syncd-``-rpc.mk (#3174) Adopt to new define used for docker-syncd Simplify/streamline through template. --- platform/barefoot/docker-syncd-bfn-rpc.mk | 14 ++------------ platform/broadcom/docker-syncd-brcm-rpc.mk | 19 +++++-------------- platform/cavium/docker-syncd-cavm-rpc.mk | 16 ++++------------ platform/centec/docker-syncd-centec-rpc.mk | 16 +++------------- platform/marvell/docker-syncd-mrvl-rpc.mk | 14 ++------------ platform/mellanox/docker-syncd-mlnx-rpc.mk | 18 +++++------------- platform/nephos/docker-syncd-nephos-rpc.mk | 19 +++++-------------- platform/template/docker-syncd-base-rpc.mk | 16 ++++++++++++++++ 8 files changed, 42 insertions(+), 90 deletions(-) create mode 100644 platform/template/docker-syncd-base-rpc.mk diff --git a/platform/barefoot/docker-syncd-bfn-rpc.mk b/platform/barefoot/docker-syncd-bfn-rpc.mk index 61f5570c16..8c9cedbc9e 100644 --- a/platform/barefoot/docker-syncd-bfn-rpc.mk +++ b/platform/barefoot/docker-syncd-bfn-rpc.mk @@ -1,15 +1,5 @@ # docker image for syncd with rpc -DOCKER_SYNCD_BFN_RPC = docker-syncd-bfn-rpc.gz -$(DOCKER_SYNCD_BFN_RPC)_PATH = $(PLATFORM_PATH)/docker-syncd-bfn-rpc -$(DOCKER_SYNCD_BFN_RPC)_DEPENDS += $(SYNCD_RPC) $(LIBTHRIFT) -$(DOCKER_SYNCD_BFN_RPC)_LOAD_DOCKERS += $(DOCKER_SYNCD_BFN) -SONIC_DOCKER_IMAGES += $(DOCKER_SYNCD_BFN_RPC) -ifeq ($(ENABLE_SYNCD_RPC),y) -SONIC_INSTALL_DOCKER_IMAGES += $(DOCKER_SYNCD_BFN_RPC) -endif +DOCKER_SYNCD_PLATFORM_CODE = bfn +include $(PLATFORM_PATH)/../template/docker-syncd-base-rpc.mk -$(DOCKER_SYNCD_BFN_RPC)_CONTAINER_NAME = syncd -$(DOCKER_SYNCD_BFN_RPC)_RUN_OPT += --net=host --privileged -t -$(DOCKER_SYNCD_BFN_RPC)_RUN_OPT += -v /host/machine.conf:/etc/machine.conf -$(DOCKER_SYNCD_BFN_RPC)_RUN_OPT += -v /etc/sonic:/etc/sonic:ro diff --git a/platform/broadcom/docker-syncd-brcm-rpc.mk b/platform/broadcom/docker-syncd-brcm-rpc.mk index fa7c0fb797..4ca1904f94 100644 --- a/platform/broadcom/docker-syncd-brcm-rpc.mk +++ b/platform/broadcom/docker-syncd-brcm-rpc.mk @@ -1,17 +1,8 @@ # docker image for brcm syncd with rpc -DOCKER_SYNCD_BRCM_RPC = docker-syncd-brcm-rpc.gz -$(DOCKER_SYNCD_BRCM_RPC)_PATH = $(PLATFORM_PATH)/docker-syncd-brcm-rpc -$(DOCKER_SYNCD_BRCM_RPC)_DEPENDS += $(SYNCD_RPC) $(LIBTHRIFT) -$(DOCKER_SYNCD_BRCM_RPC)_FILES += $(DSSERVE) $(BCMCMD) -$(DOCKER_SYNCD_BRCM_RPC)_LOAD_DOCKERS += $(DOCKER_SYNCD_BRCM) -SONIC_DOCKER_IMAGES += $(DOCKER_SYNCD_BRCM_RPC) -ifeq ($(ENABLE_SYNCD_RPC),y) -SONIC_INSTALL_DOCKER_IMAGES += $(DOCKER_SYNCD_BRCM_RPC) -endif +DOCKER_SYNCD_PLATFORM_CODE = brcm +include $(PLATFORM_PATH)/../template/docker-syncd-base-rpc.mk -$(DOCKER_SYNCD_BRCM_RPC)_CONTAINER_NAME = syncd -$(DOCKER_SYNCD_BRCM_RPC)_RUN_OPT += --net=host --privileged -t -$(DOCKER_SYNCD_BRCM_RPC)_RUN_OPT += -v /host/machine.conf:/etc/machine.conf -$(DOCKER_SYNCD_BRCM_RPC)_RUN_OPT += -v /var/run/docker-syncd:/var/run/sswsyncd -$(DOCKER_SYNCD_BRCM_RPC)_RUN_OPT += -v /etc/sonic:/etc/sonic:ro +$(DOCKER_SYNCD_BASE_RPC)_FILES += $(DSSERVE) $(BCMCMD) + +$(DOCKER_SYNCD_BASE_RPC)_RUN_OPT += -v /var/run/docker-syncd:/var/run/sswsyncd diff --git a/platform/cavium/docker-syncd-cavm-rpc.mk b/platform/cavium/docker-syncd-cavm-rpc.mk index e0136f5324..77ae09be55 100644 --- a/platform/cavium/docker-syncd-cavm-rpc.mk +++ b/platform/cavium/docker-syncd-cavm-rpc.mk @@ -1,15 +1,7 @@ # docker image for cavium syncd with rpc -DOCKER_SYNCD_CAVM_RPC = docker-syncd-cavm-rpc.gz -$(DOCKER_SYNCD_CAVM_RPC)_PATH = $(PLATFORM_PATH)/docker-syncd-cavm-rpc -$(DOCKER_SYNCD_CAVM_RPC)_DEPENDS += $(SYNCD_RPC) $(LIBTHRIFT) $(CAVM_LIBSAI) $(XP_TOOLS) $(REDIS_TOOLS) -$(DOCKER_SYNCD_CAVM_RPC)_LOAD_DOCKERS += $(DOCKER_SYNCD_CAVM) -SONIC_DOCKER_IMAGES += $(DOCKER_SYNCD_CAVM_RPC) -ifeq ($(ENABLE_SYNCD_RPC),y) -SONIC_INSTALL_DOCKER_IMAGES += $(DOCKER_SYNCD_CAVM_RPC) -endif +DOCKER_SYNCD_PLATFORM_CODE = cavm +include $(PLATFORM_PATH)/../template/docker-syncd-base-rpc.mk + +$(DOCKER_SYNCD_BASE_RPC)_DEPENDS += $(CAVM_LIBSAI) $(XP_TOOLS) $(REDIS_TOOLS) -$(DOCKER_SYNCD_CAVM_RPC)_CONTAINER_NAME = syncd -$(DOCKER_SYNCD_CAVM_RPC)_RUN_OPT += --net=host --privileged -t -$(DOCKER_SYNCD_CAVM_RPC)_RUN_OPT += -v /host/machine.conf:/etc/machine.conf -$(DOCKER_SYNCD_CAVM_RPC)_RUN_OPT += -v /etc/sonic:/etc/sonic:ro diff --git a/platform/centec/docker-syncd-centec-rpc.mk b/platform/centec/docker-syncd-centec-rpc.mk index 1798a03498..c9b76df0ff 100644 --- a/platform/centec/docker-syncd-centec-rpc.mk +++ b/platform/centec/docker-syncd-centec-rpc.mk @@ -1,16 +1,6 @@ # docker image for centec syncd with rpc -DOCKER_SYNCD_CENTEC_RPC = docker-syncd-centec-rpc.gz -$(DOCKER_SYNCD_CENTEC_RPC)_PATH = $(PLATFORM_PATH)/docker-syncd-centec-rpc -$(DOCKER_SYNCD_CENTEC_RPC)_DEPENDS += $(SYNCD_RPC) $(LIBTHRIFT) -$(DOCKER_SYNCD_CENTEC_RPC)_LOAD_DOCKERS += $(DOCKER_SYNCD_CENTEC) -SONIC_DOCKER_IMAGES += $(DOCKER_SYNCD_CENTEC_RPC) -ifeq ($(ENABLE_SYNCD_RPC),y) -SONIC_INSTALL_DOCKER_IMAGES += $(DOCKER_SYNCD_CENTEC_RPC) -endif +DOCKER_SYNCD_PLATFORM_CODE = centec +include $(PLATFORM_PATH)/../template/docker-syncd-base-rpc.mk -$(DOCKER_SYNCD_CENTEC_RPC)_CONTAINER_NAME = syncd -$(DOCKER_SYNCD_CENTEC_RPC)_RUN_OPT += --net=host --privileged -t -$(DOCKER_SYNCD_CENTEC_RPC)_RUN_OPT += -v /host/machine.conf:/etc/machine.conf -$(DOCKER_SYNCD_CENTEC_RPC)_RUN_OPT += -v /var/run/docker-syncd:/var/run/sswsyncd -$(DOCKER_SYNCD_CENTEC_RPC)_RUN_OPT += -v /etc/sonic:/etc/sonic:ro +$(DOCKER_SYNCD_BASE_RPC)_RUN_OPT += -v /var/run/docker-syncd:/var/run/sswsyncd diff --git a/platform/marvell/docker-syncd-mrvl-rpc.mk b/platform/marvell/docker-syncd-mrvl-rpc.mk index d4002a3d64..cb181e194a 100644 --- a/platform/marvell/docker-syncd-mrvl-rpc.mk +++ b/platform/marvell/docker-syncd-mrvl-rpc.mk @@ -1,15 +1,5 @@ # docker image for mrvl syncd with rpc -DOCKER_SYNCD_MRVL_RPC = docker-syncd-mrvl-rpc.gz -$(DOCKER_SYNCD_MRVL_RPC)_PATH = $(PLATFORM_PATH)/docker-syncd-mrvl-rpc -$(DOCKER_SYNCD_MRVL_RPC)_DEPENDS += $(SYNCD_RPC) $(LIBTHRIFT) -$(DOCKER_SYNCD_MRVL_RPC)_LOAD_DOCKERS += $(DOCKER_SYNCD_MRVL) -SONIC_DOCKER_IMAGES += $(DOCKER_SYNCD_MRVL_RPC) -ifeq ($(ENABLE_SYNCD_RPC),y) -SONIC_INSTALL_DOCKER_IMAGES += $(DOCKER_SYNCD_MRVL_RPC) -endif +DOCKER_SYNCD_PLATFORM_CODE = mrvl +include $(PLATFORM_PATH)/../template/docker-syncd-base-rpc.mk -$(DOCKER_SYNCD_MRVL_RPC)_CONTAINER_NAME = syncd -$(DOCKER_SYNCD_MRVL_RPC)_RUN_OPT += --net=host --privileged -t -$(DOCKER_SYNCD_MRVL_RPC)_RUN_OPT += -v /host/machine.conf:/etc/machine.conf -$(DOCKER_SYNCD_MRVL_RPC)_RUN_OPT += -v /etc/sonic:/etc/sonic:ro diff --git a/platform/mellanox/docker-syncd-mlnx-rpc.mk b/platform/mellanox/docker-syncd-mlnx-rpc.mk index fc0f6239d5..bc32c3d15a 100644 --- a/platform/mellanox/docker-syncd-mlnx-rpc.mk +++ b/platform/mellanox/docker-syncd-mlnx-rpc.mk @@ -1,16 +1,8 @@ # docker image for mlnx syncd with rpc -DOCKER_SYNCD_MLNX_RPC = docker-syncd-mlnx-rpc.gz -$(DOCKER_SYNCD_MLNX_RPC)_PATH = $(PLATFORM_PATH)/docker-syncd-mlnx-rpc -$(DOCKER_SYNCD_MLNX_RPC)_DEPENDS += $(SYNCD_RPC) $(LIBTHRIFT) $(MLNX_SFPD) -$(DOCKER_SYNCD_MLNX_RPC)_LOAD_DOCKERS += $(DOCKER_SYNCD_MLNX) -SONIC_DOCKER_IMAGES += $(DOCKER_SYNCD_MLNX_RPC) -ifeq ($(ENABLE_SYNCD_RPC),y) -SONIC_INSTALL_DOCKER_IMAGES += $(DOCKER_SYNCD_MLNX_RPC) -endif +DOCKER_SYNCD_PLATFORM_CODE = mlnx +include $(PLATFORM_PATH)/../template/docker-syncd-base-rpc.mk -$(DOCKER_SYNCD_MLNX_RPC)_CONTAINER_NAME = syncd -$(DOCKER_SYNCD_MLNX_RPC)_RUN_OPT += --net=host --privileged -t -$(DOCKER_SYNCD_MLNX_RPC)_RUN_OPT += -v /host/machine.conf:/etc/machine.conf -$(DOCKER_SYNCD_MLNX_RPC)_RUN_OPT += -v /etc/sonic:/etc/sonic:ro -$(DOCKER_SYNCD_MLNX_RPC)_RUN_OPT += -v /host/warmboot:/var/warmboot +$(DOCKER_SYNCD_BASE_RPC)_DEPENDS += $(MLNX_SFPD) + +$(DOCKER_SYNCD_BASE_RPC)_RUN_OPT += -v /host/warmboot:/var/warmboot diff --git a/platform/nephos/docker-syncd-nephos-rpc.mk b/platform/nephos/docker-syncd-nephos-rpc.mk index e891d0b1a6..23890a58a5 100644 --- a/platform/nephos/docker-syncd-nephos-rpc.mk +++ b/platform/nephos/docker-syncd-nephos-rpc.mk @@ -1,17 +1,8 @@ # docker image for nephos syncd with rpc -DOCKER_SYNCD_NEPHOS_RPC = docker-syncd-nephos-rpc.gz -$(DOCKER_SYNCD_NEPHOS_RPC)_PATH = $(PLATFORM_PATH)/docker-syncd-nephos-rpc -$(DOCKER_SYNCD_NEPHOS_RPC)_DEPENDS += $(SYNCD_RPC) $(LIBTHRIFT) -$(DOCKER_SYNCD_NEPHOS_RPC)_FILES += $(DSSERVE) $(NPX_DIAG) -$(DOCKER_SYNCD_NEPHOS_RPC)_LOAD_DOCKERS += $(DOCKER_SYNCD_NEPHOS) -SONIC_DOCKER_IMAGES += $(DOCKER_SYNCD_NEPHOS_RPC) -ifeq ($(ENABLE_SYNCD_RPC),y) -SONIC_INSTALL_DOCKER_IMAGES += $(DOCKER_SYNCD_NEPHOS_RPC) -endif +DOCKER_SYNCD_PLATFORM_CODE = nephos +include $(PLATFORM_PATH)/../template/docker-syncd-base-rpc.mk -$(DOCKER_SYNCD_NEPHOS_RPC)_CONTAINER_NAME = syncd -$(DOCKER_SYNCD_NEPHOS_RPC)_RUN_OPT += --net=host --privileged -t -$(DOCKER_SYNCD_NEPHOS_RPC)_RUN_OPT += -v /host/machine.conf:/etc/machine.conf -$(DOCKER_SYNCD_NEPHOS_RPC)_RUN_OPT += -v /var/run/docker-syncd:/var/run/sswsyncd -$(DOCKER_SYNCD_NEPHOS_RPC)_RUN_OPT += -v /etc/sonic:/etc/sonic:ro +$(DOCKER_SYNCD_BASE_RPC)_FILES += $(DSSERVE) $(NPX_DIAG) + +$(DOCKER_SYNCD_BASE_RPC)_RUN_OPT += -v /var/run/docker-syncd:/var/run/sswsyncd diff --git a/platform/template/docker-syncd-base-rpc.mk b/platform/template/docker-syncd-base-rpc.mk new file mode 100644 index 0000000000..2de7fb6c3f --- /dev/null +++ b/platform/template/docker-syncd-base-rpc.mk @@ -0,0 +1,16 @@ +# docker image for any platform syncd with rpc + +DOCKER_SYNCD_BASE = docker-syncd-$(DOCKER_SYNCD_PLATFORM_CODE).gz +DOCKER_SYNCD_BASE_RPC = docker-syncd-$(DOCKER_SYNCD_PLATFORM_CODE)-rpc.gz +$(DOCKER_SYNCD_BASE_RPC)_PATH = $(PLATFORM_PATH)/docker-syncd-$(DOCKER_SYNCD_PLATFORM_CODE)-rpc +$(DOCKER_SYNCD_BASE_RPC)_DEPENDS += $(SYNCD_RPC) $(LIBTHRIFT) +$(DOCKER_SYNCD_BASE_RPC)_LOAD_DOCKERS += $(DOCKER_SYNCD_BASE) +SONIC_DOCKER_IMAGES += $(DOCKER_SYNCD_BASE_RPC) +ifeq ($(ENABLE_SYNCD_RPC),y) +SONIC_INSTALL_DOCKER_IMAGES += $(DOCKER_SYNCD_BASE_RPC) +endif + +$(DOCKER_SYNCD_BASE_RPC)_CONTAINER_NAME = syncd +$(DOCKER_SYNCD_BASE_RPC)_RUN_OPT += --net=host --privileged -t +$(DOCKER_SYNCD_BASE_RPC)_RUN_OPT += -v /host/machine.conf:/etc/machine.conf +$(DOCKER_SYNCD_BASE_RPC)_RUN_OPT += -v /etc/sonic:/etc/sonic:ro