-
Notifications
You must be signed in to change notification settings - Fork 3.9k
[Backport] PR #7540 to release/3.0.0 #7556
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
Closed
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,54 @@ | ||
| # 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 | ||
|
|
||
| """Invariants asserted against a *built* container image. | ||
|
|
||
| The image under test is named by ``IMAGE_TAG``; the tests skip when it is unset so a plain | ||
| ``pytest docker/test`` stays green on a machine with no image. Run one explicitly with:: | ||
|
|
||
| IMAGE_TAG=isaac-lab-base:latest pytest docker/test/test_image_invariants.py | ||
| """ | ||
|
|
||
| from __future__ import annotations | ||
|
|
||
| import os | ||
| import subprocess | ||
|
|
||
| import pytest | ||
|
|
||
| IMAGE_TAG = os.environ.get("IMAGE_TAG", "") | ||
|
|
||
|
|
||
| def _in_image(script: str) -> str: | ||
| """Run ``script`` with bash inside the image under test and return its stdout.""" | ||
| result = subprocess.run( | ||
| ["docker", "run", "--rm", "--entrypoint", "bash", IMAGE_TAG, "-lc", script], | ||
| capture_output=True, | ||
| text=True, | ||
| check=True, | ||
| ) | ||
| return result.stdout | ||
|
|
||
|
|
||
| @pytest.fixture(autouse=True) | ||
| def _require_image(): | ||
| if not IMAGE_TAG: | ||
| pytest.skip("IMAGE_TAG is unset; no built image to assert against") | ||
|
|
||
|
|
||
| def test_no_prebundled_package_lost_its_entry_point(): | ||
| """A dangling ``__init__.py`` in a prebundle stops Isaac Sim extensions loading. | ||
|
|
||
| Isaac Sim shares prebundled packages between extensions as per-file symlinks, so deleting | ||
| or replacing one strands every symlink into it. #6329 added this invariant to the pip | ||
| install path after nvbugs 6343978, where it cost 438 error lines and 14 failed extensions. | ||
| The images now install with ``uv sync``, which never calls that code, so assert it here. | ||
|
|
||
| Only ``__init__.py`` is fatal: the shipped image already carries dangling submodules and | ||
| ``.pyi`` stubs that no extension imports - 41 of them, against develop's 48 - mostly | ||
| generated protobuf stubs inside an Omniverse extension's own prebundle. | ||
| """ | ||
| broken = _in_image('find / -path "*pip_prebundle*" -xtype l -name "__init__.py" 2>/dev/null || true').strip() | ||
| assert not broken, "prebundled packages lost their entry point:\n" + broken |
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The new
astral-sh/setup-uv@v6reference is mutable while executing on a self-hosted runner with the workflow-levelNGC_API_KEYand write-capable token permissions. Pinning the action to a reviewed commit prevents an upstream tag change from exposing credentials, altering the subsequent image build, or compromising the runner.How this was verified: The changed action reference was traced to its job's workflow-level secret, token permissions, and self-hosted runner.
Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!