-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
SNMP/LLDP Containers: Sonic V2 Support
* Adding support for V2 in SNMP/LLDP (-sv2 postfix) * Fixes for V1 containers: logging * Fixes for V1 LLDP: limit LLDP to Front-panel or MGMT interfaces.
- Loading branch information
thomasbo
committed
Oct 26, 2016
1 parent
293db92
commit 95c1636
Showing
8 changed files
with
128 additions
and
23 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
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 | ||
|
||
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,19 @@ | ||
[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:lldp-syncd] | ||
command=/usr/bin/env python2 -m lldp_syncd | ||
priority=200 | ||
|
||
[program:rsyslogd] | ||
command=/usr/sbin/rsyslogd -n | ||
priority=1 |
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 |
---|---|---|
@@ -0,0 +1,46 @@ | ||
FROM docker-base | ||
|
||
COPY deps/snmp_*.deb deps/snmpd_*.deb deps/libsnmp-base_*.deb deps/libsnmp30_*.deb /deps/ | ||
COPY deps/python3/*.whl /python3/ | ||
|
||
# enable -O for all Python calls | ||
ENV PYTHONOPTIMIZE 1 | ||
|
||
## Pre-install the fundamental packages | ||
## Install Python SSWSDK (SNMP subagent dependency) | ||
## Install SNMP subagent | ||
## 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/libsnmp-base_*.deb && \ | ||
dpkg_apt /deps/libsnmp30_*.deb && \ | ||
dpkg_apt /deps/snmp_*.deb && \ | ||
dpkg_apt /deps/snmpd_*.deb && \ | ||
rm -rf /deps | ||
|
||
# install subagent | ||
RUN apt-get -y install build-essential wget libssl-dev openssl supervisor && \ | ||
rm -rf /var/lib/apt/lists/* && \ | ||
wget https://www.python.org/ftp/python/3.5.2/Python-3.5.2.tgz && \ | ||
tar xvf Python-3.5.2.tgz && cd Python-3.5.2 && \ | ||
./configure --without-doc-strings --prefix=/usr --without-pymalloc --enable-shared && \ | ||
make && make install && \ | ||
ldconfig && \ | ||
cd .. && rm -rf Python-3.5.2 && rm Python-3.5.2.tgz && \ | ||
pip3 install --no-cache-dir /python3/*py3*.whl hiredis && \ | ||
rm -rf /python3 && \ | ||
python3 -m sonic_ax_impl install && \ | ||
python3 -m pip uninstall -y pip setuptools && \ | ||
/bin/bash -c "rm -rf /usr/lib/python3.5/{unittest,lib2to3,tkinter,idlelib,email,test}" && \ | ||
apt-get -y purge build-essential wget libssl-dev openssl && \ | ||
apt-get clean -y && apt-get autoclean -y && apt-get autoremove -y && \ | ||
find / | grep -E "__pycache__" | xargs rm -rf && \ | ||
rm -rf ~/.cache | ||
|
||
COPY supervisord.conf /etc/supervisor/conf.d/supervisord.conf | ||
|
||
## Although exposing ports is not need for host net mode, keep it for possible bridge mode | ||
EXPOSE 161/udp 162/udp | ||
|
||
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,14 @@ | ||
[supervisord] | ||
nodaemon=true | ||
|
||
[program:snmpd] | ||
command=/usr/sbin/snmpd -f -LS4d -u Debian-snmp -g Debian-snmp -I -smux,mteTrigger,mteTriggerConf,ifTable,ifXTable -p /run/snmpd.pid | ||
priority=100 | ||
|
||
[program:snmp-subagent] | ||
command=/usr/bin/env python3 -m sonic_ax_impl | ||
priority=200 | ||
|
||
[program:rsyslogd] | ||
command=/usr/sbin/rsyslogd -n | ||
priority=1 |
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