Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[supervisor] Install vanilla package once again, install Python 3 version in Buster container #5546

Merged
merged 10 commits into from
Nov 20, 2020
Merged
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"skip_ledd": true,
"skip_xcvrd": true,
"skip_pcied": true,
"skip_psud": true,
"skip_syseepromd": true,
"skip_thermalctld": true
Expand Down
22 changes: 13 additions & 9 deletions dockers/docker-base-buster/Dockerfile.j2
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,6 @@ RUN apt-get update && \
python3-pip \
rsyslog \
vim-tiny \
# Install dependencies of supervisor
python-pkg-resources \
python-meld3 \
# Install dependencies of redis-tools
libatomic1 \
libjemalloc2 \
Expand All @@ -67,9 +64,6 @@ RUN apt-get update && \
# ip and ifconfig utility missing in docker for arm arch
iproute2 \
net-tools \
# for arm arch: Installing j2cli dependency package MarkupSafe from source relies on weeksetuptools and wheel
python-setuptools \
python-wheel \
# for processing/handling json files in bash environment
jq \
# for sairedis zmq rpc channel
Expand All @@ -90,9 +84,22 @@ RUN dpkg -i redis-tools_6.0.6-1~bpo10+1_amd64.deb || apt-get install -f -y
RUN rm redis-tools_6.0.6-1~bpo10+1_amd64.deb
{% endif %}

# Some Python packages require setuptools (or pkg_resources, which is supplied by setuptools)
# and some require wheel
RUN pip install setuptools==40.8.0
RUN pip3 install setuptools==49.6.00
RUN pip install wheel
RUN pip3 install wheel

# For templating
RUN pip2 install j2cli

# Install supervisor
RUN pip3 install supervisor==4.2.1

# Add support for supervisord to handle startup dependencies
RUN pip3 install supervisord-dependent-startup==1.4.0

RUN mkdir -p /etc/supervisor /var/log/supervisor

RUN apt-get -y purge \
Expand All @@ -109,9 +116,6 @@ RUN apt-get -y purge \
{{ install_debian_packages(docker_base_buster_debs.split(' ')) }}
{%- endif %}

# Add support for supervisord to handle startup dependencies
RUN pip2 install supervisord-dependent-startup==1.4.0

# Clean up apt
# Remove /var/lib/apt/lists/*, could be obsoleted for derived images
RUN apt-get clean -y && \
Expand Down
22 changes: 13 additions & 9 deletions dockers/docker-base-stretch/Dockerfile.j2
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,8 @@ RUN apt-get update && \
python \
python-pip \
vim-tiny \
# Install dependencies of supervisor
python-pkg-resources \
python-meld3 \
# Install redis-tools
redis-tools=5:5.0.3-3~bpo9+2 \
# common dependencies
libpython2.7 \
libdaemon0 \
Expand All @@ -58,9 +57,6 @@ RUN apt-get update && \
# ip and ifconfig utility missing in docker for arm arch
iproute2 \
net-tools \
# for arm arch: Installing j2cli dependency package MarkupSafe from source relies on weeksetuptools and wheel
python-setuptools \
python-wheel \
# for processing json files in bash environment
jq \
# for sairedis zmq rpc channel
Expand All @@ -85,9 +81,20 @@ RUN apt-get -y -t stretch-backports install rsyslog
RUN rm redis-tools_6.0.6-1~bpo10+1_amd64.deb
{% endif %}

# Some Python packages require setuptools (or pkg_resources, which is supplied by setuptools)
# and some require wheel
RUN pip install setuptools==40.8.0
RUN pip install wheel

# For templating
RUN pip install j2cli

# Install supervisor
RUN pip install supervisor>=3.4.0

# Add support for supervisord to handle startup dependencies
RUN pip install supervisord-dependent-startup==1.4.0

RUN mkdir -p /etc/supervisor /var/log/supervisor

RUN apt-get -y purge \
Expand All @@ -104,9 +111,6 @@ RUN apt-get -y purge \
{{ install_debian_packages(docker_base_stretch_debs.split(' ')) }}
{%- endif %}

# Add support for supervisord to handle startup dependencies
RUN pip install supervisord-dependent-startup==1.4.0

