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

[Mellanox] Upgrade syncd, syncd-rpc and saiserver to bookworm #18651

Merged
merged 13 commits into from
Apr 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
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 platform/mellanox/docker-saiserver-mlnx.mk
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@ DOCKER_SAISERVER_MLNX = docker-saiserver$(SAITHRIFT_VER)-mlnx.gz
$(DOCKER_SAISERVER_MLNX)_PATH = $(PLATFORM_PATH)/docker-saiserver-mlnx
$(DOCKER_SAISERVER_MLNX)_DEPENDS += $(SAISERVER) $(PYTHON_SDK_API)
$(DOCKER_SAISERVER_MLNX)_PYTHON_DEBS += $(MLNX_SFPD)
$(DOCKER_SAISERVER_MLNX)_LOAD_DOCKERS += $(DOCKER_CONFIG_ENGINE_BULLSEYE)
$(DOCKER_SAISERVER_MLNX)_LOAD_DOCKERS += $(DOCKER_CONFIG_ENGINE_BOOKWORM)
SONIC_DOCKER_IMAGES += $(DOCKER_SAISERVER_MLNX)
$(DOCKER_SAISERVER_MLNX)_CONTAINER_NAME = saiserver$(SAITHRIFT_VER)
SONIC_BULLSEYE_DOCKERS += $(DOCKER_SAISERVER_MLNX)
SONIC_BOOKWORM_DOCKERS += $(DOCKER_SAISERVER_MLNX)

$(DOCKER_SAISERVER_MLNX)_RUN_OPT += --privileged -t
$(DOCKER_SAISERVER_MLNX)_RUN_OPT += -v /host/machine.conf:/etc/machine.conf
Expand Down
4 changes: 2 additions & 2 deletions platform/mellanox/docker-saiserver-mlnx/Dockerfile.j2
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
## limitations under the License.
##
{% from "dockers/dockerfile-macros.j2" import install_debian_packages %}
FROM docker-config-engine-bullseye-{{DOCKER_USERNAME}}:{{DOCKER_USERTAG}}
FROM docker-config-engine-bookworm-{{DOCKER_USERNAME}}:{{DOCKER_USERTAG}}

ARG docker_container_name

Expand All @@ -40,7 +40,7 @@ python-debs/{{ deb }}{{' '}}
{%- endfor -%}
debs/

RUN apt-get install -y --no-install-recommends libxml2 iptables libbsd0 protobuf-c-compiler protobuf-compiler python3-protobuf libprotobuf-c1 python3-future python3-ipaddr libnet1 pkg-config asciidoc xmlto
RUN apt-get install -y --no-install-recommends libxml2 iptables libbsd0 protobuf-c-compiler protobuf-compiler python3-protobuf libprotobuf-c1 python3-future libnet1 pkg-config asciidoc xmlto

{{ install_debian_packages(docker_saiserver_mlnx_debs.split(' ')) }}

Expand Down
5 changes: 3 additions & 2 deletions platform/mellanox/docker-syncd-mlnx-rpc.mk
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@

DOCKER_SYNCD_MLNX_RPC = docker-syncd-mlnx-rpc.gz
$(DOCKER_SYNCD_MLNX_RPC)_PATH = $(PLATFORM_PATH)/docker-syncd-mlnx-rpc
$(DOCKER_SYNCD_MLNX_RPC)_DEPENDS += $(SYNCD_RPC) $(LIBTHRIFT) $(PTF)
$(DOCKER_SYNCD_MLNX_RPC)_PYTHON_WHEELS += $(PTF_PY3)
$(DOCKER_SYNCD_MLNX_RPC)_DEPENDS += $(SYNCD_RPC)
$(DOCKER_SYNCD_MLNX_RPC)_FILES += $(SUPERVISOR_PROC_EXIT_LISTENER_SCRIPT)
ifeq ($(INSTALL_DEBUG_TOOLS), y)
$(DOCKER_SYNCD_MLNX_RPC)_DEPENDS += $(SYNCD_RPC_DBG) \
Expand All @@ -30,7 +31,7 @@ endif
$(DOCKER_SYNCD_MLNX_RPC)_PYTHON_DEBS += $(MLNX_SFPD)
$(DOCKER_SYNCD_MLNX_RPC)_LOAD_DOCKERS += $(DOCKER_SYNCD_BASE)
SONIC_DOCKER_IMAGES += $(DOCKER_SYNCD_MLNX_RPC)
SONIC_BULLSEYE_DOCKERS += $(DOCKER_SYNCD_MLNX_RPC)
SONIC_BOOKWORM_DOCKERS += $(DOCKER_SYNCD_MLNX_RPC)
ifeq ($(ENABLE_SYNCD_RPC),y)
SONIC_INSTALL_DOCKER_IMAGES += $(DOCKER_SYNCD_MLNX_RPC)
endif
Expand Down
40 changes: 22 additions & 18 deletions platform/mellanox/docker-syncd-mlnx-rpc/Dockerfile.j2
Original file line number Diff line number Diff line change
Expand Up @@ -39,15 +39,15 @@ RUN apt-get update \
python3-pip \
python3-dev \
python-is-python3 \
python3-setuptools
python3-scapy \
libnanomsg5 \
libnanomsg-dev \
libthrift-0.17.0 \
thrift-compiler \
python3-thrift

