Skip to content
Draft
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
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
16 changes: 16 additions & 0 deletions .github/actionlint.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Copyright (c) 2022-2026, The Isaac Lab Project Developers (https://github.com/isaac-sim/IsaacLab/blob/main/CONTRIBUTORS.md).
# All rights reserved.
#
# SPDX-License-Identifier: BSD-3-Clause

# Configuration for actionlint (https://github.com/rhysd/actionlint), run by pre-commit.
self-hosted-runner:
labels:
- gpu
- gpu-windows
- arm64
- multi-gpu
config-variables:
- ACTIVE_RELEASE_BACKPORT_BRANCH
- NVIDIA_BACKPORT_FALLBACK_MODEL
- NVIDIA_BACKPORT_MODEL
9 changes: 4 additions & 5 deletions .github/actions/_lib/compute-deps-hash/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,7 @@ name: 'Compute deps hash'
description: >
Compute the deps-cache hash for the Isaac Lab Docker build. Shared by the
docker-build (local-store check) and ecr-build-push-pull (registry check)
actions so a local hit and a registry hit always agree on the same
`deps-<hash>` tag. Hashes the install-relevant files, resolved base image
actions. Hashes the install-relevant files, resolved base image
digest, and target platform.

inputs:
Expand Down Expand Up @@ -50,12 +49,12 @@ runs:
.dockerignore
docker/docker-compose.yaml
docker/scripts/install_carb_env_shim.sh
docker/patches
docker/utils/volume_mounts.py
# Run by the Dockerfile's verify stage: a deps-cache hit serves an image verified against it.
docker/test/test_image_invariants.py
source/isaaclab/isaaclab/cli
tools/wheel_builder/uv-overrides.txt
# Pins the CI pytest deps layered onto the image after build, so a
# change to that list must invalidate the deps cache.
.github/actions/docker-build/action.yml
)
deps_manifest_pattern='(setup\.py|pyproject\.toml|setup\.cfg|extension\.toml|requirements[^/]*\.txt|uv\.lock)$'

Expand Down
6 changes: 3 additions & 3 deletions .github/actions/_lib/setup-docker-config/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ description: >
log into nvcr.io. Shared by the docker-build and ecr-build-push-pull actions.
Idempotent: re-invoking it in the same job reuses the existing config, and a
base-image-ref already checked with that config is not probed again, so callers
(e.g. ecr-build-push-pull delegating to docker-build) don't need to coordinate.
(e.g. ecr-build-push-pull falling back to docker-build) don't need to coordinate.
Reads NGC_API_KEY from the environment (optional; warns when missing).
When base-image-ref names an nvcr.io image that the configured credentials are
refused, falls back to anonymous access for that registry.
Expand All @@ -33,7 +33,7 @@ runs:
env:
BASE_IMAGE_REF: ${{ inputs.base-image-ref }}
STRIP_HELPER: ${{ github.action_path }}/strip_registry_auth.py
run: |
run: | # zizmor: ignore[github-env] -- writes runner-generated temp paths, never event data
# The runner's credential helper backend is broken ("not implemented")
# and causes docker login calls to fail unless we point DOCKER_CONFIG at
# a temp config with credsStore disabled. The value is written to
Expand Down Expand Up @@ -71,7 +71,7 @@ runs:
exit 0
fi

# ecr-build-push-pull delegates to docker-build, so this action can run
# ecr-build-push-pull can fall back to docker-build, so this action can run
# twice in one job with the same ref. The probes are network calls with
# backoff, and the first run already settled the outcome, so a ref
# checked with the current config is not probed again.
Expand Down
31 changes: 0 additions & 31 deletions .github/actions/_lib/test_performance_workflow.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,37 +95,6 @@ def test_ci_activation_and_runner_selection() -> None:
assert stopped.returncode != 0, "Unactivated PR explanation step exited successfully"


def test_parallel_baseline_route() -> None:
route = yaml.safe_load(_WORKFLOW.read_text())["jobs"]["performance-regression-route"]["steps"][0]
script = """
const source = require('node:fs').readFileSync(0, 'utf8');
const assert = require('node:assert/strict');
const run = new (Object.getPrototypeOf(async function() {}).constructor)('github', 'context', source);
const context = {repo: {owner: 'owner', repo: 'lab'}, payload: {pull_request: {number: 42, head: {ref: 'feature'}}}};
process.env.BASE_COMMIT = 'base';
(async () => {
for (const [label, runCount, artifacts, artifactCount, expected] of [
['fresh', 1, [], 0, true], ['reusable on retry', 1, [{expired: false}], 1, false],
['expired', 1, [{expired: true}], 1, true], ['partial run list', 2, [], 0, false],
['partial artifact list', 1, [], 1, false],
]) {
const actions = {
listWorkflowRuns: async ({branch}) => {
assert.equal(branch, 'feature');
return {data: {workflow_runs: [{run_attempt: 2}], total_count: runCount}};
},
listArtifactsForRepo: async ({name}) => {
assert.match(name, /^performance-pr-baseline-42-base-[12]$/);
return {data: name.endsWith('-2') ? {artifacts, total_count: artifactCount} : {artifacts: [], total_count: 0}};
},
};
assert.equal(await run({rest: {actions}}, context), expected, label);
}
})();
"""
subprocess.run(["node", "-e", script], input=route["with"]["script"], text=True, check=True)


def test_run_docker_ci_command_options(tmp_path: Path) -> None:
workflow = yaml.safe_load(_RUN_CI_WORKFLOW.read_text(encoding="utf-8"))
job = workflow["jobs"]["request-docker-ci"]
Expand Down
98 changes: 36 additions & 62 deletions .github/actions/_lib/test_registry_credential_fallback.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@
import importlib.util
import json
import os
import re
import shlex
import subprocess
from pathlib import Path

