-
Notifications
You must be signed in to change notification settings - Fork 3.9k
[Workflow] Add isaacsim source install uv workflow #6762
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
Changes from all commits
2122d05
027f84e
cbbfeff
2d73ce0
0e11c5e
9342421
a6cb903
5a5d134
941af6c
120b0b6
2ae5f2c
4b85303
c8ff14a
ca57b17
f77f603
2a96e11
6350bfa
c161dff
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| Added | ||
| ^^^^^ | ||
|
|
||
| * Added the ``--isaacsim_source`` CLI option, which incrementally builds Isaac Sim from a source checkout, | ||
| links its live release tree into the repository as ``_isaac_sim``, and runs Python commands with | ||
| the active environment through Isaac Sim's generated launcher. This avoided rebuilding and | ||
| installing Python wheels after every incremental native build and left ``pyproject.toml`` and | ||
| ``uv.lock`` unchanged. |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -5,7 +5,10 @@ | |
|
|
||
| """Misc commands""" | ||
|
|
||
| import platform | ||
| import shutil | ||
| import sys | ||
| from pathlib import Path | ||
|
|
||
| from ..utils import ( | ||
| ISAACLAB_ROOT, | ||
|
|
@@ -118,6 +121,83 @@ def command_build_docs() -> None: | |
| print_info(f"Open with: xdg-open {index_path}") | ||
|
|
||
|
|
||
| def command_build_isaacsim(source_path: str) -> None: | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🟡 Warning — Add unit tests for the new source-build command
|
||
| """Build Isaac Sim from source and make it usable through ``uv`` (--isaacsim_source). | ||
|
|
||
| Runs Isaac Sim's incremental build and links its release tree into Isaac Lab as ``_isaac_sim``. | ||
| Python commands launched through the Isaac Lab CLI use the active environment's interpreter | ||
| through Isaac Sim's ``python.sh`` or ``python.bat`` wrapper, so they load the live build without | ||
| packaging or installing it as wheels. | ||
|
|
||
| Args: | ||
| source_path: Path to an Isaac Sim source checkout. | ||
| """ | ||
| isaacsim_root = Path(source_path).expanduser().resolve() | ||
| build_script = isaacsim_root / ("build.bat" if is_windows() else "build.sh") | ||
|
|
||
| if not build_script.is_file(): | ||
| print_error(f"'{isaacsim_root}' is not an Isaac Sim source checkout ({build_script.name} not found).") | ||
| print_info("Clone it first with: git clone https://github.com/isaac-sim/IsaacSim.git") | ||
| raise SystemExit(1) | ||
|
|
||
| print_info("Incrementally building Isaac Sim from source. This may take a while...") | ||
| run_command([str(build_script)], cwd=isaacsim_root) | ||
|
|
||
| release_dir = _resolve_isaacsim_release_dir(isaacsim_root) | ||
| python_launcher = release_dir / ("python.bat" if is_windows() else "python.sh") | ||
| if not python_launcher.is_file(): | ||
| print_error(f"The Isaac Sim build did not produce {python_launcher}.") | ||
| raise SystemExit(1) | ||
|
|
||
| link_path = ISAACLAB_ROOT / "_isaac_sim" | ||
| if link_path.is_symlink() or link_path.exists(): | ||
| if link_path.is_symlink(): | ||
| link_path.unlink() | ||
| else: | ||
| print_error(f"{link_path} exists and is not a symbolic link. Remove it and re-run.") | ||
| raise SystemExit(1) | ||
| try: | ||
| link_path.symlink_to(release_dir, target_is_directory=True) | ||
| except OSError as error: | ||
| print_error(f"Could not link {link_path} to {release_dir}: {error}") | ||
| if is_windows(): | ||
| print_info("Enable Windows Developer Mode or run from an elevated terminal, then retry.") | ||
| raise SystemExit(1) from error | ||
| print_info(f"Linked {link_path} -> {release_dir}") | ||
| _repoint_source_build_prebundles() | ||
|
|
||
| print_info("Isaac Sim is ready. Python commands now use the live source build through '_isaac_sim'.") | ||
| print_info("Run Isaac Lab against it with:") | ||
| print_info(" uv run isaaclab train --rl_library rsl_rl --task Isaac-Cartpole-Direct physics=isaacsim_physx") | ||
|
|
||
|
|
||
| def _resolve_isaacsim_release_dir(isaacsim_root: Path) -> Path: | ||
| """Resolve the platform-specific Isaac Sim release directory.""" | ||
| machine = platform.machine().lower() | ||
| targets = { | ||
| ("linux", "amd64"): "linux-x86_64", | ||
| ("linux", "x86_64"): "linux-x86_64", | ||
| ("linux", "aarch64"): "linux-aarch64", | ||
| ("linux", "arm64"): "linux-aarch64", | ||
| ("win32", "amd64"): "windows-x86_64", | ||
| ("win32", "x86_64"): "windows-x86_64", | ||
| } | ||
| target = targets.get((sys.platform, machine)) | ||
| if target is None: | ||
| print_error(f"Isaac Sim source builds are not supported on platform '{sys.platform}' with machine '{machine}'.") | ||
| raise SystemExit(1) | ||
| return isaacsim_root / "_build" / target / "release" | ||
|
|
||
|
|
||
| def _repoint_source_build_prebundles() -> None: | ||
| """Keep Isaac Sim's prebundled packages from shadowing the active environment.""" | ||
| # ``install`` imports ``command_vscode_settings`` from this module, so defer this import until | ||
| # both command modules are initialized. Reuse the same protection as the legacy installer. | ||
| from .install import _repoint_prebundle_packages | ||
|
|
||
| _repoint_prebundle_packages() | ||
|
|
||
|
|
||
| def command_run_docker(args: list[str]) -> None: | ||
| """Run the docker container helper script (docker/container.py). | ||
|
|
||
|
|
||
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.
🔵 Suggestion —
--isaacsim_sourceis silently ignored when combined with an earlier flagThis branch sits in the
elifchain after--install,--format,--conda, and--uv. Invoking, for example,isaaclab -i --isaacsim_source ./IsaacSimruns only the install and exits without building or linking anything, with no warning; the user discovers it only whenuv run --extra isaacsim-localpicks the published release. Since this is an option (not a subcommand) that takes a value, either handle the combination explicitly or fail with a clear mutually-exclusive message.