# Clean up apt
# Remove /var/lib/apt/lists/*, could be obsoleted for derived images
RUN apt-get clean -y && \
Expand Down
10 changes: 8 additions & 2 deletions dockers/docker-base/Dockerfile.j2
Original file line number Diff line number Diff line change
Expand Up @@ -44,15 +44,21 @@ RUN apt-get -y install \
vim-tiny \
perl \
python \
python-pip \
rsyslog \
less

COPY ["etc/rsyslog.conf", "/etc/rsyslog.conf"]
COPY ["etc/rsyslog.d/*", "/etc/rsyslog.d/"]
COPY ["root/.vimrc", "/root/.vimrc"]

# Install dependencies of supervisor
RUN apt-get -y install python-pkg-resources python-meld3
# Some Python packages require setuptools (or pkg_resources, which is supplied by setuptools)
# and some require wheel
RUN pip install setuptools==40.8.0
RUN pip install wheel

# Install supervisor
RUN pip install supervisor>=3.4.0

RUN mkdir -p /etc/supervisor
RUN mkdir -p /var/log/supervisor
Expand Down
2 changes: 1 addition & 1 deletion dockers/docker-basic_router/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,4 @@ RUN mv /deps/basic_router /usr/sbin/basic_router
COPY ["start.sh", "/usr/bin/"]
COPY ["supervisord.conf", "/etc/supervisor/conf.d/"]

ENTRYPOINT ["/usr/bin/supervisord"]
ENTRYPOINT ["supervisord"]
4 changes: 2 additions & 2 deletions dockers/docker-database/docker-database-init.sh
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ if [[ $DATABASE_TYPE == "chassisdb" ]]; then
# generate all redis server supervisord configuration file
sonic-cfggen -j $db_cfg_file_tmp -t /usr/share/sonic/templates/supervisord.conf.j2 > /etc/supervisor/conf.d/supervisord.conf
rm $db_cfg_file_tmp
exec /usr/bin/supervisord
exec supervisord
exit 0
fi

Expand All @@ -79,4 +79,4 @@ else
fi
rm $db_cfg_file_tmp

exec /usr/bin/supervisord
exec supervisord
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ logfile_backups=2
nodaemon=true

[eventlistener:dependent-startup]
command=python -m supervisord_dependent_startup
command=python3 -m supervisord_dependent_startup
autostart=true
autorestart=unexpected
startretries=0
Expand Down
2 changes: 1 addition & 1 deletion dockers/docker-dhcp-relay/docker_init.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,4 @@ chmod +x /usr/bin/wait_for_intf.sh
# The docker container should start this script as PID 1, so now that supervisord is
# properly configured, we exec supervisord so that it runs as PID 1 for the
# duration of the container's lifetime
exec /usr/bin/supervisord
exec supervisord
2 changes: 1 addition & 1 deletion dockers/docker-fpm-frr/docker_init.sh
Original file line number Diff line number Diff line change
Expand Up @@ -66,4 +66,4 @@ chmod 0755 /usr/sbin/bgp-unisolate
mkdir -p /var/sonic
echo "# Config files managed by sonic-config-engine" > /var/sonic/config_status

exec /usr/bin/supervisord
exec supervisord
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ logfile_backups=2
nodaemon=true

[eventlistener:dependent-startup]
command=python -m supervisord_dependent_startup
command=python3 -m supervisord_dependent_startup
autostart=true
autorestart=unexpected
startretries=0
Expand Down
2 changes: 1 addition & 1 deletion dockers/docker-fpm-gobgp/Dockerfile.j2
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,4 @@ COPY ["daemons", "/etc/quagga/"]
COPY ["files/supervisor-proc-exit-listener", "/usr/bin"]
COPY ["critical_processes", "/etc/supervisor"]

ENTRYPOINT ["/usr/bin/supervisord"]
ENTRYPOINT ["supervisord"]
2 changes: 1 addition & 1 deletion dockers/docker-fpm-quagga/Dockerfile.j2
Original file line number Diff line number Diff line change
Expand Up @@ -36,4 +36,4 @@ COPY ["*.j2", "/usr/share/sonic/templates/"]
COPY ["files/supervisor-proc-exit-listener", "/usr/bin"]
COPY ["critical_processes", "/etc/supervisor"]

ENTRYPOINT ["/usr/bin/supervisord"]
ENTRYPOINT ["supervisord"]
2 changes: 1 addition & 1 deletion dockers/docker-iccpd/Dockerfile.j2
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,4 @@ RUN apt-get clean -y && \
apt-get autoremove -y && \
rm -rf /debs

