feat(docker): add BINARY_SOURCE selector for prebuilt Rust binaries#945
Merged
feat(docker): add BINARY_SOURCE selector for prebuilt Rust binaries#945
Conversation
Signed-off-by: Jonas Toelke <jtoelke@nvidia.com>
Collaborator
|
FYI: I triggered E2E to verify image builds work in the CI as well. |
pimlock
previously approved these changes
Apr 23, 2026
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>
Collaborator
Author
pimlock
previously approved these changes
Apr 24, 2026
…ebuilt-binaries-flag # Conflicts: # tasks/scripts/docker-build-image.sh
pimlock
approved these changes
Apr 24, 2026
Collaborator
Author
|
@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. |
Collaborator
|
@jtoelke2 I saw the rebase and approved already, so this is good to go. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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)