Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/actions/_lib/setup-docker-config/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ runs:

if [ -n "${NGC_API_KEY:-}" ]; then
echo "🔵 Logging into nvcr.io..."
docker login -u '$oauthtoken' -p "${NGC_API_KEY}" nvcr.io
printf '%s' "${NGC_API_KEY}" | docker login -u '$oauthtoken' --password-stdin nvcr.io
else
echo "🟠 NGC_API_KEY not set - skipping nvcr.io login (normal for fork PRs)"
fi
10 changes: 9 additions & 1 deletion .github/actions/run-package-tests/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,10 @@ inputs:
description: 'Optional digest-pinned Docker image containing /wheelhouse and /manifest.json'
default: ''
required: false
wheelhouse-ngc-api-key:
description: 'Optional NGC API key used only to pull the wheelhouse image'
default: ''
required: false
wheelhouse-packages:
description: 'Space-separated packages to install from the wheelhouse with pip --no-index'
default: ''
Expand Down Expand Up @@ -235,6 +239,8 @@ runs:
- name: Setup wheelhouse registry authentication
if: inputs.wheelhouse-image != ''
uses: ./.github/actions/_lib/setup-docker-config
env:
NGC_API_KEY: ${{ inputs.wheelhouse-ngc-api-key != '' && inputs.wheelhouse-ngc-api-key || env.NGC_API_KEY }}

- name: Extract ovphysx wheelhouse
id: extract-wheelhouse
Expand Down Expand Up @@ -269,7 +275,9 @@ runs:

docker pull "$WHEELHOUSE_IMAGE"
image_pulled=true
container_id="$(docker create "$WHEELHOUSE_IMAGE")"
# Wheelhouse carriers are data-only images and may be built FROM scratch
# without a default command. Supply one because the container is never run.
container_id="$(docker create "$WHEELHOUSE_IMAGE" true)"
docker cp "${container_id}:/wheelhouse" "$wheelhouse_root/wheelhouse"
docker cp "${container_id}:/manifest.json" "$wheelhouse_root/manifest.json"
docker rm "$container_id"
Expand Down
31 changes: 28 additions & 3 deletions .github/actions/run-tests/run_tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -302,12 +302,34 @@ run_tests() {
# step can still `docker kill` the container reliably.
# `docker logs -f` is the foreground process and is trivially killable.
echo "🔵 Starting Docker container for tests..."
local memory_limit
local cpu_limit
local gpu_devices
local cdi_device
local -a gpu_args
memory_limit=$(free -m | awk '/^Mem:/{printf "%dm", $2 * 0.9}')
cpu_limit=$(awk -v cpus="$(nproc)" 'BEGIN {printf "%.1f", cpus * 0.9}')
gpu_devices="${ISAACLAB_CI_GPU_DEVICES:-all}"
if [ "$gpu_devices" = "all" ]; then
gpu_args=(--gpus all)
elif command -v nvidia-ctk >/dev/null 2>&1; then
cdi_device=$(nvidia-ctk cdi list | awk '/^nvidia\.com\/gpu=/ && !/=all$/ {print; exit}')
if [ -z "$cdi_device" ]; then
echo "::error::No concrete NVIDIA CDI GPU device is available"
return 1
fi
gpu_args=(--device "$cdi_device")
gpu_devices="$cdi_device"
else
gpu_args=(--runtime=nvidia -e "NVIDIA_VISIBLE_DEVICES=${gpu_devices#device=}")
fi
echo "Docker GPU selection: ${gpu_devices}"
docker run -d --name $container_name \
--init --stop-timeout 5 \
--entrypoint bash --gpus all --network=host \
--entrypoint bash "${gpu_args[@]}" --network=host \
--security-opt=no-new-privileges:true \
--memory=$(echo "$(free -m | awk '/^Mem:/{print $2}') * 0.9 / 1" | bc)m \
--cpus=$(echo "$(nproc) * 0.9" | bc) \
--memory="$memory_limit" \
--cpus="$cpu_limit" \
--oom-kill-disable=false \
--ulimit nofile=65536:65536 \
--ulimit nproc=4096:4096 \
Expand Down Expand Up @@ -343,6 +365,9 @@ run_tests() {
*\" ovphysx \"*)
./isaaclab.sh -p -c \"import importlib.metadata,json,os,pathlib; from packaging.version import Version; manifest=json.loads(pathlib.Path(os.environ['TEST_WHEELHOUSE_MANIFEST']).read_text(encoding='utf-8')); expected=manifest.get('ovphysx_version'); actual=importlib.metadata.version('ovphysx'); print(f'Resolved ovphysx package version: {actual}'); print(f'Wheelhouse manifest ovphysx version: {expected}'); import ovphysx; runtime=getattr(ovphysx, '__version__', actual); print(f'Imported ovphysx runtime version: {runtime}'); raise SystemExit(0 if Version(actual) == Version(expected) and Version(runtime) == Version(expected) else f'ovphysx version mismatch: installed {actual}, import {runtime}, manifest {expected}')\"
;;
*\" ovrtx \"*)
./isaaclab.sh -p -c \"import hashlib,importlib.metadata,json,os,pathlib; from packaging.version import Version; manifest=json.loads(pathlib.Path(os.environ['TEST_WHEELHOUSE_MANIFEST']).read_text(encoding='utf-8')); record=manifest.get('ovrtx') or {}; wheel=pathlib.Path(os.environ['TEST_WHEELHOUSE_PATH']) / record.get('file', ''); expected=manifest.get('ovrtx_version'); actual=importlib.metadata.version('ovrtx'); digest=hashlib.file_digest(wheel.open('rb'), 'sha256').hexdigest(); import ovrtx; from ovrtx import _version; expected_branch=(manifest.get('source') or {}).get('ref'); expected_sha=manifest.get('ovrtx_git_sha'); print(f'Resolved ovrtx package version: {actual}'); print(f'Wheelhouse manifest ovrtx version: {expected}'); print(f'Wheelhouse ovrtx SHA-256: {digest}'); print(f'Imported ovrtx provenance: {_version.gitbranch}@{_version.githash}'); raise SystemExit(0 if Version(actual) == Version(expected) and digest == record.get('sha256') and _version.gitbranch == expected_branch and _version.githash == expected_sha else f'ovrtx wheelhouse mismatch: installed {actual}, manifest {expected}, sha {digest}, provenance {_version.gitbranch}@{_version.githash}')\"
;;
esac
fi
if [ -n \"\${TEST_EXTRA_PIP_PACKAGES:-}\" ]; then
Expand Down
Loading
Loading