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

[swss]: Convert swss docker to bullseye #10484

Merged
merged 9 commits into from
May 17, 2022
13 changes: 3 additions & 10 deletions dockers/docker-orchagent/Dockerfile.j2
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{% from "dockers/dockerfile-macros.j2" import install_debian_packages, install_python_wheels, copy_files %}
FROM docker-swss-layer-buster-{{DOCKER_USERNAME}}:{{DOCKER_USERTAG}}
FROM docker-swss-layer-bullseye-{{DOCKER_USERNAME}}:{{DOCKER_USERTAG}}

ARG docker_container_name
RUN [ -f /etc/rsyslog.conf ] && sed -ri "s/%syslogtag%/$docker_container_name#%syslogtag%/;" /etc/rsyslog.conf
Expand All @@ -26,17 +26,10 @@ RUN apt-get update && \

{% if ( CONFIGURED_ARCH == "armhf" or CONFIGURED_ARCH == "arm64" ) %}
# Fix for gcc/python/iputils-ping not found in arm docker
RUN apt-get install -f -y python2.7 python2.7-dev
RUN apt-get install -y \
gcc-8 \
gcc \
iputils-ping
{% endif %}
{% if CONFIGURED_ARCH == "armhf" %}
RUN ln -s -f /usr/bin/gcc-8 /usr/bin/arm-linux-gnueabihf-gcc
{% endif %}
{% if CONFIGURED_ARCH == "arm64" %}
RUN ln -s -f /usr/bin/gcc-8 /usr/bin/aarch64-linux-gnu-gcc
{% endif %}

# Dependencies of restore_neighbors.py
RUN pip3 install \
Expand All @@ -45,7 +38,7 @@ RUN pip3 install \

{% if ( CONFIGURED_ARCH == "armhf" or CONFIGURED_ARCH == "arm64" ) %}
# Remove installed gcc
RUN apt-get remove -y gcc-8
RUN apt-get remove -y gcc
{% endif %}

{% if docker_orchagent_debs.strip() -%}
Expand Down
22 changes: 22 additions & 0 deletions dockers/docker-swss-layer-bullseye/Dockerfile.j2
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{% from "dockers/dockerfile-macros.j2" import install_debian_packages, install_python_wheels, copy_files %}
FROM docker-config-engine-bullseye-{{DOCKER_USERNAME}}:{{DOCKER_USERTAG}}

## Make apt-get non-interactive
ENV DEBIAN_FRONTEND=noninteractive

RUN apt-get update

{% if docker_swss_layer_bullseye_debs.strip() -%}
theasianpianist marked this conversation as resolved.
Show resolved Hide resolved
# Copy locally-built Debian package dependencies
{{ copy_files("debs/", docker_swss_layer_bullseye_debs.split(' '), "/debs/") }}

# Install locally-built Debian packages and implicitly install their dependencies
{{ install_debian_packages(docker_swss_layer_bullseye_debs.split(' ')) }}
{%- endif %}

RUN apt-get clean -y && \
apt-get autoclean -y && \
apt-get autoremove -y && \
rm -rf /debs

ENTRYPOINT ["/usr/local/bin/supervisord"]
9 changes: 3 additions & 6 deletions rules/docker-orchagent.mk
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,17 @@ DOCKER_ORCHAGENT_DBG = $(DOCKER_ORCHAGENT_STEM)-$(DBG_IMAGE_MARK).gz

$(DOCKER_ORCHAGENT)_DEPENDS += $(SWSS)

$(DOCKER_ORCHAGENT)_DBG_DEPENDS = $($(DOCKER_SWSS_LAYER_BUSTER)_DBG_DEPENDS)
$(DOCKER_ORCHAGENT)_DBG_DEPENDS = $($(DOCKER_SWSS_LAYER_BULLSEYE)_DBG_DEPENDS)
$(DOCKER_ORCHAGENT)_DBG_DEPENDS += $(SWSS_DBG) \
$(LIBSWSSCOMMON_DBG) \
$(LIBSAIREDIS_DBG)
$(DOCKER_ORCHAGENT)_PYTHON_WHEELS += $(SCAPY)

