Repository navigation
feat(harbor): configuration homes, dataset.toml [gym] table and gym dataset init (M15) - #3807
Conversation
74b9c8d to
c676da9
Compare
|
Could you help me understand how changes to Is that intentional, or should the effective |
c676da9 to
e7b56d3
Compare
e7b56d3 to
2d6537b
Compare
2d6537b to
bf7c74f
Compare
yuhezhang-ai
left a comment
There was a problem hiding this comment.
Could we address the setup-error classification and the accepted override aliases? I also left two nonblocking suggestions for malformed override diagnostics and the deployment-wide setup example. The correctness findings were reproduced on this head with controlled local tests; no live sandbox or model rollout was run.
bf7c74f to
f32a137
Compare
9d7f43d to
8aaacb1
Compare
8aaacb1 to
ddde311
Compare
8e9a871 to
2f413e5
Compare
|
/ok to test 2f413e5 |
|
/ok to test 0eb423a |
|
/ok to test 8dc08eb |
|
/ok to test 6d6aaa3 |
|
/ok to test 145e126 |
|
Status at the new head 145e126. Felipe, on dataset.toml and identity, from the code at this head: a row's _ng_digest is task_digest(folder_digest, dataset, task_id) in nemo_gym/tasks/harbor/task.py. The folder digest is content_hash over the task folder, and whenever dataset.toml has any [gym] content the digest also folds in the applied slice, [gym.defaults] and the task's own [gym.tasks] entry, serialised as JSON. A dataset without a [gym] table keeps the plain folder hash, which is what the package store publishes and checks. So a [gym] edit after materialization does change identity: a resumed gym eval run or gym dataset validate compares the cached rows' digests with the freshly prepared ones before dispatch and refuses with "changed digest" (test_eval_run_resume_refuses_a_changed_selection_or_digest), the server refuses a row whose digest is not the one in its taskset mapping with a 422, and at seed it copies dataset.toml beside the task snapshot, reloads the task and refuses a digest that no longer matches with a 409 (test_dataset_toml_edit_after_materialization_is_refused). Since #4664 the manifest records the plain folder digests separately (HarborTask.folder_digest), so a settings edit changes the dataset digest once through dataset_toml_digest instead of reading as a task file edit, and every row also carries _ng_dataset_digest. Yu He, the 9 Oct and 15 Oct items are answered inline: OpenSandboxSetupError subclasses OpenSandboxCreateError, the deprecated memory, storage and allow_internet spellings are normalised before the merge (there is no legacy image key to map), malformed env overrides are HarborTaskErrors naming the file and table, the setup example no-ops without apt-get, the scaffold writes names Harbor 0.22.0 accepts with the harbor add, remove and sync caveat documented, the duplicate test definitions are gone, and the next-step commands are shell-quoted. |
|
Thanks, Adil—I rechecked the latest M15 against its immediate parent, and the earlier findings are addressed. One small nonblocking follow-up: could the compatibility test guard |
|
/ok to test 18b3498 |
|
/ok to test 7123266 |
|
/ok to test d4791ca |
|
Thanks. The importorskip("harbor") guards live in responses_api_agents/harbor_agent/tests/test_app.py on main, which this stack does not touch, so guarding harbor.models.dataset.manifest directly is a small separate fix to that suite rather than a change in M15. I will take it after the stack lands so that it does not get mixed into these diffs. |
|
/ok to test f327379 |
There was a problem hiding this comment.
Thanks for addressing the review findings. Approved; the remaining optional-library test guard can be handled as a nonblocking follow-up.
To clarify the location: my comment concerns tests/unit_tests/test_harbor_scaffold.py:110–112, which M15 adds. I should have named the file originally. The responses_api_agents/harbor_agent/tests/test_app.py mentioned in your reply is a different suite.
Collecting this scaffold test alongside environment_servers/harbor/tests/test_app.py makes pytest.importorskip("harbor") find Gym’s local package, then the external-model import fails with No module named 'harbor.models'. Guarding harbor.models.dataset.manifest and harbor.models.task.config directly would preserve the intended skip. This remains nonblocking and can be handled after the stack lands; my approval stands.
|
Thanks for the pointer, and sorry for sending you to the wrong suite. The guard you mean is the one M15 adds in tests/unit_tests/test_harbor_scaffold.py, where importorskip("harbor") resolves to Gym's own harbor package when the scaffold test is collected next to the environment server tests, so the external import then fails instead of skipping. I will guard harbor.models.dataset.manifest and harbor.models.task.config directly in the next fixup round of M15, together with Yu's reopened threads, so the test skips cleanly without the external library and still checks Harbor's serializer when it is installed. |
ffrujeri
left a comment
There was a problem hiding this comment.
Approving f3273796. Dataset settings moving into dataset.toml [gym] and deployment settings onto the sandbox provider looks right, and so does the config_paths ordering fix. images.auth only reaches the SDK image spec, and no log line prints it. Harbor, scaffold, OpenSandbox provider, sandbox, Compose and transfer suites pass locally (526 passed, 14 skipped). The 5 local failures are the 127.0.1.1 hostname tests flagged on #3746 and the optional-harbor scaffold guard Yu already noted. CI unit and server suites are green. One question inline.
|
/ok to test befad33 |
|
/ok to test 0871bfa |
…ataset init (M15) The harbor environment server runs every Harbor-shaped dataset, so its config is the one place a dataset-specific setting must never land. The per-task and operator environment, setup commands, thread-count derivation, image rewrites with their credentials and the Compose metadata path are gone from it; a test pins the config to its deployment fields and rejects dataset names in it. What a dataset needs on top of its tasks now lives beside them, as data, in the `[gym]` table of Harbor's `dataset.toml`: `[gym.defaults]` with `timeout_multiplier` and `resource_multiplier`, and `[gym.tasks."<id>"]` overrides written with Harbor's own `[environment]` fields (env merges, other fields replace). The loader applies them, so servers, agents and rows see the effective task.toml and the task digest still pins the folder alone. The server's task snapshot carries `dataset.toml` beside the task, so the sandboxes it creates see the same effective task as the rows and the oracle. Image mirrors, registry credentials and root setup commands move to the OpenSandbox provider block (`images`, `setup`), where they describe a deployment. `compose-images.json` is read where `gym dataset fetch` writes it. `gym dataset init <name>` scaffolds a dataset in this shape, and the harbor README documents the four configuration homes. `benchmarks/harbor/terminal_bench_4/README.md` shows the per-task `CIRCLE_NODE_TOTAL` override as a dataset.toml entry. Squashed from the previous branch and re-applied onto the environment server. Co-Authored-By: Claude Fable 5.1 <[email protected]> Signed-off-by: Adil Asif <[email protected]>
|
/ok to test 0020c35 |
ffrujeri
left a comment
There was a problem hiding this comment.
Approving 0020c35a. This answers my cpu_cap_env question: the CPU-count hints are back for the agent sandbox, the Compose main service and the separate verifier (sized by its own cpus), and the task's own env wins on a clash. The setup.commands fallback to the image's user on a no-root cell mirrors exec_as_root, and a command that still fails continues to fail the create.
|
🔄 Merge queue validation started! You can track the progress here: https://github.com/NVIDIA-NeMo/Gym/actions/runs/39686559302 |
What does this PR do?
Milestone M15 of the Harbor tasks RFC: configuration homes. The
harborresources server runs every Harbor-shaped dataset, so its config is the one place a dataset-specific setting must never land. By M13 it held eight such fields. This PR removes them and fixes where each kind of setting lives. Stacked on the M13 PR (#3754). Rebased ontomain128eab4 (2026-10-04).dataset.toml. A[gym]table beside the task folders:[gym.defaults]withtimeout_multiplierandresource_multiplier, and[gym.tasks."<id>".environment]overrides written with Harbor's own[environment]fields (envmerges, other fields replace). An override key that[environment]does not have is rejected by name, even thoughtask.tomlitself ignores unknown keys. The loader applies them, so servers, agents and rows see the effectivetask.toml. The task digest still pins the folder alone.nemo_gym/tasks/harbor/dataset_config.py.images.rewrites(ordered{from, to}prefix rules),images.auth(credentials by image prefix, longest wins, a spec's ownimage_authstill wins),setup.commands(run as root after readiness, withinsetup.timeout_seach) andsetup.env(set in every sandbox under the spec's own variables, for platform knobs such as the exec daemon's grace period). A failed setup command raisesOpenSandboxSetupError, which is never treated as a retryable create error, whatever its stderr says. A create cancelled during the probe or the setup commands still cleans up the new sandbox instead of leaving it to its TTL. Every sandbox consumer gets these blocks.sandbox_env,sandbox_env_by_task,sandbox_setup_commands,sandbox_setup_timeout_s,derive_cpu_env,image_rewrites,image_rewrite_auth,compose_image_configs(fetch writescompose-images.jsonnext to the task folders and the server reads it there).test_server_config_holds_only_deployment_settingsasserts the remaining field set and rejects dataset names in the class source.[verifier.environment]block alone selects separate verification, as in Harbor 0.22.environment_mode = "shared"keeps the shared mode, and a shared verifier cannot declare its own[verifier.environment]. A separate-mode task that declares noartifactsloads with a warning, since the verifier still receives/logs/artifacts.gym eval run <taskset> ... +config_paths=[overlay.yaml]emitted the component config paths after the caller's tokens, so provider defaults such assetup.commands: []andimages.rewrites: []erased the overlay's values. The component token now comes first, and a regression test checks that the caller's overlay is the lastconfig_pathsentry. Found by the TB2.1 parity run, where the run overlay's Debian 11 archive repair never reached the sandbox and two verifiers could not install curl.gym dataset init <name>(--root,--image) scaffolds a dataset in this shape:dataset.tomlwith its[gym]table and one task withtask.toml,instruction.md,tests/test.shandsolution/solve.sh. A test reads the scaffold back through the loader and the row writer.gym env initprints a deprecation notice for new datasets and stays for custom resources servers until M23.terminus2_outcomein the response metadata. The agent change that writes it lives earlier in the stack, so this branch only updates the test expectations.Review fixes (2026-10-04)
c676da96binfers the verifier mode as Harbor does, rejects unknown keys in[gym.tasks."<id>".environment]by name, never retriesOpenSandboxSetupError, and cleans up the sandbox when a create is cancelled. It supersedes18fa2f296(2026-09-30), which had selected separate mode only fromenvironment_modeand rejected separate mode without artifacts.90bfc9358updates the Terminus 2 test expectation forterminus2_outcome.Earlier fix commits on the branch:
94d494ed0(config_paths ordering, 2026-09-29) anda947c4dbf(Terminus 2 outcome metadata test, 2026-09-29).No issue: tracked in the RFC (M15) and its MR 400.
Validation
New tests: per-task override merging and unknown-key rejection, defaults scaling timeouts and resources, the scaffold round trip, config_paths ordering, verifier mode inference and the separate-mode warning, provider image policy (prefix rewrites and longest-prefix auth), setup commands run as root with a failure failing the create and never retried, and a cancelled create cleaning up its sandbox.
Rollouts
N/A for model compute: the sandbox spec a task produces is unchanged when no
[gym]table and no provider image policy are configured, which the server tests assert. The TB4 parity rerun with this branch applied (2026-10-01, before the 2026-10-04 rebase) is reported in #3754: 66 tasks on both paths, 55 identical, 10 flips traced to sampling, one infrastructure row. The parity audits (TB4 and TB2.1) found the config_paths ordering and Terminus 2 outcome defects fixed here.TB4 does not run overlay-free on this branch. The TB4 README documents what a run still supplies: the poll-cadence overlay from #3754, Compose networking and the shared-memory label in the
sandboxandsandbox_gpuprovider blocks,images.rewritespointing the three non-root images at derived images forgym dataset validateonly, and, for a like-for-like comparison with the old server, a hand-writtendataset.tomloverride settingCIRCLE_NODE_TOTAL=3fornextjs-performance. Model runs use the upstream images.Compatibility and benchmark impact
Configuration: the eight removed
harborserver fields are rejected at config load (the config forbids extra fields). Their replacements aredataset.toml[gym]for per-task environment and multipliers, and the provider'simagesandsetupblocks for mirrors, credentials, setup commands and deployment-wide environment.derive_cpu_envhas no replacement: like Docker and Harbor, the sandbox gets exactly the task's[environment].env. Verifier mode selection is unchanged against M13. A separate-mode task without artifacts now logs a warning. Benchmark results: none when the same values are supplied through the new homes.Checklist
pre-commit run --all-files) (so CI lint/format checks pass).git commit -s) (so the DCO check passes).🤖 Generated with Claude Code