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

[dockers]: Upgrade LLDP docker to stretch build #2633

Merged
merged 3 commits into from
Apr 17, 2019
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions dockers/docker-lldp-sv2/Dockerfile.j2
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM docker-config-engine
FROM docker-config-engine-stretch

ARG docker_container_name
RUN [ -f /etc/rsyslog.conf ] && sed -ri "s/%syslogtag%/$docker_container_name#%syslogtag%/;" /etc/rsyslog.conf
Expand All @@ -10,7 +10,7 @@ ENV DEBIAN_FRONTEND=noninteractive
RUN apt-get update

# Install dependencies
RUN apt-get install -y python-pip libbsd0 libevent-2.0-5 libjansson4 libwrap0 libxml2 libpci3 libperl5.20 libpython2.7
RUN apt-get install -y adduser init-system-helpers libbsd0 libevent-2.0-5 libjansson4 libsensors4 libwrap0 libxml2 libpci3 python-pip lsb-base libpython2.7
samaity marked this conversation as resolved.
Show resolved Hide resolved

{% if docker_lldp_sv2_debs.strip() -%}
# Copy locally-built Debian package dependencies
Expand Down
3 changes: 2 additions & 1 deletion rules/docker-lldp-sv2.mk
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,10 @@ DOCKER_LLDP_SV2 = docker-lldp-sv2.gz
$(DOCKER_LLDP_SV2)_PATH = $(DOCKERS_PATH)/docker-lldp-sv2
$(DOCKER_LLDP_SV2)_DEPENDS += $(LLDPD) $(LIBSWSSCOMMON) $(PYTHON_SWSSCOMMON)
$(DOCKER_LLDP_SV2)_PYTHON_WHEELS += $(DBSYNCD_PY2)
$(DOCKER_LLDP_SV2)_LOAD_DOCKERS += $(DOCKER_CONFIG_ENGINE)
$(DOCKER_LLDP_SV2)_LOAD_DOCKERS += $(DOCKER_CONFIG_ENGINE_STRETCH)
SONIC_DOCKER_IMAGES += $(DOCKER_LLDP_SV2)
SONIC_INSTALL_DOCKER_IMAGES += $(DOCKER_LLDP_SV2)
SONIC_STRETCH_DOCKERS += $(DOCKER_LLDP_SV2)

$(DOCKER_LLDP_SV2)_CONTAINER_NAME = lldp
$(DOCKER_LLDP_SV2)_RUN_OPT += --net=host --privileged -t
Expand Down
7 changes: 5 additions & 2 deletions rules/lldpd.mk
Original file line number Diff line number Diff line change
@@ -1,17 +1,20 @@
# lldpd package

LLDPD_VERSION = 0.9.6
LLDPD_VERSION_SUFFIX = 1
LLDPD_VERSION_FULL = $(LLDPD_VERSION)-$(LLDPD_VERSION_SUFFIX)

LLDPD = lldpd_$(LLDPD_VERSION)-0_amd64.deb
LLDPD = lldpd_$(LLDPD_VERSION_FULL)_amd64.deb
$(LLDPD)_DEPENDS += $(LIBSNMP_DEV)
$(LLDPD)_RDEPENDS += $(LIBSNMP)
$(LLDPD)_SRC_PATH = $(SRC_PATH)/lldpd
SONIC_MAKE_DEBS += $(LLDPD)

LIBLLDPCTL = liblldpctl-dev_$(LLDPD_VERSION)-0_amd64.deb
LIBLLDPCTL = liblldpctl-dev_$(LLDPD_VERSION_FULL)_amd64.deb
$(eval $(call add_derived_package,$(LLDPD),$(LIBLLDPCTL)))

# Export these variables so they can be used in a sub-make
export LLDPD_VERSION
export LLDPD_VERSION_FULL
export LLDPD
export LIBLLDPCTL
9 changes: 9 additions & 0 deletions sonic-slave-stretch/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,12 @@ RUN apt-get update && apt-get install -y \
libsensors4 \
libsensors4-dev \
libwrap0-dev \
# For lldpd
debhelper \
autotools-dev \
libbsd-dev \
pkg-config \
check \
# For mpdecimal
docutils-common \
libjs-sphinxdoc \
Expand Down Expand Up @@ -240,6 +246,9 @@ RUN pip install j2cli
# For sonic utilities testing
RUN pip install click-default-group click natsort tabulate netifaces==0.10.7 fastentrypoints

# For sonic snmpagent mock testing
RUN pip3 install mockredispy==2.9.3

# For supervisor build
RUN pip install meld3 mock

Expand Down
26 changes: 19 additions & 7 deletions src/lldpd/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,30 @@ SHELL = /bin/bash
MAIN_TARGET = $(LLDPD)
DERIVED_TARGETS = $(LIBLLDPCTL)

LLDP_URL = http://ftp.debian.org/debian/pool/main/l/lldpd

DSC_FILE = lldpd_$(LLDPD_VERSION_FULL).dsc
ORIG_FILE = lldpd_$(LLDPD_VERSION).orig.tar.gz
DEBIAN_FILE = lldpd_$(LLDPD_VERSION_FULL).debian.tar.xz

DSC_FILE_URL = $(LLDP_URL)/$(DSC_FILE)
ORIG_FILE_URL = $(LLDP_URL)/$(ORIG_FILE)
DEBIAN_FILE_URL = $(LLDP_URL)/$(DEBIAN_FILE)

$(addprefix $(DEST)/, $(MAIN_TARGET)): $(DEST)/% :
# Remove any stale files
rm -rf ./lldpd

# Clone lldpd repo
git clone https://github.com/vincentbernat/lldpd.git
pushd ./lldpd
# download debian LLDPDD
wget -NO "$(DSC_FILE)" $(DSC_FILE_URL)
wget -NO "$(ORIG_FILE)" $(ORIG_FILE_URL)
wget -NO "$(DEBIAN_FILE)" $(DEBIAN_FILE_URL)
dpkg-source -x lldpd_$(LLDPD_VERSION_FULL).dsc

# Reset HEAD to the commit of the proper tag
# NOTE: Using "git checkout <tag_name>" here detaches our HEAD,
# which stg doesn't like, so we use this method instead
git reset --hard $(LLDPD_VERSION)
pushd lldpd-$(LLDPD_VERSION)
git init
git add -f *
git commit -m "unmodified lldp source"

# Apply patches
stg init
Expand Down