-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
PR 92604: Sync repo: Github/master -> master
- SNMP/LLDP Containers: Sonic V2 Support (#41) - start.sh: Remove rsyslogd.pid file on mlnx syncd docker (#35) - check the existence of platforms/ before including it (#37) - build mft-kernel binary debian package (#36) - Apply swss configuration in a deterministic way (#39) - Dockerfile: Add libsaimetadata dependency (#42) - Dockerfile: Add bridge-utils to p4 docker (#43) - Add docker configuration for saiserver-brcm (#44) - Modification to saiserver-brcm/Dockerfile (#45) - Update get_docker-base.sh ...
- Loading branch information
Showing
44 changed files
with
561 additions
and
158 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,19 @@ | ||
FROM docker-base | ||
|
||
## Pre-install the fundamental packages | ||
COPY ["deps/redis-tools_*.deb", "deps/redis-server_*.deb", "/deps/"] | ||
|
||
## Install packages | ||
## Clean up | ||
RUN apt-get -y install \ | ||
redis-server \ | ||
&& \ | ||
RUN apt-get update && \ | ||
dpkg_apt() { [ -f $1 ] && { dpkg -i $1 || apt-get -y install -f; } || return 1; }; \ | ||
dpkg_apt /deps/redis-tools_*.deb && \ | ||
dpkg_apt /deps/redis-server_*.deb && \ | ||
apt-get clean -y && apt-get autoclean -y && apt-get autoremove -y | ||
|
||
RUN sed -ri 's/^daemonize yes$/daemonize no/' /etc/redis/redis.conf \ | ||
&& sed -ri 's/^logfile .*$/logfile ""/' /etc/redis/redis.conf \ | ||
&& sed -ri 's/^# syslog-enabled no$/syslog-enabled no/' /etc/redis/redis.conf | ||
RUN sed -ri 's/^daemonize yes$/daemonize no/; \ | ||
s/^logfile .*$/logfile ""/; \ | ||
s/^# syslog-enabled no$/syslog-enabled no/; \ | ||
s/^# unixsocket/unixsocket/ \ | ||
' /etc/redis/redis.conf | ||
|
||
ENTRYPOINT service redis-server start |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
FROM docker-base | ||
|
||
COPY deps/sswsdk*.whl deps/sonic_d*.whl deps/lldpsyncd_*.deb deps/lldpd_*.deb /deps/ | ||
|
||
## Pre-install the fundamental packages | ||
## Install Python SSWSDK (lldpsyncd dependency) | ||
## Install LLDP Sync Daemon | ||
## Note: dpkg_apt function has the benefit to detect missing .deb file | ||
## Clean up | ||
RUN apt-get update && \ | ||
dpkg_apt() { [ -f $1 ] && { dpkg -i $1 || apt-get -y install -f; } || return 1; } && \ | ||
dpkg_apt /deps/lldpd_*.deb && \ | ||
apt-get install -y python-pip supervisor && \ | ||
pip install /deps/sswsdk*.whl && \ | ||
pip install /deps/sonic_d*.whl && \ | ||
apt-get remove -y python-pip && \ | ||
apt-get purge -y && apt-get autoclean -y && apt-get autoremove -y && \ | ||
rm -rf /deps ~/.cache | ||
|
||
COPY supervisord.conf /etc/supervisor/conf.d/supervisord.conf | ||
COPY reconfigure.sh /opt/reconfigure.sh | ||
|
||
ENTRYPOINT ["/usr/bin/supervisord"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
#!/bin/bash | ||
|
||
set -e | ||
|
||
num_of_interfaces=32 | ||
if_step=4 | ||
last_if_idx=$((num_of_interfaces*if_step - if_step)) | ||
|
||
function wait_until_if_exists | ||
{ | ||
if=$1 | ||
while [ ! -L /sys/class/net/"$if" ] ; | ||
do | ||
sleep 1 | ||
done | ||
echo interface "$if" is created | ||
} | ||
|
||
|
||
function wait_until_if_not_exists | ||
{ | ||
if=$1 | ||
while [ -L /sys/class/net/"$if" ] ; | ||
do | ||
sleep 1 | ||
done | ||
echo interface "$if" is destroyed | ||
} | ||
|
||
|
||
while /bin/true ; | ||
do | ||
# wait until all interfaces are created | ||
echo Wait until all ifaces are created | ||
for i in $(seq 0 $if_step $last_if_idx) | ||
do | ||
wait_until_if_exists "Ethernet$i" | ||
done | ||
|
||
echo Wait 10 seconds while lldpd finds new interfaces | ||
sleep 10 | ||
|
||
# apply lldpd configuration | ||
echo apply lldpd configuration | ||
lldpcli -c /etc/lldpd.conf | ||
|
||
# wait until all interfaces are destroyed | ||
echo Wait until all ifaces are destroyed | ||
for i in $(seq 0 $if_step $last_if_idx) | ||
do | ||
wait_until_if_not_exists "Ethernet$i" | ||
done | ||
done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
[supervisord] | ||
nodaemon=true | ||
|
||
[program:lldpd] | ||
# https://github.com/vincentbernat/lldpd/commit/9856f2792c301116cc4a3fcfba91b9672ee5db1f | ||
# - `-d` means to stay in foreground, log to syslog | ||
# - `-dd` means to stay in foreground, log warnings to console | ||
# - `-ddd` means to stay in foreground, log warnings and info to console | ||
# - `-dddd` means to stay in foreground, log all to console | ||
command=/usr/sbin/lldpd -d -I Ethernet*,eth* | ||
priority=100 | ||
|
||
[program:lldpd-conf-reload] | ||
command=/opt/reconfigure.sh | ||
priority=150 | ||
|
||
[program:lldp-syncd] | ||
command=/usr/bin/env python2 -m lldp_syncd | ||
priority=200 | ||
|
||
[program:rsyslogd] | ||
command=/usr/sbin/rsyslogd -n | ||
priority=1 |
Oops, something went wrong.