diff --git a/dash-pipeline/Makefile b/dash-pipeline/Makefile index aa350262f..fc387e1ef 100644 --- a/dash-pipeline/Makefile +++ b/dash-pipeline/Makefile @@ -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 \ diff --git a/dash-pipeline/dockerfiles/Dockerfile.vpp b/dash-pipeline/dockerfiles/Dockerfile.vpp index 27dcb3662..bc4292431 100644 --- a/dash-pipeline/dockerfiles/Dockerfile.vpp +++ b/dash-pipeline/dockerfiles/Dockerfile.vpp @@ -1,5 +1,6 @@ # 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" @@ -7,6 +8,7 @@ LABEL description="DASH date-plane app using vpp" ARG available_processors ARG MAKEFLAGS=-j$available_processors +ARG sswitch_grpc=yes ARG CC=gcc ARG CXX=g++ # Set TZ to avoid interactive installer @@ -20,7 +22,9 @@ RUN apt-get update && \ build-essential \ autoconf \ libtool \ + libtool-bin \ pkg-config \ + patchelf \ sudo \ iproute2 net-tools iputils-ping \ make @@ -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