Innovium syncd bookworm migration

Signed-off-by: Keshav Gupta <keshavg@marvell.com>
This commit is contained in:
Keshav Gupta 2024-03-12 05:07:04 -07:00
parent 9fdbdeee85
commit 2f566ca2ec
8 changed files with 79 additions and 20 deletions

View File

@ -2,11 +2,11 @@
DOCKER_SYNCD_INVM_RPC = docker-syncd-invm-rpc.gz
$(DOCKER_SYNCD_INVM_RPC)_PATH = $(PLATFORM_PATH)/docker-syncd-invm-rpc
$(DOCKER_SYNCD_INVM_RPC)_DEPENDS += $(SYNCD_RPC) $(LIBTHRIFT) $(INVM_LIBSAI) $(PTF) $(INVM_SHELL)
$(DOCKER_SYNCD_INVM_RPC)_DEPENDS += $(SYNCD_RPC) $(INVM_LIBSAI) $(INVM_SHELL)
$(DOCKER_SYNCD_INVM_RPC)_PYTHON_WHEELS += $(PTF_PY3)
$(DOCKER_SYNCD_INVM_RPC)_FILES += $(SUPERVISOR_PROC_EXIT_LISTENER_SCRIPT)
$(DOCKER_SYNCD_INVM_RPC)_LOAD_DOCKERS += $(DOCKER_SYNCD_BASE)
SONIC_DOCKER_IMAGES += $(DOCKER_SYNCD_INVM_RPC)
SONIC_BUSTER_DOCKERS += $(DOCKER_SYNCD_INVM_RPC)
ifeq ($(ENABLE_SYNCD_RPC),y)
SONIC_INSTALL_DOCKER_IMAGES += $(DOCKER_SYNCD_INVM_RPC)
endif

View File

@ -15,19 +15,23 @@ RUN apt-get purge -y syncd
RUN apt-get update \
&& apt-get -y install \
net-tools \
python-pip \
python-setuptools \
python3-pip \
python3-setuptools \
build-essential \
libssl-dev \
libffi-dev \
python-dev \
python3-dev \
libjansson4 \
libyaml-dev \
wget \
cmake \
libqt5core5a \
libqt5network5 \
libboost-atomic1.71.0
libboost-atomic1.74.0 \
libthrift-0.17.0 \
libthrift-dev \
thrift-compiler \
python3-thrift
RUN dpkg_apt() { [ -f $1 ] && { dpkg -i $1 || apt-get -y install -f; } || return 1; } ; \
{% for deb in docker_syncd_invm_rpc_debs.split(' ') -%}
@ -44,9 +48,9 @@ RUN wget https://github.com/nanomsg/nanomsg/archive/1.0.0.tar.gz \
&& cd .. \
&& rm -fr nanomsg-1.0.0 \
&& rm -f 1.0.0.tar.gz \
&& pip install numpy \
&& pip install scipy \
&& pip install setuptools \
&& pip3 install numpy \
&& pip3 install scipy \
&& pip3 install setuptools \
&& mkdir -p /opt \
&& cd /opt \
&& wget https://raw.githubusercontent.com/p4lang/ptf/master/ptf_nn/ptf_nn_agent.py \

View File

@ -1,7 +1,7 @@
# docker image for innovium syncd
DOCKER_SYNCD_PLATFORM_CODE = invm
include $(PLATFORM_PATH)/../template/docker-syncd-base.mk
include $(PLATFORM_PATH)/../template/docker-syncd-bookworm.mk
$(DOCKER_SYNCD_BASE)_DEPENDS += $(SYNCD) $(PYTHON_SDK_API) $(INVM_LIBSAI) $(INVM_SHELL)
@ -10,9 +10,6 @@ $(DOCKER_SYNCD_BASE)_DBG_DEPENDS += $(SYNCD_DBG) \
$(LIBSAIMETADATA_DBG) \
$(LIBSAIREDIS_DBG)
SONIC_BUSTER_DOCKERS += $(DOCKER_SYNCD_BASE)
SONIC_BUSTER_DBG_DOCKERS += $(DOCKER_SYNCD_BASE_DBG)
$(DOCKER_SYNCD_BASE)_VERSION = 1.0.0
$(DOCKER_SYNCD_BASE)_PACKAGE_NAME = syncd
$(DOCKER_SYNCD_BASE)_MACHINE = innovium

View File

@ -1,4 +1,5 @@
FROM docker-config-engine-buster-{{DOCKER_USERNAME}}:{{DOCKER_USERTAG}}
{% from "dockers/dockerfile-macros.j2" import install_debian_packages %}
FROM docker-config-engine-bookworm-{{DOCKER_USERNAME}}:{{DOCKER_USERTAG}}
ARG docker_container_name

View File

