Skip to content

feat(harbor): Compose service builds (M24) - #4689

Merged
adil-a merged 2 commits into
mainfrom
adasif/harbor-m24-compose-builds
Oct 26, 2026
Merged

adil-a merged 2 commits into
mainfrom
adasif/harbor-m24-compose-builds

Conversation

@adil-a

@adil-a adil-a commented Oct 16, 2026

Copy link
Copy Markdown
Contributor

What

Every Compose service with a build: section is built at prepare, the way Harbor's docker compose build builds the whole project. This is RFC milestone M24, Compose service builds.

  • One build entry per (context, service). main keeps hb__<hash>; a sidecar is hb__<hash>-<service>.
  • built-images.json records a services map per context. The top-level image stays main's, so older records still read.
  • The loader substitutes the recorded image for every built service and drops build: and pull_policy from the document the sandbox receives.
  • docker builds the project in one docker compose build with an images override file passed last. buildah and podman build one service at a time with the direct-path argv.
  • The blanket sidecar refusal is gone. The security refusals (secrets, ssh, context escapes, host networking, credentialed caches) stay for every service.
  • The separate verifier's image is built from tests/Dockerfile when the task has one and declares no verifier image, as Harbor does. The record is keyed by Harbor's hash of tests/ and the image owns /tests, so no tests upload.

Why

The hub scan of 15 Oct 2026 (12,704 sampled tasks, 289 datasets) found 1,934 tasks in 34 datasets with a sidecar build: section that Gym refused or silently skipped, and 892 separate-mode tasks in 21 datasets whose verifier image Harbor builds from tests/Dockerfile while Gym graded in the agent image (pytest missing, reward 0). Report and reproductions: hub_dockerfiles_2026-10-15/REPORT.md, GAP_TESTS.md, D_TESTS.md on Lustre.

How it was verified

  • Unit tests for planning, naming, record merge and resume, loader substitution, docker and buildah argv, verifier image planning and seed.
  • Real buildah builds on the cluster: counselbench-100 (main plus world), tb3-preview-v2 (three services), tb3-preview-v2 verifier image (pytest on PATH, /tests/test.sh present).
  • Acceptance episodes (oracle and GPT-6 Terminus 2) on hub tasks: see the round-10 rundown.

🤖 Generated with Claude Code

@copy-pr-bot

copy-pr-bot Bot commented Oct 16, 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 commented Oct 16, 2026

Copy link
Copy Markdown
Contributor Author

/ok to test b8c94f1

@yuhezhang-ai yuhezhang-ai left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Early feedback on this draft, reviewed at b8c94f17 against the immediate stack parent #4566. Sharing two verified correctness cases now because they affect service preparation and verifier startup. The focused reproductions used controlled builders/sandboxes; no live provider/model rollout was performed during this review.

Comment thread nemo_gym/tasks/harbor/cli.py Resolved
Comment thread environment_servers/harbor/app.py Resolved
@adil-a
adil-a force-pushed the adasif/harbor-m24-compose-builds branch from b8c94f1 to 3f718d0 Compare October 19, 2026 21:27
@adil-a

adil-a commented Oct 19, 2026

Copy link
Copy Markdown
Contributor Author

/ok to test 3f718d0

@adil-a

adil-a commented Oct 20, 2026

Copy link
Copy Markdown
Contributor Author

/ok to test faae5ef

@adil-a

adil-a commented Oct 20, 2026

Copy link
Copy Markdown
Contributor Author

/ok to test 5ab8e28

@adil-a

adil-a commented Oct 21, 2026

Copy link
Copy Markdown
Contributor Author

/ok to test de389db

@adil-a

adil-a commented Oct 21, 2026

Copy link
Copy Markdown
Contributor Author

/ok to test e68fc0a

@adil-a

adil-a commented Oct 21, 2026

Copy link
Copy Markdown
Contributor Author

/ok to test 456fd32

@adil-a

adil-a commented Oct 21, 2026

Copy link
Copy Markdown
Contributor Author

/ok to test 57e6343

@adil-a

adil-a commented Oct 21, 2026

Copy link
Copy Markdown
Contributor Author

/ok to test 1e4309d

@adil-a

adil-a commented Oct 22, 2026

Copy link
Copy Markdown
Contributor Author

/ok to test 760d1c8

@adil-a

adil-a commented Oct 23, 2026

Copy link
Copy Markdown
Contributor Author

/ok to test c4f91b9

@svcnvidia-nemo-ci svcnvidia-nemo-ci left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

HOLD

One BLOCKER and four RISK findings remain: separate-verifier runtime settings can be ignored while scoring, dependent images can be reused after their build dependencies change, and three preparation/metadata paths produce incorrect results.

Reviewed all 39 changed files and traced preparation → build records → task loading → sandbox/verifier startup. Source inspection confirms the earlier functional fixes for main-build restatements, shared verifier contexts, verifier startup, ARM64/v8 selection, platform-cache refresh, tag collisions, and sidecar workdirs. The findings below concern distinct cases.

Validation was static only; no tests, image builds, or live rollouts were executed.

Note: formal approval is not available for this request, so this review is posted as a comment only.

Review generated by codex. This was a full review. Request a full review with /review reset=true.

Comment thread nemo_gym/tasks/harbor/verifier_env.py Resolved
Comment thread nemo_gym/tasks/harbor/image_build.py Resolved
Comment thread nemo_gym/tasks/harbor/prepare_builds.py Resolved
Comment thread nemo_gym/tasks/harbor/registry.py Resolved
Comment thread nemo_gym/tasks/harbor/cli.py Resolved
@adil-a

adil-a commented Oct 24, 2026

Copy link
Copy Markdown
Contributor Author

/ok to test b0f27b5

@github-actions

github-actions Bot commented Oct 24, 2026 •

Copy link
Copy Markdown
Contributor

@ffrujeri ffrujeri left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the thorough follow-up. I re-traced the five findings from the 23 Oct review at b0f27b5, and each fix is in the code with a test that exercises it. Refusing linux/amd64/v3 outright seems like a reasonable call.

Two things I'd like to understand before approving: whether the build-key refusals should also cover entitlements/privileged now that sidecars build on the prepare host, and whether the new tests/docker-compose.yaml refusals (plus the removed task-image overlay fallback for separate verifiers) could be written up in the PR body, since they shrink some datasets' eligible task sets. CI is green and the focused Harbor suites pass locally.

Comment thread nemo_gym/tasks/harbor/build_compose.py Resolved
Comment thread environment_servers/harbor/README.md Resolved
@adil-a

adil-a commented Oct 25, 2026

Copy link
Copy Markdown
Contributor Author

/ok to test 63da59a

@adil-a

adil-a commented Oct 25, 2026

Copy link
Copy Markdown
Contributor Author

/ok to test d4c9fb8

adil-a and others added 2 commits October 24, 2026 22:46
parse_global_config_dict_from_cli monkeypatches hydra.main.get_args_parser
to disable Hydra's help and left the patch in place, so a second parse in
the same process wrapped the previous wrapper, one frame deeper each time;
after 987 parses the parser recursed past the limit (RecursionError inside
argparse/gettext). The unit-test session reaches the CLI from about that
many tests, so the three multi-step tests this branch adds tipped the CI
job over: test_harbor_validation and test_super35_batch_launcher failed
with RecursionError, as every PR above this one did.

The patch now lasts for the hydra call alone and is restored in a finally,
the form the M38 second slice (#4872) already carried further up the stack;
that slice's hunk becomes a no-op here. A test parses four times and checks
hydra's own function is back.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
Signed-off-by: Adil Asif <[email protected]>
Every Compose service with a build: section is built at prepare, as Harbor's docker compose build does. One build entry per (context, service): main keeps hb__<hash>, a sidecar is hb__<hash>-<service>. built-images.json records a services map per context (the top-level image stays main's, legacy records still read). The loader substitutes the recorded image for every built service and drops build: and pull_policy from the document the sandbox receives. The docker path builds the project in one compose build with an images override file passed last; buildah and podman build one service at a time with the direct-path argv. The blanket sidecar refusal is gone; the security refusals stay for every service. Verified on this node with buildah: counselbench-100 main plus world, tb3-preview-v2 three services.

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

adil-a commented Oct 25, 2026

Copy link
Copy Markdown
Contributor Author

/ok to test 9fd2b1a

@yuhezhang-ai yuhezhang-ai left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rechecked 9fd2b1ae against main@7b632676. The earlier correctness findings and the build-permission follow-up are addressed, and the permission-sensitive fixtures now pass under restrictive umasks. No remaining blocking code finding from this recheck.

Validation: 688 focused core tests and 318 Harbor tests passed; the 141-test permission-sensitive subset also passed separately under umasks 077 and 027. These checks used controlled builders and sandbox stand-ins. The real Buildah smoke test was skipped because Buildah is unavailable; no fresh real image builds or live model rollouts were performed. Required CI checks pass. The remaining nonblocking Kilocode conformance failure also occurs on the parent.

Optional, nonblocking documentation follow-up: please copy the README's migration and dataset-eligibility summary into the PR description as discussed. The earlier README clarification about #4566's existing main-image Dockerfile support and task-image fallback also remains optional. Automatic refresh of incorrect AMD64 metadata cached by intermediate, unmerged revisions remains a known deferred limitation.

@github-actions

Copy link
Copy Markdown
Contributor

🔄 Merge queue validation started! You can track the progress here: https://github.com/NVIDIA-NeMo/Gym/actions/runs/40368868951

This branch was previously deployed

1 inactive deployment
public — 9fd2b1ae Deployed Oct 25, 2026 by copy-pr-bot[bot] via release / finalize / notify #7165
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 feature New capabilities, enhancements, or enablement work needs-review PR is ready for code review and waiting on a reviewer

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants