Use syncd-rpc for docker-syncd-rpc (#522)

* Use syncd rpc for docker-syncd-rpc. Create docker-syncd-rpc for cavium and centec
This commit is contained in:
pavel-shirshov 2017-04-20 14:37:09 -07:00 committed by GitHub
parent d30fbf1d72
commit 2c4c6e9ceb
18 changed files with 170 additions and 12 deletions

View File

@ -2,7 +2,7 @@
DOCKER_SYNCD_BRCM_RPC = docker-syncd-brcm-rpc.gz DOCKER_SYNCD_BRCM_RPC = docker-syncd-brcm-rpc.gz
$(DOCKER_SYNCD_BRCM_RPC)_PATH = $(PLATFORM_PATH)/docker-syncd-brcm-rpc $(DOCKER_SYNCD_BRCM_RPC)_PATH = $(PLATFORM_PATH)/docker-syncd-brcm-rpc
$(DOCKER_SYNCD_BRCM_RPC)_DEPENDS += $(SYNCD) $(LIBTHRIFT) $(DOCKER_SYNCD_BRCM_RPC)_DEPENDS += $(SYNCD_RPC) $(LIBTHRIFT)
$(DOCKER_SYNCD_BRCM_RPC)_FILES += $(DSSERVE) $(BCMCMD) $(DOCKER_SYNCD_BRCM_RPC)_FILES += $(DSSERVE) $(BCMCMD)
$(DOCKER_SYNCD_BRCM_RPC)_LOAD_DOCKERS += $(DOCKER_SYNCD_BRCM) $(DOCKER_SYNCD_BRCM_RPC)_LOAD_DOCKERS += $(DOCKER_SYNCD_BRCM)
SONIC_DOCKER_IMAGES += $(DOCKER_SYNCD_BRCM_RPC) SONIC_DOCKER_IMAGES += $(DOCKER_SYNCD_BRCM_RPC)

View File

@ -45,7 +45,7 @@ RUN apt-get update \
&& cd /opt \ && cd /opt \
&& wget https://raw.githubusercontent.com/p4lang/ptf/master/ptf_nn/ptf_nn_agent.py \ && wget https://raw.githubusercontent.com/p4lang/ptf/master/ptf_nn/ptf_nn_agent.py \
&& apt-get clean -y; apt-get autoclean -y; apt-get autoremove -y \ && apt-get clean -y; apt-get autoclean -y; apt-get autoremove -y \
&& rm -rf /deps && rm -rf /root/deps
COPY supervisord.conf /etc/supervisor/conf.d/supervisord.conf COPY supervisord.conf /etc/supervisor/conf.d/supervisord.conf
COPY ptf_nn_agent.conf /etc/supervisor/conf.d/ptf_nn_agent.conf COPY ptf_nn_agent.conf /etc/supervisor/conf.d/ptf_nn_agent.conf

View File

@ -25,7 +25,7 @@ SONIC_ALL += $(SONIC_ONE_IMAGE) $(SONIC_ONE_ABOOT_IMAGE) \
$(DOCKER_SYNCD_BRCM_RPC) $(DOCKER_SYNCD_BRCM_RPC)
# Inject brcm sai into sairedis # Inject brcm sai into sairedis
$(LIBSAIREDIS)_DEPENDS += $(BRCM_OPENNSL) $(BRCM_SAI) $(BRCM_SAI_DEV) $(LIBSAIREDIS)_DEPENDS += $(BRCM_OPENNSL) $(BRCM_SAI) $(BRCM_SAI_DEV) $(LIBSAITHRIFT_DEV_BRCM)
# Runtime dependency on brcm sai is set only for syncd # Runtime dependency on brcm sai is set only for syncd
$(SYNCD)_RDEPENDS += $(BRCM_OPENNSL) $(BRCM_SAI) $(SYNCD)_RDEPENDS += $(BRCM_OPENNSL) $(BRCM_SAI)

View File

@ -0,0 +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)

View File

