Skip to content

Commit

Permalink
test ofed base image
Browse files Browse the repository at this point in the history
Signed-off-by: Daniel Pressler <danielpr@nvidia.com>
  • Loading branch information
dpressle committed Jun 18, 2024
1 parent dab8d0f commit 340956b
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 34 deletions.
72 changes: 39 additions & 33 deletions .ci/dockerfiles/Dockerfile.ubuntu22.04
Original file line number Diff line number Diff line change
@@ -1,37 +1,38 @@
ARG ARCH=x86_64
FROM harbor.mellanox.com/hpcx/$ARCH/ubuntu22.04/core:latest AS build
FROM harbor.mellanox.com/hpcx/$ARCH/ubuntu22.04/builder:mofed-5.7-0.1.9.0 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"
ARG REPO_ARCH="amd64"
# 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"
# ARG REPO_ARCH="amd64"

RUN apt-get update && \
apt-get install -y \
sudo wget lynx unzip \
automake dh-make \
g++ make vim python3-pip curl \
git libglib2.0-dev \
&& apt-get clean && rm -rf /var/lib/apt/lists/*
# RUN apt-get update && \
# apt-get install -y \
# net-tools unzip \
# sudo wget lynx unzip \
# automake dh-make \
# g++ make vim python3-pip curl \
# git libglib2.0-dev \
# && apt-get clean && rm -rf /var/lib/apt/lists/*

RUN DOCA_REPO_LINK=$(lynx -dump -listonly ${HTTP_NFS_ENDPOINT}/${DOCA_REPO_BUILD} | awk '{ print $2 }' | grep doca-host | grep -iE ".rpm$|.deb$" | grep -iE "$OS_NAME.*$REPO_ARCH" || true) \
&& wget -q --no-check-certificate -O doca-repo.deb $DOCA_REPO_LINK \
&& apt-get -qq install -y ./doca-repo.deb \
&& 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 DOCA_REPO_LINK=$(lynx -dump -listonly ${HTTP_NFS_ENDPOINT}/${DOCA_REPO_BUILD} | awk '{ print $2 }' | grep doca-host | grep -iE ".rpm$|.deb$" | grep -iE "$OS_NAME.*$REPO_ARCH" || true) \
# && wget -q --no-check-certificate -O doca-repo.deb $DOCA_REPO_LINK \
# && apt-get -qq install -y ./doca-repo.deb \
# && 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
# RUN pip3 install -U pip --no-cache-dir \
# && pip3 install argparse

RUN echo "${_LOGIN} ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers && \
echo "root ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers && \
Expand All @@ -43,21 +44,26 @@ RUN echo "${_LOGIN} ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers && \

ENTRYPOINT [ "/bin/bash", "--login", "--rcfile", "/etc/bashrc", "-c" ]

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

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

FROM build AS test
FROM tests AS test
RUN apt-get update && \
apt-get install -y \
openssh-server \
net-tools psmisc \
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 /var/run/sshd ~/.ssh && \
ssh-keygen -t rsa -N '' -f ~/.ssh/id_rsa && \
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 && \
Expand All @@ -66,7 +72,7 @@ RUN mkdir /var/run/sshd ~/.ssh && \
echo " UserKnownHostsFile /dev/null" >> ~/.ssh/config && \
echo " LogLevel ERROR" >> ~/.ssh/config

FROM build AS gtest
FROM tests AS gtest

FROM build AS static
# for tidy tests
Expand Down
1 change: 0 additions & 1 deletion .ci/matrix_job.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,6 @@ runs_on_dockers:
build_args: '--no-cache --target static',
category: 'tool'
}

# tests
- {
file: '.ci/dockerfiles/Dockerfile.ubuntu22.04',
Expand Down

0 comments on commit 340956b

Please sign in to comment.