[CI] Add pinned OVPhysX wheelhouse path for develop#6267
Draft
marcodiiga wants to merge 1 commit into
Draft
Conversation
19b4c15 to
a09ac33
Compare
AntoineRichard
left a comment
Collaborator
There was a problem hiding this comment.
Wondering if the test could be made a bit shorter.
Comment on lines
+157
to
+267
| run: | | ||
| set -euo pipefail | ||
|
|
||
| if [ -z "${NGC_API_KEY:-}" ]; then | ||
| echo "::error::wheelhouse-resource is set but NGC_API_KEY is unavailable; cannot download configured wheelhouse resource" | ||
| exit 1 | ||
| fi | ||
|
|
||
| NGC_CLI_VERSION="4.20.0" | ||
| NGC_CLI_SHA256="5cf084c88998c58ad8abf7849d2d1b41d578423886eb03018df10194e341d35b" | ||
| NGC_CLI_URL="https://api.ngc.nvidia.com/v2/resources/nvidia/ngc-apps/ngc_cli/versions/${NGC_CLI_VERSION}/files/ngccli_linux.zip" | ||
|
|
||
| wheelhouse_root="$(mktemp -d "${RUNNER_TEMP:-/tmp}/ovphysx-wheelhouse.XXXXXX")" | ||
| download_root="$(mktemp -d "${RUNNER_TEMP:-/tmp}/ovphysx-wheelhouse-download.XXXXXX")" | ||
| ngc_home="$(mktemp -d "${RUNNER_TEMP:-/tmp}/ovphysx-ngc-home.XXXXXX")" | ||
| ngc_unpack_dir="" | ||
| preserve_wheelhouse_root=false | ||
| cleanup() { | ||
| if [ "$preserve_wheelhouse_root" != "true" ]; then | ||
| rm -rf "$wheelhouse_root" | ||
| fi | ||
| rm -rf "$download_root" "$ngc_home" | ||
| if [ -n "$ngc_unpack_dir" ]; then | ||
| rm -rf "$ngc_unpack_dir" | ||
| fi | ||
| } | ||
| trap cleanup EXIT | ||
|
|
||
| if ! command -v ngc >/dev/null 2>&1; then | ||
| cache_dir="${RUNNER_TEMP:-/tmp}/ngc-cli-cache" | ||
| ngc_zip="${cache_dir}/ngccli_linux.zip" | ||
| mkdir -p "$cache_dir" | ||
| if [ ! -f "$ngc_zip" ]; then | ||
| echo "Downloading NGC CLI ${NGC_CLI_VERSION}" | ||
| curl -fsSL -o "$ngc_zip" "$NGC_CLI_URL" | ||
| fi | ||
| echo "${NGC_CLI_SHA256} ${ngc_zip}" | sha256sum -c - | ||
| ngc_unpack_dir="$(mktemp -d "${RUNNER_TEMP:-/tmp}/ngc-cli.XXXXXX")" | ||
| unzip -q "$ngc_zip" -d "$ngc_unpack_dir" | ||
| export PATH="${ngc_unpack_dir}/ngc-cli:${PATH}" | ||
| fi | ||
|
|
||
| export NGC_CLI_API_KEY="$NGC_API_KEY" | ||
| export NGC_CLI_ORG=nvidian | ||
| export NGC_CLI_TEAM=omniverse | ||
| export NGC_CLI_HOME="$ngc_home" | ||
|
|
||
| ngc --version | ||
| echo "Downloading wheelhouse resource: $WHEELHOUSE_RESOURCE" | ||
| ngc registry resource download-version "$WHEELHOUSE_RESOURCE" --dest "$download_root" | ||
|
|
||
| mapfile -t manifests < <(find "$download_root" -type f -name manifest.json) | ||
| if [ "${#manifests[@]}" -ne 1 ]; then | ||
| echo "::error::expected exactly one manifest.json in downloaded wheelhouse resource, found ${#manifests[@]}" | ||
| printf '%s\n' "${manifests[@]}" | ||
| exit 1 | ||
| fi | ||
|
|
||
| payload_dir="$(dirname "${manifests[0]}")" | ||
| if [ ! -d "${payload_dir}/wheelhouse" ]; then | ||
| echo "::error::downloaded wheelhouse resource is missing wheelhouse/ next to manifest.json" | ||
| exit 1 | ||
| fi | ||
|
|
||
| mkdir -p "$wheelhouse_root/wheelhouse" | ||
| cp "${payload_dir}/manifest.json" "$wheelhouse_root/manifest.json" | ||
| cp "${payload_dir}/wheelhouse/"*.whl "$wheelhouse_root/wheelhouse/" | ||
|
|
||
| python3 - <<'PY' "$wheelhouse_root/manifest.json" "$wheelhouse_root/wheelhouse" | ||
| import hashlib | ||
| import json | ||
| import pathlib | ||
| import sys | ||
|
|
||
| manifest_path = pathlib.Path(sys.argv[1]) | ||
| wheelhouse_dir = pathlib.Path(sys.argv[2]) | ||
| manifest = json.loads(manifest_path.read_text(encoding="utf-8")) | ||
|
|
||
| expected = { | ||
| "artifact": "ovphysx-wheelhouse", | ||
| "platform": "manylinux_2_35_x86_64", | ||
| } | ||
| for key, value in expected.items(): | ||
| actual = manifest.get(key) | ||
| if actual != value: | ||
| raise SystemExit(f"manifest {key!r} mismatch: expected {value!r}, got {actual!r}") | ||
|
|
||
| wheels = manifest.get("wheels") | ||
| if not isinstance(wheels, list) or not wheels: | ||
| raise SystemExit("manifest has no wheels list") | ||
|
|
||
| for wheel in wheels: | ||
| filename = wheel.get("file") | ||
| expected_sha = wheel.get("sha256") | ||
| if not filename or not expected_sha: | ||
| raise SystemExit(f"invalid wheel manifest entry: {wheel!r}") | ||
| wheel_path = wheelhouse_dir / filename | ||
| if not wheel_path.is_file(): | ||
| raise SystemExit(f"manifest wheel is missing from wheelhouse: {filename}") | ||
| actual_sha = hashlib.sha256(wheel_path.read_bytes()).hexdigest() | ||
| if actual_sha != expected_sha: | ||
| raise SystemExit(f"sha256 mismatch for {filename}: expected {expected_sha}, got {actual_sha}") | ||
|
|
||
| print(f"Validated {len(wheels)} wheelhouse wheels from {manifest_path}") | ||
| PY | ||
|
|
||
| echo "Wheelhouse contents:" | ||
| ls -l "$wheelhouse_root/wheelhouse" | ||
| preserve_wheelhouse_root=true | ||
| echo "wheelhouse_host_dir=$wheelhouse_root" >> "$GITHUB_OUTPUT" | ||
|
|
Collaborator
There was a problem hiding this comment.
Is all of this required?
Collaborator
|
@marcodiiga I mirrored the reviewed commit a09ac33 to the official same-repository branch antoiner/test_ovphysx_wheelhouse_ci for trusted CI validation. The draft probe PR is #6314; please use that official branch name when updating the existing branch, subject to repository rules. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
ovphysxfrom that wheelhouse in the existingisaaclab_ovDocker test job for develop-targeted runspip --no-indexWhy
This lets IsaacLab
developtest against a specific OVPhysX development wheel before the corresponding public PyPI release is available, while preserving the public-package path for release branches.Validation
git diff --check origin/develop...HEADactionlintis not installed in my local environment, so I could not run it before opening this draft PR.