Repository navigation
feat(harbor): Compose template variables and env_file (RFC M19) - #4565
Conversation
yuhezhang-ai
left a comment
There was a problem hiding this comment.
Reviewed M19 at 07250b2f against its direct M17 base (ee485666, #4257).
Sharing one resolver between preparation and startup makes the behavior easier to reason about. I reproduced five issues in the new interpolation/env_file path and recommend addressing those before merging; the two P3 comments are nonblocking suggestions.
The existing short-form/remote-bind mount limitations and raw task-template propagation to the main container are inherited stack dependencies. I have kept them separate from the M19 findings; the new seed test mocks container creation and does not establish real startup compatibility. Integration should be rechecked after the lower-stack fixes land.
The focused Compose, image-config, and Harbor server tests passed, as did Ruff lint and formatting. The findings use focused CPU reproductions, including adapter preparation and M17 comparisons where applicable. No live sandbox or model rollout was run.
07250b2 to
0856425
Compare
0856425 to
ea9799b
Compare
479133f to
f9cc51d
Compare
f9cc51d to
a181d10
Compare
a181d10 to
3cef03d
Compare
|
/ok to test 3cef03d |
|
/ok to test bae9c23 |
bae9c23 to
56d1674
Compare
|
/ok to test 56d1674 |
56d1674 to
28e9cbb
Compare
|
/ok to test 28e9cbb |
|
/ok to test 7c6ff07 |
|
/ok to test 2342cf6 |
|
Status at the new head 2342cf6. All seven threads from the 13 Oct review are answered inline and you resolved them: healthcheck field types restored after interpolation, literal task environment values preserved (only a whole-value ${VAR} template resolves, as Harbor does), an unset service entry removes the env_file value, quoted env_file values keep escaped quotes, backslashes and newlines, an env_file the digest would skip is refused by name, parse errors name the service, file and line, and format: raw is refused. Nothing changed here in the rebase beyond what the parents moved. |
yuhezhang-ai
left a comment
There was a problem hiding this comment.
All seven review findings are addressed. The README correction is included in #4566; the remaining PR-description wording is nonblocking.
|
/ok to test 4b0f8c4 |
|
/ok to test c66b753 |
|
/ok to test a757b19 |
|
/ok to test c0a7102 |
ffrujeri
left a comment
There was a problem hiding this comment.
Approving c0a7102e. The interpolation engine covers Compose's operators and nesting. env_file is confined to environment/ (no absolute paths, climbing out, or symlinks), and its errors name the line number without echoing content. Compose-variable, image-config, Compose and Harbor suites pass locally (271 passed), and CI is green apart from the non-blocking conformance probes. One non-blocking note inline.
|
/ok to test dd37ee6 |
|
/ok to test c093656 |
Compose files in Harbor tasks use `${MAIN_IMAGE_NAME}`, `${CONTEXT_DIR}` and `${VAR:-default}`
templates and `env_file` entries. Preparing the dataset and the environment server now read the
Compose file through one resolver: `env_file` is inlined into `environment`, and variables
resolve from the task alone (the main image recorded for the task, the task's `environment/`
folder, the task's own defaults), never from the server's process environment. The server
resolves against its task snapshot, so bind mounts point into that copy.
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 b783696 |
|
🔄 Merge queue validation started! You can track the progress here: https://github.com/NVIDIA-NeMo/Gym/actions/runs/39688519209 |
Summary
RFC milestone M19. Prepare resolves Harbor's Compose interpolation from the task alone and the resources server reads the same resolved document at seed.
MAIN_IMAGE_NAME,CONTEXT_DIR,PREBUILT_IMAGE_NAME,CPUS,MEMORY, and theHOST_*_PATH/ENV_*_PATHlog mounts as the/logstree, with[environment].envas the task's own variables (their values interpolated first, as hil-bench relies on). The process environment is never consulted.$NAMEfails prepare with its name.env_fileentries are read after interpolation, confined to the task'senvironment/folder, inlined underenvironmentwith the service's own entries winning. Values are literal with Compose quoting and inline comments. Errors never echo file contents.environmentbecomes a mapping of strings.Checked against the hub task
scale-ai/hil-bench-swe-ask-human(${CONTEXT_DIR},${MAIN_IMAGE_NAME}, defaulted task env values). Reviewed in two DA plus verify rounds, 5 findings fixed.Test plan
tests/unit_tests/test_compose_config.py,tests/unit_tests/test_harbor_image_configs.py,resources_servers/harbor/tests/test_app.py(new cases for interpolation, env_file confinement, residual check, server seed path).pre-commit run --fileson the touched files.Added 16 Oct 2026
Compose variables resolve in Harbor's order: Gym's infrastructure set (
CONTEXT_DIR,TEST_DIR,COMPOSE_PROJECT_NAME), the task's[environment].env, the.envfile, the process environment, the default in the expression, then an empty string with one warning.${VAR:?msg}is a per-task refusal naming the task. 957 sampled hub tasks in 14 datasets were refused at prepare before this. The residual-interpolation check reports the key path, not the value, so a host secret is never echoed.🤖 Generated with Claude Code