Skip to content

Commit

Permalink
[CI] DOCA compilation: fix compiler.sh failures
Browse files Browse the repository at this point in the history
- Install all required compilers inside comtainer rather than connecting modules
- Use update-alternatives to switch between compilers
- Update matrix_job.yaml with toolbox target for docker build

Issue: HPCINFRA-1968

Signed-off-by: Viacheslav Login <vlogin@nvidia.com>
  • Loading branch information
vialogi committed Jul 15, 2024
1 parent 42ee358 commit b155b09
Show file tree
Hide file tree
Showing 4 changed files with 68 additions and 21 deletions.
36 changes: 36 additions & 0 deletions .ci/dockerfiles/Dockerfile.ubuntu22.04
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,42 @@ RUN echo "${_LOGIN} ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers && \
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 \
Expand Down
10 changes: 9 additions & 1 deletion .ci/matrix_job.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,15 @@ runs_on_dockers:
category: 'base'
}
# tool
- {name: 'toolbox', url: 'harbor.mellanox.com/hpcx/x86_64/rhel8.6/builder:inbox', category: 'tool', arch: 'x86_64'}
- {
file: '.ci/dockerfiles/Dockerfile.ubuntu22.04',
arch: 'x86_64',
name: 'toolbox',
uri: 'xlio/$arch/ubuntu22.04/$name',
tag: '20240805',
build_args: '--no-cache --target toolbox',
category: 'tool'
}
- {name: 'blackduck', url: 'harbor.mellanox.com/toolbox/ngci-centos:7.9.2009.2', category: 'tool', arch: 'x86_64'}
- {name: 'header-check', url: 'harbor.mellanox.com/toolbox/header_check:0.0.14', category: 'tool', arch: 'x86_64', tag: '0.0.14'}
# static tests
Expand Down
9 changes: 4 additions & 5 deletions contrib/jenkins_tests/compiler.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,24 +10,23 @@ rm -rf $compiler_dir
mkdir -p $compiler_dir
cd $compiler_dir

compiler_list="clang:clang++:dev/clang-9.0.1 icc:icpc:intel/ics-18.0.4 icc:icpc:intel/ics-19.1.1 gcc:g++:dev/gcc-8.3.0 gcc:g++:dev/gcc-9.3.0 gcc:g++:dev/gcc-10.1.0"
compiler_list="clang:clang++:clang-15 gcc:g++:gcc-8 gcc:g++:gcc-9 gcc:g++:gcc-10 gcc:g++:gcc-11"

compiler_tap=${WORKSPACE}/${prefix}/compiler.tap
echo "1..$(echo $compiler_list | tr " " "\n" | wc -l)" > $compiler_tap

test_id=0
for compiler in $compiler_list; do
IFS=':' read cc cxx module <<< "$compiler"
IFS=':' read cc cxx version <<< "$compiler"
update-alternatives --set $cc /usr/bin/$version
mkdir -p ${compiler_dir}/${test_id}
cd ${compiler_dir}/${test_id}
[ -z "$module" ] && test_name=$($cc --version | head -n 1) || test_name="$module"
[ ! -z "$module" ] && do_module "$module"
test_name="$version"
echo "======================================================"
$cc --version
echo
test_exec='${WORKSPACE}/configure --prefix=$compiler_dir-$cc CC=$cc CXX=$cxx --disable-lto $jenkins_test_custom_configure && make $make_opt all'
do_check_result "$test_exec" "$test_id" "$test_name" "$compiler_tap" "${compiler_dir}/compiler-${test_id}"
[ ! -z "$module" ] && module unload "$module"
cd ${compiler_dir}
test_id=$((test_id+1))
done
Expand Down
34 changes: 19 additions & 15 deletions contrib/jenkins_tests/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,11 @@ if [ $(test -d ${install_dir} >/dev/null 2>&1 || echo $?) ]; then
exit 1
fi

if [ $(command -v ibdev2netdev >/dev/null 2>&1 || echo $?) ]; then
echo "[SKIP] ibdev2netdev tool does not exist"
exit 0
fi

cd $WORKSPACE

rm -rf $test_dir
Expand Down Expand Up @@ -50,7 +55,7 @@ if [ ! -z "${test_remote_ip}" ] ; then
[ -z "${NODE_NAME}" ] && NODE_NAME=${HOSTNAME}
sperf_exec_dir="/tmp/sockperf_exec_${NODE_NAME}"
rmt_user=root

rmt_os=$(${sudo_cmd} ssh ${rmt_user}@${test_remote_ip} ". /etc/os-release ; echo \${NAME,,} | awk '{print \$1}'")
[ ! -z "${test_remote_rebuild}" ] && rmt_os="rebuld"
local_os=$(. /etc/os-release ; echo ${NAME,,} | awk '{print $1}')
Expand All @@ -63,7 +68,7 @@ if [ ! -z "${test_remote_ip}" ] ; then
${sudo_cmd} scp -q ${test_app} ${rmt_user}@${test_remote_ip}:${sperf_exec_dir}
${sudo_cmd} scp -q ${test_lib} ${rmt_user}@${test_remote_ip}:${sperf_exec_dir}
eval "pid=$(${sudo_cmd} ssh ${rmt_user}@${test_remote_ip} pidof ${prj_service})"
if [ ! -z "${pid}" ] ; then
if [ ! -z "${pid}" ] ; then
echo "${prj_service} pid=${pid}"
eval "${sudo_cmd} ssh ${rmt_user}@${test_remote_ip} kill -9 ${pid}"
fi
Expand All @@ -88,16 +93,15 @@ if [ ! -z "${test_remote_ip}" ] ; then
fi
fi
else
# Get IPv4/6 addresses for net1 interface which is a VF of MLNX NIC
test_ip_list="eth_ip4:$(ip -f inet addr show net1 | awk '/inet / {print $2}' | cut -d/ -f1)"
# test_ip_list="${test_ip_list} eth_ip6:$(ip -f inet6 addr show net1 | awk '/inet6 / {print $2}' | cut -d/ -f1)"
if [ -z "$test_ip_list" ]; then
echo "ERROR: Cannot get IPv4/6 address of net1 interface!"
exit 1
if [ ! -z $(do_get_ip 'ib') ]; then
test_ip_list="${test_ip_list} ib:$(do_get_ip 'ib')"
fi
if [ ! -z $(do_get_ip 'eth') ]; then
test_ip_list="${test_ip_list} eth_ip4:$(do_get_ip 'eth')"
fi
if [ ! -z $(do_get_ip 'inet6') ]; then
test_ip_list="${test_ip_list} eth_ip6:$(do_get_ip 'inet6')"
fi

# start the ssh server as verifyer.pl requiers
/etc/init.d/ssh start
fi

nerrors=0
Expand All @@ -112,7 +116,7 @@ for test_link in $test_ip_list; do
if [ ! -z "${test_remote_ip}" ] ; then

eval "pid=$(${sudo_cmd} pidof ${prj_service})"
[ ! -z "${pid}" ] && eval "${sudo_cmd} kill -9 ${pid}"
[ ! -z "${pid}" ] && eval "${sudo_cmd} kill -9 ${pid}"
eval "${sudo_cmd} ${install_dir}/sbin/${prj_service} --console -v5 & "

echo "BUILD_NUMBER=${BUILD_NUMBER}"
Expand All @@ -131,9 +135,9 @@ for test_link in $test_ip_list; do
-s "${test_remote_ip}" -p "${test_remote_port}" -l "${test_dir}/${test_name}.log" \
-e "XLIO_TX_BUFS=20000"
else
${sudo_cmd} $timeout_exe $PWD/tests/verifier/verifier.pl -a ${test_app} -x " --debug " \
${sudo_cmd} $timeout_exe $PWD/tests/verifier/verifier.pl -a ${test_app} -x " --load-vma=$test_lib " \
-t ${test}:tc[1-9]$ -s ${test_ip} -l ${test_dir}/${test_name}.log \
-e " LD_PRELOAD=$test_lib " \
-e " XLIO_TX_BUFS=20000 " \
--progress=0
fi

Expand Down Expand Up @@ -171,4 +175,4 @@ done
rc=$(($rc+$nerrors))

echo "[${0##*/}]..................exit code = $rc"
exit $rc
exit $rc

0 comments on commit b155b09

Please sign in to comment.