mirror of
				https://github.com/Telecominfraproject/ols-nos.git
				synced 2025-11-04 03:57:57 +00:00 
			
		
		
		
	[innovium]: Enable syncd container autorestart for Innovium platforms (#11497)
Why I did it Enable syncd container autorestart for Innovium platforms How I did it Add critical_process file and sypervisord.conf entry How to verify it Tested with autorestart/test_container_autorestart.py::test_containers_autorestart PASSED autorestart/test_container_autorestart.py::test_containers_autorestart[sonic-xxx-dut-sonic-xxx-dut|syncd] Signed-off-by: rck-innovium rck@innovium.com
This commit is contained in:
		@@ -10,7 +10,7 @@ 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
 | 
			
		||||
 
 | 
			
		||||
@@ -46,6 +46,9 @@ RUN wget https://github.com/nanomsg/nanomsg/archive/1.0.0.tar.gz \
 | 
			
		||||
 && pip install cffi==1.7.0    \
 | 
			
		||||
 && pip install --upgrade cffi==1.7.0 \
 | 
			
		||||
 && pip install nnpy    \
 | 
			
		||||
 && 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 \
 | 
			
		||||
 
 | 
			
		||||
@@ -1,7 +1,6 @@
 | 
			
		||||
FROM docker-config-engine-stretch-{{DOCKER_USERNAME}}:{{DOCKER_USERTAG}}
 | 
			
		||||
 | 
			
		||||
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
 | 
			
		||||
 
 | 
			
		||||
@@ -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
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user