[centec] Support saiserver docker for centec-x86 and centec-arm64 platform (#9162)
Fix docker-syncd-centec-rpc.gz compile fail Support Centec saiserver docker Co-authored-by: Xianghong Gu <xgu@centecnetworks.com>
This commit is contained in:
parent
7f45af9710
commit
bb798a3628
10
platform/centec-arm64/.gitignore
vendored
Normal file
10
platform/centec-arm64/.gitignore
vendored
Normal file
@ -0,0 +1,10 @@
|
||||
*.ko.cmd
|
||||
*.ko
|
||||
*.mod.c
|
||||
*.mod.o
|
||||
modules.order
|
||||
Module.symvers
|
||||
.tmp_versions
|
||||
*.o
|
||||
*.o.cmd
|
||||
*.o.d
|
10
platform/centec-arm64/docker-saiserver-centec.dep
Normal file
10
platform/centec-arm64/docker-saiserver-centec.dep
Normal file
@ -0,0 +1,10 @@
|
||||
|
||||
DPATH := $($(DOCKER_SAISERVER_CENTEC)_PATH)
|
||||
DEP_FILES := $(SONIC_COMMON_FILES_LIST) platform/centec-arm64/docker-saiserver-centec.mk platform/centec-arm64/docker-saiserver-centec.dep
|
||||
DEP_FILES += $(SONIC_COMMON_BASE_FILES_LIST)
|
||||
DEP_FILES += $(shell git ls-files $(DPATH))
|
||||
|
||||
$(DOCKER_SAISERVER_CENTEC)_CACHE_MODE := GIT_CONTENT_SHA
|
||||
$(DOCKER_SAISERVER_CENTEC)_DEP_FLAGS := $(SONIC_COMMON_FLAGS_LIST)
|
||||
$(DOCKER_SAISERVER_CENTEC)_DEP_FILES := $(DEP_FILES)
|
||||
|
@ -3,7 +3,6 @@
|
||||
DOCKER_SAISERVER_CENTEC = docker-saiserver-centec.gz
|
||||
$(DOCKER_SAISERVER_CENTEC)_PATH = $(PLATFORM_PATH)/docker-saiserver-centec
|
||||
$(DOCKER_SAISERVER_CENTEC)_DEPENDS += $(SAISERVER)
|
||||
$(DOCKER_SAISERVER_CENTEC)_FILES += $(DSSERVE) $(BCMCMD)
|
||||
$(DOCKER_SAISERVER_CENTEC)_LOAD_DOCKERS += $(DOCKER_CONFIG_ENGINE_BUSTER)
|
||||
SONIC_DOCKER_IMAGES += $(DOCKER_SAISERVER_CENTEC)
|
||||
|
||||
|
33
platform/centec-arm64/docker-saiserver-centec/Dockerfile.j2
Normal file
33
platform/centec-arm64/docker-saiserver-centec/Dockerfile.j2
Normal file
@ -0,0 +1,33 @@
|
||||
FROM docker-config-engine-buster
|
||||
|
||||
ARG docker_container_name
|
||||
RUN [ -f /etc/rsyslog.conf ] && sed -ri "s/%syslogtag%/$docker_container_name#%syslogtag%/;" /etc/rsyslog.conf
|
||||
|
||||
## Make apt-get non-interactive
|
||||
ENV DEBIAN_FRONTEND=noninteractive
|
||||
|
||||
RUN apt-get update \
|
||||
&& apt-get -y install \
|
||||
libboost-atomic1.71-dev \
|
||||
libqt5core5a \
|
||||
libqt5network5
|
||||
|
||||
COPY \
|
||||
{% for deb in docker_saiserver_centec_debs.split(' ') -%}
|
||||
debs/{{ deb }}{{' '}}
|
||||
{%- endfor -%}
|
||||
debs/
|
||||
|
||||
RUN dpkg_apt() { [ -f $1 ] && { dpkg -i $1 || apt-get -y install -f; } || return 1; } ; \
|
||||
{% for deb in docker_saiserver_centec_debs.split(' ') -%}
|
||||
dpkg_apt debs/{{ deb }}{{'; '}}
|
||||
{%- endfor %}
|
||||
|
||||
COPY ["start.sh", "/usr/bin/"]
|
||||
COPY ["supervisord.conf", "/etc/supervisor/conf.d/"]
|
||||
|
||||
## Clean up
|
||||
RUN apt-get clean -y; apt-get autoclean -y; apt-get autoremove -y
|
||||
RUN rm -rf /debs
|
||||
|
||||
ENTRYPOINT ["/usr/local/bin/supervisord"]
|
14
platform/centec-arm64/docker-saiserver-centec/start.sh
Executable file
14
platform/centec-arm64/docker-saiserver-centec/start.sh
Executable file
@ -0,0 +1,14 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
start_centec()
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
rm -f /var/run/rsyslogd.pid
|
||||
|
||||
supervisorctl start rsyslogd
|
||||
|
||||
start_centec
|
||||
|
||||
supervisorctl start saiserver
|
@ -0,0 +1,28 @@
|
||||
[supervisord]
|
||||
logfile_maxbytes=1MB
|
||||
logfile_backups=2
|
||||
nodaemon=true
|
||||
|
||||
[program:start.sh]
|
||||
command=/usr/bin/start.sh
|
||||
priority=1
|
||||
autostart=true
|
||||
autorestart=false
|
||||
stdout_logfile=syslog
|
||||
stderr_logfile=syslog
|
||||
|
||||
[program:rsyslogd]
|
||||
command=/usr/sbin/rsyslogd -n
|
||||
priority=2
|
||||
autostart=false
|
||||
autorestart=false
|
||||
stdout_logfile=syslog
|
||||
stderr_logfile=syslog
|
||||
|
||||
[program:saiserver]
|
||||
command=/usr/sbin/saiserver -p /usr/share/sonic/hwsku/sai.profile -f /usr/share/sonic/hwsku/port_config.ini
|
||||
priority=3
|
||||
autostart=false
|
||||
autorestart=false
|
||||
stdout_logfile=syslog
|
||||
stderr_logfile=syslog
|
@ -2,7 +2,7 @@
|
||||
|
||||
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)_DEPENDS += $(SYNCD_RPC) $(LIBTHRIFT) $(PTF)
|
||||
$(DOCKER_SYNCD_CENTEC_RPC)_FILES += $(SUPERVISOR_PROC_EXIT_LISTENER_SCRIPT)
|
||||
ifeq ($(INSTALL_DEBUG_TOOLS), y)
|
||||
$(DOCKER_SYNCD_CENTEC_RPC)_DEPENDS += $(SYNCD_RPC_DBG) \
|
||||
@ -21,5 +21,5 @@ $(DOCKER_SYNCD_CENTEC_RPC)_VERSION = 1.0.0+rpc
|
||||
$(DOCKER_SYNCD_CENTEC_RPC)_PACKAGE_NAME = syncd
|
||||
$(DOCKER_SYNCD_CENTEC_RPC)_RUN_OPT += --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_CENTEC_RPC)_RUN_OPT += -v /host/warmboot:/var/warmboot
|
||||
|
@ -2,6 +2,11 @@ FROM docker-syncd-centec
|
||||
|
||||
## Make apt-get non-interactive
|
||||
ENV DEBIAN_FRONTEND=noninteractive
|
||||
RUN apt-get update \
|
||||
&& apt-get -y install \
|
||||
libboost-atomic1.71-dev \
|
||||
libqt5core5a \
|
||||
libqt5network5
|
||||
|
||||
COPY \
|
||||
{% for deb in docker_syncd_centec_rpc_debs.split(' ') -%}
|
||||
|
@ -4,7 +4,7 @@ SAI_VER = 0.9.4
|
||||
|
||||
LIBSAITHRIFT_DEV = libsaithrift-dev_$(SAI_VER)_$(CONFIGURED_ARCH).deb
|
||||
$(LIBSAITHRIFT_DEV)_SRC_PATH = $(SRC_PATH)/sonic-sairedis/SAI
|
||||
$(LIBSAITHRIFT_DEV)_DEPENDS += $(LIBTHRIFT) $(LIBTHRIFT_DEV) $(PYTHON_THRIFT) $(THRIFT_COMPILER) $(CENTEC_SAI)
|
||||
$(LIBSAITHRIFT_DEV)_DEPENDS += $(LIBTHRIFT) $(LIBTHRIFT_DEV) $(PYTHON_THRIFT) $(THRIFT_COMPILER) $(CENTEC_SAI) $(LIBHIREDIS) $(LIBNL3_DEV) $(LIBNL_GENL3_DEV)
|
||||
$(LIBSAITHRIFT_DEV)_RDEPENDS += $(LIBTHRIFT) $(CENTEC_SAI)
|
||||
SONIC_DPKG_DEBS += $(LIBSAITHRIFT_DEV)
|
||||
|
||||
@ -12,7 +12,7 @@ PYTHON_SAITHRIFT = python-saithrift_$(SAI_VER)_$(CONFIGURED_ARCH).deb
|
||||
$(eval $(call add_extra_package,$(LIBSAITHRIFT_DEV),$(PYTHON_SAITHRIFT)))
|
||||
|
||||
SAISERVER = saiserver_$(SAI_VER)_$(CONFIGURED_ARCH).deb
|
||||
$(SAISERVER)_RDEPENDS += $(LIBTHRIFT) $(CENTEC_SAI)
|
||||
$(SAISERVER)_RDEPENDS += $(LIBTHRIFT) $(CENTEC_SAI) $(LIBHIREDIS) $(LIBNL3_DEV) $(LIBNL_GENL3_DEV)
|
||||
$(eval $(call add_extra_package,$(LIBSAITHRIFT_DEV),$(SAISERVER)))
|
||||
|
||||
SAISERVER_DBG = saiserver-dbg_$(SAI_VER)_$(CONFIGURED_ARCH).deb
|
||||
|
@ -1,6 +1,7 @@
|
||||
include $(PLATFORM_PATH)/sai.mk
|
||||
include $(PLATFORM_PATH)/docker-syncd-centec.mk
|
||||
include $(PLATFORM_PATH)/docker-syncd-centec-rpc.mk
|
||||
include $(PLATFORM_PATH)/docker-saiserver-centec.mk
|
||||
include $(PLATFORM_PATH)/one-image.mk
|
||||
include $(PLATFORM_PATH)/libsaithrift-dev.mk
|
||||
include $(PLATFORM_PATH)/tsingma-bsp.mk
|
||||
|
8
platform/centec/.gitignore
vendored
Normal file
8
platform/centec/.gitignore
vendored
Normal file
@ -0,0 +1,8 @@
|
||||
centec-dal/.dal*
|
||||
*.o
|
||||
*.ko
|
||||
.tmp_versions
|
||||
.centec*
|
||||
Module.symvers
|
||||
*.mod.c
|
||||
modules.order
|
10
platform/centec/docker-saiserver-centec.dep
Normal file
10
platform/centec/docker-saiserver-centec.dep
Normal file
@ -0,0 +1,10 @@
|
||||
|
||||
DPATH := $($(DOCKER_SAISERVER_CENTEC)_PATH)
|
||||
DEP_FILES := $(SONIC_COMMON_FILES_LIST) platform/centec/docker-saiserver-centec.mk platform/centec/docker-saiserver-centec.dep
|
||||
DEP_FILES += $(SONIC_COMMON_BASE_FILES_LIST)
|
||||
DEP_FILES += $(shell git ls-files $(DPATH))
|
||||
|
||||
$(DOCKER_SAISERVER_CENTEC)_CACHE_MODE := GIT_CONTENT_SHA
|
||||
$(DOCKER_SAISERVER_CENTEC)_DEP_FLAGS := $(SONIC_COMMON_FLAGS_LIST)
|
||||
$(DOCKER_SAISERVER_CENTEC)_DEP_FILES := $(DEP_FILES)
|
||||
|
14
platform/centec/docker-saiserver-centec.mk
Executable file
14
platform/centec/docker-saiserver-centec.mk
Executable file
@ -0,0 +1,14 @@
|
||||
# docker image for centec saiserver
|
||||
|
||||
DOCKER_SAISERVER_CENTEC = docker-saiserver-centec.gz
|
||||
$(DOCKER_SAISERVER_CENTEC)_PATH = $(PLATFORM_PATH)/docker-saiserver-centec
|
||||
$(DOCKER_SAISERVER_CENTEC)_DEPENDS += $(SAISERVER)
|
||||
$(DOCKER_SAISERVER_CENTEC)_LOAD_DOCKERS += $(DOCKER_CONFIG_ENGINE_BUSTER)
|
||||
SONIC_DOCKER_IMAGES += $(DOCKER_SAISERVER_CENTEC)
|
||||
|
||||
$(DOCKER_SAISERVER_CENTEC)_CONTAINER_NAME = saiserver
|
||||
$(DOCKER_SAISERVER_CENTEC)_RUN_OPT += --privileged -t
|
||||
$(DOCKER_SAISERVER_CENTEC)_RUN_OPT += -v /host/machine.conf:/etc/machine.conf
|
||||
$(DOCKER_SAISERVER_CENTEC)_RUN_OPT += -v /var/run/docker-saiserver:/var/run/sswsyncd
|
||||
$(DOCKER_SAISERVER_CENTEC)_RUN_OPT += -v /etc/sonic:/etc/sonic:ro
|
||||
$(DOCKER_SAISERVER_CENTEC)_RUN_OPT += -v /host/warmboot:/var/warmboot
|
33
platform/centec/docker-saiserver-centec/Dockerfile.j2
Normal file
33
platform/centec/docker-saiserver-centec/Dockerfile.j2
Normal file
@ -0,0 +1,33 @@
|
||||
FROM docker-config-engine-buster
|
||||
|
||||
ARG docker_container_name
|
||||
RUN [ -f /etc/rsyslog.conf ] && sed -ri "s/%syslogtag%/$docker_container_name#%syslogtag%/;" /etc/rsyslog.conf
|
||||
|
||||
## Make apt-get non-interactive
|
||||
ENV DEBIAN_FRONTEND=noninteractive
|
||||
|
||||
RUN apt-get update \
|
||||
&& apt-get -y install \
|
||||
libboost-atomic1.71-dev \
|
||||
libqt5core5a \
|
||||
libqt5network5
|
||||
|
||||
COPY \
|
||||
{% for deb in docker_saiserver_centec_debs.split(' ') -%}
|
||||
debs/{{ deb }}{{' '}}
|
||||
{%- endfor -%}
|
||||
debs/
|
||||
|
||||
RUN dpkg_apt() { [ -f $1 ] && { dpkg -i $1 || apt-get -y install -f; } || return 1; } ; \
|
||||
{% for deb in docker_saiserver_centec_debs.split(' ') -%}
|
||||
dpkg_apt debs/{{ deb }}{{'; '}}
|
||||
{%- endfor %}
|
||||
|
||||
COPY ["start.sh", "/usr/bin/"]
|
||||
COPY ["supervisord.conf", "/etc/supervisor/conf.d/"]
|
||||
|
||||
## Clean up
|
||||
RUN apt-get clean -y; apt-get autoclean -y; apt-get autoremove -y
|
||||
RUN rm -rf /debs
|
||||
|
||||
ENTRYPOINT ["/usr/local/bin/supervisord"]
|
14
platform/centec/docker-saiserver-centec/start.sh
Executable file
14
platform/centec/docker-saiserver-centec/start.sh
Executable file
@ -0,0 +1,14 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
start_centec()
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
rm -f /var/run/rsyslogd.pid
|
||||
|
||||
supervisorctl start rsyslogd
|
||||
|
||||
start_centec
|
||||
|
||||
supervisorctl start saiserver
|
28
platform/centec/docker-saiserver-centec/supervisord.conf
Normal file
28
platform/centec/docker-saiserver-centec/supervisord.conf
Normal file
@ -0,0 +1,28 @@
|
||||
[supervisord]
|
||||
logfile_maxbytes=1MB
|
||||
logfile_backups=2
|
||||
nodaemon=true
|
||||
|
||||
[program:start.sh]
|
||||
command=/usr/bin/start.sh
|
||||
priority=1
|
||||
autostart=true
|
||||
autorestart=false
|
||||
stdout_logfile=syslog
|
||||
stderr_logfile=syslog
|
||||
|
||||
[program:rsyslogd]
|
||||
command=/usr/sbin/rsyslogd -n
|
||||
priority=2
|
||||
autostart=false
|
||||
autorestart=false
|
||||
stdout_logfile=syslog
|
||||
stderr_logfile=syslog
|
||||
|
||||
[program:saiserver]
|
||||
command=/usr/sbin/saiserver -p /usr/share/sonic/hwsku/sai.profile -f /usr/share/sonic/hwsku/port_config.ini
|
||||
priority=3
|
||||
autostart=false
|
||||
autorestart=false
|
||||
stdout_logfile=syslog
|
||||
stderr_logfile=syslog
|
@ -2,6 +2,11 @@ FROM docker-syncd-centec
|
||||
|
||||
## Make apt-get non-interactive
|
||||
ENV DEBIAN_FRONTEND=noninteractive
|
||||
RUN apt-get update \
|
||||
&& apt-get -y install \
|
||||
libboost-atomic1.71-dev \
|
||||
libqt5core5a \
|
||||
libqt5network5
|
||||
|
||||
COPY \
|
||||
{% for deb in docker_syncd_centec_rpc_debs.split(' ') -%}
|
||||
|
@ -4,7 +4,7 @@ SAI_VER = 0.9.4
|
||||
|
||||
LIBSAITHRIFT_DEV = libsaithrift-dev_$(SAI_VER)_amd64.deb
|
||||
$(LIBSAITHRIFT_DEV)_SRC_PATH = $(SRC_PATH)/sonic-sairedis/SAI
|
||||
$(LIBSAITHRIFT_DEV)_DEPENDS += $(LIBTHRIFT) $(LIBTHRIFT_DEV) $(PYTHON_THRIFT) $(THRIFT_COMPILER) $(CENTEC_SAI)
|
||||
$(LIBSAITHRIFT_DEV)_DEPENDS += $(LIBTHRIFT) $(LIBTHRIFT_DEV) $(PYTHON_THRIFT) $(THRIFT_COMPILER) $(CENTEC_SAI) $(LIBHIREDIS) $(LIBNL3_DEV) $(LIBNL_GENL3_DEV)
|
||||
$(LIBSAITHRIFT_DEV)_RDEPENDS += $(LIBTHRIFT) $(CENTEC_SAI)
|
||||
SONIC_DPKG_DEBS += $(LIBSAITHRIFT_DEV)
|
||||
|
||||
@ -12,7 +12,8 @@ PYTHON_SAITHRIFT = python-saithrift_$(SAI_VER)_amd64.deb
|
||||
$(eval $(call add_extra_package,$(LIBSAITHRIFT_DEV),$(PYTHON_SAITHRIFT)))
|
||||
|
||||
SAISERVER = saiserver_$(SAI_VER)_amd64.deb
|
||||
$(SAISERVER)_RDEPENDS += $(LIBTHRIFT) $(BRCM_SAI)
|
||||
$(SAISERVER)_DEPENDS += $(LIBHIREDIS)
|
||||
$(SAISERVER)_RDEPENDS += $(LIBTHRIFT) $(CENTEC_SAI) $(LIBHIREDIS) $(LIBNL3_DEV) $(LIBNL_GENL3_DEV)
|
||||
$(eval $(call add_extra_package,$(LIBSAITHRIFT_DEV),$(SAISERVER)))
|
||||
|
||||
SAISERVER_DBG = saiserver-dbg_$(SAI_VER)_amd64.deb
|
||||
|
@ -4,6 +4,7 @@ include $(PLATFORM_PATH)/platform-modules-centec-v682.mk
|
||||
include $(PLATFORM_PATH)/sdk.mk
|
||||
include $(PLATFORM_PATH)/docker-syncd-centec.mk
|
||||
include $(PLATFORM_PATH)/docker-syncd-centec-rpc.mk
|
||||
include $(PLATFORM_PATH)/docker-saiserver-centec.mk
|
||||
include $(PLATFORM_PATH)/one-image.mk
|
||||
include $(PLATFORM_PATH)/libsaithrift-dev.mk
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user