nemo_gym.cli.main
nemo_gym.cli.main
Module Contents
Classes
Functions
Data
API
Bases: ArgumentParser
ArgumentParser that appends a difflib “did you mean?” hint to invalid-choice errors.
Covers mistyped commands/groups and bad —flag choices (e.g. —storage), since argparse validates all of them as choices against the registry baked into the parser.
A --<flag> NAME selector that resolves the named asset to a config and adds it to +config_paths.
Repeatable selectors accumulate, composing several components the way --config does.
A --name store_true flag that maps to the Hydra override +<hydra_key>=true when set.
A --name "A,B" flag that maps to the Hydra override +<hydra_key>=["A","B"]
A comma-separated CLI value translated to a Hydra list override.
gym dataset publish --harbor TARGET --output DIR: plain Harbor task folders, checked by Harbor’s own loader.
gym dataset pull TARGET: fetch a Harbor dataset into environments/harbor/ without preparing or running it.
Split a pydantic ValidationError into dotted paths of missing fields and path (reason) strings for
every other failure, so each CLI error path renders schema mistakes the same way.
gym dev compare OLD NEW: the paths and quoted options reach the command verbatim (as gym eval run passes
its TARGET) rather than through Hydra’s override grammar, which mangles non-ASCII and backslashes. The root
gym --json toggle switches stdout to the JSON summary; --json PATH after the subcommand writes it to a file.
Prepend --search-dir roots to NEMO_GYM_EXTRA_ROOTS for the duration of the command, then restore.
Setting the env var lets the roots reach every resolver (discovery, the —<component> selectors,
deep config/prompt/rollout resolution) and inherit into spawned server subprocesses.
The original value is restored (or the var unset) on exit so main() leaves no global side effect.
(sys.path is augmented with the new roots for plugin prepare.py imports and left as-is on exit.)
A run-health limit: a fraction in [0, 1], or none (any case) for no limit.
List the benchmark view of the unified workload catalog.
Coalesce all +config_paths=[...] tokens (from —config and asset selectors) into one (Hydra rejects dupes).
Make SIGTERM unwind like Ctrl-C, so a stopped recovery stops its login-host reader and closes its connection.
gym search [<type>] <query>: dispatch to the chosen type’s listing command (default environments),
which filters itself to the query config key already in overrides.
--agent-type picks the harness to compose, which is already fixed once the servers are up.
A --name VALUE flag that maps to the Hydra override +<hydra_key>=VALUE (omitted when unset).
quote=True passes VALUE as a literal string (see _hydra_quote), for filenames and free text.