Files
leleka/scripts/test-kar-cuda-build-lock.py
T
Pavlo Ratushnyi 3f5cbf3d2e
KAR CUDA compile (GPU hidden) / kar-cuda-compile (pull_request) Failing after 2m17s
fix(ci): use CUDA-supported Ubuntu builder baseline
2026-10-07 14:29:28 +02:00

36 lines
1.7 KiB
Python

#!/usr/bin/env python3
import json
from pathlib import Path
import re
ROOT=Path(__file__).resolve().parents[1]
lock=json.loads((ROOT/'deploy/kar-cuda-build.lock.json').read_text())
assert lock['schema_version']==1
assert lock['platform']=='linux/amd64'
assert lock['builder_glibc']=='2.39'
assert re.fullmatch(r'ubuntu@sha256:[0-9a-f]{64}',lock['builder_image'])
assert lock['cuda_toolkit_release']=='13.0.1'
assert lock['cuda_architecture']=='120' and lock['compile_jobs']==1
assert lock['cuda_toolkit_lock']=='cuda-toolkit.lock.json'
toolkit=json.loads((ROOT/'deploy'/lock['cuda_toolkit_lock']).read_text())
assert toolkit['release']==lock['cuda_toolkit_release']
required={'ca-certificates','cmake','gcc-13','g++-13','git','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())
workflow=(ROOT/'.gitea/workflows/kar-cuda-compile.yml').read_text()
assert f"image: {lock['builder_image']}" in workflow
assert "getconf GNU_LIBC_VERSION)" in workflow and "'glibc 2.39'" in workflow
assert 'pull_request:' in workflow and '\n push:' not in workflow
assert 'options: --platform' not in workflow
assert 'NVIDIA_VISIBLE_DEVICES: void' in workflow
assert "CUDA_VISIBLE_DEVICES: ''" in workflow
assert 'docker run' not in workflow
assert 'git fetch --depth=1 origin "$GITHUB_REF"' in workflow
assert 'GITEA_TOKEN: ${{ secrets.GITEA_TOKEN }}' in workflow
assert '-DCMAKE_CUDA_HOST_COMPILER=/usr/bin/g++-13' in workflow
assert 'uses: builtin:checkout' not in workflow
assert 'actions/checkout@' 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')