Repository navigation
fix(tier3): stop per-trial apt installs in Docker agent setup - #413
Conversation
Harbor 0.24's OpenCode install requests the distribution nodejs and npm packages on every image, although its glibc branch installs Node with nvm. Every Docker OpenCode trial (the NVIDIA Build default) therefore ran apt-get update && apt-get install -y nodejs npm inside the agent setup timeout. Every Claude Code trial also apt-installed procps, because the generated images lack pgrep. - Add SkillEvaluatorOpenCode, which reuses _installer_dependencies with Harbor's OpenCode branch selector, so musl and Alpine images still get distro Node/npm. Route Docker-engine OpenCode to it and base the gateway OpenCode wrapper on it. GKE and Harbor-native cloud runs keep the stock agent. - Add NativeInstalledOpenCode and PrivateInstalledOpenCode and the native import-path row, so plugin arms match the Docker baseline. - Install procps in every generated image (base image, task and default environment Dockerfiles, init-harbor-task starter). Signed-off-by: Narendran Raghavan <[email protected]> Co-Authored-By: Claude Opus 5.5 <[email protected]>
Name OpenCode in the Docker Node/npm note, say that nvm's node, npm and npx are on PATH only for the agent and the commands it runs, and note that generated images now include procps. Add the CHANGELOG entry under Unreleased > Fixed. Signed-off-by: Narendran Raghavan <[email protected]> Co-Authored-By: Claude Opus 5.5 <[email protected]>
…px example harbor.base_image_mode defaults to disabled, so a custom evals/environment/Dockerfile keeps its own FROM in the default setup as well as with custom_dockerfile_mode: preserve. Only reuse or rebuild with rebase puts it on the shared base image, which has procps. The note now says that, and the CHANGELOG entry says the per-task images (or the shared base image) rebuild once instead of implying everyone has a base image. Codex and OpenCode stdio MCP servers inherit nvm's npx, so the npx MCP example now applies to Claude Code, and the toolchain to every agent. The _rebase_custom_dockerfile_content docstring now points at _BASE_APT_PACKAGES instead of a stale package list. New tests pin the custom Dockerfile FROM in the default, preserve and rebase cases against the note, and the scoped npx example. Signed-off-by: Narendran Raghavan <[email protected]> Co-Authored-By: Claude Opus 5.5 <[email protected]>
…t agent The arm symmetry test compared install with Harbor's OpenCode.install, so an install retry on SkillEvaluatorOpenCode would fail it although both arms would still match. It now resolves the environment's default agent (DOCKER_AGENT_IMPORT_PATHS for docker, stock OpenCode for gke) and checks that both arms share its install and ensure_system_dependencies. Signed-off-by: Narendran Raghavan <[email protected]> Co-Authored-By: Claude Opus 5.5 <[email protected]>
The Docker setup note covered two topics in one paragraph: which agents get Node.js, npm and a toolchain, and procps in generated, starter and custom Dockerfiles. Start a second paragraph at the procps guidance, so an author with a custom Dockerfile finds it, and the rebase condition, without reading the Node.js scope first. The wording is unchanged. A new test checks that the note has two paragraphs and that procps appears only in the second. Signed-off-by: Narendran Raghavan <[email protected]> Co-Authored-By: Claude Opus 5.5 <[email protected]>
…ial-apt Conflicts: - CHANGELOG.md: both sides appended a Fixed entry under Unreleased after the HTTPie security-grading entry (main: the tier3 compare Overall lift entry from #386). Kept both, main's entry first, then this branch's OpenCode Node/npm and procps entry. Auto-merged without conflicts: docs/eval-datasets.mdx, tier3/commands.py, tier3/harbor/__init__.py (the new OpenCode row sits next to main's Hermes row in DOCKER_AGENT_IMPORT_PATHS), tier3/harbor/adapter.py, tier3/harbor/native_agents.py and tier3/plugin_native.py (the new OpenCode row sits next to main's Hermes rows in NATIVE_AGENT_IMPORT_PATHS). Signed-off-by: Narendran Raghavan <[email protected]> Co-Authored-By: Claude Opus 5.5 <[email protected]>
rng1995
left a comment
There was a problem hiding this comment.
Reviewed the complete production diff and regression coverage; checked every generated Dockerfile package list, pinned Harbor OpenCode installer predicates, wrapper inheritance, native/private routing and bootstrap failure coverage. No actionable findings.
Verification at unchanged head 749352b6594af25bc19dad75600d24cddf3b8da2: 20 existing CI checks succeeded and 2 were intentionally skipped, including the supported Python tests, lint/package and security/platform gates where applicable. Fresh git merge-tree --write-tree is clean against the frozen main commit ce52a09. No new local test run is claimed for this unchanged code.
Signed-off-by: Narendran Raghavan <[email protected]> # Conflicts: # CHANGELOG.md
rng1995
left a comment
There was a problem hiding this comment.
Integration review at 4694502c0bb55140ed6a4658569a05dde7bbe20f: resolved the actual CHANGELOG conflict while merging main a0b65a91d512fdc2254d2559900b6c30404218b8, retaining both independent entries. No additional production edit was made beyond the reviewed integration. Focused verification: 117 passed in 24.75s; make lint passed; pinned Fern 5.121.0 check passed with 0 errors and only the existing authenticated-redirect warning.
The candidate is merge-clean against explicitly audited main a0b65a91d512fdc2254d2559900b6c30404218b8; subsequent main checks are recorded where main advanced during external merges. The merge commit has DCO sign-off and was pushed normally after fresh open-PR and live-head checks. Fresh hosted CI is pending. No PR was merged by this review.
Signed-off-by: Narendran Raghavan <[email protected]> # Conflicts: # CHANGELOG.md
rng1995
left a comment
There was a problem hiding this comment.
Concurrent-merge integration review at 554b0c571ac42f765d1f9b5c101aea0ac0c51cbe: The actual CHANGELOG overlap preserves every independent entry and places this PR’s complete entry at the start of its existing Unreleased subsection. No production conflict required manual edits. Focused contracts: 117 passed in 72.22s (0:01:12). Lint passes; pinned Fern validation reports 0 errors and only the existing authenticated-redirect warning.
The signed-off fix was pushed normally after live open/head/base guards and clean merge checks against captured main b38b71be01f7fdf332e37efbfec49714f3939161 and actual base main at b38b71be01f7fdf332e37efbfec49714f3939161. Fresh exact-head hosted CI is pending. No PR was merged by this review.
Signed-off-by: Narendran Raghavan <[email protected]> # Conflicts: # CHANGELOG.md
rng1995
left a comment
There was a problem hiding this comment.
Concurrent-merge integration review at f6114bf07ef9d7572a1ab782fceef18a1dbe737c: The actual CHANGELOG overlap preserves every independent entry and places this PR’s complete entry after its assigned existing bullet in the same Unreleased subsection. Exact route identity expectations follow Harbor 0.25 OpenCode native model nvidia/test-model/provider null; Codex and Claude expectations retained. Unwrapped agent and wrapper match; production behavior unchanged. No production conflict required manual edits. Focused contracts: 117 passed in 75.63s (0:01:15). Lint passes; pinned Fern validation reports 0 errors and only the existing authenticated-redirect warning.
The signed-off fix was pushed normally after live open/head/base guards and clean merge checks against captured main 3cf34ec3f052cc2e75d1fadeb34d2a83a5a9a97f and actual base main at 3cf34ec3f052cc2e75d1fadeb34d2a83a5a9a97f. Fresh exact-head hosted CI is pending. No PR was merged by this review.
Brings in #410, #412, #413, #419, #421, #425, #430 and #444. Conflicts: CHANGELOG.md (kept both Unreleased Fixed entries) and evaluation/options.py (kept main's tolerate_baseline_timeouts field and this PR's backend field). Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Narendran Raghavan <[email protected]>
Summary
On the evaluator-generated
python:3.12-slimimage, none of the supported Docker agents (Claude Code, Codex, OpenCode) now runs anapt-get installduring Harbor's agent setup.nodejsandnpmpackages on glibc images, as fix: avoid redundant Node/npm during Docker agent setup #193 did for Claude Code and Codex. NewSkillEvaluatorOpenCodeintier3/harbor/installed_agents.pyoverrides onlyensure_system_dependencies. It runs the existing_installer_dependenciesprobe with Harbor's OpenCode branch selector (ldd --version 2>&1 | grep -qi musl || [ -f /etc/alpine-release ], the same string asSkillEvaluatorCodex), so musl and Alpine images still get distro Node/npm.curl,bash,coreutilsand the CA-bundle fallback are unchanged.DOCKER_AGENT_IMPORT_PATHSroutesopencodeto the new wrapper. GKE (CONTAINER_AGENT_IMPORT_PATHS) and Harbor-native cloud backends keep Harbor's stock OpenCode, as with fix: avoid redundant Node/npm during Docker agent setup #193.SkillEvaluatorGatewayOpenCode(OpenAI-compatible gateway in Docker) now builds onSkillEvaluatorOpenCode. Local-modeSkillEvaluatorLocalOpenCodeis unchanged; it installs nothing.NativeInstalledOpenCodeandPrivateInstalledOpenCodeinnative_agents.py, and aNATIVE_AGENT_IMPORT_PATHSrow for the new base inplugin_native.py. The private row comes from the existing:Nativeto:Privatederivation. Without the row,_private_agent_pathswould raisePluginLoadErrorfor OpenCode in Docker.NativeOpenCodeandPrivateOpenCodestay on stock OpenCode, which GKE and cloud runs still resolve to.procps. Harbor's Claude Code setup checkspgrepand apt-installsprocpswhen it is missing. A new_BASE_APT_PACKAGESconstant inadapter.py(bash curl git jq procps ripgrep) feedsbuild_eval_base_image,_write_dockerfileand_write_default_environment_dockerfile. Theinit-harbor-taskstarter Dockerfile intier3/commands.pylists the same packages. Generated images rebuild once for the new package list: by default the per-task Dockerfiles that_write_dockerfilewrites, or the shared base image (its tag is a content hash) whenharbor.base_image_modeisreuse.docs/eval-datasets.mdxnow names OpenCode and says where nvm'snode/npm/npxare onPATH(the agent and its stdio MCP servers, not the verifier or healthchecks). ItsnpxMCP example now applies to Claude Code, and thegcc/g++/makecase to every agent. A second paragraph of the note coversprocps: generated and starter images have it, and a customevals/environment/Dockerfilekeeps its own base image and should install it, unlessharbor.base_image_modeisreuseorrebuildandcustom_dockerfile_modeisrebase. The_rebase_custom_dockerfile_contentdocstring now points at_BASE_APT_PACKAGESinstead of listing packages. CHANGELOG entry under Unreleased > Fixed.mainat d717f22. Several PRs merged there touched the same files, among them feat(tier3): add experimental Hermes agent with native NVIDIA Build routing #385 (Hermes), feat(tier3): import production trace exports as reviewed eval cases #378, feat(tier3): report dataset coverage and label one-case starters #381, feat(tier3): reuse a compatible retained no-skill baseline #384, fix(tier3): show the run's Overall lift in tier3 compare when a metric is N/A in one arm #386 and feat(tier3): compare a run against a prior skill version #387:DOCKER_AGENT_IMPORT_PATHSandNATIVE_AGENT_IMPORT_PATHSsit next to the Hermes rows from feat(tier3): add experimental Hermes agent with native NVIDIA Build routing #385.native_agents.py,adapter.py,tier3/commands.pyanddocs/eval-datasets.mdxmerged without conflicts.CHANGELOG.md, where fix(tier3): show the run's Overall lift in tier3 compare when a metric is N/A in one arm #386 added a Fixed entry in the same place. Both entries are kept, fix(tier3): show the run's Overall lift in tier3 compare when a metric is N/A in one arm #386's first.tier3/commands.py. This PR changes only the starter Dockerfile's apt line there, and that file merges cleanly with feat(tier3): add selectable NeMo Gym execution backend #225's branch.Why
The quickstart Tier 3 path is NVIDIA Build with OpenCode in Docker mode. Harbor 0.24's OpenCode install requests
nodejsandnpmon every image, even though its glibc branch installs Node with nvm. So every OpenCode trial first ranapt-get update && apt-get install -y nodejs npm, then installed a second Node. Every Claude Code trial ranapt-get update && apt-get install -y procps. Both run inside Harbor's 360-second agent setup timeout, and a package mirror error fails the trial before the agent starts.On
mainat d717f22, a probe that runs each Docker agent's realinstall()against an environment with exactly the generated image's commands shows:opencode(stock Harbor agent):apt-get update && apt-get install -y nodejs npmclaude-code(SkillEvaluatorClaudeCode):apt-get update && apt-get install -y procpscodex(SkillEvaluatorCodex): no package installWith this change all three run no package install.
Behavior change, documented: like Claude Code and Codex since 0.6.0, OpenCode containers on Debian-based images no longer have Debian's
gcc,g++andmake, or a system Node.js outside the OpenCode process. Skills that need them list them inscripts/apt-packages.txtor a custom Dockerfile.Kept from public
_installer_dependencies, its branch probe, thebundled-without-caCA-bundle fallback and Harbor's package-manager logic are reused as they are. Harbor's installers are not patched.SkillEvaluatorOpenCodedoes not add the install retry that the Claude Code and Codex wrappers have. Harbor's OpenCodeinstall()has no installed-CLI check, so a retry would rerun nvm and npm in full.opencode.xz, which the generated apt line does not list.harbor.base_image_modeisdisabled) and withcustom_dockerfile_mode: preserve, so the docs note says to installprocpsthere. Onlybase_image_modereuseorrebuildwithrebasemode puts them on the shared base image, which now hasprocps.Tests
tests/tier3/test_installed_agent_bootstrap.py(45 to 68 tests):SkillEvaluatorOpenCodejoins the installer-branch tests: glibc images install no system Node and keep the vendor installer (musl predicate,nvm install 22,npm i -g opencode-ai); the system-npm branch still installsnodejs npmon apt and apk; a missing CA bundle installsca-certificates; an unknown platform stops before installing; probe transport errors propagate; non-Node requests skip the probe; unknown dependency validation is kept; a missingstdbufstill installscoreutils.opencoderesolves through Harbor'sAgentFactoryby name and import path with report identityopencode.SkillEvaluatorGatewayOpenCodejoins the gateway and NVIDIA Build wrapper test.test_generated_images_satisfy_docker_agent_setup_dependencies(3 cases): forclaude-code,codexandopencodefromDOCKER_AGENT_IMPORT_PATHS, every apt package that reaches Harbor's package step is in the apt line of each generated Dockerfile (base image,_write_dockerfile,_write_default_environment_dockerfile,init-harbor-taskstarter), pluscoreutilsandca-certificatesfrom the slim base.test_custom_dockerfiles_reach_procps_only_through_the_shared_base_image_rebase: a custom Dockerfile keeps its ownFROMby default (no base image) and withpreserve, is rebased only with a base image andrebase, and the docs note says so.test_docker_setup_note_scopes_the_npx_mcp_example_to_claude_code: the note ties thenpxMCP example to Claude Code and the toolchain to every agent.test_docker_setup_note_gives_procps_guidance_its_own_paragraph: the note has two paragraphs. The first coversnodejs,npmandscripts/apt-packages.txtand does not mentionprocps. The second starts with the sentence onprocpsin generated images and holds therebasecondition.tests/tier3/test_private_setup_classification.py(44 to 49 tests): newtest_opencode_plugin_arms_share_the_environment_default_agentchecks that_private_agent_paths(["opencode"], {}, ...)givesPrivateInstalledOpenCode/NativeInstalledOpenCodeondockerandPrivateOpenCode/NativeOpenCodeongke. Both arms must shareinstallandensure_system_dependencieswith that environment's default agent:DOCKER_AGENT_IMPORT_PATHS["opencode"]ondocker, Harbor's stock OpenCode ongke. The existing table tests now cover the two new wrappers.tests/test_harbor_secure_docker_environment.py: the Docker command test expectsDOCKER_AGENT_IMPORT_PATHS["opencode"].adapter.pyandcommands.pyfrommain, the image test fails forclaude-code({'procps'}missing).SkillEvaluatorOpenCodereduced to stock OpenCode, 13 bootstrap tests fail (55 pass): every new OpenCode case except the system-npm branch (2), the non-Node request and the Docker route identity cases (2), which pin behavior stock OpenCode already has.opencoderoute removed, 5 tests fail (113 pass): thedockercase of the plugin-arm test, both Docker route identity cases foropencode, the image test foropencode, and the secure Docker command test.NativeOpenCodebased onSkillEvaluatorOpenCode, thegkecase of the plugin-arm test fails.docs/eval-datasets.mdxfrommain, all three new docs tests fail (no note mentionsprocps). The custom Dockerfile andnpxtests also fail on a note that tells onlycustom_dockerfile_mode: preserveusers to installprocpsand gives thenpxMCP example for every agent. The paragraph test fails on the same note written as one paragraph (1 failed, 2 passed).src/frommain,test_installed_agent_bootstrap.pyfails to importSkillEvaluatorOpenCode, and thedockercase of the plugin-arm test fails.SkillEvaluatorOpenCodelater gains an install retry, since it compares the arms with the environment's default agent, not with Harbor'sOpenCode.install.mainat d717f22, the full suite with-n 6: 27387 passed, 35 skipped, 12 failed. None of the failures are in code this PR touches:mainon this machine:test_sidecar_retains_only_structurally_required_nonsecret_compose_task_valueandtest_sidecar_retains_structurally_required_nonsecret_host_compose_valueintests/test_harbor_secure_docker_environment.py, five Bedrock model-probe tests intests/test_harbor_runtime_preflight.py, the bounded Harbor process timeout test intests/test_harbor_runner_status.py, and three CI launcher tests intests/ci/test_all_tier_preflight.pyandtests/ci/test_feedback.py.test_local_callback_receives_complete_line_before_process_exitintests/test_harbor_local_mode.pywaits 0.5 seconds for a line and timed out under load. It passes alone, on this branch and onmain.test_custom_execution_backends.pypasses: a custom backend still gets stockopencode.ruff checkandruff format --checkare clean on the changed Python files, andscripts/check_oss_boundary.pypassed.🤖 Generated with Claude Code