RUN pip3 install --upgrade pip

# Build and install python-scapy
RUN curl http://ftp.us.debian.org/debian/pool/main/s/scapy/python3-scapy_2.4.0-2_all.deb --output python3-scapy_2.4.0-2_all.deb \
&& dpkg -i python3-scapy_2.4.0-2_all.deb \
&& apt install -f

{% if docker_syncd_mlnx_rpc_debs.strip() -%}
# Copy locally-built Debian package dependencies
{{ copy_files("debs/", docker_syncd_mlnx_rpc_debs.split(' '), "/debs/") }}
Expand All @@ -68,29 +68,33 @@ RUN curl http://ftp.us.debian.org/debian/pool/main/s/scapy/python3-scapy_2.4.0-2
{{ install_debian_packages(docker_syncd_mlnx_rpc_pydebs.split(' ')) }}
{% endif %}

RUN wget https://github.com/nanomsg/nanomsg/archive/1.0.0.tar.gz \
&& tar xvfz 1.0.0.tar.gz \
&& cd nanomsg-1.0.0 \
&& mkdir -p build \
&& cmake . \
&& make install \
&& ldconfig \
&& cd .. \
&& rm -fr nanomsg-1.0.0 \
&& rm -f 1.0.0.tar.gz \
&& pip3 install cffi==1.16.0 \
RUN pip3 install cffi==1.16.0 \
&& pip3 install wheel \
&& pip3 install nnpy \
&& pip3 install ptf \
&& mkdir -p /opt \
&& cd /opt \
&& wget https://raw.githubusercontent.com/p4lang/ptf/master/ptf_nn/ptf_nn_agent.py \
&& apt-get clean -y; apt-get autoclean -y; apt-get autoremove -y \
&& rm -rf /root/deps

{% if docker_syncd_mlnx_rpc_whls.strip() -%}
# Copy locally-built Python wheel dependencies
{{ copy_files("python-wheels/", docker_syncd_mlnx_rpc_whls.split(' '), "/python-wheels/") }}
# Install locally-built Python wheel dependencies
{{ install_python_wheels(docker_syncd_mlnx_rpc_whls.split(' ')) }}
{% endif %}

COPY ["ptf_nn_agent.conf", "/etc/supervisor/conf.d/"]

## Clean up
RUN apt-get -y purge \
cmake \
libssl-dev \
libffi-dev \
python3-dev \
libthrift-dev \
build-essential

RUN apt-get clean -y && \
apt-get autoclean -y && \
apt-get autoremove -y && \
Expand Down
2 changes: 1 addition & 1 deletion platform/mellanox/docker-syncd-mlnx.mk
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
# docker image for mlnx syncd

DOCKER_SYNCD_PLATFORM_CODE = mlnx
include $(PLATFORM_PATH)/../template/docker-syncd-bullseye.mk
include $(PLATFORM_PATH)/../template/docker-syncd-bookworm.mk

$(DOCKER_SYNCD_BASE)_DEPENDS += $(SYNCD) $(PYTHON_SDK_API) $(MFT) $(MFT_FWTRACE_CFG) $(IPROUTE2_MLNX)

Expand Down
2 changes: 1 addition & 1 deletion platform/mellanox/docker-syncd-mlnx/Dockerfile.j2
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
## limitations under the License.
##
{% from "dockers/dockerfile-macros.j2" import install_debian_packages, install_python_wheels, copy_files %}
FROM docker-config-engine-bullseye-{{DOCKER_USERNAME}}:{{DOCKER_USERTAG}}
FROM docker-config-engine-bookworm-{{DOCKER_USERNAME}}:{{DOCKER_USERTAG}}