ENTRYPOINT ["/usr/bin/supervisord"]
ENTRYPOINT ["supervisord"]
2 changes: 1 addition & 1 deletion dockers/docker-iccpd/supervisord.conf
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ logfile_backups=2
nodaemon=true

[eventlistener:dependent-startup]
command=python -m supervisord_dependent_startup
command=python3 -m supervisord_dependent_startup
autostart=true
autorestart=unexpected
startretries=0
Expand Down
2 changes: 1 addition & 1 deletion dockers/docker-lldp/docker-lldp-init.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
#Generate supervisord.conf based on device metadata
mkdir -p /etc/supervisor/conf.d/
sonic-cfggen -d -t /usr/share/sonic/templates/supervisord.conf.j2 > /etc/supervisor/conf.d/supervisord.conf
exec /usr/bin/supervisord
exec supervisord
2 changes: 1 addition & 1 deletion dockers/docker-lldp/supervisord.conf.j2
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ logfile_backups=2
nodaemon=true

[eventlistener:dependent-startup]
command=python -m supervisord_dependent_startup
command=python3 -m supervisord_dependent_startup
autostart=true
autorestart=unexpected
startretries=0
Expand Down
3 changes: 1 addition & 2 deletions dockers/docker-nat/Dockerfile.j2
Original file line number Diff line number Diff line change
Expand Up @@ -35,5 +35,4 @@ COPY ["critical_processes", "/etc/supervisor"]
RUN apt-get clean -y; apt-get autoclean -y; apt-get autoremove -y
RUN rm -rf /debs

ENTRYPOINT ["/usr/bin/supervisord"]

ENTRYPOINT ["supervisord"]
2 changes: 1 addition & 1 deletion dockers/docker-nat/supervisord.conf
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ logfile_backups=2
nodaemon=true

[eventlistener:dependent-startup]
command=python -m supervisord_dependent_startup
command=python3 -m supervisord_dependent_startup
autostart=true
autorestart=unexpected
startretries=0
Expand Down
2 changes: 1 addition & 1 deletion dockers/docker-orchagent/docker-init.sh
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,4 @@ if [ "$VLAN" != "" ]; then
cp /usr/share/sonic/templates/ndppd.conf /etc/supervisor/conf.d/
fi

exec /usr/bin/supervisord
exec supervisord
2 changes: 1 addition & 1 deletion dockers/docker-orchagent/supervisord.conf
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ logfile_backups=2
nodaemon=true

[eventlistener:dependent-startup]
command=python -m supervisord_dependent_startup
command=python3 -m supervisord_dependent_startup
autostart=true
autorestart=unexpected
startretries=0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ logfile_backups=2
nodaemon=true

[eventlistener:dependent-startup]
command=python -m supervisord_dependent_startup
command=python3 -m supervisord_dependent_startup
autostart=true
autorestart=unexpected
startretries=0
Expand Down
2 changes: 1 addition & 1 deletion dockers/docker-platform-monitor/docker_init.sh
Original file line number Diff line number Diff line change
Expand Up @@ -40,4 +40,4 @@ if [ $HAVE_FANCONTROL_CONF -eq 1 ]; then
/bin/cp -f $FANCONTROL_CONF_FILE /etc/
fi

exec /usr/bin/supervisord
exec supervisord
2 changes: 1 addition & 1 deletion dockers/docker-router-advertiser/docker-init.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@ sonic-cfggen $CFGGEN_PARAMS

chmod +x /usr/bin/wait_for_link.sh

exec /usr/bin/supervisord
exec supervisord
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ logfile_backups=2
nodaemon=true

[eventlistener:dependent-startup]
command=python -m supervisord_dependent_startup
command=python3 -m supervisord_dependent_startup
autostart=true
autorestart=unexpected
startretries=0
Expand Down
2 changes: 1 addition & 1 deletion dockers/docker-sflow/Dockerfile.j2
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,4 @@ COPY ["files/supervisor-proc-exit-listener", "/usr/bin"]
COPY ["critical_processes", "/etc/supervisor"]
COPY ["port_index_mapper.py", "/usr/bin"]

ENTRYPOINT ["/usr/bin/supervisord"]
ENTRYPOINT ["supervisord"]
2 changes: 1 addition & 1 deletion dockers/docker-sflow/supervisord.conf
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ logfile_backups=2
nodaemon=true

