Skip to content

refactor(server_runtime): rename the head server to the registry server - #5553

Draft
ananthsub wants to merge 3 commits into
ananthsub/renamed-config-keysfrom
ananthsub/registry-server-rename
Draft

ananthsub wants to merge 3 commits into
ananthsub/renamed-config-keysfrom
ananthsub/registry-server-rename

Conversation

@ananthsub

@ananthsub ananthsub commented Nov 3, 2026 •

Copy link
Copy Markdown
Contributor

What changed and why

Every Gym server and client gets the run's merged config and the server addresses from one server. It was called the "head server", but "head" already means the Ray head node (ray_head_node_address) and the Slurm head node, so the name did not say what the server does. This PR renames it the registry server, in the config, the code, log and error messages, and the docs under fern/versions/latest/. The frozen fern/versions/v*/ docs are unchanged.

This is the last of the naming clean-ups that followed the nemo_gym/ reorganization (#5166), after #5526, #5528 and #5531, alongside #5533. It has no separate issue.

The PR has three commits: the registry server rename, the telemetry names, and the two dependency keys.

Built on #5628. #5628 adds the shared mechanism for renamed config keys and arguments in nemo_gym/config/renamed_keys.py, so this PR targets #5628's branch. Once #5628 merges, this PR's base becomes main. It does not depend on #5533, the token capture rename, which builds on #5628 too. Both add entries to RENAMED_TOP_LEVEL_KEYS, so whichever merges second resolves a conflict in that one dict.

Renames

Before After
head_server: config block (host, port) registry_server:
HEAD_SERVER_KEY_NAME REGISTRY_SERVER_KEY_NAME
DEFAULT_HEAD_SERVER_PORT DEFAULT_REGISTRY_SERVER_PORT
HeadServer RegistryServer
HeadServerUnreachableError RegistryServerUnreachableError
HeadServerConfigMalformedError RegistryServerConfigMalformedError
HeadServerUnresponsiveError RegistryServerUnresponsiveError
head_server_spinup_timeout_seconds config key registry_server_spinup_timeout_seconds
ServerClient.head_server_config ServerClient.registry_server_config
ServerClient.load_head_server_config() ServerClient.load_registry_server_config()
head_server_config= argument registry_server_config=
HEAD_MAX_WAIT in scripts/wait_for_servers.sh REGISTRY_MAX_WAIT
head_server_deps config key, HEAD_SERVER_DEPS_KEY_NAME parent_process_deps, PARENT_PROCESS_DEPS_KEY_NAME
head_server_constraints config key, HEAD_SERVER_CONSTRAINTS_KEY_NAME parent_process_constraints, PARENT_PROCESS_CONSTRAINTS_KEY_NAME
Telemetry: nemo.gym.event_loop value head_server registry_server
Telemetry: startup stages start_head_server, wait_for_head_server start_registry_server, wait_for_registry_server

The head_server_config= argument is on ServerClient.load_from_global_config, setup_server_client, and RolloutCollectionHelper.run_examples, run_outcomes and setup_server_client. Private names, such as the supervisor's _head_server_thread, are renamed without aliases. HeadServerUnresponsiveError and head_server_spinup_timeout_seconds came in with #5343 and are in no release yet, so they are renamed without aliases too.

Compatibility

Every old name keeps working until nemo_gym 0.10.0. Each use logs a DeprecationWarning that names the new name.

  • Config key. A head_server block set in YAML, on the command line, or in an initial config passed in by a training framework such as NeMo RL is moved to registry_server by the config parser's renamed-key step from feat(config): accept renamed config keys and arguments under their old names #5628, which this PR registers head_server with. The parser renames it in each config source before merging, so an old key in one source and the new key in another follow the usual precedence: the command line wins over a YAML config. A source that sets both keys to different values fails with an error that says which one to remove. If both are set to the same value, the run goes ahead with a warning.
  • Python names. The old constants and classes still resolve, through MOVED_NAMES in nemo_gym/_moved_paths.py, at every module path that shipped them: nemo_gym.server_utils, nemo_gym.cli.env, nemo_gym.config_types and nemo_gym.global_config. They resolve to the renamed objects, so except HeadServerUnreachableError still catches the new error. nemo_gym/config/config_types.py now installs the module __getattr__ that serves them. The renamed entries are in their own block, next to the token capture block, so the other open rename PRs only conflict on the lines that removed the old names from the main block.
  • ServerClient. ServerClient(head_server_config=...), the .head_server_config attribute and load_head_server_config() all still work.
  • Keyword arguments. The renamed_keyword decorator from feat(config): accept renamed config keys and arguments under their old names #5628 accepts head_server_config=. Passing it together with registry_server_config= is a TypeError, as passing any argument twice is.
  • wait_for_servers.sh still reads HEAD_MAX_WAIT when REGISTRY_MAX_WAIT is unset.
  • Dependency keys. The parser computes both keys on every parse, so a config never set them: a value set under the old name was replaced by the computed one. The parser now drops head_server_deps and head_server_constraints without a warning, rather than telling users to set a key they cannot set, so the old names do not linger next to the computed ones. HEAD_SERVER_DEPS_KEY_NAME and HEAD_SERVER_CONSTRAINTS_KEY_NAME still resolve at nemo_gym.global_config and nemo_gym.cli.setup_command. nemo_gym/orchestration/server_venv.py now installs the module __getattr__ that serves them.

Wire formats and run outputs

These do not change. Here is what I checked:

  • Registry routes and payloads. /global_config_dict_yaml, /server_instances and the liveness and readiness routes are unchanged. So is the shape of what they return. Only the top-level key that names the registry's own address inside the served config is renamed.
  • Run identity. Resuming a run compares a configuration identity with the one saved with the run. That identity covers only server blocks, so the registry's key never enters it. A test checks that a config with head_server and a config with registry_server on a different port give the same identity. head_server stays in the runtime-option list alongside registry_server.
  • Telemetry: changed on purpose. The nemo.gym.event_loop attribute value for the registry server's loop is now registry_server, and the supervisor's startup stages are now start_registry_server and wait_for_registry_server. These are values, not attribute or metric names. A dashboard or query that filters on head_server, start_head_server or wait_for_head_server needs the new values. The metrics docs give the former label value.
  • Resolved config. The resolved config written with a run now has registry_server, parent_process_deps and parent_process_constraints instead of the old keys. Nothing in Gym or NeMo RL reads those keys back.
  • ServerStartFailedError.server_name. When the registry server fails to bind, this is now registry_server, the config key to fix. It is an in-process exception attribute and is not written to run outputs.

NeMo RL

I checked what ~/dev/RL reads and sets:

  • from nemo_gym.server_utils import HEAD_SERVER_KEY_NAME, BaseServerConfig still works, with a warning. The constant now resolves to "registry_server", so NeMo RL writes the new key into its initial config.
  • rch.run_examples(examples=..., head_server_config=...) still works, with a warning.
  • ServerClient.load_from_global_config(self.head_server_config) passes the config positionally and needs no change.
  • NeMo RL's rollout-checkpoint fingerprint excludes env.**.head_server and env.**.head_server_deps. Gym's computed keys do not reach that fingerprint, so nothing breaks. NeMo RL should add env.**.registry_server and env.**.parent_process_deps to that exclusion list. That is a NeMo RL follow-up.

Why the dependency keys are renamed too

head_server_deps and head_server_constraints are not about the registry server. "Head" in their names meant the parent gym process, which runs gym env start or gym eval run. head_server_deps holds requirements from that process: its openai version, telemetry packages and sandbox provider plugins. These are installed into every server venv. head_server_constraints pins the parent's exact Ray version, both as a constraint and as an override, so a server that joins the parent's Ray cluster runs the same Ray. Once the head server is the registry server, head_server_* names a server that no longer exists, so the keys are now named for where the pins come from: parent_process_deps and parent_process_constraints.

Validation

  • pre-commit run --files <touched files>: passed.
  • Unit tests, with PYTHONPATH and NEMO_GYM_EXTRA_ROOTS set to the worktree: every touched unit test file, tests/unit_tests/test_moved_paths.py, tests/unit_tests/config/test_renamed_keys.py and the new compatibility tests all pass.
  • The new compatibility tests cover each old name at each old module path. They check that a head_server block in an initial config, a YAML config or on the command line parses exactly like registry_server, and that one source setting both keys to different values is an error. They check that an old dependency key is dropped from the parsed config. They check the ServerClient field, attribute and loader, the head_server_config= argument on each function that accepts it, the saved run identity, and the HEAD_MAX_WAIT fallback.
  • Mutation check. I removed each compatibility shim in turn: the head_server entry in RENAMED_TOP_LEVEL_KEYS, the drop of the old dependency keys, the ServerClient validator, the attribute and the loader, each of the five renamed_keyword decorators, the config_types and server_venv __getattr__s, the MOVED_NAMES block and the script fallback. Each time, at least one of the new tests failed. Removing the MOVED_NAMES block also fails the import surface check in test_moved_paths.py.
  • Server tests under resources_servers/, responses_api_agents/ and environment_servers/ only had mechanical renames, and are left to CI (gym env test).

Smoke run

I ran this branch on one machine with the quickstart setup: the mcqa environment, simple_agent, and openai_model pointed at a hosted gpt-oss-20b endpoint. I ran gym env start, then gym eval run --no-serve --limit 5 --num-repeats 1, twice:

Old key New key
Registry address ++head_server.port=11731 on both commands ++registry_server.port=11732 on both commands
Deprecation warning Once per command: Config key 'head_server' was renamed 'registry_server'; ... None
Registry server Started on 11731, and eval run found it there Started on 11732, and eval run found it there
Rollouts 5 of 5, rewards 1, 1, 0, 1, 1 5 of 5, rewards 1, 1, 0, 1, 1
Aggregate mean/reward 0.8, pass@1/accuracy 80.0 mean/reward 0.8, pass@1/accuracy 80.0
Output files Same set of files, same row and manifest keys Same

In both runs the resolved config written with the output has a registry_server block, with its own port.

After the dependency key rename, I ran a third start and collection with ++registry_server.port=11733 and "++head_server_deps=['ignored==1.0']". The server venv installs carried the computed openai==2.44.0 pin and not the ignored value. The collection gave mean/reward 0.8, and the resolved config has parent_process_deps and parent_process_constraints. That run predates the change that drops the old dependency keys without a warning; the unit tests cover the drop, and the computed pins are unchanged.

I did not run with a metrics exporter, so the new telemetry values are checked only by reading the change.

User-facing impact

Configs, scripts and code that use the old names keep working until 0.10.0. They log a deprecation warning that names the replacement. Docs and examples now use registry_server. Benchmark results are not affected.

@copy-pr-bot

copy-pr-bot Bot commented Nov 3, 2026

Copy link
Copy Markdown

Auto-sync is disabled for draft pull requests in this repository. Workflows must be run manually.

Contributors can view more details about this message here.

@ananthsub
ananthsub force-pushed the ananthsub/token-capture-rename branch from 91a62dc to 30182d5 Compare November 4, 2026 00:58
@ananthsub
ananthsub force-pushed the ananthsub/registry-server-rename branch from aa7f6e2 to 51c4563 Compare November 4, 2026 01:06
@ananthsub
ananthsub force-pushed the ananthsub/token-capture-rename branch from 30182d5 to 847367b Compare November 4, 2026 20:22
@ananthsub
ananthsub force-pushed the ananthsub/registry-server-rename branch from 51c4563 to f257b13 Compare November 4, 2026 20:31
@ananthsub
ananthsub force-pushed the ananthsub/token-capture-rename branch from 847367b to 40b850d Compare November 4, 2026 20:44
@ananthsub
ananthsub force-pushed the ananthsub/registry-server-rename branch from f257b13 to c0c532a Compare November 4, 2026 20:49
@ananthsub
ananthsub changed the base branch from ananthsub/token-capture-rename to ananthsub/renamed-config-keys November 4, 2026 20:49
@ananthsub
ananthsub force-pushed the ananthsub/renamed-config-keys branch from 7f1cdc1 to 2b971d4 Compare November 4, 2026 22:42
@ananthsub
ananthsub force-pushed the ananthsub/registry-server-rename branch from c0c532a to c5cc762 Compare November 4, 2026 23:19
@ananthsub
ananthsub force-pushed the ananthsub/renamed-config-keys branch from 2b971d4 to 8db168e Compare November 5, 2026 06:15
The server every Gym server and client asks for the run's config and
server addresses was called the head server. "Head" already means the
Ray head node and the Slurm head node, so the name did not say what the
server does. It is now the registry server, in the config, the code,
log and error messages, and the docs.

Old names keep working, with a DeprecationWarning, until nemo_gym
0.10.0:

- The `head_server` config block, from YAML, the command line, or an
  initial config such as the one NeMo RL passes in, is moved to
  `registry_server` by the same renamed-key step as token capture.
  Setting both to different values is an error.
- HEAD_SERVER_KEY_NAME, DEFAULT_HEAD_SERVER_PORT, HeadServer,
  HeadServerUnreachableError and HeadServerConfigMalformedError resolve
  at every old module path through MOVED_NAMES.
- ServerClient accepts the `head_server_config` field and attribute,
  and keeps `load_head_server_config`.
- `head_server_config=` is still accepted by
  ServerClient.load_from_global_config, setup_server_client, and
  RolloutCollectionHelper.run_examples, run_outcomes and
  setup_server_client.
- scripts/wait_for_servers.sh still reads HEAD_MAX_WAIT.

The registry's routes and payloads, the run identity used to resume a
run, and the telemetry label and startup stage values that name the
loop (`head_server`, `start_head_server`, `wait_for_head_server`) do not
change. `head_server_deps` and `head_server_constraints` keep their
names: they carry the parent gym process's pins into server venvs and
are not about the registry server.

Signed-off-by: Ananth Subramaniam <[email protected]>
…p stages after it

The event-loop label and the supervisor's two startup stages still used
the head server's name: `head_server`, `start_head_server` and
`wait_for_head_server`. They are now `registry_server`,
`start_registry_server` and `wait_for_registry_server`. A dashboard or
query that filters on the old values needs the new ones.

Signed-off-by: Ananth Subramaniam <[email protected]>
… to parent_process_*

The two keys hold pins from the parent gym process that every server
venv installs: its openai version, telemetry packages and sandbox
provider plugins as requirements, and its exact Ray version as a
constraint and override. They are not about the registry server, so
they are now `parent_process_deps` and `parent_process_constraints`,
with PARENT_PROCESS_DEPS_KEY_NAME and PARENT_PROCESS_CONSTRAINTS_KEY_NAME.

The parser computes both keys on every parse, so a config never set
them. The parser drops either old key without a warning, as it
overwrote them before, so the old name does not linger next to the
computed one. The old constants resolve
at nemo_gym.global_config and nemo_gym.cli.setup_command until nemo_gym
0.10.0.

Signed-off-by: Ananth Subramaniam <[email protected]>
@ananthsub
ananthsub force-pushed the ananthsub/registry-server-rename branch from c5cc762 to 2597ae9 Compare November 5, 2026 06:28
@svcnvidia-nemo-ci svcnvidia-nemo-ci added feature New capabilities, enhancements, or enablement work area:core Shared APIs, servers, telemetry, health, and registries labels Nov 7, 2026

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

area:core Shared APIs, servers, telemetry, health, and registries feature New capabilities, enhancements, or enablement work

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants