Skip to content

Remove --external_environment_class_path in favor of Arena plugins - #1841

Draft
xyao-nv wants to merge 2 commits into
mainfrom
xyao/refactor/remove_external_environment_class_path
Draft

xyao-nv wants to merge 2 commits into
mainfrom
xyao/refactor/remove_external_environment_class_path

Conversation

@xyao-nv

@xyao-nv xyao-nv commented Dec 3, 2026

Copy link
Copy Markdown
Collaborator

Remove --external_environment_class_path. An external environment now runs by its name, like a built-in one, once its package declares the module that registers it as an Arena plugin.

Why this change?

#1804 let an installed package declare isaaclab_arena.plugins entry points. Arena imports those modules when it registers assets, so every runner, Experiment and environment graph YAML finds the package's environments, tasks and assets by name.

That leaves two ways to run an external environment. --external_environment_class_path imports one factory class from a dotted path, and only the Policy Runner and Isaac Lab scripts act on it. Plugins cover the same case in every runner, so the flag is a second route to document and test.

What changes?

  • --external_environment_class_path is removed from get_isaaclab_arena_cli_parser and from environment_registration_callback, which registers environments for Isaac Lab scripts. import_external_environment_factory goes with it.
  • Passing the old flag stops with a message that points to Arena plugins and the v0.5 migration guide. Without it, argparse would take the class path as the environment name and fail with invalid choice. The flag is hidden from --help and has a TODO to delete it one release after v0.5.
  • Tests that used the flag declare the in-tree example as a plugin instead. tests/utils/arena_plugins.py writes test-only package metadata (a .dist-info folder with entry_points.txt) and puts it on a child process's PYTHONPATH. The Policy Runner test in test_external_environment.py finds franka_table only through that metadata. The plugin tests in test_arena_env_graph_spec.py share the helper. The four flag tests in test_environment_cfgs.py are removed.
  • Docs: the external environment page runs franka_table by name, the Docker example drops the flag, and the v0.5 migration guide has a before/after entry. The "Choosing a runner" note and the run-experiment skill no longer send external environments to the Policy Runner.

Breaking changes:

  • Commands and Isaac Lab scripts that pass the flag must drop it, and the package that defines the environment must be installed with a plugin entry point.
  • A module that is only on PYTHONPATH must be installed, because Arena reads plugins from installed package metadata.
  • The factory must register itself with @register_environment. The flag registered the class it imported; a plugin only imports the module.
  • The in-tree example, isaaclab_arena_examples/external_environments/franka_table_environment.py, is not installed as a plugin, so the docs no longer show a command that runs it from an Arena checkout.

release/0.4.0 keeps the flag.

Usage example

Before:

python isaaclab_arena/evaluation/policy_runner.py --policy_type zero_action \
  --external_environment_class_path my_package.isaaclab_arena_environments.franka_table_environment.ExternalFrankaTableEnvironment \
  franka_table --object tomato_soup_can

After, with the module declared as a plugin in the package's pyproject.toml:

[project.entry-points."isaaclab_arena.plugins"]
my_package_franka_table = "my_package.isaaclab_arena_environments.franka_table_environment"
python isaaclab_arena/evaluation/policy_runner.py --policy_type zero_action \
  franka_table --object tomato_soup_can

Validation

  • Ran policy_runner.py with the old flag: it exits with code 2 and prints the plugin message.
  • Not covered: an Isaac Lab script that loads a plugin in a fresh process. The callback test imports the example module directly, because the test's shared simulation app loaded plugins before the test starts. The plugin tests in test_arena_env_graph_spec.py cover plugin loading itself.

Arena plugins load an external environment in every runner, in
Experiments, and in Isaac Lab scripts, so the class-path flag is a
second way to do the same thing.

- Remove the flag from the Arena CLI, the environment CLI, and the
  Isaac Lab registration callback, along with
  import_external_environment_factory.
- Run the external environment tests through a plugin: the Policy
  Runner test declares the example as a plugin with test-only metadata,
  shared with the spec tests in tests/utils/arena_plugins.py.
- Docs run the example by name, and the v0.5 migration guide shows the
  replacement.

Signed-off-by: Xinjie Yao <[email protected]>
Without the flag, argparse took the class path that followed it as the
environment name and failed with "invalid choice". A hidden flag now
stops with a pointer to Arena plugins, in the Arena runners and in the
Isaac Lab registration callback.

Signed-off-by: Xinjie Yao <[email protected]>

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant