From 31e71ac930d3d1f16d2f8fc866d3dcbc5eeb1a63 Mon Sep 17 00:00:00 2001 From: Junhua Zhai Date: Sat, 6 Jul 2024 15:54:42 +0000 Subject: [PATCH] Include SAI in docker vpp and add dash sai libs dependency on vpp --- dash-pipeline/Makefile | 3 +++ dash-pipeline/dockerfiles/Dockerfile.vpp | 29 +++++++++++++++++++++++- 2 files changed, 31 insertions(+), 1 deletion(-) 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