Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[DOCA] compile xlio with doca #147

Merged
26 changes: 0 additions & 26 deletions .ci/dockerfiles/Dockerfile.rhel8.6

This file was deleted.

133 changes: 133 additions & 0 deletions .ci/dockerfiles/Dockerfile.ubuntu22.04
Original file line number Diff line number Diff line change
@@ -0,0 +1,133 @@
FROM harbor.mellanox.com/swx-infra/media/base_ubuntu_22.04 AS build

ARG _UID=6213
ARG _GID=101
ARG _LOGIN=swx-jenkins
ARG _HOME=/var/home/$_LOGIN

ARG HTTP_NFS_ENDPOINT="http://nbu-nfs.mellanox.com"
ARG DOCA_REPO_BUILD="/auto/sw/release/doca/doca-repo-x86/doca-repo-2.6.0/last_stable"
ARG OS_NAME="ubuntu2204"

RUN ARCH=$(uname -m) && \
echo "Platform is $ARCH"; \
if [ "$ARCH" = "x86_64" ]; then \
ARCH="amd64"; \
DOCA_ARCH="x86_64"; \
elif [ "$ARCH" = "aarch64" ]; then \
ARCH="arm64"; \
DOCA_ARCH="arm64-sbsa"; \
else \
echo "Unsupported architecture: $ARCH"; \
exit 1; \
fi && \
echo "Architecture is $ARCH" && \
apt-get update && \
apt-get install -y \
sudo wget clang-15 \
automake dh-make \
g++ make vim python3-pip curl \
git libglib2.0-dev \
&& echo >> /etc/apt/sources.list.d/doca.list \
&& echo deb [signed-by=/etc/apt/trusted.gpg.d/GPG-KEY-Mellanox.pub] https://doca-repo-prod.nvidia.com/internal/repo/doca/2.7.0/ubuntu22.04/$DOCA_ARCH/latest ./ >> /etc/apt/sources.list.d/doca.list \
&& curl https://doca-repo-prod.nvidia.com/internal/repo/doca/2.7.0/ubuntu22.04/$DOCA_ARCH/latest//GPG-KEY-Mellanox.pub | gpg --dearmor > /etc/apt/trusted.gpg.d/GPG-KEY-Mellanox.pub \
&& apt-get clean && rm -rf /var/lib/apt/lists/*

RUN apt-get -qq update \
&& mkdir -p /lib/modules \
&& apt-get -qq install -y --allow-downgrades ibacm ibacm infiniband-diags libibumad \
libibverbs-dev libibverbs1 libibverbs-dev librdmacm-dev flex \
librdmacm1 mlnx-ethtool mlnx-iproute2 mlnx-tools mstflint \
ofed-scripts rdma-core collectx-clxapi collectx-clxapidev \
python3-protobuf libgrpc-dev mlnx-dpdk-dev mlnx-dpdk \
ninja-build meson libjson-c-dev libjsoncpp-dev libzip-dev libgtest-dev \
build-essential

RUN pip3 install -U pip --no-cache-dir \
&& pip3 install argparse --no-cache-dir

RUN echo "${_LOGIN} ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers && \
echo "root ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers && \
mkdir -p ${_HOME} && \
groupadd -f -g "$_GID" "$_LOGIN" && \
useradd -u "$_UID" -g "$_GID" -s /bin/bash -m -d ${_HOME} "${_LOGIN}" && \
chown -R ${_LOGIN} ${_HOME} && \
mkdir /build && chown -R ${_LOGIN} /build

FROM build AS toolbox
RUN apt-get update \
&& wget http://mirrors.kernel.org/ubuntu/pool/universe/g/gcc-8/gcc-8_8.4.0-3ubuntu2_amd64.deb \
&& wget http://mirrors.edge.kernel.org/ubuntu/pool/universe/g/gcc-8/gcc-8-base_8.4.0-3ubuntu2_amd64.deb \
&& wget http://mirrors.kernel.org/ubuntu/pool/universe/g/gcc-8/libgcc-8-dev_8.4.0-3ubuntu2_amd64.deb \
&& wget http://mirrors.kernel.org/ubuntu/pool/universe/g/gcc-8/cpp-8_8.4.0-3ubuntu2_amd64.deb \
&& wget http://mirrors.kernel.org/ubuntu/pool/universe/g/gcc-8/libmpx2_8.4.0-3ubuntu2_amd64.deb \
&& wget http://mirrors.kernel.org/ubuntu/pool/main/i/isl/libisl22_0.22.1-1_amd64.deb \
&& apt install -y ./libisl22_0.22.1-1_amd64.deb ./libmpx2_8.4.0-3ubuntu2_amd64.deb \
./cpp-8_8.4.0-3ubuntu2_amd64.deb ./libgcc-8-dev_8.4.0-3ubuntu2_amd64.deb \
./gcc-8-base_8.4.0-3ubuntu2_amd64.deb ./gcc-8_8.4.0-3ubuntu2_amd64.deb \
&& wget http://mirrors.kernel.org/ubuntu/pool/universe/g/gcc-8/libstdc++-8-dev_8.4.0-3ubuntu2_amd64.deb \
&& wget http://mirrors.kernel.org/ubuntu/pool/universe/g/gcc-8/g++-8_8.4.0-3ubuntu2_amd64.deb \
&& apt install -y ./libstdc++-8-dev_8.4.0-3ubuntu2_amd64.deb ./g++-8_8.4.0-3ubuntu2_amd64.deb \
&& apt install -y software-properties-common \
&& add-apt-repository ppa:ubuntu-toolchain-r/test -y \
&& apt update \
&& apt install -y gcc-9 g++-9 clang-14 \
&& apt install -y gcc-9-multilib g++-9-multilib \
&& apt install -y gcc-10 g++-10 \
&& apt install -y gcc-10-multilib g++-10-multilib \
&& update-alternatives --install /usr/bin/clang clang /usr/bin/clang-15 100 \
--slave /usr/bin/clang++ clang++ /usr/bin/clang++-15 \
&& update-alternatives --install /usr/bin/clang clang /usr/bin/clang-14 90 \
--slave /usr/bin/clang++ clang++ /usr/bin/clang++-14 \
&& update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-8 70 \
--slave /usr/bin/g++ g++ /usr/bin/g++-8 \
&& update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-9 80 \
--slave /usr/bin/g++ g++ /usr/bin/g++-9 \
&& update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-10 90 \
--slave /usr/bin/g++ g++ /usr/bin/g++-10 \
&& update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-11 100 \
--slave /usr/bin/g++ g++ /usr/bin/g++-11 \
&& rm -rf *.deb \
&& apt-get clean && rm -rf /var/lib/apt/lists/*

FROM build AS tests
RUN apt-get update && \
apt-get install -y \
net-tools unzip iproute2 \
&& apt-get clean && rm -rf /var/lib/apt/lists/*

FROM tests AS vg
RUN sudo su - && \
apt-get update && \
apt-get install -y \
valgrind \
&& apt-get clean && rm -rf /var/lib/apt/lists/*

FROM tests AS test
RUN apt-get update && \
apt-get install -y \
openssh-server psmisc \
&& apt-get clean && rm -rf /var/lib/apt/lists/*
# setup ssh server and passwordless login for root for tests flows (verifyer.pl)
RUN mkdir -p /var/run/sshd ~/.ssh && \
rm -rf ~/.ssh/id_rsa* && ssh-keygen -t rsa -N '' -f ~/.ssh/id_rsa && \
cat ~/.ssh/id_rsa.pub > ~/.ssh/authorized_keys && \
sed -i 's|#PermitRootLogin.*|PermitRootLogin without-password|g' /etc/ssh/sshd_config && \
sed -i 's|#PasswordAuthentication.*|PasswordAuthentication no|g' /etc/ssh/sshd_config && \
echo "Host *" >> ~/.ssh/config && \
echo " StrictHostKeyChecking no" >> ~/.ssh/config && \
echo " UserKnownHostsFile /dev/null" >> ~/.ssh/config && \
echo " LogLevel ERROR" >> ~/.ssh/config

FROM tests AS gtest

FROM build AS static
# for tidy tests
RUN sudo su - && \
pip3 install compiledb --no-cache-dir
RUN sudo su - && \
apt-get update && \
apt-get install -y \
cppcheck clang-tools clang-tidy \
&& apt-get clean && rm -rf /var/lib/apt/lists/*

dpressle marked this conversation as resolved.
Show resolved Hide resolved
Loading