Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Marvell]: Upgrade syncd, syncd-rpc and saiserver to bookworm (sonic-…
Browse files Browse the repository at this point in the history
…net#18740)

* [Marvell] syncd migration to bookworm

Signed-off-by: Pavan Naregundi <[email protected]>

* Add docker-saiserver-mrvl

Signed-off-by: Pavan Naregundi <[email protected]>

* [Marvell-armhf] Update SAI SDK version to 1.13.0-3

Signed-off-by: Pavan Naregundi <[email protected]>

---------

Signed-off-by: Pavan Naregundi <[email protected]>
pavannaregundi authored and pull[bot] committed Apr 30, 2024
1 parent 1e15896 commit 0cfb024
Showing 11 changed files with 115 additions and 35 deletions.
8 changes: 4 additions & 4 deletions platform/marvell/docker-saiserver-mrvl.mk
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
# docker image for mrvl saiserver

DOCKER_SAISERVER_MRVL = docker-saiserver-mrvl.gz
DOCKER_SAISERVER_MRVL = docker-saiserver$(SAITHRIFT_VER)-mrvl.gz
$(DOCKER_SAISERVER_MRVL)_PATH = $(PLATFORM_PATH)/docker-saiserver-mrvl
$(DOCKER_SAISERVER_MRVL)_DEPENDS += $(SAISERVER)
$(DOCKER_SAISERVER_MRVL)_LOAD_DOCKERS += $(DOCKER_CONFIG_ENGINE_BULLSEYE)
$(DOCKER_SAISERVER_MRVL)_LOAD_DOCKERS += $(DOCKER_CONFIG_ENGINE_BOOKWORM)
SONIC_DOCKER_IMAGES += $(DOCKER_SAISERVER_MRVL)
SONIC_BULLSEYE_DOCKERS += $(DOCKER_SAISERVER_MRVL)
SONIC_BOOKWORM_DOCKERS += $(DOCKER_SAISERVER_MRVL)

$(DOCKER_SAISERVER_MRVL)_CONTAINER_NAME = saiserver
$(DOCKER_SAISERVER_MRVL)_CONTAINER_NAME = saiserver$(SAITHRIFT_VER)
$(DOCKER_SAISERVER_MRVL)_RUN_OPT += --privileged -t
$(DOCKER_SAISERVER_MRVL)_RUN_OPT += -v /host/machine.conf:/etc/machine.conf
$(DOCKER_SAISERVER_MRVL)_RUN_OPT += -v /var/run/docker-saiserver:/var/run/sswsyncd
35 changes: 35 additions & 0 deletions platform/marvell/docker-saiserver-mrvl/Dockerfile.j2
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
{% from "dockers/dockerfile-macros.j2" import install_debian_packages %}
FROM docker-config-engine-bookworm-{{DOCKER_USERNAME}}:{{DOCKER_USERTAG}}

ARG docker_container_name

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

RUN apt-get update \
&& apt-get -y install \
libboost-atomic1.74.0 \
libqt5core5a \
libqt5network5 \
gdb \
libthrift-0.17.0

COPY \
{% for deb in docker_saiserver_mrvl_debs.split(' ') -%}
debs/{{ deb }}{{' '}}
{%- endfor -%}
debs/

RUN dpkg_apt() { [ -f $1 ] && { dpkg -i $1 || apt-get -y install -f; } || return 1; } ; \
{% for deb in docker_saiserver_mrvl_debs.split(' ') -%}
dpkg_apt debs/{{ deb }}{{'; '}}
{%- endfor %}

COPY ["start.sh", "/usr/bin/"]
COPY ["supervisord.conf", "/etc/supervisor/conf.d/"]

## Clean up
RUN apt-get clean -y; apt-get autoclean -y; apt-get autoremove -y
RUN rm -rf /debs

ENTRYPOINT ["/usr/local/bin/supervisord"]
7 changes: 7 additions & 0 deletions platform/marvell/docker-saiserver-mrvl/start.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/usr/bin/env bash

rm -f /var/run/rsyslogd.pid

supervisorctl start rsyslogd

supervisorctl start saiserver
28 changes: 28 additions & 0 deletions platform/marvell/docker-saiserver-mrvl/supervisord.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
[supervisord]
logfile_maxbytes=1MB
logfile_backups=2
nodaemon=true

[program:start.sh]
command=/usr/bin/start.sh
priority=1
autostart=true
autorestart=false
stdout_logfile=syslog
stderr_logfile=syslog

[program:rsyslogd]
command=/usr/sbin/rsyslogd -n
priority=2
autostart=false
autorestart=false
stdout_logfile=syslog
stderr_logfile=syslog

[program:saiserver]
command=/usr/sbin/saiserver -p /usr/share/sonic/hwsku/sai.profile -f /usr/share/sonic/hwsku/port_config.ini
priority=3
autostart=false
autorestart=false
stdout_logfile=syslog
stderr_logfile=syslog
5 changes: 3 additions & 2 deletions platform/marvell/docker-syncd-mrvl-rpc.mk
Original file line number Diff line number Diff line change
@@ -2,7 +2,8 @@

DOCKER_SYNCD_MRVL_RPC = docker-syncd-mrvl-rpc.gz
$(DOCKER_SYNCD_MRVL_RPC)_PATH = $(PLATFORM_PATH)/docker-syncd-mrvl-rpc
$(DOCKER_SYNCD_MRVL_RPC)_DEPENDS += $(SYNCD_RPC) $(LIBTHRIFT) $(PTF)
$(DOCKER_SYNCD_MRVL_RPC)_DEPENDS += $(SYNCD_RPC)
$(DOCKER_SYNCD_MRVL_RPC)_PYTHON_WHEELS += $(PTF_PY3)
$(DOCKER_SYNCD_MRVL_RPC)_FILES += $(SUPERVISOR_PROC_EXIT_LISTENER_SCRIPT)
ifeq ($(INSTALL_DEBUG_TOOLS), y)
$(DOCKER_SYNCD_MRVL_RPC)_DEPENDS += $(SYNCD_RPC_DBG) \
@@ -25,4 +26,4 @@ $(DOCKER_SYNCD_MRVL_RPC)_RUN_OPT += -v /host/machine.conf:/etc/machine.conf
$(DOCKER_SYNCD_MRVL_RPC)_RUN_OPT += -v /etc/sonic:/etc/sonic:ro
$(DOCKER_SYNCD_MRVL_RPC)_RUN_OPT += -v /host/warmboot:/var/warmboot

SONIC_BULLSEYE_DOCKERS += $(DOCKER_SYNCD_MRVL_RPC)
SONIC_BOOKWORM_DOCKERS += $(DOCKER_SYNCD_MRVL_RPC)
39 changes: 21 additions & 18 deletions platform/marvell/docker-syncd-mrvl-rpc/Dockerfile.j2
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
FROM docker-syncd-mrvl-{{DOCKER_USERNAME}}:{{DOCKER_USERTAG}}
{% from "dockers/dockerfile-macros.j2" import install_python_wheels, copy_files %}

## Make apt-get non-interactive
ENV DEBIAN_FRONTEND=noninteractive
@@ -20,37 +21,39 @@ RUN apt-get update \
build-essential \
libssl-dev \
libffi-dev \
python-dev \
python3-dev \
wget \
cmake \
libqt5core5a \
libqt5network5 \
libboost-atomic1.74.0
libboost-atomic1.74.0 \
libthrift-0.17.0 \
libnanomsg5 \
libnanomsg-dev

RUN dpkg_apt() { [ -f $1 ] && { dpkg -i $1 || apt-get -y install -f; } || return 1; } ; \
{% for deb in docker_syncd_mrvl_rpc_debs.split(' ') -%}
dpkg_apt debs/{{ deb }}{{'; '}}
{%- endfor %}

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.7.0 \
&& pip3 install --upgrade cffi==1.7.0 \
RUN pip3 install cffi \
&& pip3 install nnpy \
&& 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
&& wget https://raw.githubusercontent.com/p4lang/ptf/master/ptf_nn/ptf_nn_agent.py

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

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

# Install locally-built Python wheel dependencies
{{ install_python_wheels(docker_syncd_mrvl_rpc_whls.split(' ')) }}
{% endif %}

## Clean up
RUN apt-get purge -y libyaml-dev python3-dev libffi-dev libssl-dev wget build-essential
RUN apt-get clean -y; apt-get autoclean -y; apt-get autoremove -y
RUN rm -rf /root/deps

ENTRYPOINT ["/usr/local/bin/supervisord"]
2 changes: 1 addition & 1 deletion platform/marvell/docker-syncd-mrvl.mk
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# docker image for mrvl syncd

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

$(DOCKER_SYNCD_BASE)_DEPENDS += $(SYNCD)
$(DOCKER_SYNCD_BASE)_DEPENDS += $(MRVL_SAI)
4 changes: 2 additions & 2 deletions platform/marvell/docker-syncd-mrvl/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 %}
FROM docker-config-engine-bullseye-{{DOCKER_USERNAME}}:{{DOCKER_USERTAG}}
FROM docker-config-engine-bookworm-{{DOCKER_USERNAME}}:{{DOCKER_USERTAG}}

ARG docker_container_name

@@ -19,7 +19,7 @@ RUN apt-get update \
net-tools \
iputils-ping

RUN apt-get -y install libpcap-dev libxml2-dev python-dev swig libsensors4-dev nfs-common
RUN apt-get -y install libpcap-dev libxml2-dev python3-dev swig

RUN dpkg -i \
{% for deb in docker_syncd_mrvl_debs.split(' ') -%}
19 changes: 12 additions & 7 deletions platform/marvell/libsaithrift-dev.mk
Original file line number Diff line number Diff line change
@@ -2,19 +2,24 @@

SAI_VER = 0.9.4

LIBSAITHRIFT_DEV = libsaithrift-dev_$(SAI_VER)_$(CONFIGURED_ARCH).deb
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) $(MRVL_FPA) $(MRVL_SAI)
$(LIBSAITHRIFT_DEV)_RDEPENDS += $(LIBTHRIFT) $(MRVL_SAI)

ifeq ($(SAITHRIFT_V2),y)
$(LIBSAITHRIFT_DEV)_BUILD_ENV = SAITHRIFTV2=true SAITHRIFT_VER=v2
endif

$(LIBSAITHRIFT_DEV)_DEPENDS += $(MRVL_SAI) $(LIBSAIMETADATA) $(LIBSAIMETADATA_DEV)
$(LIBSAITHRIFT_DEV)_RDEPENDS += $(MRVL_SAI) $(LIBSAIMETADATA)
SONIC_DPKG_DEBS += $(LIBSAITHRIFT_DEV)

