Repository navigation
Enhanced Offline Mode - #4479
clayton-littlejohn wants to merge 29 commits into
Conversation
Greptile OverviewGreptile SummaryThis PR implements comprehensive offline training support by adding an asset resolution system that transparently redirects Nucleus/S3 URLs to local storage. The implementation uses a two-layer strategy: monkey patching Isaac Lab spawn configs ( Key Changes:
Implementation Quality: Issues Found:
Testing: Confidence Score: 4/5
Important Files Changed
Sequence DiagramsequenceDiagram
participant User
participant TrainScript as Training Script
participant Resolver as OfflineAssetResolver
participant ConfigHooks as Monkey Patched Configs
participant FileSystem as Local Filesystem
participant Nucleus as Nucleus Server
Note over User,Nucleus: One-time Setup Phase
User->>TrainScript: Run download_assets.py
TrainScript->>Nucleus: Request asset list
Nucleus-->>TrainScript: Return file structure
TrainScript->>Nucleus: Download assets
Nucleus-->>FileSystem: Write to offline_assets/
Note over User,Nucleus: Offline Training Phase
User->>TrainScript: Run train.py --offline
TrainScript->>Resolver: setup_offline_mode()
Resolver->>Resolver: enable_offline_mode()
Resolver->>ConfigHooks: install_path_hooks()
Note over ConfigHooks: Monkey patch UsdFileCfg,<br/>GroundPlaneCfg, PreviewSurfaceCfg
TrainScript->>Resolver: patch_config_for_offline_mode(env_cfg)
Resolver->>Resolver: Patch robot, terrain, sky_light, visualizers
Note over TrainScript,FileSystem: Asset Loading
TrainScript->>ConfigHooks: Instantiate UsdFileCfg(usd_path="nucleus://...")
ConfigHooks->>Resolver: resolve_asset_path(nucleus_url)
Resolver->>Resolver: _extract_relative_path()
Note over Resolver: Extract "Robots/Go2/go2.usd"<br/>from versioned Nucleus URL
Resolver->>FileSystem: Check if offline_assets/Robots/Go2/go2.usd exists
alt Asset exists locally
FileSystem-->>Resolver: File found
Resolver-->>ConfigHooks: Return local path
ConfigHooks-->>TrainScript: Use local asset
else Asset not found
FileSystem-->>Resolver: File not found
Resolver-->>ConfigHooks: Return original Nucleus URL
ConfigHooks->>Nucleus: Fallback to Nucleus server
Nucleus-->>TrainScript: Stream asset
end
TrainScript->>TrainScript: Train environment
|
| print(f"[OfflineAssetResolver] ✓ Using offline: {path_to_convert}") | ||
| return offline_path | ||
| else: | ||
| print(f"[OfflineAssetResolver] ⚠️ Not found locally: {path_to_convert}") | ||
| print("[OfflineAssetResolver] Falling back to Nucleus") |
There was a problem hiding this comment.
Printing to stdout on every asset resolution could create excessive output when processing environments with many assets. Consider using a logging level or adding a verbose flag.
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!
UPDATE: Addressed the following issues found:
|
Mayankm96
left a comment
There was a problem hiding this comment.
Thank you for the PR!
Still have to review in detail but at a high-level, I feel the concept of offline assets should be a global thing that lives through the AppLauncher. Right now, it only gets propogated inside the RL training scripts and not other tutorials/demos, which might be hindering.
2ef7fc8 to
f3061a4
Compare
You're so right! Changes have been made and drastically reduced repetitive code. Now works alongside various tutorials and demos. ✔️ |
Signed-off-by: Clayton Littlejohn <[email protected]>
|
…6739) # Description > [!IMPORTANT] > Confirm the pull request base before submitting. Target `develop` for all > contributions. The `release/3.0.0-beta2` branch is a frozen stable landing > snapshot and is not used for ongoing maintenance. <!-- Thank you for your interest in sending a pull request. Please make sure to check the contribution guidelines. Link: https://isaac-sim.github.io/IsaacLab/main/source/refs/contributing.html 💡 Please try to keep PRs small and focused. Large PRs are harder to review and merge. --> Isaac Lab's asset paths ignore the documented `ISAACSIM_ASSET_ROOT` environment variable, so users cannot point Isaac Lab at a local, self-hosted, or air-gapped copy of the assets. `NUCLEUS_ASSET_ROOT_DIR` and every path derived from it are resolved by parsing `persistent.isaac.asset_root.cloud` out of `apps/isaaclab.python.kit`. Because the value comes from the experience file rather than the environment, the variable has no effect on Isaac Lab's constants, which stay on the production S3 bucket. The variable does not reach Isaac Sim's own asset root either. `ISAACSIM_ASSET_ROOT` is applied by `isaacsim.storage.native`, which sets `persistent.isaac.asset_root.default` at extension startup, and the shipped Isaac Lab experiences do not load that extension. So in an Isaac Lab launch today the documented override is inert on both sides, which is why this change touches both the resolver and the experience files. In #6318 the reporter worked around the second half by configuring `persistent.isaac.asset_root.default` to a local directory directly, with `persistent.isaac.asset_root.cloud` unset entirely, and `ISAAC_NUCLEUS_DIR` still resolved to the cloud URL because Isaac Lab only read `cloud`. This change makes Isaac Lab follow the same override Isaac Sim documents: - `ISAACSIM_ASSET_ROOT` is read first and used exactly as `isaacsim.storage.native` uses it, so the two sides cannot resolve different roots from the same value. The only deviation is the trailing separator, stripped for both `/` and `\` because Isaac Lab concatenates further path components onto the root and the variable is documented for Windows as well. - The experience file remains the fallback for kitless use, but now reads `persistent.isaac.asset_root.default` before the legacy `persistent.isaac.asset_root.cloud`, matching the only asset-root setting Isaac Sim resolves. Note the migration consequence: redirecting Isaac Lab by editing only the `cloud` key in an experience file no longer has any effect, since the shipped experiences leave `default` on the cloud URL. This is called out in both the new documentation and the changelog fragment. - `isaacsim.storage.native` is added to the `isaaclab.python` and `isaaclab.python.headless` experiences so Isaac Sim's own asset-root APIs apply the variable too. See the note on #6499 below. - New documentation covers pointing Isaac Lab at a local asset root. Note on scope: this makes `ISAACSIM_ASSET_ROOT` the supported *runtime* override for the asset root. Editing `persistent.isaac.asset_root.default` in an experience file also works, since that is the fallback Isaac Lab reads. What it does not restore is a command-line override such as `--kit_args="--/persistent/isaac/asset_root/cloud=<path>"`: Isaac Lab still does not read the live Carb setting, so changing it at runtime alone will not move these constants. ## On re-adding `isaacsim.storage.native` and Warp #6499 removed `isaacsim.storage.native` by name, along with the other Isaac Sim extensions, to keep Isaac Sim's Warp version out of the extension graph. This change re-adds only that one extension, and it does not reintroduce that risk: - Walking the recursive dependency closure, `isaacsim.storage.native` resolves 55 extensions while `isaacsim.core.version` — which both experiences already load — resolves 54. The delta is exactly one extension: `isaacsim.storage.native` itself. Its dependencies, `isaacsim.core.version` and `omni.client`, are already in the graph. - No Warp extension appears anywhere in that closure. - Headless launches before and after this change both report Warp at the unchanged baseline `1.13.0`. After the change, native storage is enabled and the Carb `default` setting plus every Isaac Lab asset constant resolve to the local path. This follows the same approach as #6697, which re-added `omni.physics.physx` for the PhysX registration bridge without restoring the Isaac Sim core extension or its Warp dependency. ## Known limitation, unchanged by this PR The experience-file fallback always reads `apps/isaaclab.python.kit` regardless of which experience was launched. This is inert today because every shipped experience carries the same asset root, but editing the value in another experience file still has no effect on Isaac Lab. Related but separate: #4478 and #4479 propose a broader offline mode with asset mirroring and an `--offline` flag. This PR is the narrow fix for the documented environment override. Fixes #6318 <!-- As a practice, it is recommended to open an issue to have discussions on the proposed pull request. This makes it easier for the community to keep track of what is being developed or added, and if a given feature is demanded by more than one party. --> ## Type of change <!-- As you go through the list, delete the ones that are not applicable. --> - Bug fix (non-breaking change which fixes an issue) - Documentation update ## Screenshots Not applicable, this change has no visual output. <!-- Example: | Before | After | | ------ | ----- | | _gif/png before_ | _gif/png after_ | To upload images to a PR -- simply drag and drop an image while in edit mode and it should upload the image directly. You can then paste that source into the above before/after sections. --> ## Checklist - [x] I have read and understood the [contribution guidelines](https://isaac-sim.github.io/IsaacLab/main/source/refs/contributing.html) - [x] I have run the [`pre-commit` checks](https://pre-commit.com/) with `./isaaclab.sh --format` - [x] I have made corresponding changes to the documentation - [x] My changes generate no new warnings - [x] I have added tests that prove my fix is effective or that my feature works - [x] I have added a changelog fragment under `source/<pkg>/changelog.d/` for every touched package (do **not** edit `CHANGELOG.rst` or bump `extension.toml` — CI handles that) - [x] I have added my name to the `CONTRIBUTORS.md` or my name already exists there <!-- As you go through the checklist above, you can mark something as done by putting an x character in it For example, - [x] I have done this task - [ ] I have not done this task --> --------- Co-authored-by: Kelly Guo <[email protected]>
…saac-sim#6739) # Description > [!IMPORTANT] > Confirm the pull request base before submitting. Target `develop` for all > contributions. The `release/3.0.0-beta2` branch is a frozen stable landing > snapshot and is not used for ongoing maintenance. <!-- Thank you for your interest in sending a pull request. Please make sure to check the contribution guidelines. Link: https://isaac-sim.github.io/IsaacLab/main/source/refs/contributing.html 💡 Please try to keep PRs small and focused. Large PRs are harder to review and merge. --> Isaac Lab's asset paths ignore the documented `ISAACSIM_ASSET_ROOT` environment variable, so users cannot point Isaac Lab at a local, self-hosted, or air-gapped copy of the assets. `NUCLEUS_ASSET_ROOT_DIR` and every path derived from it are resolved by parsing `persistent.isaac.asset_root.cloud` out of `apps/isaaclab.python.kit`. Because the value comes from the experience file rather than the environment, the variable has no effect on Isaac Lab's constants, which stay on the production S3 bucket. The variable does not reach Isaac Sim's own asset root either. `ISAACSIM_ASSET_ROOT` is applied by `isaacsim.storage.native`, which sets `persistent.isaac.asset_root.default` at extension startup, and the shipped Isaac Lab experiences do not load that extension. So in an Isaac Lab launch today the documented override is inert on both sides, which is why this change touches both the resolver and the experience files. In isaac-sim#6318 the reporter worked around the second half by configuring `persistent.isaac.asset_root.default` to a local directory directly, with `persistent.isaac.asset_root.cloud` unset entirely, and `ISAAC_NUCLEUS_DIR` still resolved to the cloud URL because Isaac Lab only read `cloud`. This change makes Isaac Lab follow the same override Isaac Sim documents: - `ISAACSIM_ASSET_ROOT` is read first and used exactly as `isaacsim.storage.native` uses it, so the two sides cannot resolve different roots from the same value. The only deviation is the trailing separator, stripped for both `/` and `\` because Isaac Lab concatenates further path components onto the root and the variable is documented for Windows as well. - The experience file remains the fallback for kitless use, but now reads `persistent.isaac.asset_root.default` before the legacy `persistent.isaac.asset_root.cloud`, matching the only asset-root setting Isaac Sim resolves. Note the migration consequence: redirecting Isaac Lab by editing only the `cloud` key in an experience file no longer has any effect, since the shipped experiences leave `default` on the cloud URL. This is called out in both the new documentation and the changelog fragment. - `isaacsim.storage.native` is added to the `isaaclab.python` and `isaaclab.python.headless` experiences so Isaac Sim's own asset-root APIs apply the variable too. See the note on isaac-sim#6499 below. - New documentation covers pointing Isaac Lab at a local asset root. Note on scope: this makes `ISAACSIM_ASSET_ROOT` the supported *runtime* override for the asset root. Editing `persistent.isaac.asset_root.default` in an experience file also works, since that is the fallback Isaac Lab reads. What it does not restore is a command-line override such as `--kit_args="--/persistent/isaac/asset_root/cloud=<path>"`: Isaac Lab still does not read the live Carb setting, so changing it at runtime alone will not move these constants. ## On re-adding `isaacsim.storage.native` and Warp isaac-sim#6499 removed `isaacsim.storage.native` by name, along with the other Isaac Sim extensions, to keep Isaac Sim's Warp version out of the extension graph. This change re-adds only that one extension, and it does not reintroduce that risk: - Walking the recursive dependency closure, `isaacsim.storage.native` resolves 55 extensions while `isaacsim.core.version` — which both experiences already load — resolves 54. The delta is exactly one extension: `isaacsim.storage.native` itself. Its dependencies, `isaacsim.core.version` and `omni.client`, are already in the graph. - No Warp extension appears anywhere in that closure. - Headless launches before and after this change both report Warp at the unchanged baseline `1.13.0`. After the change, native storage is enabled and the Carb `default` setting plus every Isaac Lab asset constant resolve to the local path. This follows the same approach as isaac-sim#6697, which re-added `omni.physics.physx` for the PhysX registration bridge without restoring the Isaac Sim core extension or its Warp dependency. ## Known limitation, unchanged by this PR The experience-file fallback always reads `apps/isaaclab.python.kit` regardless of which experience was launched. This is inert today because every shipped experience carries the same asset root, but editing the value in another experience file still has no effect on Isaac Lab. Related but separate: isaac-sim#4478 and isaac-sim#4479 propose a broader offline mode with asset mirroring and an `--offline` flag. This PR is the narrow fix for the documented environment override. Fixes isaac-sim#6318 <!-- As a practice, it is recommended to open an issue to have discussions on the proposed pull request. This makes it easier for the community to keep track of what is being developed or added, and if a given feature is demanded by more than one party. --> ## Type of change <!-- As you go through the list, delete the ones that are not applicable. --> - Bug fix (non-breaking change which fixes an issue) - Documentation update ## Screenshots Not applicable, this change has no visual output. <!-- Example: | Before | After | | ------ | ----- | | _gif/png before_ | _gif/png after_ | To upload images to a PR -- simply drag and drop an image while in edit mode and it should upload the image directly. You can then paste that source into the above before/after sections. --> ## Checklist - [x] I have read and understood the [contribution guidelines](https://isaac-sim.github.io/IsaacLab/main/source/refs/contributing.html) - [x] I have run the [`pre-commit` checks](https://pre-commit.com/) with `./isaaclab.sh --format` - [x] I have made corresponding changes to the documentation - [x] My changes generate no new warnings - [x] I have added tests that prove my fix is effective or that my feature works - [x] I have added a changelog fragment under `source/<pkg>/changelog.d/` for every touched package (do **not** edit `CHANGELOG.rst` or bump `extension.toml` — CI handles that) - [x] I have added my name to the `CONTRIBUTORS.md` or my name already exists there <!-- As you go through the checklist above, you can mark something as done by putting an x character in it For example, - [x] I have done this task - [ ] I have not done this task --> --------- Co-authored-by: Kelly Guo <[email protected]>
|
Hi @clayton-littlejohn — thank you so much for opening this PR, and for taking the time to contribute to Isaac Lab! 🙏 We're currently doing a big spring-clean of our pull request backlog, which had grown past 400 open PRs. Being honest: at that volume we stopped being able to give every contribution the attention it deserved, and this one is a case where we dropped the ball on getting back to you. That's on us, not on you. Why this PR is being closed: Here is exactly what we found on this PR when we reviewed the backlog:
It was picked up by the sweep because it has been open for about 7 months. It was then put in the "close" bucket because the author has been silent for about 6 months — which is the signal we used to tell apart pull requests that are still being worked on from ones that have genuinely been set aside. We deliberately did not close pull requests that were approved and ready to land, or that were small and clearly still fixing a live bug — there were 27 of those, and we are merging them rather than closing them. To be completely clear — this is not a judgement on the quality or the value of your work. It's purely about getting the queue down to a size where we can actually review things properly and give contributors real, timely feedback. One thing worth knowing first: Isaac Lab 3.0 has since shipped. It is also the honest reason a lot of these older pull requests stopped applying: the code If this change is still relevant, please reopen this PR or open a fresh one against Thanks again for contributing to Isaac Lab, and sorry for the long silence! 💚 🤖 This comment was drafted with AI assistance as part of a maintainer-led sweep of the Isaac Lab pull request backlog. A maintainer is behind this cleanup — but if this closure looks wrong, it may well be, so please push back and we'll take another look. |
Enhanced Offline Training Support for Isaac Lab
Description
This PR implements an enhanced comprehensive offline training system that enables training Isaac Lab environments, tutorials, and demos without internet connectivity. The system automatically redirects asset paths from Nucleus/S3 servers to local storage while maintaining the same directory structure, requiring zero configuration changes to existing environments.
Problem
Current Problem:
Training Isaac Lab environments requires constant internet connectivity to load assets from Nucleus/S3 servers. This creates several critical issues:
Solution
One-time asset download with automatic path resolution for seamless offline training. Simply add
--offlineflag to any training command.Key Features:
--offlinefor various training environments, tutorials, and demos--offline-permissivefallback to Nucleus for asset not found inoffline_assetsoffline_assetplug and play mirroring Nucleus structureType of change
scripts/offline_setup)Changes Made
New Files
Core System:
source/isaaclab/isaaclab/utils/asset_resolver.py- Path resolution engine with singleton pattern, monkey patching, and regex-based URL matchingAsset Management:
scripts/offline_setup/download_assets.py- Asset downloader with size calculation and progress trackingscripts/offline_setup/README.md- Complete setup and usage guideModified Files
Training Scripts (All RL Libraries):
AppLauncher. (Propagates globally across RL training scripts and other tutorials/demos)Core Integration:
source/isaaclab/isaaclab/utils/__init__.py- Added wildcard import for offline resolverHow It Works
Two-Layer Resolution Strategy
Layer 1 - Monkey Patching (90% coverage):
Patches Isaac Lab spawn configs (
UsdFileCfg,GroundPlaneCfg,PreviewSurfaceCfg) to automatically resolve paths when instantiated.Layer 2 - Config Patching (10% coverage):
Explicitly patches already-loaded configs (robot, terrain, visualizers) to catch pre-loaded paths.
Path Resolution Pipeline
Handles versioned URLs (
/Assets/Isaac/5.1/...), non-versioned URLs, and environment variables.Usage
Quick Start
1. Download essential assets (one-time,
all~60 GB)Assets download to the
~/IsaacLab/offline_assetsdirectory:cd ~/IsaacLabAlternative Note: Category fields can be specified separately
Successful Downloads
2. Train completely offline with any robot via the
--offlineflag (also works with/play)Supported for:
rl_games,rsl_rl,sb3,skrl, andsim2transferRun various demos and tutorials with
--offlineflagStrict mode (default) - fails immediately if asset not found locally
Permissive mode - warns and falls back to Nucleus if asset not found
Environment variables work too
Missing Assets Awareness
Note: For offline training, assets that cannot be found in
offline_assetswill attempted to be fetched from the Nucleus Server when using the--offline-permissiveflag.Before vs After
Before (Hardcoded approach):
After (Generic system):
Testing
Manual Testing Completed
✅ Asset Download
✅ Offline Training - All RL Libraries
✅ Various Demos and Tutorials:
✅ Multi-Robot Testing
✅ Complete Offline Verification
--offline-permissivespecified)Test Output
Screenshots
Asset Download Progress
Training Output
Breaking Changes
None. This is a purely additive feature:
--offlineflagDependencies
Required:
tqdm- For download progress bars (add to requirements:pip install tqdm)No new dependencies for core functionality - Uses existing Isaac Lab infrastructure.
Documentation
scripts/offline_setup/README.mdChecklist
pre-commitchecks with./isaaclab.sh --formatconfig/extension.tomlfileCONTRIBUTORS.mdor my name already exists thereAdditional Notes
Performance Impact
Future Enhancements
Tested On
sha f3061a464c2cded093db021233fadea63663631c)Ready for review! This implementation enables airgapped training, improves reliability, and reduces code duplication and localized complexity while maintaining full backward compatibility.