Skip to content

Commit

Permalink
Include SAI in docker vpp and add dash sai libs dependency on vpp
Browse files Browse the repository at this point in the history
  • Loading branch information
jimmyzhai committed Aug 14, 2024
1 parent d574dc1 commit 6937c3d
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 1 deletion.
3 changes: 3 additions & 0 deletions dash-pipeline/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -268,6 +268,9 @@ run-saithrift-bldr-bash:
DOCKER_RUN_VPP = docker run\
$(DOCKER_FLAGS) \
-v $(PWD)/bmv2:/bmv2 \
-v $(PWD)/$(P4_OUTDIR)/dash_pipeline.json:/etc/dash/dash_pipeline.json \
-v $(PWD)/$(P4_OUTDIR)/dash_pipeline_p4rt.txt:/etc/dash/dash_pipeline_p4rt.txt \
-v $(PWD)/SAI:/SAI \
-v $(PWD)/tests:/tests \
-v $(PWD)/../:/dash \
--network=host \
Expand Down
29 changes: 28 additions & 1 deletion dash-pipeline/dockerfiles/Dockerfile.vpp
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
# This Dockerfile builds an image used to compile vpp for dash date-plane app.
FROM amd64/ubuntu:20.04
FROM sonicdash.azurecr.io/dash-grpc:1.43.2 as grpc
FROM p4lang/behavioral-model@sha256:ce45720e28a96a50f275c1b511cd84c2558b62f2cf7a7e506765183bc3fb2e32
LABEL maintainer="SONIC-DASH Community"
LABEL description="DASH date-plane app using vpp"

# Configure make to run as many parallel jobs as cores available
ARG available_processors
ARG MAKEFLAGS=-j$available_processors

ARG sswitch_grpc=yes
ARG CC=gcc
ARG CXX=g++
# Set TZ to avoid interactive installer
Expand All @@ -20,7 +22,9 @@ RUN apt-get update && \
build-essential \
autoconf \
libtool \
libtool-bin \
pkg-config \
patchelf \
sudo \
iproute2 net-tools iputils-ping \
make
Expand All @@ -39,6 +43,29 @@ RUN (git clone https://gerrit.fd.io/r/vpp && \
cd vpp && UNATTENDED=y make install-dep)


WORKDIR /usr/local/lib/

# Copy libabsl .a files from p4pi, make shared lib for our use and delete .a's
COPY --from=grpc /usr/local/lib/lib*grpc*.so* \
/usr/local/lib/libabsl*.so* \
/usr/local/lib/libgpr*.so* \
/usr/local/lib/libupb*.so* \
/usr/local/lib/libre2*.so* \
/usr/local/lib/libaddress_sorting*.so* \
/usr/local/lib/libssl*.so* \
/usr/local/lib/libcrypto*.so* \
./

# Specify dash sai libs dependency on vpp
RUN patchelf --set-rpath /SAI/lib /usr/bin/vpp
RUN patchelf --add-needed libsai.so \
--add-needed libprotobuf.so \
--add-needed libpiprotobuf.so \
--add-needed libpiprotogrpc.so \
--add-needed libgrpc++.so.1.43 \
/usr/bin/vpp
RUN ldconfig

WORKDIR /

ARG user
Expand Down

0 comments on commit 6937c3d

Please sign in to comment.