ARG docker_container_name

Expand Down
4 changes: 2 additions & 2 deletions platform/mellanox/iproute2.mk
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
# limitations under the License.
#

IPROUTE2_MLNX_VERSION = 5.10.0
IPROUTE2_MLNX_VERSION_FULL = $(IPROUTE2_MLNX_VERSION)-4~bpo10+1
IPROUTE2_MLNX_VERSION = 6.1.0
IPROUTE2_MLNX_VERSION_FULL = $(IPROUTE2_MLNX_VERSION)-3

export IPROUTE2_MLNX_VERSION
export IPROUTE2_MLNX_VERSION_FULL
Expand Down
Original file line number Diff line number Diff line change
@@ -1,16 +1,17 @@
From 28e58b34f1168de182c37eff640180b6064a800d Mon Sep 17 00:00:00 2001
From: liora <liora@nvidia.com>
Date: Tue, 18 Apr 2023 13:01:16 +0000
Subject: [PATCH 1/1] Remove arpd from iproute2 package
From 9b10f163354059a6b6cc2029ded5275f871f23e8 Mon Sep 17 00:00:00 2001
From: Vivek Reddy <vkarri@nvidia.com>
Date: Fri, 26 Jan 2024 06:54:14 +0000
Subject: [PATCH 1/2] Remove arpd from iproute2 package

Signed-off-by: Vivek Reddy <[email protected]>
---
debian/control | 3 +--
debian/iproute2.install | 1 -
misc/Makefile | 4 ----
3 files changed, 1 insertion(+), 7 deletions(-)

diff --git a/debian/control b/debian/control
index b5e8b0a..e735c26 100644
index f3a49a8..adc66c4 100644
--- a/debian/control
+++ b/debian/control
@@ -28,8 +28,7 @@ Build-Depends: bison,
Expand All @@ -24,16 +25,16 @@ index b5e8b0a..e735c26 100644
Depends: ${misc:Depends}, ${shlibs:Depends}, libcap2-bin,
Recommends: ${ipmods:Recommends}
diff --git a/debian/iproute2.install b/debian/iproute2.install
index f9e8c26..fba201d 100644
index f93b273..b017b44 100644
--- a/debian/iproute2.install
+++ b/debian/iproute2.install
@@ -1,6 +1,5 @@
etc/
usr/include/iproute2/
-sbin/arpd /usr/sbin
sbin/bridge
sbin/dcb
sbin/devlink
sbin/genl /usr/sbin
diff --git a/misc/Makefile b/misc/Makefile
index 50dae79..1f3898f 100644
--- a/misc/Makefile
Expand All @@ -50,5 +51,5 @@ index 50dae79..1f3898f 100644

ss: $(SSOBJ)
--
2.30.2
2.17.1

Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
From 6676c4a200df54a06c96faa9a30baaefc61a91b5 Mon Sep 17 00:00:00 2001
From: liora <liora@nvidia.com>
Date: Thu, 27 Apr 2023 03:34:10 +0000
Subject: [PATCH 1/1] Rename iproute2 debian package
From e21c49764de5efc4b53685815837a74de37538f3 Mon Sep 17 00:00:00 2001
From: Vivek Reddy <vkarri@nvidia.com>
Date: Fri, 26 Jan 2024 06:59:51 +0000
Subject: [PATCH 2/2] Rename iproute2 debian package

Signed-off-by: Vivek Reddy <[email protected]>
---
debian/control | 4 ++--
debian/{iproute2.install => iproute2-mlnx.install} | 0
Expand All @@ -11,7 +12,7 @@ Subject: [PATCH 1/1] Rename iproute2 debian package
rename debian/{iproute2.install => iproute2-mlnx.install} (100%)

diff --git a/debian/control b/debian/control
index e735c26..4b03a6f 100644
index adc66c4..0eb5988 100644
--- a/debian/control
+++ b/debian/control
@@ -25,11 +25,11 @@ Build-Depends: bison,
Expand All @@ -27,24 +28,24 @@ index e735c26..4b03a6f 100644
+Replaces: iproute, iproute2
Depends: ${misc:Depends}, ${shlibs:Depends}, libcap2-bin,
Recommends: ${ipmods:Recommends}
Suggests: iproute2-doc
Suggests: iproute2-doc, python3:any
diff --git a/debian/iproute2.install b/debian/iproute2-mlnx.install
similarity index 100%
rename from debian/iproute2.install
rename to debian/iproute2-mlnx.install
diff --git a/debian/rules b/debian/rules
index d940d3c..8bd4f84 100755
index 4c93c86..4489d2c 100755
--- a/debian/rules
+++ b/debian/rules
@@ -34,7 +34,7 @@ override_dh_clean:
@@ -33,7 +33,7 @@ execute_after_dh_clean:

override_dh_shlibdeps:
dh_shlibdeps -a -Xq_atm.so -Xm_xt.so -Xm_ipt.so
- dh_shlibdeps -a -- -pipmods -dRecommends -e debian/iproute2/usr/lib/tc/m_xt.so -e debian/iproute2/usr/lib/tc/q_atm.so -xlibc6
+ dh_shlibdeps -a -- -pipmods -dRecommends -e debian/iproute2-mlnx/usr/lib/tc/m_xt.so -e debian/iproute2-mlnx/usr/lib/tc/q_atm.so -xlibc6
- dh_shlibdeps -a -- -pipmods -dRecommends -e debian/iproute2/usr/lib/$(DEB_HOST_MULTIARCH)/tc/m_xt.so -e debian/iproute2/usr/lib/$(DEB_HOST_MULTIARCH)/tc/q_atm.so -xlibc6
+ dh_shlibdeps -a -- -pipmods -dRecommends -e debian/iproute2-mlnx/usr/lib/$(DEB_HOST_MULTIARCH)/tc/m_xt.so -e debian/iproute2-mlnx/usr/lib/$(DEB_HOST_MULTIARCH)/tc/q_atm.so -xlibc6

override_dh_auto_test:
# upstream test suite needs root and leaves machine unclean, skip it
--
2.30.2
2.17.1

This file was deleted.

1 change: 0 additions & 1 deletion platform/mellanox/iproute2/patch/series
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
0001-Remove-arpd-from-iproute2-package.patch
0002-Rename-iproute2-debian-package.patch
0003-Fix-version-identifier.patch

3 changes: 0 additions & 3 deletions platform/mellanox/libsaithrift-dev.mk
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,6 @@ SAI_VER = 0.9.4

LIBSAITHRIFT_DEV = libsaithrift$(SAITHRIFT_VER)-dev_$(SAI_VER)_$(CONFIGURED_ARCH).deb
$(LIBSAITHRIFT_DEV)_SRC_PATH = $(SRC_PATH)/sonic-sairedis/SAI
$(LIBSAITHRIFT_DEV)_DEPENDS += $(LIBTHRIFT) $(LIBTHRIFT_DEV) $(PYTHON_THRIFT) $(THRIFT_COMPILER)
$(LIBSAITHRIFT_DEV)_RDEPENDS += $(LIBTHRIFT)
$(LIBSAITHRIFT_DEV)_BUILD_ENV = SAITHRIFT_VER=v2 # Workaround to use python3 in build
$(LIBSAITHRIFT_DEV)_DEPENDS += $(MLNX_SAI) $(MLNX_SAI_DEV)
$(LIBSAITHRIFT_DEV)_RDEPENDS += $(MLNX_SAI)

Expand Down
2 changes: 2 additions & 0 deletions platform/mellanox/rules.mk
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@ $(SYNCD)_DEPENDS += $(MLNX_SAI)
$(SYNCD)_UNINSTALLS += $(MLNX_SAI)

ifeq ($(ENABLE_SYNCD_RPC),y)
# Remove the libthrift_0.11.0 dependency injected by rules/syncd.mk
$(SYNCD)_DEPENDS := $(filter-out $(LIBTHRIFT_DEV),$($(SYNCD)_DEPENDS))
$(SYNCD)_DEPENDS += $(LIBSAITHRIFT_DEV)
endif

Expand Down
6 changes: 6 additions & 0 deletions sonic-slave-bookworm/Dockerfile.j2
Original file line number Diff line number Diff line change
Expand Up @@ -590,6 +590,12 @@ RUN update-alternatives --set iptables /usr/sbin/iptables-legacy
# Install m2crypto package, needed by SWI tools
RUN apt-get install python3-m2crypto

# Install libthrift package needed by saithrift
RUN apt-get install libthrift-0.17 \
libthrift-dev \
thrift-compiler\
python3-thrift

# Install swi tools
RUN pip3 install git+https://github.com/aristanetworks/swi-tools.git@bead66bf261770237f7dd21ace3774ba04a017e9

Expand Down
Loading