Repository navigation
refactor(environments)!: fold the environments that share a benchmark's name into their benchmarks and refuse new shared names - #6692
Conversation
…sources server's config A catalog name is its folder path under benchmarks/ or environments/, and ether0 was a folder in both. environments/ether0 (#1472) repeats resources_servers/ether0/configs/ether0.yaml with paths under environments/ (it lacks only oracle_max_concurrency), and its example data and prepare.py are byte-identical to the resources server's data/example*.jsonl and scripts/prepare_ether0.py. The benchmark keeps the name. benchmarks/ether0/prepare.py now imports format_row from resources_servers/ether0/scripts/prepare_ether0.py, the same function, and its README links there. Breaking: `--environment ether0` and config paths under environments/ether0/ no longer resolve. `--resources-server ether0` loads the same servers and datasets. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Yuhe Zhang <[email protected]>
… benchmark A catalog name is its folder path under benchmarks/ or environments/, and labbench2_pdf was a folder in both. environments/labbench2_pdf was the benchmark's implementation and nothing else used it: the benchmark's config included its config, its prepare.py imported three of its modules, and harbor_agent_general's config test loaded its two profiles. Its files now live in benchmarks/labbench2_pdf/ and the environment folder is gone: - config.yaml -> harbor_docker.yaml (the Harbor job profile that config.yaml includes) and config_singularity.yaml -> harbor_singularity.yaml. Neither declares a benchmark dataset, so the catalog does not list them. - prepare.py -> materialize.py (the Harbor task materializer, since the benchmark already has a prepare.py); data_utils.py, download_papers.py, download_questions.py, prepare_data.py and verifier.py sit beside it, with docker/ and .dockerignore. ENV_ROOT is now BENCHMARK_DIR. - README.md -> harbor-tasks.md, which the benchmark README links to for acquisition, task layout, direct runs and licensing. - The example input and smoke-rollout evidence move to data/, whose .gitignore keeps them while ignoring generated files. Downloads, generated Harbor tasks and job directories now go under benchmarks/labbench2_pdf/data/. - The tests move to tests/ (test_prepare.py -> test_materialize.py). Breaking: `--environment labbench2_pdf`, config paths under environments/labbench2_pdf/ and `environments.labbench2_pdf` imports no longer resolve. Use `--config benchmarks/labbench2_pdf/harbor_docker.yaml` (or harbor_singularity.yaml) and `benchmarks.labbench2_pdf`. The benchmark's own name, config and selector are unchanged. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Yuhe Zhang <[email protected]>
…benchmark as a Terminus 2 preset A catalog name is its folder path under benchmarks/ or environments/, and biomnibench_da was a folder in both. The environment (#1897) and the benchmark (#3915) download the same upstream dataset, phylobio/BiomniBench-DA. The environment only adds another harness (Terminus 2 through harbor_agent with Gym's model server) and a seeded train/test partition. A harness-only difference is a run preset of the benchmark, without a manifest of its own, so the environment now lives in benchmarks/biomnibench_da/terminus_2/, apart from the benchmark's OpenCode adapter in harbor/: - config.yaml -> harbor_docker.yaml, config_singularity.yaml -> harbor_singularity.yaml. Neither declares a benchmark dataset or is named config.yaml, so the catalog does not list them and `--benchmark biomnibench_da/terminus_2` selects nothing. - prepare.py, docker/, .dockerignore, data/ (example input, rollouts and metrics) and tests/ move unchanged apart from paths. ENV_ROOT is now PRESET_DIR, and the test's repository root is one level further up. - README.md is the preset's README, linked from the benchmark README; the harbor_agent README's worked example points at it. - Every path naming the old folder moves: the configs' local_dataset_path, prepare.py's examples and generator, the example metrics' jsonl_fpath and the example rollouts' task paths. - The benchmark's .gitignore anchors data/ and logs/ to its root so the preset's committed data/ is not ignored, a .dockerignore keeps terminus_2/ out of the benchmark image's build context, and an __init__.py makes the folder a package for the preset's tests. Breaking: `--environment biomnibench_da`, config paths under environments/biomnibench_da/ and `environments.biomnibench_da` imports no longer resolve. Use `--config benchmarks/biomnibench_da/terminus_2/harbor_docker.yaml` (or harbor_singularity.yaml) and `benchmarks.biomnibench_da.terminus_2`. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Yuhe Zhang <[email protected]>
…e has A catalog name is its folder path, and it identifies one entry whatever its kind, so a top-level folder name is used in only one of benchmarks/ and environments/. This holds for folders without a manifest too, since their config is listed under the folder path. - registry.folder_in_other_catalog_tree returns the folder in the other tree of the same search root that has a name's top-level folder name. - `gym env init --environment/--benchmark` refuses such a name before it writes anything. - `gym env validate` refuses a manifest whose name's top-level folder is in the other tree. - tests/unit_tests/test_catalog_tree_names.py fails when a tracked top-level folder name is in both trees of the repository. Discovery (`gym list`) does not enforce it, so search roots whose trees already share a name keep listing both entries. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Yuhe Zhang <[email protected]>
svcnvidia-nemo-ci
left a comment
There was a problem hiding this comment.
SHIP WITH CARE — one migration risk: moving existing LabBench2 Docker tasks leaves their PDF bind mounts pointing at the removed directory.
I reviewed all 68 changed files, surrounding implementations, callers, configs, tests and existing feedback. No other concerns found.
Focused probes in 766267172432.dkr.ecr.us-east-1.amazonaws.com/gym:main-offline, Python 3.13.14, showed:
- Catalog collisions are rejected without writes; unrelated names work and discovery remains tolerant.
- Only the three intended benchmarks are cataloged; moved Harbor profiles are not added as benchmarks.
- Base/head preparation preserved task identities and verifier behavior. Biomni Docker/Singularity outputs and ether0 formatting matched after expected path normalization.
- Following the LabBench2 move-only migration produced a missing bind source. Re-materialization from moved caches repaired it without downloading or changing task identity.
CI evidence on this head: lint, secrets, copyright, DCO and lock-freshness checks passed. Unit/server-suite results were unavailable; the PR comment reports runner vetting is required. Formal reviews and inline comments were empty. I did not rerun repository suites or perform live container/model rollouts.
Review generated by codex. This was a full review. Request a full review with /review reset=true.
A Docker task's docker-compose.yaml binds its corpus view at /papers by the view's absolute host path, so a tasks_docker tree moved from environments/labbench2_pdf/data still binds the folder it was generated in and loses /papers once that folder is gone. harbor-tasks.md now requires moving the question and PDF caches and generating the tasks again from them with prepare_data.py (--questions-dir, --papers-dir, --overwrite), which downloads nothing and keeps the task names. Singularity tasks hold hard links to their papers and name no host path, so a moved tasks_singularity tree keeps working. Tests cover generating again after a move (every /papers bind source exists under the new tree, same task names), a moved Singularity tree naming no host path, and the default output folders sitting in the folder that holds materialize.py. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Yuhe Zhang <[email protected]>
|
/ok to test 16408d1 |
ffrujeri
left a comment
There was a problem hiding this comment.
Thanks. One name, one catalog entry: the guard is in gym env init, gym env validate and a repository test, and the migration table covers the three removed paths. LGTM.
|
🔄 Merge queue validation started! You can track the progress here: https://github.com/NVIDIA-NeMo/Gym/actions/runs/46501693676 |
What changed and why
A catalog name is its folder path under
benchmarks/orenvironments/(_path_identityinnemo_gym/environment/registry.py). It should identify one catalog entry whatever its kind. Three top-level names were folders in both trees onmain:labbench2_pdf,biomnibench_daandether0. Their manifest names did not clash yet only because one folder of each pair has no manifest. Each pair is one task set, so each gets one catalog ID. The benchmarks keep their names, which are the upstream benchmarks' names, and the three environment folders are removed. A rule now keeps a new shared name from landing.environments/labbench2_pdfbenchmarks/labbench2_pdf/prepare.pyimported three of its modules, and onlyharbor_agent_general's config test loaded its two profiles.environments/biomnibench_dabenchmarks/biomnibench_da/terminus_2/, a run preset of the benchmark with no manifestphylobio/BiomniBench-DA). It differs only in its harness (Terminus 2 throughharbor_agentwith Gym's model server, where the benchmark uses OpenCode throughharbor_agent_general) and in a seeded train/test partition. A harness-only difference is a preset of the benchmark, not a catalog entry.environments/ether0resources_servers/ether0/configs/ether0.yamlwith paths underenvironments/, lacking onlyoracle_max_concurrency. Its example data andprepare.pyare byte-identical to the resources server'sdata/example*.jsonlandscripts/prepare_ether0.py.Where things moved
benchmarks/labbench2_pdf/:config.yamlbecameharbor_docker.yaml, which the benchmark'sconfig.yamlincludes, andconfig_singularity.yamlbecameharbor_singularity.yaml.prepare.pybecamematerialize.py, because the benchmark already has aprepare.py.data_utils.py,download_papers.py,download_questions.py,prepare_data.py,verifier.py,docker/and.dockerignoremoved beside it.ENV_ROOTis nowBENCHMARK_DIR.harbor-tasks.md, which the benchmark README links to.data/, whose.gitignorekeeps them and ignores generated files.tests/, withtest_prepare.pyrenamedtest_materialize.py.benchmarks/labbench2_pdf/data/. Harbor job directories stay inresults/labbench2_pdf/harbor_jobs.harbor-tasks.mdhas a new "Move generated tasks" section: Docker tasks bind their papers by absolute path, so a tree generated under the old folder must be generated again from the moved caches.benchmarks/biomnibench_da/terminus_2/, kept apart from the benchmark's OpenCode adapter inharbor/:config.yamlbecameharbor_docker.yamlandconfig_singularity.yamlbecameharbor_singularity.yaml.prepare.py,docker/,.dockerignore,data/(example input, rollouts and metrics) andtests/moved with only path changes.ENV_ROOTis nowPRESET_DIR.local_dataset_path,prepare.py's examples and generator field, the example metrics'jsonl_fpath, the example rollouts' task paths, and theharbor_agentREADME's worked example..gitignoreanchorsdata/andlogs/to its root, so the preset's committeddata/is not ignored. A.dockerignorekeepsterminus_2/out of the benchmark image's build context (its Dockerfile copies nothing from it). An__init__.pymakes the folder a package for the preset's tests.benchmarks/ether0/prepare.pynow importsformat_row(the same function) fromresources_servers/ether0/scripts/prepare_ether0.py, and its README links there.responses_api_agents/harbor_agent_general/tests/test_config.pypoints at the two moved LabBench2 profiles.config.yaml, and none declares atype: benchmarkdataset. Sogym listshows only the three benchmarks, and--benchmark biomnibench_da/terminus_2selects nothing.fern/,.github/,scripts/(includingscripts/ci/core_test_durations.json),.gitignoreor the README table.The rule
folder_in_other_catalog_tree(nemo_gym/environment/registry.py) returns the folder in the other tree of the same search root that has the name's top-level folder name.gym env init --environment/--benchmarkrefuses such a name before it writes anything.gym env validaterefuses a manifest whose name's top-level folder is in the other tree.tests/unit_tests/test_catalog_tree_names.pyfails when a tracked top-level folder name exists in both trees of the repository.gym list) does not enforce the rule, so search roots whose trees already share a name keep listing both entries.namerow in the manifest field reference (contribute/environments/new-environment.mdx) documents the rule.No GitHub issue: this follows from keeping catalog names path-shaped (#6102 deferred). Internal tracking: GYMINT-932.
Compatibility and migration
Breaking: three environment folders are removed. The benchmarks' names,
--benchmarkselectors and configs are unchanged.--environment labbench2_pdf,--config environments/labbench2_pdf/config.yaml--config benchmarks/labbench2_pdf/harbor_docker.yaml--config environments/labbench2_pdf/config_singularity.yaml--config benchmarks/labbench2_pdf/harbor_singularity.yamlenvironments/labbench2_pdf/{prepare_data,download_papers,download_questions,prepare}.py,environments.labbench2_pdf.*benchmarks/labbench2_pdf/..., withprepare.pynowmaterialize.py;benchmarks.labbench2_pdf.*--environment biomnibench_da,--config environments/biomnibench_da/config.yaml--config benchmarks/biomnibench_da/terminus_2/harbor_docker.yaml--config environments/biomnibench_da/config_singularity.yaml--config benchmarks/biomnibench_da/terminus_2/harbor_singularity.yamlenvironments/biomnibench_da/prepare.py,environments.biomnibench_da.preparebenchmarks/biomnibench_da/terminus_2/prepare.py,benchmarks.biomnibench_da.terminus_2.prepare--environment ether0,--config environments/ether0/config.yaml--resources-server ether0: the same servers and datasets, with the resources server'soracle_max_concurrency: 8environments.ether0.prepareresources_servers.ether0.scripts.prepare_ether0--environmentname or config path working with a deprecation warning.nemo_gym/_moved_paths.pycovers Python modules and names insidenemo_gymonly, andasset_config_pathmaps a selector directly to a folder. The old names therefore stop resolving, and this PR does not add an alias mechanism.gym env validaterefuses the benchmark manifest of the same name and names the leftover folder.docker-compose.yamlbinds its data by absolute host path, so a moved tree still binds the old folder and loses that data once the old folder is deleted. Move the download caches, generate the Docker tasks again from them, then delete the old folder:LabBench2: move
environments/labbench2_pdf/data/sourcetobenchmarks/labbench2_pdf/data/source, then run the command below with the first run's selection flags (--benchmarks,--limit-per-benchmark,--source-policy,--missing-paper,--image). With both directories supplied it downloads nothing, and the task names stay the same because they come from each question's position in the question snapshot. Users of the cataloged workflow can instead rerungym eval prepare --benchmark labbench2_pdfwith+prepare_script_args.questions_dirand+prepare_script_args.papers_dirset to the absolute paths of the moved caches and+prepare_script_args.build_image=false. "Move generated tasks" inbenchmarks/labbench2_pdf/harbor-tasks.mdhas the steps.BiomniBench-DA: move
environments/biomnibench_da/data/sourcetobenchmarks/biomnibench_da/terminus_2/data/source, then rerunbenchmarks/biomnibench_da/terminus_2/prepare.py --environment-type docker --overwritefor each Docker task tree, with--local-dir benchmarks/biomnibench_da/terminus_2/data/source, its new--output-dir(for the example,benchmarks/biomnibench_da/terminus_2/data/example) and the first run's selection and split flags. Without--downloadit downloads nothing.environments/labbench2_pdf/data/tasks_singularitytobenchmarks/labbench2_pdf/data/, and BiomniBench-DA Singularity trees such asdata/example_singularitytobenchmarks/biomnibench_da/terminus_2/data/.environments/ether0/data/val.jsonlgoes toresources_servers/ether0/data/.results/labbench2_pdf/harbor_jobsand the BiomniBench-DA profiles toresponses_api_agents/harbor_agent/jobs, as onmain.gym list environmentsno longer listslabbench2_pdf,biomnibench_daorether0. It now listsresources_servers/ether0, the resources server's own config, whichenvironments/ether0used to hide.mainapart from the paths that moved (see Validation).Validation
uv run --frozen --extra dev pytest tests/unit_tests/test_catalog_tree_names.py tests/unit_tests/environment: 794 passed. The new tests cover refusal bygym env initandgym env validatefrom both trees, for a folder without a manifest and for a nested name's top-level folder. Onmain(17674bec9a),git ls-treeshows the three shared names that the new repository test rejects.pytest benchmarks/labbench2_pdf/tests benchmarks/biomnibench_da/terminus_2/tests: 54 passed. The new LabBench2 tests cover three cases:/papersbind source exists under the new tree, and the task names are unchanged.materialize.py.main'senvironments/labbench2_pdf/prepare_data.py. Then moved the caches and both task trees tobenchmarks/labbench2_pdf/data/and deleted the old folder./papersbind sources existed.prepare_data.py --questions-dir … --papers-dir … --overwrite, with HTTP(S) proxies set to a closed port:benchmarks/labbench2_pdf/data/tasks_docker/_corpus_views/<benchmark>/papersand hold the expected PDFs.--local-dirbinds data underterminus_2/data/source.responses_api_agents/harbor_agent_general/tests/test_config.py, run in that agent's own locked environment: 38 passed, including both moved LabBench2 profiles.gym env test --resources-server ether0: 124 passed, 4 skipped. This includestest_preparation.py, which importsbenchmarks.ether0.prepareand through it the resources server'sformat_row.gym env validatepasses for--benchmark labbench2_pdf,--benchmark ether0,--benchmark biomnibench_da,--config benchmarks/biomnibench_da/terminus_2/harbor_{docker,singularity}.yaml --model-type vllm_modeland--config benchmarks/labbench2_pdf/harbor_{docker,singularity}.yaml.gym listlistslabbench2_pdf,ether0andbiomnibench_daas benchmarks, and none of the moved profiles.--benchmark biomnibench_da/terminus_2does not resolve.gym env resolve, on this branch and onmain, ignoring randomly assigned ports:benchmarks/biomnibench_da/terminus_2/harbor_{docker,singularity}.yamlagainstmain'senvironments/biomnibench_da/config{,_singularity}.yaml: identical apart fromlocal_dataset_pathand theconfig_pathsentry.benchmarks/labbench2_pdf/harbor_{docker,singularity}.yamlagainstenvironments/labbench2_pdf/config{,_singularity}.yaml, andbenchmarks/labbench2_pdf/config.yamlagainst itself: identical apart from the Harbor tasks path and theconfig_pathsentry.benchmarks/{ether0,biomnibench_da}/config.yaml: identical.resources_servers/ether0/configs/ether0.yamlagainstenvironments/ether0/config.yaml: differs only in its own data paths andoracle_max_concurrency: 8.environments/ether0/config.yaml,gym env validate ether0 --kind benchmarkrefuses it and names the folder.gym env init --benchmark <taken environment name>refuses the name and writes nothing.pre-commit run --files <58 changed files>: passed, with no files modified.tests/unit_tests/{data/test_task_data.py,tooling,benchmarks},test_packaging_paths.py,test_fern_docs_links.pyandtest_public_api_facades.py, run together with the environment tests above: 4521 passed and 20 failed. All 20 are intests/unit_tests/toolingandtests/unit_tests/benchmarks/test_super35_batch_launcher.py, and these two folders give the same 20 failures on a cleanmaincheckout on this machine. The causes are macOS-specific, such as bash 3.2's unbound-variable error on an empty array and APFS rejecting a non-UTF-8 filename.Rollout evidence
N/A. Folders, files and the paths that point into them move. The resolved configs are identical to
mainapart from those paths, and the code that runs is unchanged apart from module and constant names. The new rule runs only ingym env init,gym env validateand a unit test, never in a rollout.🤖 Generated with Claude Code