[Innovium] Backport platform fixes from master (#12526)

Syncd container restart for Innovium:
   https://github.com/sonic-net/sonic-buildimage/pull/11497

 Innovium platform shell
   https://github.com/sonic-net/sonic-buildimage/pull/11845

Signed-off-by: rck-innovium rck@innovium.com
This commit is contained in:
Ravindranath C K 2022-11-04 11:29:05 -07:00 committed by GitHub
parent 10c12e12e4
commit 66b6c212fc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 37 additions and 11 deletions

View File

@ -2,15 +2,17 @@
DOCKER_SYNCD_INVM_RPC = docker-syncd-invm-rpc.gz
$(DOCKER_SYNCD_INVM_RPC)_PATH = $(PLATFORM_PATH)/docker-syncd-invm-rpc
$(DOCKER_SYNCD_INVM_RPC)_DEPENDS += $(SYNCD_RPC) $(LIBTHRIFT) $(INVM_LIBSAI) $(PTF)
$(DOCKER_SYNCD_INVM_RPC)_DEPENDS += $(SYNCD_RPC) $(LIBTHRIFT) $(INVM_LIBSAI) $(PTF) $(INVM_SHELL)
$(DOCKER_SYNCD_INVM_RPC)_FILES += $(SUPERVISOR_PROC_EXIT_LISTENER_SCRIPT)
$(DOCKER_SYNCD_INVM_RPC)_LOAD_DOCKERS += $(DOCKER_SYNCD_BASE)
SONIC_DOCKER_IMAGES += $(DOCKER_SYNCD_INVM_RPC)
SONIC_BUSTER_DOCKERS += $(DOCKER_SYNCD_INVM_RPC)
ifeq ($(ENABLE_SYNCD_RPC),y)
SONIC_INSTALL_DOCKER_IMAGES += $(DOCKER_SYNCD_INVM_RPC)
endif
$(DOCKER_SYNCD_INVM_RPC)_CONTAINER_NAME = syncd
$(DOCKER_SYNCD_INVM_RPC)_VERSION = 1.0.0+rpc
$(DOCKER_SYNCD_INVM_RPC)_VERSION = 1.0.0-rpc
$(DOCKER_SYNCD_INVM_RPC)_PACKAGE_NAME = syncd
$(DOCKER_SYNCD_INVM_RPC)_RUN_OPT += --privileged -t
$(DOCKER_SYNCD_INVM_RPC)_RUN_OPT += -v /host/machine.conf:/etc/machine.conf

View File

@ -46,6 +46,7 @@ RUN wget https://github.com/nanomsg/nanomsg/archive/1.0.0.tar.gz \
&& rm -f 1.0.0.tar.gz \
&& pip install numpy \
&& pip install scipy \
&& pip install setuptools \
&& mkdir -p /opt \
&& cd /opt \
&& wget https://raw.githubusercontent.com/p4lang/ptf/master/ptf_nn/ptf_nn_agent.py \

View File

@ -3,7 +3,7 @@
DOCKER_SYNCD_PLATFORM_CODE = invm
include $(PLATFORM_PATH)/../template/docker-syncd-base.mk
$(DOCKER_SYNCD_BASE)_DEPENDS += $(SYNCD) $(PYTHON_SDK_API) $(INVM_LIBSAI)
$(DOCKER_SYNCD_BASE)_DEPENDS += $(SYNCD) $(PYTHON_SDK_API) $(INVM_LIBSAI) $(INVM_SHELL)
$(DOCKER_SYNCD_BASE)_DBG_DEPENDS += $(SYNCD_DBG) \
$(LIBSWSSCOMMON_DBG) \

View File

@ -1,7 +1,6 @@
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
@ -25,7 +24,11 @@ RUN dpkg -i \
debs/{{ deb }}{{' '}}
{%- endfor %}
COPY ["start.sh", "/usr/bin/"]
COPY ["ivm_start.sh", "/usr/bin/"]
COPY ["supervisord.conf", "/etc/supervisor/conf.d/"]
COPY ["files/supervisor-proc-exit-listener", "/usr/bin"]
COPY ["critical_processes", "/etc/supervisor/"]
## Clean up
RUN apt-get clean -y; apt-get autoclean -y; apt-get autoremove -y

View File

@ -4,29 +4,47 @@ logfile_backups=2
nodaemon=true
[eventlistener:dependent-startup]
command=python2 -m supervisord_dependent_startup
command=python3 -m supervisord_dependent_startup
autostart=true
autorestart=unexpected
startretries=0
exitcodes=0,3
events=PROCESS_STATE
buffer_size=25
[eventlistener:supervisor-proc-exit-listener]
command=/usr/bin/supervisor-proc-exit-listener --container-name syncd
events=PROCESS_STATE_EXITED,PROCESS_STATE_RUNNING
autostart=true
autorestart=unexpected
buffer_size=1024
[program:rsyslogd]
command=/usr/sbin/rsyslogd -n -iNONE
priority=1
autostart=false
autorestart=false
autorestart=unexpected
stdout_logfile=syslog
stderr_logfile=syslog
dependent_startup=true
[program:start]
command=/usr/bin/start.sh
priority=2
autostart=false
autorestart=false
startsecs=0
stdout_logfile=syslog
stderr_logfile=syslog
dependent_startup=true
dependent_startup_wait_for=rsyslogd:running
[program:syncd]
command=/usr/bin/syncd_start.sh
priority=2
priority=3
autostart=false
autorestart=false
stdout_logfile=syslog
stderr_logfile=syslog
dependent_startup=true
dependent_startup_wait_for=rsyslogd:running
dependent_startup_wait_for=start:exited

View File

@ -1,15 +1,17 @@
# INVM SAI
INVM_SAI_ONLINE = https://github.com/Innovium/SONiC/raw/master/debian/master
INVM_SAI_ONLINE = https://github.com/Innovium/SONiC/raw/master/debian/202111
INVM_LIBSAI = isai.deb
INVM_HSAI = saihdr.deb
INVM_DRV = ipd.deb
INVM_SHELL = ishell.deb
$(INVM_LIBSAI)_URL = $(INVM_SAI_ONLINE)/$(INVM_LIBSAI)
$(INVM_HSAI)_URL = $(INVM_SAI_ONLINE)/$(INVM_HSAI)
$(INVM_DRV)_URL = $(INVM_SAI_ONLINE)/$(INVM_DRV)
$(INVM_SHELL)_URL = $(INVM_SAI_ONLINE)/$(INVM_SHELL)
$(eval $(call add_conflict_package,$(INVM_HSAI),$(LIBSAIVS_DEV)))
SONIC_ONLINE_DEBS += $(INVM_LIBSAI) $(INVM_HSAI) $(INVM_DRV)
SONIC_ONLINE_DEBS += $(INVM_LIBSAI) $(INVM_HSAI) $(INVM_DRV) $(INVM_SHELL)

View File

@ -13,7 +13,7 @@ SONIC_ALL += $(SONIC_INVM_ONE_IMAGE) \
$(DOCKER_SYNCD_INVM_RPC)
# Inject invm sai into syncd
$(SYNCD)_DEPENDS += $(INVM_HSAI) $(INVM_LIBSAI) $(LIBSAITHRIFT_DEV_INVM)
$(SYNCD)_DEPENDS += $(INVM_HSAI) $(INVM_LIBSAI) $(LIBSAITHRIFT_DEV_INVM) $(INVM_SHELL)
$(SYNCD)_UNINSTALLS += $(INVM_HSAI)
# Runtime dependency on invm sai is set only for syncd