Skip to content

Commit

Permalink
Check and update SAI Thrift build targets from the stable commit ID (#…
Browse files Browse the repository at this point in the history
…213)

Signed-off-by: Yurii Lisovskyi <[email protected]>
  • Loading branch information
yuriilisovskyi authored Oct 12, 2023
1 parent 3840d2d commit 6800640
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 4 deletions.
1 change: 1 addition & 0 deletions .github/workflows/sc-client-server-deb10.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ on:
- '.github/workflows/sc-client-server-deb10.yml'
- 'dockerfiles/buster/Dockerfile.client'
- 'dockerfiles/buster/Dockerfile.server'
- 'dockerfiles/buster/Dockerfile.saithrift-server'
- 'npu/broadcom/BCM56850/saivs/Dockerfile.server'
- 'common/**'
- 'cli/**'
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/sc-client-server-deb11.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ on:
- '.github/workflows/sc-client-server-deb11.yml'
- 'dockerfiles/bullseye/Dockerfile.client'
- 'dockerfiles/bullseye/Dockerfile.server'
- 'dockerfiles/bullseye/Dockerfile.saithrift-server'
- 'npu/broadcom/BCM56850/saivs/Dockerfile.server'
- 'common/**'
- 'cli/**'
Expand All @@ -25,7 +26,7 @@ env:
DOCKER_CLIENT: 'dockerfiles/bullseye/Dockerfile.client'
DOCKER_SERVER_BASE: 'dockerfiles/bullseye/Dockerfile.server'
DOCKER_SERVER: 'npu/broadcom/BCM56850/saivs/Dockerfile.server'
DOCKER_THRIFT_SERVER: 'dockerfiles/buster/Dockerfile.saithrift-server'
DOCKER_THRIFT_SERVER: 'dockerfiles/bullseye/Dockerfile.saithrift-server'
REDIS_CLIENT: 0
REDIS_SERVER: 0
THRIFT_SERVER: 0
Expand Down
15 changes: 12 additions & 3 deletions dockerfiles/buster/Dockerfile.saithrift-server
Original file line number Diff line number Diff line change
Expand Up @@ -49,15 +49,24 @@ RUN apt-get install -y thrift-compiler libthrift-dev libthrift-0.11.0 \
&& pip3 install ctypesgen thrift==0.11.0 ;

ENV SAITHRIFTV2=y
ENV GEN_SAIRPC_OPTS="-cve"
ENV SAIRPC_EXTRA_LIBS="-L/usr/local/lib/ -lpthread"
ENV GEN_SAIRPC_OPTS="-ve"
ENV SAIRPC_EXTRA_LIBS="-L/usr/local/lib/"
# Required to build libsaimetadata.so and libsai.so
ENV SAI_THRIFT_ID="af31a8f"

RUN git clone https://github.com/opencomputeproject/SAI.git \
&& cd SAI && git fetch origin \
&& . /sai.env \
&& git checkout ${SAI_ID} \
# Old branches have "saitypes.h" which conflicts with latest metadata Makefile
&& sed -i 's/#include "saitypes.h"/#include <saitypes.h>/g' inc/saiwred.h \
&& cd meta \
&& make all libsaimetadata.so libsai.so \
&& make all \
# Verify and update build targets from the stable commit ID
&& if ! $(grep -q "libsai.so" Makefile) || ! $(grep -q "lsai -lsaimetadata" ../test/saithriftv2/Makefile); then \
git checkout ${SAI_THRIFT_ID} Makefile size.sh size.pl libsai.cpp sai_rpc_frontend.main.cpp ../test/saithriftv2; \
fi \
&& make libsaimetadata.so libsai.so \
&& cp libsaimetadata.so /usr/lib \
&& cp libsai.so /usr/lib \
&& cd .. \
Expand Down

0 comments on commit 6800640

Please sign in to comment.