$(DOCKER_ORCHAGENT)_DBG_IMAGE_PACKAGES = $($(DOCKER_SWSS_LAYER_BUSTER)_DBG_IMAGE_PACKAGES)
$(DOCKER_ORCHAGENT)_DBG_IMAGE_PACKAGES = $($(DOCKER_SWSS_LAYER_BULLSEYE)_DBG_IMAGE_PACKAGES)

$(DOCKER_ORCHAGENT)_PATH = $(DOCKERS_PATH)/$(DOCKER_ORCHAGENT_STEM)

$(DOCKER_ORCHAGENT)_LOAD_DOCKERS += $(DOCKER_SWSS_LAYER_BUSTER)
$(DOCKER_ORCHAGENT)_LOAD_DOCKERS += $(DOCKER_SWSS_LAYER_BULLSEYE)

$(DOCKER_ORCHAGENT)_VERSION = 1.0.0
$(DOCKER_ORCHAGENT)_PACKAGE_NAME = swss
Expand All @@ -39,6 +39,3 @@ $(DOCKER_ORCHAGENT)_RUN_OPT += -v /var/log/swss:/var/log/swss:rw

$(DOCKER_ORCHAGENT)_BASE_IMAGE_FILES += swssloglevel:/usr/bin/swssloglevel
$(DOCKER_ORCHAGENT)_FILES += $(ARP_UPDATE_SCRIPT) $(ARP_UPDATE_VARS_TEMPLATE) $(SUPERVISOR_PROC_EXIT_LISTENER_SCRIPT)

SONIC_BUSTER_DOCKERS += $(DOCKER_ORCHAGENT)
SONIC_BUSTER_DBG_DOCKERS += $(DOCKER_ORCHAGENT_DBG)
9 changes: 9 additions & 0 deletions rules/docker-swss-layer-bullseye.dep
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@

DPATH := $($(DOCKER_SWSS_LAYER_BULLSEYE)_PATH)
DEP_FILES := $(SONIC_COMMON_FILES_LIST) rules/docker-swss-layer-bullseye.mk rules/docker-swss-layer-bullseye.dep
DEP_FILES += $(SONIC_COMMON_BASE_FILES_LIST)
DEP_FILES += $(shell git ls-files $(DPATH))

$(DOCKER_SWSS_LAYER_BULLSEYE)_CACHE_MODE := GIT_CONTENT_SHA
$(DOCKER_SWSS_LAYER_BULLSEYE)_DEP_FLAGS := $(SONIC_COMMON_FLAGS_LIST)
$(DOCKER_SWSS_LAYER_BULLSEYE)_DEP_FILES := $(DEP_FILES)
14 changes: 14 additions & 0 deletions rules/docker-swss-layer-bullseye.mk
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# bullseye-based docker image for sonic swss layer

DOCKER_SWSS_LAYER_BULLSEYE= docker-swss-layer-bullseye.gz
$(DOCKER_SWSS_LAYER_BULLSEYE)_PATH = $(DOCKERS_PATH)/docker-swss-layer-bullseye

$(DOCKER_SWSS_LAYER_BULLSEYE)_DEPENDS += $(SWSS)
$(DOCKER_SWSS_LAYER_BULLSEYE)_LOAD_DOCKERS += $(DOCKER_CONFIG_ENGINE_BULLSEYE)

$(DOCKER_SWSS_LAYER_BULLSEYE)_DBG_DEPENDS = $($(DOCKER_CONFIG_ENGINE_BULLSEYE)_DBG_DEPENDS) \
$(SWSS)
$(DOCKER_SWSS_LAYER_BULLSEYE)_DBG_IMAGE_PACKAGES = $($(DOCKER_CONFIG_ENGINE_BULLSEYE)_DBG_IMAGE_PACKAGES)

SONIC_DOCKER_IMAGES += $(DOCKER_SWSS_LAYER_BULLSEYE)
SONIC_BULLSEYE_DOCKERS += $(DOCKER_SWSS_LAYER_BULLSEYE)