fix(ci): use pinned GPU-hidden job container
KAR CUDA compile (GPU hidden) / kar-cuda-compile (pull_request) Failing after 0s

This commit is contained in:
Pavlo Ratushnyi
2026-10-07 13:59:51 +02:00
parent 92e611bad5
commit 8c19d82447
2 changed files with 39 additions and 39 deletions
+30 -38
View File
@@ -1,17 +1,6 @@
name: KAR CUDA compile (GPU hidden)
on:
push:
paths:
- 'gpu/kar/**'
- 'engine/strata/CMakeLists.txt'
- 'scripts/bootstrap-cuda-toolkit.py'
- 'scripts/build-static-cuda.sh'
- 'scripts/test-kar-expert-cache.sh'
- 'scripts/test-kar-cuda-build-lock.py'
- 'deploy/cuda-toolkit.lock.json'
- 'deploy/kar-cuda-build.lock.json'
- '.gitea/workflows/kar-cuda-compile.yml'
pull_request:
paths:
- 'gpu/kar/**'
@@ -31,37 +20,40 @@ jobs:
kar-cuda-compile:
runs-on: ubuntu-latest
timeout-minutes: 150
container:
image: ubuntu@sha256:88a381d5b5eeb2b35d3ad70925a362c37ce569daf43ede89ff818ec20e4d3794
options: --platform linux/amd64
env:
NVIDIA_VISIBLE_DEVICES: void
CUDA_VISIBLE_DEVICES: ''
steps:
- uses: https://git.vezha.io/actions/checkout@v4
- name: Build lock check
- name: Compile CUDA component in pinned GPU-hidden container
shell: bash
run: |
set -euo pipefail
python3 scripts/test-kar-cuda-build-lock.py
- name: Compile CUDA component in GPU-hidden Docker
shell: bash
run: |
set -euo pipefail
base="$(python3 -c 'import json; print(json.load(open("deploy/kar-cuda-build.lock.json"))["builder_image"])')"
packages="$(python3 -c 'import json; p=json.load(open("deploy/kar-cuda-build.lock.json"))["apt_packages"]; print(" ".join(f"{k}={v}" for k,v in p.items()))')"
docker run --rm --platform linux/amd64 --network bridge \
-e NVIDIA_VISIBLE_DEVICES=void -e CUDA_VISIBLE_DEVICES= \
-e LOCKED_PACKAGES="$packages" \
-v "$GITHUB_WORKSPACE:/work" -w /work "$base" \
bash -euxo pipefail -c '
apt-get update -qq
DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends $LOCKED_PACKAGES
dpkg-query -W -f="${Package}=${Version}\n" ca-certificates cmake gcc-13 g++-13 make python3
python3 scripts/test-kar-cuda-build-lock.py
CXX=g++-13 scripts/test-kar-expert-cache.sh
python3 scripts/bootstrap-cuda-toolkit.py --output /tmp/cuda-toolkit
export CUDACXX=/tmp/cuda-toolkit/bin/nvcc
export CUDAToolkit_ROOT=/tmp/cuda-toolkit
export CC=gcc-13 CXX=g++-13
cmake -S gpu/kar -B /tmp/kar-build -DCMAKE_BUILD_TYPE=Release -DCMAKE_CUDA_ARCHITECTURES=120
cmake --build /tmp/kar-build --parallel 1 --target strata-kar-expert-cache-test strata-kar-expert-test strata-kar-expert-miss-test strata-kar-expert-probe
ctest --test-dir /tmp/kar-build --output-on-failure -R "^kar_expert_cache_index$"
test -z "$(nvidia-smi 2>/dev/null || true)" || { echo "unexpected GPU visible in compile container" >&2; exit 1; }
'
test "$NVIDIA_VISIBLE_DEVICES" = void
test -z "$CUDA_VISIBLE_DEVICES"
if compgen -G '/dev/nvidia*' >/dev/null; then
echo 'unexpected NVIDIA device mounted in CUDA compile job' >&2
exit 1
fi
apt-get update -qq
DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
ca-certificates=20260601~26.04.1 \
cmake=4.2.3-2ubuntu2 \
gcc-13=13.4.0-10ubuntu1 \
g++-13=13.4.0-10ubuntu1 \
make=4.4.1-3 \
python3=3.14.3-0ubuntu2
dpkg-query -W -f='${Package}=${Version}\n' ca-certificates cmake gcc-13 g++-13 make python3
CXX=g++-13 scripts/test-kar-expert-cache.sh
python3 scripts/bootstrap-cuda-toolkit.py --output /tmp/cuda-toolkit
export CUDACXX=/tmp/cuda-toolkit/bin/nvcc
export CUDAToolkit_ROOT=/tmp/cuda-toolkit
export CC=gcc-13 CXX=g++-13
cmake -S gpu/kar -B /tmp/kar-build -DCMAKE_BUILD_TYPE=Release -DCMAKE_CUDA_ARCHITECTURES=120
cmake --build /tmp/kar-build --parallel 1 --target strata-kar-expert-cache-test strata-kar-expert-test strata-kar-expert-miss-test strata-kar-expert-probe
ctest --test-dir /tmp/kar-build --output-on-failure -R "^kar_expert_cache_index$"
+9 -1
View File
@@ -16,4 +16,12 @@ assert toolkit['release']==lock['cuda_toolkit_release']
required={'ca-certificates','cmake','gcc-13','g++-13','make','python3'}
assert set(lock['apt_packages'])==required
assert all(re.fullmatch(r'[0-9][A-Za-z0-9.+:~_-]*',v) for v in lock['apt_packages'].values())
print('PASS: pinned CUDA 13.0.1 Linux build image, compiler, CMake and base packages')
workflow=(ROOT/'.gitea/workflows/kar-cuda-compile.yml').read_text()
assert f"image: {lock['builder_image']}" in workflow
assert 'pull_request:' in workflow and '\n push:' not in workflow
assert 'NVIDIA_VISIBLE_DEVICES: void' in workflow
assert "CUDA_VISIBLE_DEVICES: ''" in workflow
assert 'docker run' not in workflow
for name,version in lock['apt_packages'].items():
assert f'{name}={version}' in workflow
print('PASS: pinned CUDA 13.0.1 GPU-hidden Gitea container and direct packages')