@ -0,0 +1,56 @@
FROM docker-syncd-cavm
## Make apt-get non-interactive
ENV DEBIAN_FRONTEND=noninteractive
COPY \
{% for deb in docker_syncd_cavm_rpc_debs.split(' ') -%}
debs/{{ deb }}{{' '}}
{%- endfor -%}
debs/
RUN dpkg -P syncd
RUN dpkg_apt() { [ -f $1 ] && { dpkg -i $1 || apt-get -y install -f; } || return 1; } ; \
{% for deb in docker_syncd_cavm_rpc_debs.split(' ') -%}
dpkg_apt debs/{{ deb }}{{'; '}}
{%- endfor %}
## Pre-install the fundamental packages
RUN apt-get update \
&& apt-get -y install \
net-tools \
python-pip \
build-essential \
libssl-dev \
libffi-dev \
python-dev \
wget \
cmake \
supervisor \
&& wget https://github.com/nanomsg/nanomsg/archive/1.0.0.tar.gz \
&& tar xvfz 1.0.0.tar.gz \
&& cd nanomsg-1.0.0 \
&& mkdir -p build \
&& cmake . \
&& make install \
&& ldconfig \
&& cd .. \
&& rm -fr nanomsg-1.0.0 \
&& rm -f 1.0.0.tar.gz \
&& pip install cffi==1.7.0 \
&& pip install --upgrade cffi==1.7.0 \
&& pip install nnpy \
&& mkdir -p /opt \
&& cd /opt \
&& wget https://raw.githubusercontent.com/p4lang/ptf/master/ptf_nn/ptf_nn_agent.py \
&& apt-get clean -y; apt-get autoclean -y; apt-get autoremove -y \
&& rm -rf /root/deps
COPY supervisord.conf /etc/supervisor/conf.d/supervisord.conf
COPY ptf_nn_agent.conf /etc/supervisor/conf.d/ptf_nn_agent.conf
RUN sed -i 's/read/sysctl -w net.core.rmem_max=509430500 ; \/usr\/bin\/supervisord/' /usr/bin/start.sh
ENTRYPOINT ["/bin/bash"]
CMD ["/usr/bin/start.sh"]

View File

@ -0,0 +1,10 @@
[program:ptf_nn_agent]
command=/usr/bin/python /opt/ptf_nn_agent.py --device-socket 1@tcp://0.0.0.0:10900 -i 1-3@Ethernet12 --set-iface-rcv-buffer=109430400
process_name=ptf_nn_agent
stdout_logfile=/tmp/ptf_nn_agent.out.log
stderr_logfile=/tmp/ptf_nn_agent.err.log
redirect_stderr=false
autostart=true
autorestart=true
startsecs=1
numprocs=1

View File

@ -0,0 +1,2 @@
[supervisord]
nodaemon=true

View File

@ -1,5 +1,6 @@
include $(PLATFORM_PATH)/cavm-sai.mk include $(PLATFORM_PATH)/cavm-sai.mk
include $(PLATFORM_PATH)/docker-syncd-cavm.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)/docker-orchagent-cavm.mk
include $(PLATFORM_PATH)/cavm-platform-modules.mk include $(PLATFORM_PATH)/cavm-platform-modules.mk
include $(PLATFORM_PATH)/cavm-xpnet.mk include $(PLATFORM_PATH)/cavm-xpnet.mk
@ -8,10 +9,11 @@ include $(PLATFORM_PATH)/libsaithrift-dev.mk
include $(PLATFORM_PATH)/python-saithrift.mk include $(PLATFORM_PATH)/python-saithrift.mk
SONIC_ALL += $(SONIC_ONE_IMAGE) \ SONIC_ALL += $(SONIC_ONE_IMAGE) \
$(DOCKER_FPM) $(DOCKER_FPM) \
$(DOCKER_SYNCD_CAVM_RPC)
# Inject cavium sai into sairedis # Inject cavium sai into sairedis
$(LIBSAIREDIS)_DEPENDS += $(CAVM_SAI) $(CAVM_LIBSAI) $(LIBSAIREDIS)_DEPENDS += $(CAVM_SAI) $(CAVM_LIBSAI) $(LIBSAITHRIFT_DEV_CAVM)
# Runtime dependency on cavium sai is set only for syncd # Runtime dependency on cavium sai is set only for syncd
$(SYNCD)_RDEPENDS += $(CAVM_SAI) $(SYNCD)_RDEPENDS += $(CAVM_SAI)

View File

@ -0,0 +1,7 @@
# 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)

View File

