Skip to content

Commit

Permalink
[CI] DOCA compilation: add do_compile_doca() in globals.sh
Browse files Browse the repository at this point in the history
do_compile_doca() function does the following:
- checks out DOCA SDK source code
- prepares the environment
- runs compilation

Issue: HPCINFRA-1968

Signed-off-by: Viacheslav Login <vlogin@nvidia.com>

[CI] DOCA compilation: add trigger for DOCA compilation

We prepare DOCA environment for XLIO "build" step, that will be fully integrated at the later steps:
- check do_compile_doca variable
- define jenkins_test_doca trigger

Issue: HPCINFRA-1968

Signed-off-by: Viacheslav Login <vlogin@nvidia.com>
  • Loading branch information
vialogi committed May 14, 2024
1 parent a1e0660 commit 345a478
Show file tree
Hide file tree
Showing 4 changed files with 78 additions and 1 deletion.
19 changes: 18 additions & 1 deletion .ci/matrix_job.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ runs_on_dockers:
uri: '$arch/$name',
tag: '20240805',
build_args: '--no-cache',
category: 'tool'
category: 'doca'
}

runs_on_agents:
Expand Down Expand Up @@ -123,6 +123,23 @@ steps:
run: |
./autogen.sh -s
parallel: false

- name: Build with DOCA
enable: ${do_compile_doca} && $(do_build)
containerSelector:
- "{category: 'doca'}"
agentSelector:
- "{nodeLabel: 'skip-agent'}"
run: |
[ "x${do_compile_doca}" == "xtrue" ] && action=yes || action=no
env WORKSPACE=$PWD TARGET=${flags} jenkins_test_build=${action} jenkins_test_doca=${action} ./contrib/test_jenkins.sh
parallel: false
onfail: |
./.ci/artifacts.sh
archiveArtifacts-onfail: |
jenkins/**/arch-*.tar.gz
archiveTap-onfail: |
jenkins/**/*.tap
- name: Build
enable: ${do_build}
Expand Down
4 changes: 4 additions & 0 deletions .ci/proj_jjb.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,10 @@
name: "do_build"
default: true
description: "This verifies different configuration using gcc compiler."
- bool:
name: "do_compile_doca"
default: false
description: "Compiles DOCA SDK for futher tests with XLIO."
- bool:
name: "do_compiler"
default: true
Expand Down
51 changes: 51 additions & 0 deletions contrib/jenkins_tests/globals.sh
Original file line number Diff line number Diff line change
Expand Up @@ -281,6 +281,57 @@ do_version_check()
}'
}

do_compile_doca()
{
echo "===== DOCA checkout & compilation starts ====="
doca_version="2.7"
doca_path=${WORKSPACE}/${prefix}/doca-sdk
doca_repo="ssh://git-nbu.nvidia.com:12023/doca/doca"
doca_dir=${WORKSPACE}/${prefix}/doca_dir
doca_branch=doca_"${doca_version}"

mkdir -p "${doca_path}"
mkdir -p "${doca_dir}"

if [ -d "${doca_path}" ]; then
echo "Directory ${doca_path} exists. Updating..."
pushd "${doca_path}" || exit 1
git fetch origin "{$doca_branch}"
git checkout "{$doca_branch}"
git merge origin/"{$doca_branch}"
else
echo "Directory ${doca_path} does not exist. Cloning..."
git clone -b "{$doca_branch}" "{$doca_repo}" "${doca_path}"
pushd "$doca_path" || exit 1
fi

if ! devtools/scripts/prepare_for_dev.sh --host --local; then
echo "Cannot prepare for dev..."
exit 1
fi

# shellcheck source=/dev/null
if ! (source devtools/public/set_env_variables.sh --deb); then
echo "Cannot set up ENV..."
exit 1
fi

if ! meson "${doca_dir}"; then
echo "Cannot prepare the project for compilation..."
exit 1
fi

if ninja -C "${doca_dir}"; then
eval "$1=${doca_dir}"
echo "===== DOCA compilation complete ====="
else
echo "Compilation error..."
exit 1
fi

popd
}

do_check_dpcp()
{
local ret=0
Expand Down
5 changes: 5 additions & 0 deletions contrib/test_jenkins.sh
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ jenkins_test_style=${jenkins_test_style:="no"}
jenkins_test_tool=${jenkins_test_tool:="no"}
jenkins_test_commit=${jenkins_test_commit:="no"}
jenkins_test_tidy=${jenkins_test_tidy:="no"}
jenkins_test_doca=${jenkins_test_doca:="no"}

echo
for var in ${!jenkins_test_@}; do
Expand Down Expand Up @@ -115,6 +116,10 @@ if [ "$TARGET" == "all" -o "$TARGET" == "default" ]; then
do_err "target: $TARGET"
exit 1
fi
if do_compile_doca doca_path; then
target_list[$i]=" --with-dpcp=${doca_path}"
i=$((i+1))
fi
fi

echo
Expand Down

0 comments on commit 345a478

Please sign in to comment.