Skip to content

feat(harbor): hello-world proof of concept from the Harbor hub (M5) - #3677

Closed
adil-a wants to merge 3 commits into
adasif/harbor-m3-oracle-clifrom
adasif/harbor-m5-poc
Closed

adil-a wants to merge 3 commits into
adasif/harbor-m3-oracle-clifrom
adasif/harbor-m5-poc

Conversation

@adil-a

@adil-a adil-a commented Sep 24, 2026 •

Copy link
Copy Markdown
Contributor

What does this PR do?

M5 of the Harbor tasks RFC: the hello-world proof of concept, pulled straight from the Harbor hub, run end to end on OpenSandbox through the Episode Architecture stack. The diff is only the server-folder .gitignore (results/, where the server downloads verifier logs). The milestone is the evidence below on top of #3673–#3676.

Rebased onto main 128eab4 (2026-10-04). The diff is unchanged. The runs and counts below were gathered before that rebase.

Validation

Every run below used the stack as pushed at the time. Unit tests then: 355 passed across the five PRs. Pre-commit clean.

Rollouts

Reference solution. gym dataset validate harbor:hello-world (oracle agent, no model):

task_id      status         reward
hello-world  oracle solved  1.0

Registry fetch (HEAD pinned to cdb76bae) → materialized row → harbor resources server seeds ubuntu:24.04 on OpenSandbox with WORKDIR /app → single_agent_turn → oracle runs solution/solve.sh in the borrowed sandbox → tests/test.sh (apt, uv, pytest) → reward 1.0, sandbox closed.

Model run. gym eval run harbor:hello-world --agent hermes --model-type openai_model --model openai/openai/eccn-gpt-6-sol --model-url https://inference-api.nvidia.com/v1:

mean/reward: 1.0    mean/verifier_return_code: 0.0

