nemo_gym.discovery
nemo_gym.discovery
Shared component-discovery helpers: which roots to scan for a component, how to resolve name
collisions across them, and how to read a component’s (domain, description).
Lives below the per-component registries (registry.py, benchmarks.py, agent_registry.py) so
they can share it without depending on each other. Reads configs only; never starts servers.
Module Contents
Classes
Functions
Data
API
Bases: GlobalConfigDictParser
parse_no_environment for listing: fill unset ???, ${...} and environment values (runtime-only
things like API keys/endpoints) with a placeholder so the config still resolves enough to identify the
component. Never mutates the input; other config and resolver errors propagate.
Best-effort (domain, description) from a config mapping: the first of each found across all
server groups. Never raises.
Run dir_scanning_fn on subdir of every component_search_roots root and merge the results.
The shared body of discover_environments/discover_agents/discover_models/
discover_benchmarks: each passes its <type>/ subdir and a single-directory scan function, and
gets user-shadows-built-in merging (via merge_by_name) for free.
Yield (group_key, server_name, server_config) for every server across all instances in a config.
Walks each top-level instance and each known server group. It is defensive against malformed shapes and never raises.
Merge per-root name -> entry mappings; earlier roots win on a collision (user shadows built-in),
matching component_search_roots precedence. Insertion order preserved.
Shared (domain, description) reader for an environment or benchmark config. Two passes, because
the two declare metadata differently:
- Raw (non-resolving) scan — environment configs declare it inline, and this is safe even though they reference servers defined elsewhere (resolving in isolation would raise).
- Resolving fallback for whatever’s still unset — benchmark configs inherit it via
config_paths/_inherit_from. Tolerates unset runtime values; on failure keeps the raw result.
Never raises: an unreadable/unresolvable config yields (None, None).