@ -0,0 +1,56 @@
FROM docker-syncd-centec
## Make apt-get non-interactive
ENV DEBIAN_FRONTEND=noninteractive
COPY \
{% for deb in docker_syncd_centec_rpc_debs.split(' ') -%}
debs/{{ deb }}{{' '}}
{%- endfor -%}
debs/
RUN dpkg -P syncd
RUN dpkg_apt() { [ -f $1 ] && { dpkg -i $1 || apt-get -y install -f; } || return 1; } ; \
{% for deb in docker_syncd_centec_rpc_debs.split(' ') -%}
dpkg_apt debs/{{ deb }}{{'; '}}
{%- endfor %}
## Pre-install the fundamental packages
RUN apt-get update \
&& apt-get -y install \
net-tools \
python-pip \
build-essential \
libssl-dev \
libffi-dev \
python-dev \
wget \
cmake \
supervisor \
&& wget https://github.com/nanomsg/nanomsg/archive/1.0.0.tar.gz \
&& tar xvfz 1.0.0.tar.gz \
&& cd nanomsg-1.0.0 \
&& mkdir -p build \
&& cmake . \
&& make install \
&& ldconfig \
&& cd .. \
&& rm -fr nanomsg-1.0.0 \
&& rm -f 1.0.0.tar.gz \
&& pip install cffi==1.7.0 \
&& pip install --upgrade cffi==1.7.0 \
&& pip install nnpy \
&& mkdir -p /opt \
&& cd /opt \
&& wget https://raw.githubusercontent.com/p4lang/ptf/master/ptf_nn/ptf_nn_agent.py \
&& apt-get clean -y; apt-get autoclean -y; apt-get autoremove -y \
&& rm -rf /root/deps
COPY supervisord.conf /etc/supervisor/conf.d/supervisord.conf
COPY ptf_nn_agent.conf /etc/supervisor/conf.d/ptf_nn_agent.conf
RUN sed -i 's/read/sysctl -w net.core.rmem_max=509430500 ; \/usr\/bin\/supervisord/' /usr/bin/start.sh
ENTRYPOINT ["/bin/bash"]
CMD ["/usr/bin/start.sh"]

View File

@ -0,0 +1,10 @@
[program:ptf_nn_agent]
command=/usr/bin/python /opt/ptf_nn_agent.py --device-socket 1@tcp://0.0.0.0:10900 -i 1-3@Ethernet12 --set-iface-rcv-buffer=109430400
process_name=ptf_nn_agent
stdout_logfile=/tmp/ptf_nn_agent.out.log
stderr_logfile=/tmp/ptf_nn_agent.err.log
redirect_stderr=false
autostart=true
autorestart=true
startsecs=1
numprocs=1

View File

@ -0,0 +1,2 @@
[supervisord]
nodaemon=true

View File

@ -2,14 +2,16 @@ include $(PLATFORM_PATH)/sdk.mk
include $(PLATFORM_PATH)/sai.mk include $(PLATFORM_PATH)/sai.mk
include $(PLATFORM_PATH)/docker-orchagent-centec.mk include $(PLATFORM_PATH)/docker-orchagent-centec.mk
include $(PLATFORM_PATH)/docker-syncd-centec.mk include $(PLATFORM_PATH)/docker-syncd-centec.mk
include $(PLATFORM_PATH)/docker-syncd-centec-rpc.mk
include $(PLATFORM_PATH)/one-image.mk include $(PLATFORM_PATH)/one-image.mk
include $(PLATFORM_PATH)/libsaithrift-dev.mk include $(PLATFORM_PATH)/libsaithrift-dev.mk
include $(PLATFORM_PATH)/python-saithrift.mk include $(PLATFORM_PATH)/python-saithrift.mk
SONIC_ALL += $(SONIC_ONE_IMAGE) SONIC_ALL += $(SONIC_ONE_IMAGE) \
$(DOCKER_SYNCD_CENTEC_RPC)
# Inject centec sai into sairedis # Inject centec sai into sairedis
$(LIBSAIREDIS)_DEPENDS += $(CENTEC_SAI) $(LIBSAIREDIS)_DEPENDS += $(CENTEC_SAI) $(LIBSAITHRIFT_DEV_CENTEC)
# Runtime dependency on centec sai is set only for syncd # Runtime dependency on centec sai is set only for syncd
$(SYNCD)_RDEPENDS += $(CENTEC_SAI) $(SYNCD)_RDEPENDS += $(CENTEC_SAI)

View File

@ -2,7 +2,7 @@
DOCKER_SYNCD_MLNX_RPC = docker-syncd-mlnx-rpc.gz DOCKER_SYNCD_MLNX_RPC = docker-syncd-mlnx-rpc.gz
$(DOCKER_SYNCD_MLNX_RPC)_PATH = $(PLATFORM_PATH)/docker-syncd-mlnx-rpc $(DOCKER_SYNCD_MLNX_RPC)_PATH = $(PLATFORM_PATH)/docker-syncd-mlnx-rpc
$(DOCKER_SYNCD_MLNX_RPC)_DEPENDS += $(SYNCD) $(LIBTHRIFT) $(DOCKER_SYNCD_MLNX_RPC)_DEPENDS += $(SYNCD_RPC) $(LIBTHRIFT)
$(DOCKER_SYNCD_MLNX_RPC)_FILES += $(MLNX_FW) $(DOCKER_SYNCD_MLNX_RPC)_FILES += $(MLNX_FW)
$(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)