Hermes borrowed the seeded sandbox, installed its runtime there (x86_64 uv via #3676), and finished in 3 terminal calls: two python … write_text(...) attempts (no python in ubuntu:24.04, then python3), then printf 'Hello, world!' > hello.txt. Both pytest checks passed. Observations: 4 records, 0 gaps. 3 min 10 s including server start-up.

Chris's examples (#3653, 9d016d46), run unchanged with gym eval run <folder> --agent hermes … on OpenSandbox (their READMEs use OpenCode and Docker. Docker is M12):

Example Tasks Reward
environments/hello_world 1 (single task folder) 1.0
environments/hello_dataset 2 (folder of task folders, no manifest) 1.0, 1.0

With the examples' original test.sh all three scored 0: Hermes writes the file without a trailing newline while test.sh does a byte-exact cmp against the text plus \n. A newline-tolerant compare (posted on #3653) gives the rewards above. Running them also caught a loader bug, fixed in #3673: a single-task folder's mapping pointed one level too deep and the seed was refused with 422.

Compatibility and benchmark impact

None beyond the stack. Three run-time notes. The OpenSandbox connection block needs use_server_proxy: true when the agent host is outside the cluster. The generated Hermes block sets chat_template_kwargs_enabled: false because the openai_model chat schema forbids that vLLM-only field (override it when serving with vLLM). From M7 (#3729) onward --agent hermes is ambiguous because hermes_sandboxed_agent also matches, so the commands above need --agent hermes_agent on the later branches.

Checklist

  • I have read the contributing guidelines.
  • The change is focused; unrelated "drive-by" edits are tracked as separate issues/PRs.
  • Tests added or updated and pass locally, or N/A for docs-only / non-code changes (so CI unit/server checks pass when applicable).
  • Documentation added or updated, or N/A with justification.
  • Pre-commit checks pass locally (pre-commit run --all-files) (so CI lint/format checks pass).
  • New source files include the required Apache-2.0 SPDX header.
  • All commits have DCO sign-off (git commit -s) (so the DCO check passes).

🤖 Generated with Claude Code

@adil-a
adil-a added this pull request to stack #3678 September 24, 2026 08:49
@copy-pr-bot

copy-pr-bot Bot commented Sep 24, 2026

Copy link
Copy Markdown

This pull request requires additional validation before any workflows can run on NVIDIA's runners.

Pull request vetters can view their responsibilities here.

Contributors can view more details about this message here.

@adil-a adil-a changed the title chore(harbor): ignore downloaded verifier logs under the server folder feat(harbor): hello-world proof of concept from the Harbor hub (M5) Sep 24, 2026
@adil-a
adil-a force-pushed the adasif/harbor-m4-hermes branch from 360f248 to d87fd1b Compare September 24, 2026 08:52
@adil-a
adil-a force-pushed the adasif/harbor-m5-poc branch 2 times, most recently from d9b73b7 to e0d5c8b Compare September 24, 2026 09:00
@adil-a
adil-a force-pushed the adasif/harbor-m4-hermes branch 2 times, most recently from ec2cb9b to c4e41c6 Compare September 24, 2026 09:15
@adil-a
adil-a force-pushed the adasif/harbor-m5-poc branch from e0d5c8b to 68ccdae Compare September 24, 2026 09:15
@adil-a
adil-a force-pushed the adasif/harbor-m4-hermes branch from c4e41c6 to f444bcc Compare September 28, 2026 19:35
@adil-a
adil-a force-pushed the adasif/harbor-m5-poc branch from 68ccdae to 93c7d95 Compare September 28, 2026 19:35
@adil-a
adil-a removed this pull request from stack #3678 September 28, 2026 19:35
@adil-a
adil-a added this pull request to stack #3733 September 28, 2026 19:36
@adil-a
adil-a force-pushed the adasif/harbor-m4-hermes branch from f444bcc to 7c8a8d3 Compare September 28, 2026 20:10
@adil-a
adil-a force-pushed the adasif/harbor-m5-poc branch from 93c7d95 to df930e1 Compare September 28, 2026 20:10
@adil-a
adil-a force-pushed the adasif/harbor-m4-hermes branch from 7c8a8d3 to b025138 Compare September 30, 2026 03:48
@adil-a
adil-a force-pushed the adasif/harbor-m5-poc branch from df930e1 to 0c583b6 Compare September 30, 2026 03:48
@adil-a
adil-a removed this pull request from stack #3733 September 30, 2026 03:50
@adil-a
adil-a added this pull request to stack #3806 September 30, 2026 03:51
@adil-a
adil-a removed this pull request from stack #3806 September 30, 2026 04:12
@adil-a
adil-a added this pull request to stack #3808 September 30, 2026 04:12
@adil-a
adil-a force-pushed the adasif/harbor-m5-poc branch from 0c583b6 to af4bd64 Compare October 4, 2026 23:19
@adil-a
adil-a force-pushed the adasif/harbor-m4-hermes branch from b025138 to 531e64d Compare October 4, 2026 23:19
@adil-a
adil-a force-pushed the adasif/harbor-m5-poc branch from e132625 to 5b9339e Compare October 15, 2026 04:51
linj-glitch pushed a commit to linj-glitch/Gym that referenced this pull request Oct 15, 2026
…zed rows (NVIDIA-NeMo#3673)

## What does this PR do?

M1 of the Harbor tasks RFC (GitLab MR 340): read Harbor's task format
into NeMo Gym materialized rows. First PR of the stack, based directly
on `main`.

Rebased onto main 128eab4 (2026-10-04). The review fixes from that
date are listed below.

Adds `nemo_gym/tasks/harbor`:

- Pydantic mirror of `task.toml` schema 1.4 with Harbor field names.
Deprecated spellings (`version`, `image`, `memory`, `storage`,
`allow_internet`) are read and normalized, never written. Keys the
mirror does not know are ignored with a warning, as Harbor ignores them.
`docker_image` is optional.
- Discovery: a folder with `task.toml` is one task. Otherwise its direct
children are the tasks. `task_id` is the folder name. A task folder that
does not load is skipped with a warning and listed in
`PreparedTaskset.skipped`, so the rest of the dataset still prepares.
- Base-image-only Dockerfile detection (`FROM` plus
`WORKDIR`/`ENV`/`USER`/`LABEL`). Such tasks run the base image directly.
`task.toml` settings win over the Dockerfile.
- Whole-folder digest in `task_data._ng_digest`, same record format as
the Harbor package publisher, so a server can refuse a row whose folder
changed.
- `harbor:<dataset>[@Version]` resolves the Harbor registry, pins `HEAD`
to a commit, and fetches task folders into the shared datasets folder
(`$NEMO_GYM_DATASETS_DIR`, default `./datasets`, now gitignored) under
`<dataset>-<version>/` with a `manifest.toml` of pins. Task folders
already present keep the pins the manifest recorded for them.
- Rows are `MaterializedTask[SingleAgentTurnTaskInput]`. The generated
run config binds a `harbor` resources server instance, the selected
agent and a `single_agent_turn` environment server, routed by taskset.
- CLI: `gym eval run <folder | harbor:dataset> --agent <name> [--sandbox
<provider>]` prepares the taskset under `results/harbor/<taskset>/` and
runs end to end.

### Review fixes (2026-10-04)

One commit, `166e09c0e fix(harbor): loader robustness for registry
datasets`:

- Version resolution is a total order: numeric versions first, by
component, then the rest by text. An unpinned reference to a dataset
whose versions do not order numerically is an error that asks for
`@<version>`.
- Registry dataset folders are named `<dataset>-<version>`, so two
versions of one dataset never share a folder.
- A rerun reuses the manifest pins of task folders already present and
resolves `HEAD` once per repository. Completing a partial fetch no
longer moves a pin.
- Registry `git_url` values must be `https://`, `ssh://`, `git://` or
`user@host:path`. Anything else (file paths, `ext::`, option-looking
strings) is refused before it reaches a git command line, and `--`
separates URLs from git options.
- Unknown `task.toml` keys are ignored with a warning instead of failing
the task. A task folder that fails to load (bad TOML, non-UTF-8 text,
missing files) is skipped and reported instead of aborting the dataset.

## Validation

- `pytest tests/unit_tests/test_harbor_tasks.py` (58 tests: models and
unknown-key detection, Dockerfile detector, digest, discovery with
skipped tasks, taskset mapping, hub version resolution and git URL
validation, hub fetch against a local git repo including manifest reuse,
row and run-config shapes, CLI wiring).
- `pytest tests/unit_tests/test_cli_main.py` (existing `eval run` flags
unchanged).
- `pre-commit run --files <changed files>` clean.
- Against the live Harbor registry (before the review fixes):
`harbor:hello-world` pinned `HEAD` to `cdb76bae`, fetched
`examples/tasks/hello-world`, detected `ubuntu:24.04` + `WORKDIR /app`,
wrote rows and run config. The fixes only change where the folder lands
(`<dataset>-<version>` when the registry entry has a version).

## Rollouts

N/A for this PR alone (loader only). End-to-end runs are recorded in
NVIDIA-NeMo#3677.

## Compatibility and benchmark impact

Additive. `gym eval run` gains an optional positional target and
`--sandbox`. Existing invocations are unchanged. `datasets/` is added to
`.gitignore`. No benchmark results affected.

## Checklist

- [x] I have read the [contributing
guidelines](https://github.com/NVIDIA-NeMo/Gym/blob/main/CONTRIBUTING.md).
- [x] The change is focused; unrelated "drive-by" edits are tracked as
separate issues/PRs.
- [x] Tests added or updated and pass locally, or N/A for docs-only /
non-code changes (so CI unit/server checks pass when applicable).
- [x] Documentation added or updated, or N/A with justification.
- [x] Pre-commit checks pass locally (`pre-commit run --all-files`) (so
CI lint/format checks pass).
- [x] New source files include the required Apache-2.0 SPDX header.
- [x] All commits have DCO sign-off (`git commit -s`) (so the DCO check
passes).

🤖 Generated with [Claude Code](https://claude.com/claude-code)

---------

Signed-off-by: Adil Asif <[email protected]>
Signed-off-by: Yuhe Zhang <[email protected]>
Co-authored-by: Claude Fable 5.1 <[email protected]>
Co-authored-by: Yuhe Zhang <[email protected]>
@github-actions github-actions Bot added the sla:triage-overdue Review assignment is over the one-business-day SLA label Oct 15, 2026
@adil-a

adil-a commented Oct 16, 2026

Copy link
Copy Markdown
Contributor Author

/ok to test 5b9339e

@adil-a

adil-a commented Oct 19, 2026

Copy link
Copy Markdown
Contributor Author

/ok to test 50ef5b0

@adil-a

adil-a commented Oct 20, 2026

Copy link
Copy Markdown
Contributor Author

/ok to test e72d5d8

@adil-a

adil-a commented Oct 20, 2026

Copy link
Copy Markdown
Contributor Author

/ok to test c595222

adil-a and others added 3 commits October 20, 2026 07:55
One environment server, `environment_servers/harbor`, runs Harbor task folders: its `/run`
owns the whole episode. It checks the row's digest against the taskset mapping, snapshots
the task once per digest, starts the task image through the configured sandbox provider,
hands the harness a `SandboxAccess` through the agent session seed every sandboxed harness
already accepts, posts the task's `responses_create_params`, closes the agent session,
runs `tests/test.sh` in the same sandbox and reads the reward it wrote, then stops the
sandbox. No resources server takes part; harnesses never see a sandbox handle.

Failures are staged episode failures: `seed` (terminal when the task or row is at fault,
retryable when the provider failed), `agent`, `cleanup` and `verification`, with the
harness's observations and any usable response attached. A missing or invalid reward file
is a measured zero with a namespaced `failure_kind`; only a Gym-side failure masks the
sample. Verifier logs land in a fresh folder under the results root per verification.

Carried from the resources-server review: snapshots under a temporary directory with the
digest checked on the copy, sandbox ownership kept until a stop succeeds (retried by the
episode's final cleanup and at shutdown), environment templates resolved at use and never
written to rows or snapshots, episode-based sandbox TTL, root-first transfers with a
default-user fallback, reward download before optional logs with unsafe members skipped,
and verifier roots unlinked before preparation.

The generated run config now holds an agent block (which declares the materialized rows as
its validation dataset, where rollout collection looks for datasets) and a per-taskset
`harbor` environment server block that names that agent.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
Signed-off-by: Adil Asif <[email protected]>
…bor tasks

Adds `responses_api_agents/oracle_agent` (M3 of the Harbor tasks RFC). The oracle is an
ordinary agent harness that runs a task's reference solution instead of a model: it borrows
the sandbox the `harbor` environment server seeded, locates the task folder through that
server's taskset mapping in the run config (the environment server that names this agent as
its `agent_server`, or an explicit `environment_server` reference), checks the digest, uploads
`solution/` and runs `solve.sh` in the task's working directory. Verification then scores the
result like any rollout. Tasks without `solution/solve.sh` return a response tagged
`oracle=unvalidated` and are never failed.

`gym dataset validate <folder | harbor:dataset> [--sandbox <provider>]` prepares the taskset,
runs it with the oracle through the normal end-to-end collection (with a placeholder policy
model block, since the oracle calls no model), and prints one line per task with its reward
or why there is none. It exits non-zero when a validated task scores below 1.0, is masked, or
fails. The generated run config sets `use_absolute_ip` for harnesses that call the model
server from inside the sandbox.

Squashed from the previous oracle branch, review fixes included: every selected task and
repeat is accounted for, validation artifacts stay apart from model evaluation, resumed
validation is rejected when task digests or the selection changed, solution environment
templates resolve at use, task loading stays off the request loop, the oracle serves sessions
through the base agent hooks, `ray_enabled` is declared, custom provider execution
compatibility is preserved, and validate reads rollouts in the collector's stored shape.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
Signed-off-by: Adil Asif <[email protected]>
@adil-a

adil-a commented Oct 20, 2026

Copy link
Copy Markdown
Contributor Author

/ok to test 8f7af71

@adil-a

adil-a commented Oct 20, 2026

Copy link
Copy Markdown
Contributor Author

Closing: this one-line .gitignore entry is folded into M2 (#3674), which now ignores the downloaded verifier logs under the server folder itself. #3706 (M6) now sits directly on M3 (#3675).

This branch was previously deployed

1 inactive deployment
public — 8f7af71b Deployed Oct 20, 2026 by copy-pr-bot[bot] via release / finalize / notify #5971
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:environment Individual environments, benchmarks, verifiers, and environment-specific resources servers ci CI, automation, test queue, or workflow infrastructure work complexity:low Localized change in one scope with a small, straightforward review surface needs-review PR is ready for code review and waiting on a reviewer sla:triage-overdue Review assignment is over the one-business-day SLA

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants