[docker-syncd-*]: Properly manage syncd with supervisord (#617)

- This PR allows supervisord to log syncd exit events to syslog 
 - Syncd dockers now are built from docker-config-engine instead of docker-base
 - Supervisord in all syncd dockers now call syncd_start.s which is installed by sonic-sairedis repo
This commit is contained in:
Joe LeVeque 2017-05-24 11:53:38 -07:00 committed by GitHub
parent 5cc45a991d
commit a2eda30a03
14 changed files with 17 additions and 79 deletions

View File

@ -1,4 +1,4 @@
FROM docker-base
FROM docker-config-engine
## Make apt-get non-interactive
ENV DEBIAN_FRONTEND=noninteractive
@ -19,7 +19,7 @@ debs/{{ deb }}{{' '}}
## TODO: add kmod into Depends
RUN apt-get install -f kmod
COPY ["debs/dsserve", "debs/bcmcmd", "start.sh", "syncd.sh", "/usr/bin/"]
COPY ["debs/dsserve", "debs/bcmcmd", "start.sh", "/usr/bin/"]
RUN chmod +x /usr/bin/dsserve /usr/bin/bcmcmd
COPY ["supervisord.conf", "/etc/supervisor/conf.d/"]

View File

@ -20,7 +20,7 @@ stdout_logfile=syslog
stderr_logfile=syslog
[program:syncd]
command=/usr/bin/syncd.sh
command=/usr/bin/syncd_start.sh
priority=3
autostart=false
autorestart=false

View File

@ -1,12 +0,0 @@
#!/usr/bin/env bash
function clean_up {
service syncd stop
exit
}
trap clean_up SIGTERM SIGKILL
service syncd start
read

View File

@ -1,4 +1,4 @@
FROM docker-base
FROM docker-config-engine
## Make apt-get non-interactive
ENV DEBIAN_FRONTEND=noninteractive
@ -18,7 +18,7 @@ RUN dpkg -i \
debs/{{ deb }}{{' '}}
{%- endfor %}
COPY ["start.sh", "syncd.sh", "/usr/bin/"]
COPY ["start.sh", "/usr/bin/"]
COPY ["supervisord.conf", "/etc/supervisor/conf.d/"]
COPY ["profile.ini", "/etc/ssw/AS7512/"]

View File

@ -20,7 +20,7 @@ stdout_logfile=syslog
stderr_logfile=syslog
[program:syncd]
command=/usr/bin/syncd.sh
command=/usr/bin/syncd_start.sh
priority=3
autostart=false
autorestart=false

View File

@ -1,22 +0,0 @@
#!/usr/bin/env bash
export XP_ROOT=/usr/bin/
while true; do
# Check if redis-server starts
result=$(redis-cli ping)
if [ "$result" == "PONG" ]; then
redis-cli FLUSHALL
syncd -p /etc/ssw/AS7512/profile.ini -N
break
fi
sleep 1
done

View File

@ -1,4 +1,4 @@
FROM docker-base
FROM docker-config-engine
## Make apt-get non-interactive
ENV DEBIAN_FRONTEND=noninteractive
@ -19,7 +19,7 @@ debs/{{ deb }}{{' '}}
## TODO: add kmod into Depends
RUN apt-get install -f kmod
COPY ["start.sh", "syncd.sh", "/usr/bin/"]
COPY ["start.sh", "/usr/bin/"]
COPY ["supervisord.conf", "/etc/supervisor/conf.d/"]
## Clean up

View File

@ -20,7 +20,7 @@ stdout_logfile=syslog
stderr_logfile=syslog
[program:syncd]
command=/usr/bin/syncd.sh
command=/usr/bin/syncd_start.sh
priority=3
autostart=false
autorestart=false

View File

@ -1,12 +0,0 @@
#!/usr/bin/env bash
function clean_up {
service syncd stop
exit
}
trap clean_up SIGTERM SIGKILL
service syncd start
read

View File

@ -1,4 +1,4 @@
FROM docker-base
FROM docker-config-engine
## Make apt-get non-interactive
ENV DEBIAN_FRONTEND=noninteractive
@ -18,7 +18,7 @@ RUN dpkg -i \
debs/{{ deb }}{{' '}}
{%- endfor %}
COPY ["start.sh", "syncd.sh", "mlnx-fw-upgrade.sh", "/usr/bin/"]
COPY ["start.sh", "mlnx-fw-upgrade.sh", "/usr/bin/"]
COPY ["supervisord.conf", "/etc/supervisor/conf.d/"]
COPY ["/debs/fw-SPC.mfa", "/etc/mlnx/"]

View File

@ -4,5 +4,8 @@ rm -f /var/run/rsyslogd.pid
supervisorctl start rsyslogd
supervisorctl start syncd
# mlnx-fw-upgrade.sh will exit if firmware was actually upgraded
# or if some error occurs
. mlnx-fw-upgrade.sh
supervisorctl start syncd

View File

@ -20,7 +20,7 @@ stdout_logfile=syslog
stderr_logfile=syslog
[program:syncd]
command=/usr/bin/syncd.sh
command=/usr/bin/syncd_start.sh
priority=3
autostart=false
autorestart=false

View File

@ -1,19 +0,0 @@
#!/usr/bin/env bash
function clean_up {
service syncd stop
exit
}
trap clean_up SIGTERM SIGKILL
# fw-upgrade will exit if firmware was actually upgraded or if some error
# occures
. mlnx-fw-upgrade.sh
# FIXME: the script cannot trap SIGTERM signal and it exits without clean_up
# Remove rsyslogd.pid file manually so that to start the rsyslog instantly
service syncd start
read

@ -1 +1 @@
Subproject commit 9fe1e696c6a9b5e99406ff2548c6f52db4e0b604
Subproject commit 31131d7d76fa68619b90d88528270a0740daa438