[eventlistener:dependent-startup]
command=python -m supervisord_dependent_startup
command=python3 -m supervisord_dependent_startup
autostart=true
autorestart=unexpected
startretries=0
Expand Down
2 changes: 1 addition & 1 deletion dockers/docker-snmp/Dockerfile.j2
Original file line number Diff line number Diff line change
Expand Up @@ -76,4 +76,4 @@ COPY ["critical_processes", "/etc/supervisor"]
# Although exposing ports is not needed for host net mode, keep it for possible bridge mode
EXPOSE 161/udp 162/udp

ENTRYPOINT ["/usr/bin/supervisord"]
ENTRYPOINT ["supervisord"]
2 changes: 1 addition & 1 deletion dockers/docker-snmp/supervisord.conf
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ logfile_backups=2
nodaemon=true

[eventlistener:dependent-startup]
command=python -m supervisord_dependent_startup
command=python3 -m supervisord_dependent_startup
autostart=true
autorestart=unexpected
startretries=0
Expand Down
2 changes: 1 addition & 1 deletion dockers/docker-sonic-mgmt-framework/Dockerfile.j2
Original file line number Diff line number Diff line change
Expand Up @@ -36,4 +36,4 @@ RUN apt-get remove -y g++ python-dev
RUN apt-get clean -y; apt-get autoclean -y; apt-get autoremove -y
RUN rm -rf /debs

ENTRYPOINT ["/usr/bin/supervisord"]
ENTRYPOINT ["supervisord"]
2 changes: 1 addition & 1 deletion dockers/docker-sonic-mgmt-framework/supervisord.conf
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ logfile_backups=2
nodaemon=true

[eventlistener:dependent-startup]
command=python -m supervisord_dependent_startup
command=python3 -m supervisord_dependent_startup
autostart=true
autorestart=unexpected
startretries=0
Expand Down
2 changes: 1 addition & 1 deletion dockers/docker-sonic-restapi/Dockerfile.j2
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,4 @@ COPY ["supervisord.conf", "/etc/supervisor/conf.d/"]
COPY ["files/supervisor-proc-exit-listener", "/usr/bin"]
COPY ["critical_processes", "/etc/supervisor"]

ENTRYPOINT ["/usr/bin/supervisord"]
ENTRYPOINT ["supervisord"]
2 changes: 1 addition & 1 deletion dockers/docker-sonic-restapi/supervisord.conf
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ logfile_backups=2
nodaemon=true

[eventlistener:dependent-startup]
command=python -m supervisord_dependent_startup
command=python3 -m supervisord_dependent_startup
autostart=true
autorestart=unexpected
startretries=0
Expand Down
2 changes: 1 addition & 1 deletion dockers/docker-sonic-telemetry/Dockerfile.j2
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,4 @@ COPY ["supervisord.conf", "/etc/supervisor/conf.d/"]
COPY ["files/supervisor-proc-exit-listener", "/usr/bin"]
COPY ["critical_processes", "/etc/supervisor"]

ENTRYPOINT ["/usr/bin/supervisord"]
ENTRYPOINT ["supervisord"]
2 changes: 1 addition & 1 deletion dockers/docker-sonic-telemetry/supervisord.conf
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ logfile_backups=2
nodaemon=true

[eventlistener:dependent-startup]
command=python -m supervisord_dependent_startup
command=python3 -m supervisord_dependent_startup
autostart=true
autorestart=unexpected
startretries=0
Expand Down
2 changes: 1 addition & 1 deletion dockers/docker-teamd/Dockerfile.j2
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,4 @@ COPY ["supervisord.conf", "/etc/supervisor/conf.d/"]
COPY ["files/supervisor-proc-exit-listener", "/usr/bin"]
COPY ["critical_processes", "/etc/supervisor"]

ENTRYPOINT ["/usr/bin/supervisord"]
ENTRYPOINT ["supervisord"]
2 changes: 1 addition & 1 deletion dockers/docker-teamd/supervisord.conf
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ logfile_backups=2
nodaemon=true

[eventlistener:dependent-startup]
command=python -m supervisord_dependent_startup
command=python3 -m supervisord_dependent_startup
autostart=true
autorestart=unexpected
startretries=0
Expand Down
Loading