Repository navigation
Conversation
A YAML environment graph that named a robot or object registered in an external package failed with "Unknown asset registry_name", because neither runner had a way to import the registering module. Add a python_modules list to ArenaEnvGraphSpec. A before-validator imports the listed modules, so their @register_* decorators run before registry names are checked, for every loader of the spec. The field is hidden from the JSON schema, and spec inference drops it from model output, so a generated spec cannot import code. The unknown registry name error now points to python_modules. Signed-off-by: Xinjie Yao <xyao@nvidia.com>
Confidence Score: 5/5
[Medium impact] The PR appears safe to merge; no actionable issues were found. SummaryAdds
Diagram%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[Authored graph] --> B[Import listed modules]
B --> C[Check graph and registered names]
D[Generated response] --> E[Remove python_modules]
E --> C
C --> F[Validated graph]
Reviews (1) · Last reviewed commit: "Import an environment graph's python_mod..." · Reviewed by Greptile |
🤖 Isaac Lab-Arena Review BotSummaryThis PR adds a Findings🔵 Improvement: docs/pages/concepts/environment/environment_definition.rst:288: 🔵 Improvement: isaaclab_arena/environment_spec/arena_env_graph_types.py:52: only the unknown-asset error points to Test Coverage and CI Cost🔵 CI status: when this review ran, "Run tests (native uv, source)" had been skipped and pre-commit was still queued, so I couldn't see test results. I didn't run the tests myself. VerdictMinor fixes needed |
- Add the python_modules hint as a note in from_dict only, so the LLM's critic retry no longer gets advice it cannot follow. Unknown task and relation kinds get the same note. - Leave assets registered by a spec's python_modules out of the agent's asset catalogue, so the review GUI cannot save a spec that loads nowhere else. - Register Arena's assets before importing python_modules, name the entry in import errors, and reject relative module names. - Keep python_modules in the public JSON schema and remove it only from SpecInference's strict schema. - Join python_modules lists across external_yaml includes. - Document importability, trust, and process lifetime of the imports. Signed-off-by: Xinjie Yao <xyao@nvidia.com>
…elper Signed-off-by: Xinjie Yao <xyao@nvidia.com>
An environment YAML stays pure data. Instead of listing modules to import in each YAML, a package declares the modules that register its components as entry points in the isaaclab_arena.plugins group. - ensure_assets_registered() loads every installed plugin after Arena's own components, so a plugin cannot take a built-in registry name. An entry point names a module to import or a module:function to call. - ensure_environments_registered() loads plugins too, so Experiments can select environments that a plugin registers. - A plugin that fails to load raises with a note naming it. - ArenaEnvGraphSpec.from_dict points unknown asset, task, and relation names to Arena plugins. - Remove python_modules and the code it needed: the spec inference schema edit, the agent catalogue exclusion, and the include merge rule. - Document plugins in the Arena in your repository guide. Signed-off-by: Xinjie Yao <xyao@nvidia.com>
Signed-off-by: Xinjie Yao <xyao@nvidia.com>
Signed-off-by: Xinjie Yao <xyao@nvidia.com>
Signed-off-by: Xinjie Yao <xyao@nvidia.com>
qianl-nv
left a comment
There was a problem hiding this comment.
Thanks for address this long overdue issue.
Added a few comments.
…h_python_modules # Conflicts: # docs/pages/arena_in_your_repo/external_tasks_and_embodiments.rst
- Accept only modules as isaaclab_arena.plugins entry points. - Append a plugin hint to the unregistered asset, task, and relation errors, and drop the from_dict note that matched error text. - Register the external example's task and environment, so a package that declares the example as a plugin runs franka_table by name. The task accepts task_description, which an environment YAML passes. - Add franka_table.yaml, the example as an environment YAML. The plugin tests declare the example module as the plugin and load that YAML. - Docs: move the plugin section before "Putting It All Together", install with install_package.sh, run the example and its YAML with experiment_runner.py, and note in "Choosing a runner" that plugin environments run in the Experiment Runner. Signed-off-by: Xinjie Yao <xyao@nvidia.com>
Let an installed package register its own robots, objects, tasks, relations, policies, and environments with Arena through
isaaclab_arena.pluginsentry points, so environment YAML and Experiments can name them.Why this change?
A YAML environment that names a custom robot or object fails with
Unknown asset registry_name, because neither runner can import the module that registers it. Reported by VDR https://nvbugspro.nvidia.com/bug/7173054An Experiment also cannot select an environment that an external package registers. External repositories work around both by wrapping Arena's runner and patching its internals to import their modules first. However, users tend to launch eval exps with our experiment_runner.py, instead of their own runner py.
What changes?
ensure_assets_registered()loads every installedisaaclab_arena.pluginsentry point after Arena's own components, in name order. An entry point names a module, which is imported; an entry point that names a module attribute is rejected. A plugin that fails to load raises with a note naming it.ensure_environments_registered()also loads plugins, so Experiments can select environments that a plugin registers.franka_tableby name.franka_table.yamlshows the same environment as an environment YAML.Usage example
Your repository keeps Arena as an unmodified submodule:
pyproject.tomldeclares the modules that register the custom components:After installing the package with
install_package.sh, the environment YAML names them like built-in components:An Experiment selects the environment by its path, and Arena's
experiment_runner.pyruns it unchanged:cd my_repo python submodules/IsaacLab-Arena/isaaclab_arena/evaluation/experiment_runner.py \ --experiment_config experiments/widget_lift_experiment.yamlA Python environment in the same package works the same way.
my_project/envs.pyregisters a factory that uses the custom components:An Experiment selects it by its registered name. A built-in Python environment also accepts the custom components by name:
On the command line,
widget_tableis an environment subcommand like the built-in ones:Before this change, the same YAML failed with
Unknown asset registry_name 'my_soft_franka'unless a custom launcher importedmy_projectfirst.Validation
load_arena_experiment_from_config_fileloads the Experiment above, and its Run selectsenvs/widget_lift.yaml.widget_tableasWidgetTableEnvironmentCfgandpick_and_place_maple_tablewithmy_soft_frankaandmy_widget.environment_runner.py widget_table --object my_widgetparses.franka_tableby name andfranka_table.yamlby path, each withobject: tomato_soup_canand a zero-action policy. Both episodes succeeded at step 50.