View File

@ -45,7 +45,7 @@ RUN apt-get update \
&& cd /opt \ && cd /opt \
&& wget https://raw.githubusercontent.com/p4lang/ptf/master/ptf_nn/ptf_nn_agent.py \ && wget https://raw.githubusercontent.com/p4lang/ptf/master/ptf_nn/ptf_nn_agent.py \
&& apt-get clean -y; apt-get autoclean -y; apt-get autoremove -y \ && apt-get clean -y; apt-get autoclean -y; apt-get autoremove -y \
&& rm -rf /deps && rm -rf /root/deps
COPY supervisord.conf /etc/supervisor/conf.d/supervisord.conf COPY supervisord.conf /etc/supervisor/conf.d/supervisord.conf
COPY ptf_nn_agent.conf /etc/supervisor/conf.d/ptf_nn_agent.conf COPY ptf_nn_agent.conf /etc/supervisor/conf.d/ptf_nn_agent.conf

View File

@ -15,7 +15,7 @@ SONIC_ALL += $(SONIC_ONE_IMAGE) \
$(DOCKER_SYNCD_MLNX_RPC) $(DOCKER_SYNCD_MLNX_RPC)
# Inject mlnx sai into sairedis # Inject mlnx sai into sairedis
$(LIBSAIREDIS)_DEPENDS += $(MLNX_SAI) $(LIBSAIREDIS)_DEPENDS += $(MLNX_SAI) $(LIBSAITHRIFT_DEV_MLNX)
# Runtime dependency on mlnx sai is set only for syncd # Runtime dependency on mlnx sai is set only for syncd
$(SYNCD)_RDEPENDS += $(MLNX_SAI) $(SYNCD)_RDEPENDS += $(MLNX_SAI)

View File

@ -2,7 +2,7 @@
LIBSAIREDIS = libsairedis_1.0.0_amd64.deb LIBSAIREDIS = libsairedis_1.0.0_amd64.deb
$(LIBSAIREDIS)_SRC_PATH = $(SRC_PATH)/sonic-sairedis $(LIBSAIREDIS)_SRC_PATH = $(SRC_PATH)/sonic-sairedis
$(LIBSAIREDIS)_DEPENDS += $(LIBSWSSCOMMON_DEV) $(LIBSAIREDIS)_DEPENDS += $(LIBSWSSCOMMON_DEV) $(LIBTHRIFT_DEV)
$(LIBSAIREDIS)_RDEPENDS += $(LIBSWSSCOMMON) $(LIBSAIREDIS)_RDEPENDS += $(LIBSWSSCOMMON)
SONIC_DPKG_DEBS += $(LIBSAIREDIS) SONIC_DPKG_DEBS += $(LIBSAIREDIS)
@ -13,6 +13,10 @@ SYNCD = syncd_1.0.0_amd64.deb
$(SYNCD)_RDEPENDS += $(LIBSAIREDIS) $(LIBSAIMETADATA) $(SYNCD)_RDEPENDS += $(LIBSAIREDIS) $(LIBSAIMETADATA)
$(eval $(call add_derived_package,$(LIBSAIREDIS),$(SYNCD))) $(eval $(call add_derived_package,$(LIBSAIREDIS),$(SYNCD)))
SYNCD_RPC = syncd-rpc_1.0.0_amd64.deb
$(SYNCD_RPC)_RDEPENDS += $(LIBSAIREDIS) $(LIBSAIMETADATA)
$(eval $(call add_derived_package,$(LIBSAIREDIS),$(SYNCD_RPC)))
LIBSAIMETADATA = libsaimetadata_1.0.0_amd64.deb LIBSAIMETADATA = libsaimetadata_1.0.0_amd64.deb
$(eval $(call add_derived_package,$(LIBSAIREDIS),$(LIBSAIMETADATA))) $(eval $(call add_derived_package,$(LIBSAIREDIS),$(LIBSAIMETADATA)))

@ -1 +1 @@
Subproject commit e28e4c038572aeea65491424a86fcb4f1ac229de Subproject commit 230f322b66f4da67b5dba7dbedf39e70219a21f7