Skip to content

Commit

Permalink
ubuntu24.04 ci pipeline fix
Browse files Browse the repository at this point in the history
Signed-off-by: shiva kumar <[email protected]>
  • Loading branch information
shivakunv committed Nov 22, 2024
1 parent a4bc190 commit 82cef2b
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions tests/scripts/findkernelversion.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,25 +17,25 @@ chmod a+x bin/regctl
export PATH=$(pwd)/bin:${PATH}

# calculate kernel version of latest image
echo -e "SHIVA1 ${BASE_TARGET}-${KERNEL_FLAVOR}-${DRIVER_BRANCH} "
# echo -e "SHIVA1 ${BASE_TARGET}-${KERNEL_FLAVOR}-${DRIVER_BRANCH} "
regctl image get-file ghcr.io/nvidia/driver:base-${BASE_TARGET}-${KERNEL_FLAVOR}-${DRIVER_BRANCH} /var/kernel_version.txt ./kernel_version.txt 2>/dev/null || true
if [[ -f ./kernel_version.txt && -s ./kernel_version.txt ]]; then
# File exists and is not empty
echo -e "SHIVA2 "
# echo -e "SHIVA2 "
export $(grep -oP 'KERNEL_VERSION=[^ ]+' ./kernel_version.txt)
rm -f kernel_version.txt
else
# Define variables for artifact pattern
prefix="kernel-version-${DRIVER_BRANCH}-${LTS_KERNEL}"
suffix="${kernel_flavor}-${DIST}"
artifacts=$(gh api -X GET /repos/${GITHUB_REPOSITORY}/actions/runs/${GITHUB_RUN_ID}/artifacts --jq '.artifacts[].name')
echo -e "SHIVA2 $artifacts"
# echo -e "SHIVA2 $artifacts"
# Use a loop or a pattern to find the matching artifact dynamically
for artifact in $artifacts; do
echo -e "SHIVA2 $artifact"
# echo -e "SHIVA2 $artifact"
if [[ $artifact == $prefix*-$suffix ]]; then
gh run download --name "$artifact" --dir ./
tar -xvf $artifact.tar
tar -xf $artifact.tar
rm -f $artifact.tar
cat ./kernel_version.txt
export $(grep -oP 'KERNEL_VERSION=[^ ]+' ./kernel_version.txt)
Expand Down Expand Up @@ -71,9 +71,9 @@ fi

# calculate driver tag
status=0
echo -e "SHIVA4"
# echo -e "SHIVA4"
regctl tag ls nvcr.io/nvidia/driver | grep "^${DRIVER_BRANCH}-${KERNEL_VERSION}-${DIST}$" || status=$?
echo -e "SHIVA5"
# echo -e "SHIVA5"
if [[ $status -eq 0 ]]; then
export should_continue=false
else
Expand Down

0 comments on commit 82cef2b

Please sign in to comment.