Skip to content

Commit f7be697

Browse files
committed
[CI] issue: HPCINFRA-4016 Split compiler step into parallel steps
The compiler step currently takes a long time to run (about 20–40 minutes). Split the compiler step into 6 separate steps (one per compiler) running in parallel to reduce build duration. Signed-off-by: Noam Tsemah <[email protected]>
1 parent a698fb7 commit f7be697

File tree

3 files changed

+86
-29
lines changed

3 files changed

+86
-29
lines changed

.ci/matrix_job.yaml

Lines changed: 62 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ job: LIBXLIO
33

44
step_allow_single_selector: false
55

6-
registry_host: harbor.mellanox.com
6+
registry_host: nbu-harbor.gtm.nvidia.com
77
registry_auth: swx-infra_harbor_credentials
88
registry_path: /swx-infra/media
99

@@ -17,10 +17,10 @@ kubernetes:
1717
arch_table:
1818
x86_64:
1919
nodeSelector: 'kubernetes.io/arch=amd64'
20-
jnlpImage: 'harbor.mellanox.com/toolbox/c3po-jnlp:latest'
20+
jnlpImage: '${registry_host}/toolbox/c3po-jnlp:latest'
2121
aarch64:
2222
nodeSelector: 'kubernetes.io/arch=arm64'
23-
jnlpImage: 'harbor.mellanox.com/toolbox/c3po-jnlp:latest'
23+
jnlpImage: '${registry_host}/toolbox/c3po-jnlp:latest'
2424

