From 78f0d9b379f814029fa79bb6dc6f72992b2def02 Mon Sep 17 00:00:00 2001 From: Yurii Lisovskyi Date: Tue, 3 Oct 2023 11:48:42 +0300 Subject: [PATCH] Remove VS platform from dockerfile Signed-off-by: Yurii Lisovskyi --- .github/workflows/sc-client-server-deb10.yml | 3 + .github/workflows/sc-client-server-deb11.yml | 3 + configs/server/supervisord.conf.thrift | 8 -- .../bullseye/Dockerfile.saithrift-server | 85 +++++++++++++++++++ .../buster/Dockerfile.saithrift-server | 1 - 5 files changed, 91 insertions(+), 9 deletions(-) create mode 100644 dockerfiles/bullseye/Dockerfile.saithrift-server diff --git a/.github/workflows/sc-client-server-deb10.yml b/.github/workflows/sc-client-server-deb10.yml index de4ca19f..2b5f084c 100644 --- a/.github/workflows/sc-client-server-deb10.yml +++ b/.github/workflows/sc-client-server-deb10.yml @@ -70,6 +70,9 @@ jobs: with: name: Server Image path: sc-server.tar + + - name: Build Thrift server Docker image + run: ./build.sh -i server -o deb10 -s thrift build-sc-client: name: Build SAI Challenger client image diff --git a/.github/workflows/sc-client-server-deb11.yml b/.github/workflows/sc-client-server-deb11.yml index b6639c5b..eac31767 100644 --- a/.github/workflows/sc-client-server-deb11.yml +++ b/.github/workflows/sc-client-server-deb11.yml @@ -70,6 +70,9 @@ jobs: name: Server Image path: sc-server.tar + - name: Build Thrift server Docker image + run: ./build.sh -i server -o deb11 -s thrift + build-sc-client: name: Build SAI Challenger client image runs-on: ubuntu-20.04 diff --git a/configs/server/supervisord.conf.thrift b/configs/server/supervisord.conf.thrift index 85c77fb2..3cd2a363 100644 --- a/configs/server/supervisord.conf.thrift +++ b/configs/server/supervisord.conf.thrift @@ -21,14 +21,6 @@ stdout_logfile=syslog stderr_logfile=syslog dependent_startup=true -[program:wait-interfaces] -command=/usr/bin/wait-interfaces.sh -priority=2 -startsecs=0 -autostart=false -autorestart=false -dependent_startup=true - [program:saiserver] command=/usr/sbin/saiserver -f /usr/share/sonic/hwsku/port_config.ini -p /usr/share/sonic/hwsku/sai.profile priority=3 diff --git a/dockerfiles/bullseye/Dockerfile.saithrift-server b/dockerfiles/bullseye/Dockerfile.saithrift-server new file mode 100644 index 00000000..8a6b2adb --- /dev/null +++ b/dockerfiles/bullseye/Dockerfile.saithrift-server @@ -0,0 +1,85 @@ +FROM debian:buster-slim + +RUN echo "deb [arch=amd64] http://debian-archive.trafficmanager.net/debian/ buster main contrib non-free" >> /etc/apt/sources.list && \ + echo "deb-src [arch=amd64] http://debian-archive.trafficmanager.net/debian/ buster main contrib non-free" >> /etc/apt/sources.list && \ + echo "deb [arch=amd64] http://debian-archive.trafficmanager.net/debian-security/ buster/updates main contrib non-free" >> /etc/apt/sources.list && \ + echo "deb-src [arch=amd64] http://debian-archive.trafficmanager.net/debian-security/ buster/updates main contrib non-free" >> /etc/apt/sources.list && \ + echo "deb [arch=amd64] http://debian-archive.trafficmanager.net/debian buster-backports main" >> /etc/apt/sources.list + +## 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 \ + vim \ + curl \ + wget \ + iproute2 \ + unzip \ + git \ + procps \ + build-essential \ + graphviz \ + doxygen \ + aspell \ + python3-pip \ + rsyslog \ + supervisor + +# Add support for supervisord to handle startup dependencies +RUN pip3 install supervisord-dependent-startup==1.4.0 + +# Install generic packages +RUN apt-get install -y \ + libtemplate-perl \ + libconst-fast-perl \ + libmoosex-aliases-perl \ + libnamespace-autoclean-perl \ + libgetopt-long-descriptive-perl \ + aspell-en bison flex g++ \ + libboost-all-dev libevent-dev libssl-dev \ + libpython3-dev libpcap-dev + +WORKDIR /sai + +RUN apt-get install -y pkg-config \ + && wget "http://archive.apache.org/dist/thrift/0.11.0/thrift-0.11.0.tar.gz" \ + && tar -xf thrift-0.11.0.tar.gz \ + && cd thrift-0.11.0 \ + && ./bootstrap.sh \ + && ./configure --prefix=/usr --with-cpp --with-python \ + --with-qt4=no --with-qt5=no --with-csharp=no --with-java=no --with-erlang=no \ + --with-nodejs=no --with-lua=no --with-per=no --with-php=no --with-dart=no \ + --with-ruby=no --with-haskell=no --with-go=no --with-rs=no --with-haxe=no \ + --with-dotnetcore=no --with-d=no \ + && make && make install \ + && pip3 install ctypesgen lib/py \ + && cd /sai \ + && rm -rf thrift-0.11.0 thrift-0.11.0.tar.gz ; + +ENV SAITHRIFTV2=y +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 + +CMD ["/usr/bin/supervisord"] diff --git a/dockerfiles/buster/Dockerfile.saithrift-server b/dockerfiles/buster/Dockerfile.saithrift-server index 5ef4c839..51c94506 100644 --- a/dockerfiles/buster/Dockerfile.saithrift-server +++ b/dockerfiles/buster/Dockerfile.saithrift-server @@ -49,7 +49,6 @@ 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"