diff --git a/.gitignore b/.gitignore index ffcc741d83ef..81a7535baec7 100644 --- a/.gitignore +++ b/.gitignore @@ -36,4 +36,6 @@ dockers/docker-team/Dockerfile dockers/docker-teamd/Dockerfile dockers/docker-config-engine/Dockerfile dockers/docker-base/Dockerfile -platform/broadcom/docker-syncd-brcm/Dockerfile +platform/*/docker-syncd-*/Dockerfile +platform/*/docker-syncd-*-rpc/Dockerfile + diff --git a/platform/broadcom/docker-syncd-brcm-rpc.mk b/platform/broadcom/docker-syncd-brcm-rpc.mk new file mode 100644 index 000000000000..2fbca8f30978 --- /dev/null +++ b/platform/broadcom/docker-syncd-brcm-rpc.mk @@ -0,0 +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) $(LIBTHRIFT) +$(DOCKER_SYNCD_BRCM_RPC)_FILES += $(DSSERVE) $(BCMCMD) +$(DOCKER_SYNCD_BRCM_RPC)_LOAD_DOCKERS += $(DOCKER_SYNCD_BRCM) +SONIC_DOCKER_IMAGES += $(DOCKER_SYNCD_BRCM_RPC) diff --git a/dockers/docker-syncd-brcm-rpc/Dockerfile b/platform/broadcom/docker-syncd-brcm-rpc/Dockerfile.j2 similarity index 81% rename from dockers/docker-syncd-brcm-rpc/Dockerfile rename to platform/broadcom/docker-syncd-brcm-rpc/Dockerfile.j2 index 23f5e7a25f6a..912f52cf73a7 100644 --- a/dockers/docker-syncd-brcm-rpc/Dockerfile +++ b/platform/broadcom/docker-syncd-brcm-rpc/Dockerfile.j2 @@ -3,7 +3,19 @@ FROM docker-syncd-brcm ## Make apt-get non-interactive ENV DEBIAN_FRONTEND=noninteractive -COPY deps /deps +COPY \ +{% for deb in docker_syncd_brcm_rpc_debs.split(' ') -%} +debs/{{ deb }}{{' '}} +{%- endfor -%} +debs/ + +RUN dpkg -r syncd + +RUN dpkg_apt() { [ -f $1 ] && { dpkg -i $1 || apt-get -y install -f; } || return 1; } ; \ +dpkg_apt \ +{% for deb in docker_syncd_brcm_rpc_debs.split(' ') -%} +debs/{{ deb }}{{' '}} +{%- endfor %} ## Pre-install the fundamental packages RUN apt-get update \ @@ -34,9 +46,6 @@ RUN apt-get update \ && cd /opt \ && wget https://raw.githubusercontent.com/p4lang/ptf/master/ptf_nn/ptf_nn_agent.py \ && dpkg_apt() { [ -f $1 ] && { dpkg -i $1 || apt-get -y install -f; } || return 1; } \ - && dpkg -r syncd \ - && dpkg_apt /deps/syncd_*.deb \ - && dpkg_apt /deps/libthrift-0.9.3_*.deb \ && apt-get clean -y; apt-get autoclean -y; apt-get autoremove -y \ && rm -rf /deps diff --git a/dockers/docker-syncd-brcm-rpc/ptf_nn_agent.conf b/platform/broadcom/docker-syncd-brcm-rpc/ptf_nn_agent.conf similarity index 100% rename from dockers/docker-syncd-brcm-rpc/ptf_nn_agent.conf rename to platform/broadcom/docker-syncd-brcm-rpc/ptf_nn_agent.conf diff --git a/dockers/docker-syncd-brcm-rpc/supervisord.conf b/platform/broadcom/docker-syncd-brcm-rpc/supervisord.conf similarity index 100% rename from dockers/docker-syncd-brcm-rpc/supervisord.conf rename to platform/broadcom/docker-syncd-brcm-rpc/supervisord.conf diff --git a/platform/broadcom/rules.mk b/platform/broadcom/rules.mk index 37e18ba80285..79d01b02f7eb 100755 --- a/platform/broadcom/rules.mk +++ b/platform/broadcom/rules.mk @@ -6,6 +6,7 @@ include $(PLATFORM_PATH)/platform-modules-arista.mk include $(PLATFORM_PATH)/platform-modules-ingrasys-s9100.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)/one-image.mk include $(PLATFORM_PATH)/one-aboot.mk @@ -18,7 +19,8 @@ $(DSSERVE)_URL = "https://sonicstorage.blob.core.windows.net/packages/dsserve?sv SONIC_ONLINE_FILES += $(BCMCMD) $(DSSERVE) SONIC_ALL += $(SONIC_ONE_IMAGE) $(SONIC_ONE_ABOOT_IMAGE) \ - $(DOCKER_FPM_GOBGP) + $(DOCKER_FPM_GOBGP) \ + $(DOCKER_SYNCD_BRCM_RPC) # Inject brcm sai into sairedis $(LIBSAIREDIS)_DEPENDS += $(BRCM_OPENNSL) $(BRCM_SAI) $(BRCM_SAI_DEV) diff --git a/platform/mellanox/docker-syncd-mlnx-rpc.mk b/platform/mellanox/docker-syncd-mlnx-rpc.mk new file mode 100644 index 000000000000..7aab3c802327 --- /dev/null +++ b/platform/mellanox/docker-syncd-mlnx-rpc.mk @@ -0,0 +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) $(LIBTHRIFT) +$(DOCKER_SYNCD_MLNX_RPC)_FILES += $(MLNX_FW) +$(DOCKER_SYNCD_MLNX_RPC)_LOAD_DOCKERS += $(DOCKER_SYNCD_MLNX) +SONIC_DOCKER_IMAGES += $(DOCKER_SYNCD_MLNX_RPC) diff --git a/dockers/docker-syncd-mlnx-rpc/Dockerfile b/platform/mellanox/docker-syncd-mlnx-rpc/Dockerfile.j2 similarity index 81% rename from dockers/docker-syncd-mlnx-rpc/Dockerfile rename to platform/mellanox/docker-syncd-mlnx-rpc/Dockerfile.j2 index 42e24be7ecb5..15c998385abc 100644 --- a/dockers/docker-syncd-mlnx-rpc/Dockerfile +++ b/platform/mellanox/docker-syncd-mlnx-rpc/Dockerfile.j2 @@ -3,7 +3,19 @@ FROM docker-syncd-mlnx ## Make apt-get non-interactive ENV DEBIAN_FRONTEND=noninteractive -COPY deps /deps +COPY \ +{% for deb in docker_syncd_mlnx_rpc_debs.split(' ') -%} +debs/{{ deb }}{{' '}} +{%- endfor -%} +debs/ + +RUN dpkg -r syncd + +RUN dpkg_apt() { [ -f $1 ] && { dpkg -i $1 || apt-get -y install -f; } || return 1; } ; \ +dpkg_apt \ +{% for deb in docker_syncd_mlnx_rpc_debs.split(' ') -%} +debs/{{ deb }}{{' '}} +{%- endfor %} ## Pre-install the fundamental packages RUN apt-get update \ @@ -34,9 +46,6 @@ RUN apt-get update \ && cd /opt \ && wget https://raw.githubusercontent.com/p4lang/ptf/master/ptf_nn/ptf_nn_agent.py \ && dpkg_apt() { [ -f $1 ] && { dpkg -i $1 || apt-get -y install -f; } || return 1; } \ - && dpkg -r syncd \ - && dpkg_apt /deps/syncd_*.deb \ - && dpkg_apt /deps/libthrift-0.9.3_*.deb \ && apt-get clean -y; apt-get autoclean -y; apt-get autoremove -y \ && rm -rf /deps diff --git a/dockers/docker-syncd-mlnx-rpc/ptf_nn_agent.conf b/platform/mellanox/docker-syncd-mlnx-rpc/ptf_nn_agent.conf similarity index 100% rename from dockers/docker-syncd-mlnx-rpc/ptf_nn_agent.conf rename to platform/mellanox/docker-syncd-mlnx-rpc/ptf_nn_agent.conf diff --git a/dockers/docker-syncd-mlnx-rpc/supervisord.conf b/platform/mellanox/docker-syncd-mlnx-rpc/supervisord.conf similarity index 100% rename from dockers/docker-syncd-mlnx-rpc/supervisord.conf rename to platform/mellanox/docker-syncd-mlnx-rpc/supervisord.conf diff --git a/platform/mellanox/rules.mk b/platform/mellanox/rules.mk index 8bcb8d0278b4..5a57e57fbc4e 100644 --- a/platform/mellanox/rules.mk +++ b/platform/mellanox/rules.mk @@ -4,11 +4,13 @@ include $(PLATFORM_PATH)/mft.mk include $(PLATFORM_PATH)/mlnx-sai.mk include $(PLATFORM_PATH)/hw-management.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)/one-image.mk SONIC_ALL += $(SONIC_ONE_IMAGE) \ - $(DOCKER_FPM_GOBGP) + $(DOCKER_FPM_GOBGP) \ + $(DOCKER_SYNCD_MLNX_RPC) # Inject mlnx sai into sairedis $(LIBSAIREDIS)_DEPENDS += $(MLNX_SAI)