2525
credentials:
2626
- {credentialsId: 'media_coverity_credentials', usernameVariable: 'XLIO_COV_USER', passwordVariable: 'XLIO_COV_PASSWORD'}
@@ -86,8 +86,12 @@ runs_on_dockers:
8686
build_args: '--no-cache --target style',
8787
category: 'tool'
8888
}
89-
- {name: 'toolbox', url: 'harbor.mellanox.com/hpcx/x86_64/rhel8.6/builder:inbox', category: 'tool', arch: 'x86_64'}
90-
- {name: 'header-check', url: 'harbor.mellanox.com/toolbox/header_check:0.0.58', category: 'tool', arch: 'x86_64', tag: '0.0.58'}
89+
- {name: 'toolbox', url: '${registry_host}/hpcx/x86_64/rhel8.6/builder:inbox', category: 'tool', arch: 'x86_64'}
90+
- {name: 'toolbox-clang-9.0.1', url: '${registry_host}/hpcx/x86_64/rhel8.6/builder:inbox', category: 'tool', arch: 'x86_64'}
91+
- {name: 'toolbox-icc-18.0.4', url: '${registry_host}/hpcx/x86_64/rhel8.6/builder:inbox', category: 'tool', arch: 'x86_64'}
92+
- {name: 'toolbox-icc-19.1.1', url: '${registry_host}/hpcx/x86_64/rhel8.6/builder:inbox', category: 'tool', arch: 'x86_64'}
93+
- {name: 'toolbox-gcc', url: '${registry_host}/hpcx/x86_64/rhel8.6/builder:inbox', category: 'tool', arch: 'x86_64'}
94+
- {name: 'header-check', url: '${registry_host}/toolbox/header_check:0.0.58', category: 'tool', arch: 'x86_64', tag: '0.0.58'}
9195
# static tests
9296
- {
9397
file: '.ci/dockerfiles/Dockerfile.rhel8.6',
@@ -106,7 +110,7 @@ runs_on_dockers:
106110
build_args: '--no-cache --target static',
107111
category: 'tool'
108112
}
109-
- {name: 'xlio_static.csbuild', url: 'harbor.mellanox.com/swx-infra/media/x86_64/xlio_static.csbuild-clang18:20250515', category: 'tool', arch: 'x86_64' }
113+
- {name: 'xlio_static.csbuild', url: '${registry_host}/swx-infra/media/x86_64/xlio_static.csbuild-clang18:20250515', category: 'tool', arch: 'x86_64' }
110114
# tests
111115
- {
112116
file: '.ci/dockerfiles/Dockerfile.ubuntu22.04',
@@ -126,7 +130,7 @@ runs_on_dockers:
126130
- {
127131
arch: 'x86_64',
128132
name: 'vg-worker-threads',
129-
url: 'harbor.mellanox.com/swx-infra/media/xlio/x86_64/ubuntu22.04/vg:20250219',
133+
url: '${registry_host}/swx-infra/media/xlio/x86_64/ubuntu22.04/vg:20250219',
130134
category: 'tool',
131135
annotations: [{ key: 'k8s.v1.cni.cncf.io/networks', value: 'sriov-cx6dx-p2' }],
132136
limits: '{memory: 10Gi, cpu: 10000m, hugepages-2Mi: 10Gi, nvidia.com/sriov-cx6dx-p2: 1}',
@@ -153,7 +157,7 @@ runs_on_dockers:
153157
- {
154158
arch: 'x86_64',
155159
name: 'sockperf-worker-threads',
156-
url: 'harbor.mellanox.com/swx-infra/media/xlio/x86_64/ubuntu22.04/sockperf:20251015',
160+
url: '${registry_host}/swx-infra/media/xlio/x86_64/ubuntu22.04/sockperf:20251015',
157161
category: 'tests',
158162
annotations: [{ key: 'k8s.v1.cni.cncf.io/networks', value: 'sriov-cx6dx-p1' }],
159163
limits: '{memory: 10Gi, cpu: 10000m, hugepages-2Mi: 10Gi, nvidia.com/sriov-cx6dx-p1: 1}',
@@ -222,12 +226,12 @@ steps:
222226
- "{nodeLabel: 'skip-agent'}"
223227
run: |
224228
echo "Installing DOCA: ${DOCA_VERSION} ..."
225-
.ci/scripts/doca_install.sh
229+
.ci/scripts/doca_install.sh
226230
227231
- name: Install Doca-host on Tools
228232
run: |
229233
echo "Installing DOCA: ${DOCA_VERSION} ..."
230-
.ci/scripts/doca_install.sh
234+
.ci/scripts/doca_install.sh
231235
containerSelector:
232236
- "{name: 'style', category: 'tool', variant: 1}"
233237
agentSelector:
@@ -320,15 +324,60 @@ steps:
320324
archiveArtifacts-onfail: |
321325
jenkins/**/arch-*.tar.gz
322326
323-
- name: Compiler
327+
- name: Compiler (clang-9.0.1)
324328
enable: ${do_compiler}
325329
containerSelector:
326-
- "{name: 'toolbox', category: 'tool'}"
330+
- "{name: 'toolbox-clang-9.0.1', category: 'tool'}"
331+
agentSelector:
332+
- "{nodeLabel: 'skip-agent'}"
333+
run: |
334+
[ "x${do_compiler}" == "xtrue" ] && action=yes || action=no
335+
env WORKSPACE=$PWD TARGET=${flags} COMPILER_SPEC="clang:clang++:dev/clang-9.0.1" jenkins_test_compiler=${action} ./contrib/test_jenkins.sh
336+
parallel: false
337+
onfail: |
338+
./.ci/artifacts.sh
339+
archiveArtifacts-onfail: |
340+
jenkins/**/arch-*.tar.gz
341+
342+
- name: Compiler (icc-18.0.4)
343+
enable: ${do_compiler}
344+
containerSelector:
345+
- "{name: 'toolbox-icc-18.0.4', category: 'tool'}"
346+
agentSelector:
347+
- "{nodeLabel: 'skip-agent'}"
348+
run: |
349+
[ "x${do_compiler}" == "xtrue" ] && action=yes || action=no
350+
env WORKSPACE=$PWD TARGET=${flags} COMPILER_SPEC="icc:icpc:intel/ics-18.0.4" jenkins_test_compiler=${action} ./contrib/test_jenkins.sh
351+
parallel: false
352+
onfail: |
353+
./.ci/artifacts.sh
354+
archiveArtifacts-onfail: |
355+
jenkins/**/arch-*.tar.gz
356+
357+
- name: Compiler (icc-19.1.1)
358+
enable: ${do_compiler}
359+
containerSelector:
360+
- "{name: 'toolbox-icc-19.1.1', category: 'tool'}"
361+
agentSelector:
362+
- "{nodeLabel: 'skip-agent'}"
363+
run: |
364+
[ "x${do_compiler}" == "xtrue" ] && action=yes || action=no
365+
env WORKSPACE=$PWD TARGET=${flags} COMPILER_SPEC="icc:icpc:intel/ics-19.1.1" jenkins_test_compiler=${action} ./contrib/test_jenkins.sh
366+
parallel: false
367+
onfail: |
368+
./.ci/artifacts.sh
369+
archiveArtifacts-onfail: |
370+
jenkins/**/arch-*.tar.gz
371+
372+
- name: Compiler (gcc)
373+
enable: ${do_compiler}
374+
containerSelector:
375+
- "{name: 'toolbox-gcc', category: 'tool'}"
327376
agentSelector:
328377
- "{nodeLabel: 'skip-agent'}"
329378
run: |
330379
[ "x${do_compiler}" == "xtrue" ] && action=yes || action=no
331-
env WORKSPACE=$PWD TARGET=${flags} jenkins_test_compiler=${action} ./contrib/test_jenkins.sh
380+
env WORKSPACE=$PWD TARGET=${flags} COMPILER_SPEC="gcc" jenkins_test_compiler=${action} ./contrib/test_jenkins.sh
332381
parallel: false
333382
onfail: |
334383
./.ci/artifacts.sh

contrib/jenkins_tests/compiler.sh

Lines changed: 23 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -4,36 +4,44 @@ source $(dirname $0)/globals.sh
44

55
echo "Checking for compiler ..."
66

7-
cd $WORKSPACE
7+
cd "${WORKSPACE}"
88

9-
rm -rf $compiler_dir
10-
mkdir -p $compiler_dir
11-
cd $compiler_dir
9+
rm -rf "${compiler_dir}"
10+
mkdir -p "${compiler_dir}"
11+
cd "${compiler_dir}"
1212

13-
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"
13+
default_compilers="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"
1414

15-
compiler_tap=${WORKSPACE}/${prefix}/compiler.tap
16-
echo "1..$(echo $compiler_list | tr " " "\n" | wc -l)" > $compiler_tap
15+
if [[ -z "$COMPILER_SPEC" ]]; then
16+
compiler_list="${default_compilers}"
17+
elif [[ "$COMPILER_SPEC" == "gcc" ]] || [[ "$COMPILER_SPEC" == "clang" ]] || [[ "$COMPILER_SPEC" == "icc" ]]; then
18+
compiler_list=$(echo "${default_compilers}" | tr " " "\n" | grep "^${COMPILER_SPEC}:" | tr "\n" " ")
19+
else
20+
compiler_list="${COMPILER_SPEC}"
21+
fi
22+
23+
compiler_tap="${WORKSPACE}/${prefix}/compiler.tap"
24+
echo "1..$(echo "${compiler_list}" | tr " " "\n" | wc -l)" > "${compiler_tap}"
1725

1826
test_id=0
1927
for compiler in $compiler_list; do
20-
IFS=':' read cc cxx module <<< "$compiler"
21-
mkdir -p ${compiler_dir}/${test_id}
22-
cd ${compiler_dir}/${test_id}
28+
IFS=':' read -r cc cxx module <<< "$compiler"
29+
mkdir -p "${compiler_dir}/${test_id}"
30+
cd "${compiler_dir}/${test_id}"
2331
[ -z "$module" ] && test_name=$($cc --version | head -n 1) || test_name="$module"
2432
[ ! -z "$module" ] && do_module "$module"
2533
echo "======================================================"
2634
$cc --version
2735
echo
2836
test_exec='${WORKSPACE}/configure --prefix=$compiler_dir-$cc CC=$cc CXX=$cxx --disable-lto $jenkins_test_custom_configure && make $make_opt all'
2937
do_check_result "$test_exec" "$test_id" "$test_name" "$compiler_tap" "${compiler_dir}/compiler-${test_id}"
30-
[ ! -z "$module" ] && module unload "$module"
31-
cd ${compiler_dir}
38+
[ ! -z "${module}" ] && module unload "$module"
39+
cd "${compiler_dir}"
3240
test_id=$((test_id+1))
33-
pushd ${WORKSPACE}/third_party/json-c
41+
pushd "${WORKSPACE}/third_party/json-c"
3442
make distclean
3543
popd
3644
done
3745

38-
echo "[${0##*/}]..................exit code = $rc"
39-
exit $rc
46+
echo "[${0##*/}]..................exit code = ${rc}"
47+
exit "${rc}"

contrib/test_jenkins.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ for target_v in "${target_list[@]}"; do
156156
set +e
157157
if [ 1 -lt "$jenkins_opt_exit" -o "$rc" -eq 0 ]; then
158158
if [ "$jenkins_test_compiler" = "yes" ]; then
159-
$WORKSPACE/contrib/jenkins_tests/compiler.sh
159+
"${WORKSPACE}/contrib/jenkins_tests/compiler.sh"
160160
ret=$?
161161
if [ $ret -gt 0 ]; then
162162
do_err "case: [compiler: ret=$ret]"

0 commit comments

Comments
 (0)