import pytest
import yaml

_LIB_DIR = Path(__file__).resolve().parent
Expand All @@ -26,6 +26,8 @@
_HUB = "https://index.docker.io/v1/"
_DIGEST = "sha256:" + "a" * 64

pytestmark = pytest.mark.pr


def _load_helper():
spec = importlib.util.spec_from_file_location("strip_registry_auth", _STRIP_HELPER)
Expand Down Expand Up @@ -295,67 +297,39 @@ def test_successful_read_ignores_stderr_noise(tmp_path: Path) -> None:
assert hashes[1] != hashes[2]


def test_dependency_cache(tmp_path: Path, subtests) -> None:
"""Exercise the real cache/push shells with state left by an older base-side action."""
action = yaml.safe_load((_LIB_DIR.parent / "ecr-build-push-pull/action.yml").read_text())
steps = {step["name"]: step for step in action["runs"]["steps"]}
bin_dir = tmp_path / "bin"
trace = tmp_path / "docker-calls.log"
_write_stub_docker(
bin_dir,
'if [ "$1 $2" = "manifest inspect" ]; then [ "$CACHE" = deps ]; exit $?; fi',
)
for cache in ("exact", "deps", "miss"):
with subtests.test(dependency_cache=cache):
cache_path = tmp_path / cache
cache_path.mkdir(parents=True)
trace.unlink(missing_ok=True)
env = {
**os.environ,
"PATH": f"{bin_dir}:{os.environ['PATH']}",
"CACHE": cache,
"ECR_URL": "registry.example/lab",
"ECR_IMAGE": "registry.example/lab:PR",
"DEPS_ECR_IMAGE": "registry.example/lab:deps-BASE",
"PUSH_DEPS_IMAGE": "true",
"GITHUB_ENV": str(cache_path / "env"),
"GITHUB_OUTPUT": str(cache_path / "output"),
}
values = {"inputs.image-tag": "local:PR", "steps.deps-hash.outputs.hash": "PR"}

def expand(text):
return re.sub(r"\$\{\{\s*([^}]+?)\s*}}", lambda match: values.get(match[1], ""), text)

def run(body):
result = subprocess.run(["bash", "-e", "-c", expand(body)], env=env, capture_output=True, text=True)
assert result.returncode == 0, result.stderr

if cache != "exact":
run(steps["Check deps cache"]["run"])
for file, destination, prefix in (("env", env, ""), ("output", values, "steps.deps-cache.outputs.")):
path = cache_path / file
if path.exists():
for line in path.read_text().splitlines():
key, value = line.split("=", 1)
destination[prefix + key] = value
push = steps["Push deps tag"]
context = {**values, **{f"env.{key}": value for key, value in env.items()}}
condition = re.sub(
r"\b(?:env|steps)\.[\w.-]+",
lambda match: json.dumps(context.get(match[0], "")),
push["if"].strip().removeprefix("${{").removesuffix("}}"),
)
enabled = subprocess.check_output(["node", "-p", f"Boolean({condition})"], text=True).strip() == "true"
if enabled:
env.update({key: expand(value) for key, value in push.get("env", {}).items()})
run(push["run"])
commands = trace.read_text().splitlines() if trace.exists() else []
publications = [line for line in commands if line.startswith(("tag ", "push "))]
assert publications == (
["tag local:PR registry.example/lab:deps-PR", "push registry.example/lab:deps-PR"]
if cache == "miss"
else []
)
def test_dependency_cache(tmp_path: Path) -> None:
"""A deps hit aliases the commit tag registry-side; a miss builds and publishes under both tags."""
steps = {step["name"]: step for step in yaml.safe_load((_LIB_DIR.parent / "ecr-build-push-pull/action.yml").read_text())["runs"]["steps"]}
check = steps["Check deps cache"]["run"]
for cache in ("deps", "miss"):
out = tmp_path / cache / "output"
out.parent.mkdir()
bin_dir = tmp_path / cache / "bin"
_write_stub_docker(bin_dir, 'if [ "$1 $2 $3" = "buildx imagetools inspect" ]; then [ "$CACHE" = deps ]; exit $?; fi')
env = {
**os.environ,
"PATH": f"{bin_dir}:{os.environ['PATH']}",
"CACHE": cache,
"ECR_IMAGE": "registry.example/lab:PR",
"DEPS_IMAGE": "registry.example/lab:deps-HASH",
"GITHUB_OUTPUT": str(out),
}
subprocess.run(["bash", "-e", "-c", check], env=env, check=True, capture_output=True, text=True)
calls = (bin_dir.parent / "docker-calls.log").read_text().splitlines()
aliases = [line for line in calls if line.startswith("buildx imagetools create")]
outputs = dict(line.split("=", 1) for line in out.read_text().splitlines())
assert outputs["image"] == "registry.example/lab:deps-HASH"
if cache == "deps":
assert aliases == ["buildx imagetools create -t registry.example/lab:PR registry.example/lab:deps-HASH"]
assert "miss" not in outputs
else:
assert aliases == []
assert outputs["miss"] == "true"

build = steps["Build and push"]
assert build["if"] == steps["Set up BuildKit"]["if"] == "steps.deps.outputs.miss == 'true'"
assert build["with"]["tags"].splitlines() == ["${{ steps.ecr.outputs.image }}", "${{ steps.deps.outputs.image }}"]
assert "push=true" in build["with"]["outputs"]


_PYPROJECT = '[project]\nname = "isaaclab"\nversion = "1.0.0"\ndependencies = ["torch==2.10.0"]\n'
Expand Down
Loading
Loading