Skip to content

Commit

Permalink
[CI] HW-dependent tests: move to k8s
Browse files Browse the repository at this point in the history
We're going to run the tests that require special HW NICs in k8s cluster
This commit is to set up ci-demo part and Dockerfile for required tests

Issue: HPCINFRA-2196

Signed-off-by: Viacheslav Login <vlogin@nvidia.com>
  • Loading branch information
vialogi committed May 29, 2024
1 parent cb52843 commit 66e4dbc
Show file tree
Hide file tree
Showing 2 changed files with 89 additions and 8 deletions.
67 changes: 67 additions & 0 deletions .ci/dockerfiles/Dockerfile.ub2204
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
FROM ubuntu:22.04
ARG _UID=6213
ARG _GID=101
ARG _LOGIN=swx-jenkins
ARG _HOME=/var/home/$_LOGIN
ARG http_proxy=http://10.210.9.1:3128/
ARG https_proxy=http://10.210.9.1:3128/

ENV DEBIAN_FRONTEND=noninteractive

RUN apt-get update && \
apt-get install -y \
sudo \
automake \
default-jdk \
dh-make \
g++ \
git \
libcap2 \
libnuma-dev \
libtool \
make \
maven \
udev \
wget \
vim \
cpio \
net-tools \
iputils-ping \
environment-modules \
libibverbs-dev \
libfile-fcntllock-perl \
chrpath flex gfortran graphviz dpatch libgfortran5 tcl bison tk swig \
libnl-route-3-dev libnl-3-dev kmod python3 lsof pciutils ethtool libmnl0 pkg-config \
lsb-release \
python3-pip \
libavahi-compat-libdnssd-dev \
doxygen graphviz \
iproute2 gdb \
curl \
libcap-dev \
&& apt-get clean && rm -rf /var/lib/apt/lists/*

RUN mkdir -p /opt/mellanox/rivermax && \
curl -o /opt/mellanox/rivermax/rivermax.lic https://urm.nvidia.com/artifactory/sw-rivermax-generic-local/license/rivermax.lic

RUN pip3 install --trusted-host pypi.org --trusted-host pypi.python.org --trusted-host files.pythonhosted.org --upgrade pip && \
pip3 install wheel && \
pip3 install cmake conan~=2.0.5

RUN echo "Host *\n\tHostkeyAlgorithms +ssh-rsa\n\tPubkeyAcceptedAlgorithms +ssh-rsa" >> /etc/ssh/ssh_config

RUN echo "${_LOGIN} ALL=(ALL) NOPASSWD: ALL\nroot 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" && \
usermod -aG sudo $_LOGIN && \
chown -R ${_LOGIN} ${_HOME}

# W/A for libvma installation issue under docker environment
RUN touch /etc/init.d/vma && chmod +x /etc/init.d/vma

ENV MODULEPATH /hpc/local/etc/modulefiles
SHELL ["/bin/bash"]

USER "$_LOGIN"
ENTRYPOINT [ "/bin/bash", "--login", "--rcfile", "/etc/bashrc", "-c" ]
30 changes: 22 additions & 8 deletions .ci/matrix_job.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ kubernetes:
privileged: false
cloud: swx-k8s-spray
nodeSelector: 'beta.kubernetes.io/os=linux'
namespace: xlio-ci
namespace: 'xlio-ci'
limits: '{memory: 8Gi, cpu: 7000m}'
requests: '{memory: 8Gi, cpu: 7000m}'

Expand Down Expand Up @@ -69,7 +69,21 @@ runs_on_dockers:
uri: '$arch/$name',
tag: '20240703',
build_args: '--no-cache',
category: 'tool'
category: 'tool',
}
- {file: '.ci/dockerfiles/Dockerfile.ub2204',
arch: 'x86_64',
name: 'xlio_tests.gtests',
uri: '$arch/$name',
tag: '20242905',
build_args: '--no-cache',
category: 'tool',
annotations: [{ key: 'k8s.v1.cni.cncf.io/networks', value: 'sriov-cx6dx-p2' }],
limits: '{memory: 8Gi, cpu: 8000m, mellanox.com/sriov_cx6dx_p2: 1}',
requests: '{memory: 8Gi, cpu: 8000m, mellanox.com/sriov_cx6dx_p2: 1}',
caps_add: '[ IPC_LOCK, SYS_RESOURCE ]',
runAsUser: '0',
runAsGroup: '0'
}

runs_on_agents:
Expand Down Expand Up @@ -294,9 +308,9 @@ steps:
- name: Test
enable: ${do_test}
containerSelector:
- "{name: 'skip-container'}"
- "{name: 'xlio_tests.test', category:'tool'}"
agentSelector:
- "{nodeLabel: 'beni09'}"
- "{nodeLabel: 'skip-agent'}"
run: |
[ "x${do_test}" == "xtrue" ] && action=yes || action=no
env WORKSPACE=$PWD TARGET=${flags} jenkins_test_run=${action} ./contrib/test_jenkins.sh
Expand All @@ -311,9 +325,9 @@ steps:
- name: Gtest
enable: ${do_gtest}
containerSelector:
- "{name: 'skip-container'}"
- "{name: 'xlio_tests.gtests', category:'tool'}"
agentSelector:
- "{nodeLabel: 'beni09'}"
- "{nodeLabel: 'skip-agent'}"
run: |
[ "x${do_gtest}" == "xtrue" ] && action=yes || action=no
env WORKSPACE=$PWD TARGET=${flags} jenkins_test_gtest=${action} ./contrib/test_jenkins.sh
Expand All @@ -330,9 +344,9 @@ steps:
- name: Valgrind
enable: ${do_valgrind}
containerSelector:
- "{name: 'skip-container'}"
- "{name: 'xlio_tests.valgrind', category:'tool'}"
agentSelector:
- "{nodeLabel: 'beni09'}"
- "{nodeLabel: 'skip-agent'}"
run: |
[ "x${do_valgrind}" == "xtrue" ] && action=yes || action=no
env WORKSPACE=$PWD TARGET=${flags} jenkins_test_vg=${action} ./contrib/test_jenkins.sh
Expand Down

0 comments on commit 66e4dbc

Please sign in to comment.