Repository navigation
refactor(server_runtime): move the server runtime modules into nemo_gym/server_runtime - #5214
Merged
Merged
Conversation
|
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
marked this pull request as ready for review
October 28, 2026 19:10
35 of 41 tasks
Contributor
ananthsub
force-pushed
the
ananthsub/layout-server-runtime
branch
from
October 28, 2026 19:25
831b81f to
91d72d8
Compare
ananthsub
force-pushed
the
ananthsub/layout-server-runtime
branch
from
October 28, 2026 19:56
91d72d8 to
d4c3f4f
Compare
ananthsub
force-pushed
the
ananthsub/layout-server-runtime
branch
from
October 28, 2026 21:56
b94c96b to
941ff93
Compare
ananthsub
force-pushed
the
ananthsub/layout-server-runtime
branch
from
October 28, 2026 22:26
941ff93 to
a64b596
Compare
ananthsub
force-pushed
the
ananthsub/layout-server-runtime
branch
from
October 28, 2026 23:10
a64b596 to
ae5e530
Compare
ananthsub
force-pushed
the
ananthsub/layout-server-runtime
branch
from
October 29, 2026 00:55
ae5e530 to
ef86e9b
Compare
…ym/server_runtime The resources and environment server bases, episode and turn types, tool access, the runtime directory, server status, MCP auto-exposure and verifier observability move into nemo_gym/server_runtime; session routing and the rollout context middleware (rollout_correlation.py) into server_runtime/request_handling; and the checkpoint package into server_runtime/_checkpoint, except its two model-server modules, which go straight to nemo_gym/models so they move only once. Record the moves in MOVED_MODULES (the checkpoint package as a whole, with longer entries for its two model-server modules), rewrite in-repo references with scripts/migrate_imports.py, point the lazy exports at server_runtime.base_resources_server, make the contract's server runtime layer the nemo_gym.server_runtime package next to server_utils until server_utils is split, and redirect the old library reference pages in fern/docs.yml. The checkpoint model-server tests go to tests/unit_tests/models with their modules. Tests that import helpers from the moved files follow them, and the checkpoint declaration test finds the repository root one level further up. Regenerate the public API of each layout package that exists here from what non-test code outside nemo_gym imports, and point code outside nemo_gym, tests included, at nemo_gym.<package>. Signed-off-by: Ananth Subramaniam <[email protected]>
5 tasks done
This branch was previously deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What and why
Moves what runs inside every Gym server into a new
nemo_gym/server_runtime/package: the resources and environment server bases, the episode and turn types they exchange, request handling, and partial-rollout checkpoints.server_utils.pyis split in the next PR, so this one moves whole modules only.Where this PR sits
The stack lands bottom-up; each PR's base is the branch of the PR before it, so each diff shows only that PR's change.
Where the package sits
An arrow means "imports"; each package imports only packages below it. Yellow: created by this PR. Green: created by an earlier PR in the stack. Grey: still to come.
What moves
Whole modules, unchanged:
nemo_gym/base_resources_server.pynemo_gym/server_runtime/base_resources_server.pynemo_gym/base_environment_server.pynemo_gym/server_runtime/base_environment_server.pynemo_gym/episode_types.pynemo_gym/server_runtime/episode_types.py(moved on tonemo_gym/core/episode_types.pyby #5536)nemo_gym/single_agent_turn_types.pynemo_gym/server_runtime/single_agent_turn_types.pynemo_gym/tool_access.pynemo_gym/server_runtime/tool_access.pynemo_gym/runtime_dir.pynemo_gym/server_runtime/runtime_dir.pynemo_gym/server_status.pynemo_gym/server_runtime/server_status.pynemo_gym/mcp_auto_exposure.pynemo_gym/server_runtime/mcp_auto_exposure.pynemo_gym/observability/verifiers.pynemo_gym/server_runtime/verifier_observability.pynemo_gym/session_routing.pynemo_gym/server_runtime/request_handling/session_routing.pynemo_gym/rollout_correlation.pynemo_gym/server_runtime/request_handling/rollout_context.pynemo_gym/_checkpoint/nemo_gym/server_runtime/_checkpoint/nemo_gym/_checkpoint/model.pynemo_gym/models/_checkpoint.pynemo_gym/_checkpoint/model_workers.pynemo_gym/models/_checkpoint_workers.pyHow to review
One commit. Its changes:
MOVED_MODULESinnemo_gym/_moved_paths.py.scripts/migrate_imports.py.server_runtimelayer becomes thenemo_gym.server_runtimepackage.fern/docs.ymlredirects the old library reference pages to the new ones.nemo_gym/models/, their place in the proposal, so they move only once. LongerMOVED_MODULESentries sendnemo_gym._checkpoint.modelandnemo_gym._checkpoint.model_workersthere, and the rest ofnemo_gym._checkpointtoserver_runtime/_checkpoint/. Theserver_utils.checkpoint_settingsentry from refactor(client): move the HTTP and server clients into nemo_gym/client #5206 now points atserver_runtime/_checkpoint/settings.pydirectly, so it warns once rather than twice.rollout_correlation.pynow holds only the rollout context middleware, after refactor(core): move shared definitions into nemo_gym/core #5203 moved its episode tracking tocore/, so it moves whole asrequest_handling/rollout_context.py. Its old names keep resolving through the feat(compat): keep old import paths working across the package reorganization #5167 fix for modules that move after serving moved names.nemo_gym/__init__.pypoint atserver_runtime.base_resources_server, and the contract's server runtime layer isnemo_gym.server_runtimenext tonemo_gym.server_utilsuntil the split.tests/unit_tests/server_runtime/, and the two checkpoint model-server test files intotests/unit_tests/models/. Tests that import helpers from moved test files follow them.Public API
Every layout package that exists after this PR has a lazy public API in its
__init__.py: the names non-test code outsidenemo_gym/imports from it (servers, benchmarks, scripts, and code samples in docs and skills), each served from the submodule that defines it on first use. Code outsidenemo_gym/and its tests (servers and their tests, benchmarks, scripts, and docs) imports those names fromnemo_gym.<package>, so later moves inside a package leave it alone. Code insidenemo_gym/, and the library's tests undertests/, import from the module that defines each name, so the import-linter contract sees every dependency and a test reads what it patches. A patch target names the module the code under test looks the name up in.AGENTS.mdstates the rule.Validation
pytest -n 16 tests/unit_tests, also with-W errorfor the moved paths. The only failures are environment-specific and unrelated to the move: this machine's hostname resolves to127.0.1.1, which the sandbox host check refuses (the Harbor run summary tests and the benchmark listing test), and two Docker PTY tests.lint-imports.pre-commit runon the changed files.Rollout evidence: N/A. The modules move unchanged.
Compatibility
nemo_gym.server_runtime.*. A logging config set onnemo_gymstill covers them.python scripts/migrate_imports.py <paths>.Issue
Part of #5166.