[Mellanox][SAISERVER] Support Mellanox saiserverv1 and saiserverv2 docker (#9686)

* support saiserverv1 and saiserverv2 docker

* add saiserver into buster and revert some changes

* update thrift version
This commit is contained in:
Yang Wang 2022-03-10 13:15:44 +08:00 committed by GitHub
parent 86017096b2
commit c8db7a2d52
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 30 additions and 23 deletions

View File

@ -16,15 +16,16 @@
#
# docker image for mlnx saiserver
DOCKER_SAISERVER_MLNX = docker-saiserver-mlnx.gz
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_STRETCH)
$(DOCKER_SAISERVER_MLNX)_LOAD_DOCKERS += $(DOCKER_CONFIG_ENGINE_BUSTER)
SONIC_DOCKER_IMAGES += $(DOCKER_SAISERVER_MLNX)
SONIC_STRETCH_DOCKERS += $(DOCKER_SAISERVER_MLNX)
SONIC_BUSTER_DOCKERS += $(DOCKER_SAISERVER_MLNX)
$(DOCKER_SAISERVER_MLNX)_CONTAINER_NAME = saiserver$(SAITHRIFT_VER)
$(DOCKER_SAISERVER_MLNX)_CONTAINER_NAME = saiserver
$(DOCKER_SAISERVER_MLNX)_RUN_OPT += --privileged -t
$(DOCKER_SAISERVER_MLNX)_RUN_OPT += -v /host/machine.conf:/etc/machine.conf
$(DOCKER_SAISERVER_MLNX)_RUN_OPT += -v /etc/sonic:/etc/sonic:ro

View File

@ -14,7 +14,8 @@
## See the License for the specific language governing permissions and
## limitations under the License.
##
FROM docker-config-engine-stretch
{% from "dockers/dockerfile-macros.j2" import install_debian_packages %}
FROM docker-config-engine-buster
ARG docker_container_name
RUN [ -f /etc/rsyslog.conf ] && sed -ri "s/%syslogtag%/$docker_container_name#%syslogtag%/;" /etc/rsyslog.conf
@ -22,7 +23,11 @@ RUN [ -f /etc/rsyslog.conf ] && sed -ri "s/%syslogtag%/$docker_container_name#%s
## Make apt-get non-interactive
ENV DEBIAN_FRONTEND=noninteractive
RUN apt-get update
## Pre-install the fundamental packages
RUN apt-get update \
&& apt-get -y install \
gdb \
libboost-atomic1.71.0
COPY \
{% for deb in docker_saiserver_mlnx_debs.split(' ') -%}
@ -38,15 +43,7 @@ debs/
RUN apt-get install -y --no-install-recommends libxml2 iptables libbsd0 protobuf-c-compiler protobuf-compiler python-protobuf libprotobuf-c1 python-future python-ipaddr libnet1 pkg-config asciidoc xmlto
RUN dpkg_apt() { [ -f $1 ] && { dpkg -i $1 || apt-get -y install -f; } || return 1; } ; \
{% for deb in docker_saiserver_mlnx_debs.split(' ') -%}
dpkg_apt debs/{{ deb }}{{'; '}}
{%- endfor %}
RUN dpkg_apt() { [ -f $1 ] && { dpkg -i $1 || apt-get -y install -f; } || return 1; } ; \
{% for deb in docker_saiserver_mlnx_pydebs.split(' ') -%}
dpkg_apt debs/{{ deb }}{{'; '}}
{%- endfor %}
{{ install_debian_packages(docker_saiserver_mlnx_debs.split(' ')) }}
COPY ["start.sh", "/usr/bin/"]

View File

@ -20,7 +20,7 @@ stdout_logfile=syslog
stderr_logfile=syslog
[program:saiserver]
command=/usr/bin/saiserver -p /etc/sai/profile.ini -f /etc/sai/portmap.ini
command=/usr/sbin/saiserver -p /etc/sai/profile.ini -f /etc/sai/portmap.ini
priority=3
autostart=false
autorestart=false

View File

@ -18,19 +18,28 @@
SAI_VER = 0.9.4
LIBSAITHRIFT_DEV = libsaithrift-dev_$(SAI_VER)_amd64.deb
LIBSAITHRIFT_DEV = libsaithrift$(SAITHRIFT_VER)-dev_$(SAI_VER)_amd64.deb
$(LIBSAITHRIFT_DEV)_SRC_PATH = $(SRC_PATH)/sonic-sairedis/SAI
$(LIBSAITHRIFT_DEV)_DEPENDS += $(LIBTHRIFT) $(LIBTHRIFT_DEV) $(PYTHON_THRIFT) $(THRIFT_COMPILER) $(MLNX_SAI) $(MLNX_SAI_DEV)
$(LIBSAITHRIFT_DEV)_RDEPENDS += $(LIBTHRIFT) $(MLNX_SAI)
ifeq ($(SAITHRIFT_V2),y)
$(LIBSAITHRIFT_DEV)_DEPENDS += $(LIBTHRIFT_0_14_1) $(LIBTHRIFT_0_14_1_DEV) $(PYTHON3_THRIFT_0_14_1) $(THRIFT_0_14_1_COMPILER)
$(LIBSAITHRIFT_DEV)_RDEPENDS += $(LIBTHRIFT_0_14_1)
$(LIBSAITHRIFT_DEV)_BUILD_ENV = SAITHRIFTV2=true SAITHRIFT_VER=v2
else
$(LIBSAITHRIFT_DEV)_DEPENDS += $(LIBTHRIFT) $(LIBTHRIFT_DEV) $(PYTHON_THRIFT) $(THRIFT_COMPILER)
$(LIBSAITHRIFT_DEV)_RDEPENDS += $(LIBTHRIFT)
endif
$(LIBSAITHRIFT_DEV)_DEPENDS += $(MLNX_SAI) $(MLNX_SAI_DEV)
$(LIBSAITHRIFT_DEV)_RDEPENDS += $(MLNX_SAI)
SONIC_DPKG_DEBS += $(LIBSAITHRIFT_DEV)
PYTHON_SAITHRIFT = python-saithrift_$(SAI_VER)_amd64.deb
PYTHON_SAITHRIFT = python-saithrift$(SAITHRIFT_VER)_$(SAI_VER)_amd64.deb
$(eval $(call add_extra_package,$(LIBSAITHRIFT_DEV),$(PYTHON_SAITHRIFT)))
SAISERVER = saiserver_$(SAI_VER)_amd64.deb
$(SAISERVER)_RDEPENDS += $(LIBTHRIFT) $(MLNX_SAI)
SAISERVER = saiserver$(SAITHRIFT_VER)_$(SAI_VER)_amd64.deb
$(SAISERVER)_RDEPENDS += $(LIBSAITHRIFT_DEV)
$(eval $(call add_extra_package,$(LIBSAITHRIFT_DEV),$(SAISERVER)))
SAISERVER_DBG = saiserver-dbg_$(SAI_VER)_amd64.deb
SAISERVER_DBG = saiserver$(SAITHRIFT_VER)-dbg_$(SAI_VER)_amd64.deb
$(SAISERVER_DBG)_RDEPENDS += $(SAISERVER)
$(eval $(call add_extra_package,$(LIBSAITHRIFT_DEV),$(SAISERVER_DBG)))