@ -1,7 +1,20 @@
# libsaithrift-dev package
SAI_VER = 0.9.4
LIBSAITHRIFT_DEV_INVM = libsaithrift-dev_0.9.4_$(CONFIGURED_ARCH).deb
$(LIBSAITHRIFT_DEV_INVM)_SRC_PATH = $(SRC_PATH)/sonic-sairedis/SAI
$(LIBSAITHRIFT_DEV_INVM)_DEPENDS += $(LIBTHRIFT) $(LIBTHRIFT_DEV) $(THRIFT_COMPILER) $(INVM_LIBSAI) $(INVM_HSAI)
$(LIBSAITHRIFT_DEV_INVM)_RDEPENDS += $(LIBTHRIFT) $(INVM_HSAI)
SONIC_DPKG_DEBS += $(LIBSAITHRIFT_DEV_INVM)
LIBSAITHRIFT_DEV = libsaithrift$(SAITHRIFT_VER)-dev_$(SAI_VER)_$(CONFIGURED_ARCH).deb
$(LIBSAITHRIFT_DEV)_SRC_PATH = $(SRC_PATH)/sonic-sairedis/SAI
ifeq ($(SAITHRIFT_V2),y)
$(LIBSAITHRIFT_DEV)_DEPENDS += $(INVM_LIBSAI) $(INVM_HSAI) $(LIBSAIMETADATA) $(LIBSAIMETADATA_DEV)
$(LIBSAITHRIFT_DEV)_RDEPENDS += $(INVM_HSAI) $(LIBSAIMETADATA)
$(LIBSAITHRIFT_DEV)_BUILD_ENV = SAITHRIFTV2=true SAITHRIFT_VER=v2
else
$(LIBSAITHRIFT_DEV)_DEPENDS += $(INVM_LIBSAI) $(INVM_HSAI)
$(LIBSAITHRIFT_DEV)_RDEPENDS += $(INVM_HSAI)
endif
$(LIBSAITHRIFT_DEV)_DEPENDS += $(LIBSAIMETADATA) $(LIBSAIMETADATA_DEV)
$(LIBSAITHRIFT_DEV)_RDEPENDS += $(LIBSAIMETADATA) $(INVM_LIBSAI) $(INVM_SHELL)
PYTHON_SAITHRIFT = python-saithrift$(SAITHRIFT_VER)_$(SAI_VER)_$(CONFIGURED_ARCH).deb
$(eval $(call add_extra_package,$(LIBSAITHRIFT_DEV),$(PYTHON_SAITHRIFT)))
SONIC_DPKG_DEBS += $(LIBSAITHRIFT_DEV)

View File

@ -16,8 +16,13 @@ SONIC_ALL += $(SONIC_INVM_ONE_IMAGE) \
$(DOCKER_SYNCD_INVM_RPC)
# Inject invm sai into syncd
$(SYNCD)_DEPENDS += $(INVM_HSAI) $(INVM_LIBSAI) $(LIBSAITHRIFT_DEV_INVM) $(INVM_SHELL)
$(SYNCD)_DEPENDS += $(INVM_HSAI) $(INVM_LIBSAI) $(INVM_SHELL)
$(SYNCD)_UNINSTALLS += $(INVM_HSAI)
ifeq ($(ENABLE_SYNCD_RPC),y)
$(SYNCD)_DEPENDS := $(filter-out $(LIBTHRIFT_DEV),$($(SYNCD)_DEPENDS))
$(SYNCD)_DEPENDS += $(LIBSAITHRIFT_DEV)
endif
# Runtime dependency on invm sai is set only for syncd
$(SYNCD)_RDEPENDS += $(INVM_HSAI)

View File

@ -0,0 +1,33 @@
# docker image for syncd
DOCKER_SYNCD_BASE_STEM = docker-syncd-$(DOCKER_SYNCD_PLATFORM_CODE)
DOCKER_SYNCD_BASE = $(DOCKER_SYNCD_BASE_STEM).gz
DOCKER_SYNCD_BASE_DBG = $(DOCKER_SYNCD_BASE_STEM)-$(DBG_IMAGE_MARK).gz
$(DOCKER_SYNCD_BASE)_PATH = $(PLATFORM_PATH)/docker-syncd-$(DOCKER_SYNCD_PLATFORM_CODE)
$(DOCKER_SYNCD_BASE)_FILES += $(SUPERVISOR_PROC_EXIT_LISTENER_SCRIPT)
$(DOCKER_SYNCD_BASE)_LOAD_DOCKERS += $(DOCKER_CONFIG_ENGINE_BOOKWORM)
$(DOCKER_SYNCD_BASE)_DBG_DEPENDS += $($(DOCKER_CONFIG_ENGINE_BOOKWORM)_DBG_DEPENDS)
$(DOCKER_SYNCD_BASE)_DBG_IMAGE_PACKAGES = $($(DOCKER_CONFIG_ENGINE_BOOKWORM)_DBG_IMAGE_PACKAGES)
SONIC_DOCKER_IMAGES += $(DOCKER_SYNCD_BASE)
ifneq ($(ENABLE_SYNCD_RPC),y)
SONIC_INSTALL_DOCKER_IMAGES += $(DOCKER_SYNCD_BASE)
endif
SONIC_DOCKER_DBG_IMAGES += $(DOCKER_SYNCD_BASE_DBG)
ifneq ($(ENABLE_SYNCD_RPC),y)
SONIC_INSTALL_DOCKER_DBG_IMAGES += $(DOCKER_SYNCD_BASE_DBG)
endif
$(DOCKER_SYNCD_BASE)_CONTAINER_NAME = syncd
$(DOCKER_SYNCD_BASE)_RUN_OPT += --privileged -t
$(DOCKER_SYNCD_BASE)_RUN_OPT += -v /host/machine.conf:/etc/machine.conf
$(DOCKER_SYNCD_BASE)_RUN_OPT += -v /etc/sonic:/etc/sonic:ro
SONIC_BOOKWORM_DOCKERS += $(DOCKER_SYNCD_BASE)
SONIC_BOOKWORM_DBG_DOCKERS += $(DOCKER_SYNCD_BASE_DBG)

View File

@ -561,6 +561,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