From 5314230980f16ea865882dce746ce0d214e034df Mon Sep 17 00:00:00 2001 From: pavel-shirshov Date: Fri, 24 Mar 2017 18:36:56 -0700 Subject: [PATCH] [docker-syncd-%-rpc]: Integrate syncd dockers with rpc (#431) * Build docker-syncd-*-rpc for brcm and mlnx * Fix errors * Update make files for rpc * Fix mistypes --- .gitignore | 4 +++- platform/broadcom/docker-syncd-brcm-rpc.mk | 8 ++++++++ .../docker-syncd-brcm-rpc/Dockerfile.j2 | 17 +++++++++++++---- .../docker-syncd-brcm-rpc/ptf_nn_agent.conf | 0 .../docker-syncd-brcm-rpc/supervisord.conf | 0 platform/broadcom/rules.mk | 4 +++- platform/mellanox/docker-syncd-mlnx-rpc.mk | 8 ++++++++ .../docker-syncd-mlnx-rpc/Dockerfile.j2 | 17 +++++++++++++---- .../docker-syncd-mlnx-rpc/ptf_nn_agent.conf | 0 .../docker-syncd-mlnx-rpc/supervisord.conf | 0 platform/mellanox/rules.mk | 4 +++- 11 files changed, 51 insertions(+), 11 deletions(-) create mode 100644 platform/broadcom/docker-syncd-brcm-rpc.mk rename dockers/docker-syncd-brcm-rpc/Dockerfile => platform/broadcom/docker-syncd-brcm-rpc/Dockerfile.j2 (81%) rename {dockers => platform/broadcom}/docker-syncd-brcm-rpc/ptf_nn_agent.conf (100%) rename {dockers => platform/broadcom}/docker-syncd-brcm-rpc/supervisord.conf (100%) create mode 100644 platform/mellanox/docker-syncd-mlnx-rpc.mk rename dockers/docker-syncd-mlnx-rpc/Dockerfile => platform/mellanox/docker-syncd-mlnx-rpc/Dockerfile.j2 (81%) rename {dockers => platform/mellanox}/docker-syncd-mlnx-rpc/ptf_nn_agent.conf (100%) rename {dockers => platform/mellanox}/docker-syncd-mlnx-rpc/supervisord.conf (100%) diff --git a/.gitignore b/.gitignore index ffcc741d83..81a7535bae 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 0000000000..2fbca8f309 --- /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 23f5e7a25f..912f52cf73 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 37e18ba802..79d01b02f7 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 0000000000..7aab3c8023 --- /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 42e24be7ec..15c998385a 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 8bcb8d0278..5a57e57fbc 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)