Repository navigation
Conversation
…#1804) Net change of #1804 at 8df62af, applied as one commit because its first commits added python_modules, which later commits replaced with Arena plugins. Left out: isaaclab_arena_examples/external_environments/ franka_table_environment.py and franka_table.yaml, which build on #1782 and don't exist on release/0.4.0. Conflicts resolved toward release's content, where release lacks the tags docs (#1775) and the register_environment import (#1729), and where release's tasks page still runs advanced.py with --external_environment_class_path. (cherry picked from commits 16b9ca5..8df62af) Signed-off-by: Xinjie Yao <xyao@nvidia.com>
Release has advanced.py instead of #1782's franka_table_environment.py, and its external environments are ExampleEnvironmentBase subclasses loaded with --external_environment_class_path. - Keep the flag commands and drop the paragraphs that run franka_table by name through a plugin. - Say how to make a custom task usable from an environment YAML, without pointing to the YAML example that release lacks. - Name my_environment_with_task in the plugin entry-point example, as the release page does. - Use advanced.py, which registers franka_ik_soft, as the test plugin. Signed-off-by: Xinjie Yao <xyao@nvidia.com>
Confidence Score: 4/5
[Medium impact] The shared registration path now reaches Arena’s graph and environment workflows when installed plugins are present. The PR appears safe to merge, with a non-blocking gap in plugin test coverage. Findings
SummaryAdds automatic loading of installed
Diagram%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[Asset lookup or environment registration] --> B[Load built-in components]
B --> C[Find installed plugin entry points]
C --> D[Import plugin modules in name order]
D --> E[Run registration decorators]
E --> F[Resolve graph components or select environment]
Reviews (1) · Last reviewed commit: "Adapt the Arena plugin docs and tests to..." · Reviewed by Greptile |
| def test_a_spec_names_components_that_an_installed_plugin_registers(tmp_path): | ||
| _install_plugin_package(tmp_path, _EXAMPLE_PLUGIN_MODULE) | ||
| data = _minimal_env_graph_data() | ||
| data["embodiment"]["registry_name"] = "franka_ik_soft" | ||
| spec_path = tmp_path / "env_graph.yaml" | ||
| spec_path.write_text(yaml.safe_dump(data), encoding="utf-8") | ||
|
|
||
| result = _load_spec_in_a_fresh_process(spec_path, extra_python_path=tmp_path) | ||
|
|
||
| assert result.returncode == 0, f"loading the spec failed:\n{result.stderr}" |
There was a problem hiding this comment.
Plugin tests cover only robots
Both new success tests check only franka_ik_soft. The fixture registers no task, relation, or environment, and _REPLAY_SCRIPT never builds the graph. These tests can pass even if the other advertised plugin uses fail. Add a small plugin fixture that registers those components, build its graph, and check that its environment can be selected.
| """ | ||
| import isaaclab_arena_environments # noqa: F401 | ||
|
|
||
| ensure_assets_registered() |
There was a problem hiding this comment.
🟡 A plugin environment breaks the argparse runners on this branch
This call puts plugin environments in EnvironmentRegistry before add_example_environments_cli_args builds a subparser for every registered environment.
- Why it fails: On
release/0.4.0,add_environment_cli_argsstill goes through_get_legacy_argparse_cfg_type, which asserts that the factory has the private_legacy_argparse_cfg_typeattribute. A plugin with a typed@register_environmentfactory won't have it. The new docs suggest registering environments through plugins ("an Experiment cannot select an environment that your package registers"). - What breaks:
policy_runner.pyandenvironment_runner.pythen fail for every environment, built-ins included. So do graph-YAML Experiment runs, which build that parser inbuild_arena_builder_from_legacy_graph. Only--env_specCLI runs avoid it.
Main fixed this in #1716, which reads the config type from EnvironmentRegistry and only removes one line from each factory. Could we pick #1716 into this branch first or alongside this PR?
| assert entry_point.attr is None, "an Arena plugin entry point must name a module, not a module attribute" | ||
| entry_point.load() | ||
| except Exception as exc: | ||
| exc.add_note(f"Raised while loading Arena plugin '{entry_point.name} = {entry_point.value}'.") |
There was a problem hiding this comment.
🟡 The plugin name is lost when spec validation hits the failure
If the first registry lookup happens inside ArenaEnvGraphSpec validation, pydantic turns an AssertionError or ValueError from the plugin into a ValidationError and drops this note. That happens, for example, when record_placement_layouts.py:124 calls ArenaEnvGraphSpec.from_yaml.
- Affected failures: the
entry_point.attrcheck above, and every assert in theregister_*decorators. - What the user sees:
Assertion failed, an Arena plugin entry point must name a module…, blamed on a valid name likefranka_ik, once per validated field, with no plugin named.
I reproduced this with pydantic 2.14: the error has no note and no __cause__. Raising a new error that names the plugin isn't converted by pydantic, and it keeps the original error as the cause:
except Exception as exc:
raise RuntimeError(f"Failed to load Arena plugin '{entry_point.name} = {entry_point.value}'.") from exc- Test:
test_a_plugin_that_fails_to_load_is_named_in_the_errorraisesRuntimeError, which pydantic lets through, so it misses this case. Making the broken plugin fail anassertinstead would cover it. - Docs: The line "an error whose note names the plugin" would then become "an error that names the plugin".
The same code is in #1804.
🤖 Isaac Lab-Arena Review BotSummaryThis cherry-picks #1804 onto Two things need fixing before this ships in a release:
Findings🟡 Warning: isaaclab_arena_environments/cli.py:35
🟡 Warning: isaaclab_arena/assets/registries.py:428
🔵 Improvement (already broken before this PR): docs/pages/arena_in_your_repo/external_tasks_and_embodiments.rst:48
Test Coverage and CI Cost
VerdictMinor fixes needed |
Cherry-pick #1804 into
release/0.4.0, so an environment YAML on the release branch can name robots, objects, tasks, and relations that an installedisaaclab_arena.pluginspackage registers (https://nvbugspro.nvidia.com/bug/7173054).#1804 is still open. Its net change is picked as one commit, because its first commits added
python_modules, which later commits replaced with plugins. Later review changes to #1804 will be picked here too.The second commit is release-only. Release still has
basic.pyandadvanced.pyinstead of #1782'sfranka_table_environment.py, so this branch leaves out the decorated example andfranka_table.yaml, and:--external_environment_class_pathcommands and drops themainparagraphs that runfranka_tableby name.advanced.pyas the plugin in the tests, which registersfranka_ik_soft.