Skip to content

Commit

Permalink
Add basic vs Thrift server
Browse files Browse the repository at this point in the history
Signed-off-by: Yurii Lisovskyi <[email protected]>
  • Loading branch information
yuriilisovskyi committed Oct 2, 2023
1 parent 1ecb98b commit b34c526
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 24 deletions.
9 changes: 9 additions & 0 deletions configs/server/supervisord.conf.thrift
Original file line number Diff line number Diff line change
Expand Up @@ -39,3 +39,12 @@ stderr_logfile=syslog
dependent_startup=true
dependent_startup_wait_for=rsyslogd:running wait-interfaces:exited

[program:saiserver]
command=/usr/sbin/saiserver -f /usr/share/sonic/hwsku/port_config.ini -p /usr/share/sonic/hwsku/sai.profile
priority=3
autostart=true
autorestart=true
stdout_logfile=syslog
stderr_logfile=syslog
dependent_startup_wait_for=rsyslogd:running

45 changes: 21 additions & 24 deletions dockerfiles/buster/Dockerfile.saithrift-server
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ RUN echo "deb [arch=amd64] http://debian-archive.trafficmanager.net/debian/ bust
## Make apt-get non-interactive
ENV DEBIAN_FRONTEND=noninteractive

COPY sai.env /

# Install generic packages
RUN apt-get -o Acquire::Check-Valid-Until=false update && apt-get install -y \
apt-utils \
Expand All @@ -30,30 +32,6 @@ RUN apt-get -o Acquire::Check-Valid-Until=false update && apt-get install -y \
# Add support for supervisord to handle startup dependencies
RUN pip3 install supervisord-dependent-startup==1.4.0

# Install sonic-swss-common & sonic-sairedis building dependencies
RUN apt-get install -y \
make libtool m4 autoconf dh-exec debhelper automake cmake pkg-config \
libhiredis-dev libnl-3-dev libnl-genl-3-dev libnl-route-3-dev swig3.0 \
libgtest-dev libgmock-dev libboost-dev autoconf-archive \
uuid-dev libboost-serialization-dev libyang-dev libyang0.16

RUN apt-get install -y \
libnl-3-dev libnl-genl-3-dev libnl-route-3-dev libnl-nf-3-dev libzmq3-dev

COPY sai.env /
RUN git clone --recursive https://github.com/sonic-net/sonic-swss-common \
&& cd sonic-swss-common \
&& . /sai.env \
&& git checkout ${SWSS_COMMON_ID} \
&& ./autogen.sh \
&& export DEB_BUILD_PROFILES=nopython2 \
&& dpkg-buildpackage -us -uc -b --jobs=auto \
&& cd .. \
&& dpkg -i libswsscommon_1.0.0_amd64.deb \
&& dpkg -i libswsscommon-dev_1.0.0_amd64.deb \
&& rm -rf sonic-swss-common \
&& rm -f *swsscommon*

# Install generic packages
RUN apt-get install -y \
libtemplate-perl \
Expand All @@ -70,6 +48,25 @@ WORKDIR /sai
RUN apt-get install -y thrift-compiler libthrift-dev libthrift-0.11.0 \
&& pip3 install ctypesgen thrift==0.11.0 ;

ENV SAITHRIFTV2=y
ENV platform=vs
ENV GEN_SAIRPC_OPTS="-cve"
ENV SAIRPC_EXTRA_LIBS="-L/usr/local/lib/ -lpthread"

RUN git clone https://github.com/opencomputeproject/SAI.git \
&& cd SAI && git fetch origin \
&& . /sai.env \
&& git checkout ${SAI_ID} \
&& cd meta \
&& make all libsaimetadata.so libsai.so \
&& cp libsaimetadata.so /usr/lib \
&& cp libsai.so /usr/lib \
&& cd .. \
&& mkdir /usr/include/sai/ \
&& cp ./inc/sai*.h /usr/include/sai/ \
&& cp ./experimental/sai*.h /usr/include/sai/ \
&& make saithrift-install

WORKDIR /sai-challenger

COPY configs/server/supervisord.conf.thrift /etc/supervisor/conf.d/supervisord.conf
Expand Down
10 changes: 10 additions & 0 deletions npu/broadcom/BCM56850/saivs/Dockerfile.saithrift-server
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
ARG BASE_OS
FROM sc-thrift-server-base:$BASE_OS

COPY configs/sai.profile /usr/share/sonic/hwsku/
COPY configs/port_config.ini /usr/share/sonic/hwsku/
COPY configs/lanemap.ini /usr/share/sonic/hwsku/

WORKDIR /

CMD ["/usr/bin/supervisord"]

0 comments on commit b34c526

Please sign in to comment.