PYTHON_SAITHRIFT = python-saithrift_$(SAI_VER)_$(CONFIGURED_ARCH).deb
PYTHON_SAITHRIFT = python-saithrift$(SAITHRIFT_VER)_$(SAI_VER)_$(CONFIGURED_ARCH).deb
$(eval $(call add_extra_package,$(LIBSAITHRIFT_DEV),$(PYTHON_SAITHRIFT)))

SAISERVER = saiserver_$(SAI_VER)_$(CONFIGURED_ARCH).deb
$(SAISERVER)_RDEPENDS += $(LIBTHRIFT) $(MRVL_SAI)
SAISERVER = saiserver$(SAITHRIFT_VER)_$(SAI_VER)_$(CONFIGURED_ARCH).deb
$(SAISERVER)_RDEPENDS += $(LIBSAITHRIFT_DEV)
$(eval $(call add_extra_package,$(LIBSAITHRIFT_DEV),$(SAISERVER)))

SAISERVER_DBG = saiserver-dbg_$(SAI_VER)_$(CONFIGURED_ARCH).deb
SAISERVER_DBG = saiserver$(SAITHRIFT_VER)-dbg_$(SAI_VER)_$(CONFIGURED_ARCH).deb
$(SAISERVER_DBG)_RDEPENDS += $(SAISERVER)
$(eval $(call add_extra_package,$(LIBSAITHRIFT_DEV),$(SAISERVER_DBG)))
1 change: 1 addition & 0 deletions platform/marvell/rules.mk
Original file line number Diff line number Diff line change
@@ -19,6 +19,7 @@ $(SYNCD)_DEPENDS += $(MRVL_SAI)
$(SYNCD)_UNINSTALLS += $(MRVL_SAI)

ifeq ($(ENABLE_SYNCD_RPC),y)
$(SYNCD)_DEPENDS := $(filter-out $(LIBTHRIFT_DEV),$($(SYNCD)_DEPENDS))
$(SYNCD)_DEPENDS += $(LIBSAITHRIFT_DEV)
endif

2 changes: 1 addition & 1 deletion platform/marvell/sai.mk
Original file line number Diff line number Diff line change
@@ -4,7 +4,7 @@ BRANCH = master
ifeq ($(CONFIGURED_ARCH),arm64)
MRVL_SAI_VERSION = 1.13.0-1
else ifeq ($(CONFIGURED_ARCH),armhf)
MRVL_SAI_VERSION = 1.13.0-2
MRVL_SAI_VERSION = 1.13.0-3
else
MRVL_SAI_VERSION = 1.13.0-1
endif

0 comments on commit 0cfb024

Please sign in to comment.