From 9fde3ae6812bc9f6103ea54245ffdccf9ea6c9f0 Mon Sep 17 00:00:00 2001 From: Jichuan Hu Date: Tue, 1 Dec 2026 12:25:57 -0800 Subject: [PATCH 1/2] Restrict the container venv to group writes and lock the PyPI metadata check The Docker images made the venv lib and bin world-writable so CI, which runs the image as the runner's uid, could install test-only packages into it. Make them writable by the isaaclab group (gid 1000) instead, and add that group to the CI containers with --group-add 1000. The PyPI metadata check resolved the newest packaging release and allowed source builds. Pin it to the locked version and pass --no-build. --- .github/actions/multi-gpu/multi_gpu_host_launcher.sh | 1 + .github/actions/multi-gpu/multi_gpu_shard_runner.sh | 1 + .github/actions/run-tests/run_tests.sh | 3 ++- .github/workflows/wheel.yml | 2 +- docker/Dockerfile.base | 6 ++++-- docker/Dockerfile.curobo | 8 +++++--- 6 files changed, 14 insertions(+), 7 deletions(-) diff --git a/.github/actions/multi-gpu/multi_gpu_host_launcher.sh b/.github/actions/multi-gpu/multi_gpu_host_launcher.sh index 0dc67f4ee3ac..2f4cb97843b0 100755 --- a/.github/actions/multi-gpu/multi_gpu_host_launcher.sh +++ b/.github/actions/multi-gpu/multi_gpu_host_launcher.sh @@ -100,6 +100,7 @@ fi docker run --rm --gpus all --network=host \ --entrypoint bash \ --user "${host_uid}:${host_gid}" \ + --group-add 1000 \ --name "isaac-lab-mgpu-${GITHUB_RUN_ID}-${GITHUB_RUN_ATTEMPT}" \ -v "$PWD:/workspace/isaaclab:rw" \ --tmpfs /workspace/isaaclab/.git \ diff --git a/.github/actions/multi-gpu/multi_gpu_shard_runner.sh b/.github/actions/multi-gpu/multi_gpu_shard_runner.sh index 899511e4b943..c727f8b13593 100755 --- a/.github/actions/multi-gpu/multi_gpu_shard_runner.sh +++ b/.github/actions/multi-gpu/multi_gpu_shard_runner.sh @@ -8,6 +8,7 @@ # Container expectations (set by the host launcher): # --gpus all # --user $host_uid:$host_gid +# --group-add 1000 (the image's isaaclab group; owns the venv) # -v :/workspace/isaaclab:rw # -v :/mgpu:rw (subdirs queue/, inflight/, done/) # -v :/shard-logs:rw (per-shard tee target) diff --git a/.github/actions/run-tests/run_tests.sh b/.github/actions/run-tests/run_tests.sh index 906ca817db5f..e268eb9373cc 100755 --- a/.github/actions/run-tests/run_tests.sh +++ b/.github/actions/run-tests/run_tests.sh @@ -269,7 +269,8 @@ run_tests() { -v "${docker_runtime_dir}/isaac-sim/logs:/isaac-sim/.nvidia-omniverse/logs:rw" -v "${docker_runtime_dir}/isaac-sim/pkg:/isaac-sim/.local/share/ov/pkg:rw" ) - docker_user_args=(--user "${host_uid}:${host_gid}") + # gid 1000 is the image's isaaclab group, which owns the group-writable venv. + docker_user_args=(--user "${host_uid}:${host_gid}" --group-add 1000) docker_env_args+=( -e "HOME=/tmp/isaaclab-ci-home" -e "XDG_CACHE_HOME=/tmp/isaaclab-ci-home/.cache" diff --git a/.github/workflows/wheel.yml b/.github/workflows/wheel.yml index 830113827439..d2b37c188a7c 100644 --- a/.github/workflows/wheel.yml +++ b/.github/workflows/wheel.yml @@ -190,7 +190,7 @@ jobs: (startsWith(github.ref, 'refs/heads/release/') || startsWith(github.base_ref, 'release/')) run: >- - uv run --no-project --with packaging python tools/wheel_builder/validate_pypi_metadata.py + uv run --no-project --no-build --with packaging==26.0 python tools/wheel_builder/validate_pypi_metadata.py tools/wheel_builder/build/dist/isaaclab-*.whl - name: Upload wheel artifact diff --git a/docker/Dockerfile.base b/docker/Dockerfile.base index 7d4dbbc20a5b..c0a7b11d67e1 100644 --- a/docker/Dockerfile.base +++ b/docker/Dockerfile.base @@ -141,12 +141,14 @@ COPY --parents source/*/pyproject.toml ${ISAACLAB_PATH}/ # of ``renderer=newton_optix`` (x86-64 only); it needs an NVIDIA driver of the 590 series or newer. ARG IMAGE_EXTRAS="--extra sb3 --extra skrl --extra rl-games --extra rsl-rl --extra viser --extra rerun --extra mimic --extra teleop --extra test --extra tetrahedralization --extra ov --extra fovi --extra newton-neural --extra optix" +# The venv is group-writable, not world-writable: CI runs the image as the runner's uid with +# ``--group-add 1000`` (the isaaclab group) and installs test-only packages into the venv. RUN --mount=type=cache,target=/root/.cache/uv \ cd ${ISAACLAB_PATH} && \ uv sync --frozen --inexact ${IMAGE_EXTRAS} \ --no-install-workspace --no-install-package imageio-ffmpeg && \ chown -R isaaclab:isaaclab ${VIRTUAL_ENV} && \ - chmod -R a+rwX ${VIRTUAL_ENV}/lib ${VIRTUAL_ENV}/bin + chmod -R g+rwX ${VIRTUAL_ENV}/lib ${VIRTUAL_ENV}/bin COPY source/ ${ISAACLAB_PATH}/source/ COPY tools/ ${ISAACLAB_PATH}/tools/ @@ -167,7 +169,7 @@ RUN --mount=type=cache,target=/root/.cache/uv \ uv sync --frozen --inexact ${IMAGE_EXTRAS} \ --no-install-package imageio-ffmpeg && \ find ${VIRTUAL_ENV} \! -user isaaclab \ - -exec chown isaaclab:isaaclab {} + -exec chmod a+rwX {} + + -exec chown isaaclab:isaaclab {} + -exec chmod g+rwX {} + # Isaac Sim's prebundled packages sit on PYTHONPATH ahead of the venv for launch paths that # never import isaaclab (``runheadless.sh``, ``isaac-sim.streaming.sh``), so its torch would diff --git a/docker/Dockerfile.curobo b/docker/Dockerfile.curobo index 71dfdc99bcec..6890c8fcd703 100644 --- a/docker/Dockerfile.curobo +++ b/docker/Dockerfile.curobo @@ -161,13 +161,15 @@ COPY --parents source/*/pyproject.toml ${ISAACLAB_PATH}/ # ``_structures.py`` and forced a get-pip.py re-bootstrap). ``quadprog`` is not a lock entry, # so it is never installed and needs no uninstall. ``isaaclab_teleop`` (needed by the Pink IK # tests) is a workspace member and comes from the sync. +# The venv is group-writable, not world-writable: CI runs the image as the runner's uid with +# ``--group-add 1000`` (the isaaclab group) and installs test-only packages into the venv. RUN --mount=type=cache,target=/root/.cache/uv \ cd ${ISAACLAB_PATH} && \ uv venv --seed "${VIRTUAL_ENV}" && \ uv sync --frozen --inexact ${IMAGE_EXTRAS} \ --no-install-workspace --no-install-package imageio-ffmpeg && \ chown -R isaaclab:isaaclab ${VIRTUAL_ENV} && \ - chmod -R a+rwX ${VIRTUAL_ENV}/lib ${VIRTUAL_ENV}/bin + chmod -R g+rwX ${VIRTUAL_ENV}/lib ${VIRTUAL_ENV}/bin COPY source/ ${ISAACLAB_PATH}/source/ COPY tools/ ${ISAACLAB_PATH}/tools/ @@ -187,7 +189,7 @@ RUN --mount=type=cache,target=/root/.cache/uv \ uv sync --frozen --inexact ${IMAGE_EXTRAS} \ --no-install-package imageio-ffmpeg && \ find ${VIRTUAL_ENV} \! -user isaaclab \ - -exec chown isaaclab:isaaclab {} + -exec chmod a+rwX {} + + -exec chown isaaclab:isaaclab {} + -exec chmod g+rwX {} + # Isaac Sim's prebundled packages sit on PYTHONPATH ahead of the venv for launch paths that # never import isaaclab (``runheadless.sh``, ``isaac-sim.streaming.sh``), so its torch would @@ -216,7 +218,7 @@ RUN --mount=type=cache,target=/root/.cache/uv \ uv pip install --no-build-isolation /tmp/curobo && \ rm -rf /tmp/curobo \ && find ${VIRTUAL_ENV} \! -user isaaclab \ - -exec chown isaaclab:isaaclab {} + -exec chmod a+rwX {} + + -exec chown isaaclab:isaaclab {} + -exec chmod g+rwX {} + # aliasing uv run isaaclab and python for convenience RUN echo "export ISAACLAB_PATH=${ISAACLAB_PATH}" >> ${DOCKER_USER_HOME}/.bashrc && \ From 6700e72c143cbc3f6cec1b284a0ef6622e8c0443 Mon Sep 17 00:00:00 2001 From: Jichuan Hu Date: Wed, 2 Dec 2026 00:32:38 -0800 Subject: [PATCH 2/2] Check release wheel metadata without installing packaging The release metadata check installed packaging from the index at run time, so its only lock was a version pin: SonarQube S8544 asks for a dependency locked to verified hashes. The check needs packaging only to find direct URL requirements, which PEP 508 writes as "name @ url" before any marker. Detect that with the standard library and run the script with the runner's python3, so the step installs nothing. --- .github/workflows/wheel.yml | 2 +- .../changelog.d/jichuanh-sonar-ci-container-perms.skip | 0 source/isaaclab/test/cli/test_wheel_builder_metadata.py | 2 ++ tools/wheel_builder/validate_pypi_metadata.py | 7 ++++--- 4 files changed, 7 insertions(+), 4 deletions(-) create mode 100644 source/isaaclab/changelog.d/jichuanh-sonar-ci-container-perms.skip diff --git a/.github/workflows/wheel.yml b/.github/workflows/wheel.yml index d2b37c188a7c..0f7ad160f4b3 100644 --- a/.github/workflows/wheel.yml +++ b/.github/workflows/wheel.yml @@ -190,7 +190,7 @@ jobs: (startsWith(github.ref, 'refs/heads/release/') || startsWith(github.base_ref, 'release/')) run: >- - uv run --no-project --no-build --with packaging==26.0 python tools/wheel_builder/validate_pypi_metadata.py + python3 tools/wheel_builder/validate_pypi_metadata.py tools/wheel_builder/build/dist/isaaclab-*.whl - name: Upload wheel artifact diff --git a/source/isaaclab/changelog.d/jichuanh-sonar-ci-container-perms.skip b/source/isaaclab/changelog.d/jichuanh-sonar-ci-container-perms.skip new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/source/isaaclab/test/cli/test_wheel_builder_metadata.py b/source/isaaclab/test/cli/test_wheel_builder_metadata.py index fd8c5623b112..c6600c5a4c0d 100644 --- a/source/isaaclab/test/cli/test_wheel_builder_metadata.py +++ b/source/isaaclab/test/cli/test_wheel_builder_metadata.py @@ -198,7 +198,9 @@ def test_wheel_builder_preserves_registry_compatible_torch_requirements( ("requirement", "accepted"), [ ("torch==2.11.0", True), + ("torch==2.11.0 ; sys_platform == 'linux'", True), ("torch @ https://download.pytorch.org/whl/cu130/torch.whl", False), + ("torch[cuda] @ https://download.pytorch.org/whl/cu130/torch.whl ; sys_platform == 'linux'", False), ], ) def test_pypi_metadata_validator_rejects_direct_urls( diff --git a/tools/wheel_builder/validate_pypi_metadata.py b/tools/wheel_builder/validate_pypi_metadata.py index 248934cc9138..7e27a4ea4993 100644 --- a/tools/wheel_builder/validate_pypi_metadata.py +++ b/tools/wheel_builder/validate_pypi_metadata.py @@ -12,8 +12,6 @@ from pathlib import Path from zipfile import ZipFile -from packaging.requirements import Requirement - def validate_pypi_metadata(wheel_path: Path) -> None: """Raise an error when a wheel contains direct URL dependencies.""" @@ -23,7 +21,10 @@ def validate_pypi_metadata(wheel_path: Path) -> None: raise ValueError(f"Expected one METADATA file in {wheel_path}, found {len(metadata_paths)}") metadata = email.message_from_bytes(wheel.read(metadata_paths[0])) - direct_urls = [requirement for requirement in metadata.get_all("Requires-Dist", []) if Requirement(requirement).url] + # A PEP 508 direct reference is "name [extras] @ url [; marker]": its "@" comes before the marker, where a + # registry requirement has none. Standard library only, so the release check installs nothing. + requirements = metadata.get_all("Requires-Dist", []) + direct_urls = [requirement for requirement in requirements if "@" in requirement.split(";")[0]] if direct_urls: formatted = "\n".join(f" - {requirement}" for requirement in direct_urls) raise ValueError(f"PyPI does not allow direct URL dependencies in {wheel_path}:\n{formatted}")