Uh oh!
There was an error while loading. Please reload this page.
feat(docker): add BINARY_SOURCE selector for prebuilt Rust binaries - #945
Conversation
Signed-off-by: Jonas Toelke <jtoelke@nvidia.com>
pimlock
commented
Apr 23, 2026
FYI: I triggered E2E to verify image builds work in the CI as well. |
Uh oh!
There was an error while loading. Please reload this page.
Adds --chmod=755 to the COPY instructions in the scratch-based prebuilt binary stages. Without this, binaries produced by PR 4a and shuttled through actions/upload-artifact + download-artifact lose their executable bit during the roundtrip, and the resulting image's ENTRYPOINT fails at runtime. Signed-off-by: Jonas Toelke <jtoelke@nvidia.com>
jtoelke2
commented
Apr 24, 2026
…ebuilt-binaries-flag # Conflicts: # tasks/scripts/docker-build-image.sh
jtoelke2
commented
Apr 24, 2026
@pimlock — rebased onto latest The rebase dismissed your approval automatically. When you have a sec, re-approve and squash-merge from the UI — no further changes expected from my side unless something else lands on main first. Sorry for the churn. |
pimlock
commented
Apr 24, 2026
@jtoelke2 I saw the rebase and approved already, so this is good to go. |
Uh oh!
There was an error while loading. Please reload this page.
… 4a) Builds openshell-gateway and openshell-sandbox natively per-arch on the nv-gha-runners shared CPU pool with a GHA-backed sccache, and uploads the resulting binaries as artifacts shaped for Dockerfile.images' BINARY_SOURCE=prebuilt path (added in #945). Dispatch manually 4-5 times after merge to collect cold + warm numbers and compare against the Rust portion of docker-build.yml's ARC baseline. PR 4c will wire these artifacts into the real pipeline once numbers land. Refs OS-128. Signed-off-by: Jonas Toelke <jtoelke@nvidia.com>
… 4a) (#973) Builds openshell-gateway and openshell-sandbox natively per-arch on the nv-gha-runners shared CPU pool with a GHA-backed sccache, and uploads the resulting binaries as artifacts shaped for Dockerfile.images' BINARY_SOURCE=prebuilt path (added in #945). Dispatch manually 4-5 times after merge to collect cold + warm numbers and compare against the Rust portion of docker-build.yml's ARC baseline. PR 4c will wire these artifacts into the real pipeline once numbers land. Refs OS-128. Signed-off-by: Jonas Toelke <jtoelke@nvidia.com>
Summary
Add a
BINARY_SOURCEselector todeploy/docker/Dockerfile.imagesso the three final images (gateway,supervisor,cluster) can consume pre-built Rust binaries from the build context instead of compiling inside Docker. Default staysbuild(unchanged behavior);prebuiltis opt-in and inert until later Phase 4 PRs wire in the producer + workflow.Related Issue
OS-49 runner migration, Phase 4 / OS-128. This is PR 4b of three:
cargo buildjobs publishopenshell-gateway/openshell-sandboxartifacts. Data-blocked on Phase 2 dispatch results.Full plan + gotchas live on OS-128 as a Linear comment.
Changes
deploy/docker/Dockerfile.images:ARG BINARY_SOURCE=builddeclared at global scope (required for BuildKitFROM *-${ARG}substitution).gateway-binary-build(alias forgateway-builder) /gateway-binary-prebuilt(scratch +COPY deploy/docker/.build/prebuilt-binaries/${TARGETARCH}/openshell-gateway /build/out/openshell-gateway) → merged intogateway-binaryviaFROM gateway-binary-${BINARY_SOURCE}.supervisor-binary.COPY --from=*-builderlines re-pointed at*-binary:supervisor-output,gateway,supervisor,cluster.BINARY_SOURCE=prebuilt, BuildKit skips therust-builder-*/rust-deps/*-builder/*-workspacestages entirely — Docker becomes packaging-only. PR 4c just flips the default and deletes the now-unreferenced stages.tasks/scripts/docker-build-image.sh:USE_PREBUILT_BINARIESenv var. Whentrueand target isgateway/supervisor/cluster/supervisor-output, passes--build-arg BINARY_SOURCE=prebuiltplus a fail-early sanity check thatdeploy/docker/.build/prebuilt-binaries/exists.Testing
mise run pre-commitpassesdocker buildx build --call=checkongateway,supervisor,clustertargets — lint-clean, no warnings.docker buildx build --call=checkwithBINARY_SOURCE=prebuiltoverride — lint-clean.mise run build:docker:gateway(defaultBINARY_SOURCE=build) — completed end-to-end, producedopenshell/gateway:dev(115MB).docker run openshell/gateway:dev --versionreturnsopenshell-gateway 0.0.0(version-injection not exercised locally; CI path unchanged).USE_PREBUILT_BINARIES=true mise run build:docker:gatewayend-to-end — not exercised in this PR. Theprebuiltpath is inert until PR 4a lands and stages the binaries. First real end-to-end test ships in PR 4a.Checklist
BINARY_SOURCE=buildroutes through the samegateway-builder/supervisor-builderstages as before)create_documentMCP outage)