Repository navigation
feat(op,orchestrator): a spec's needs can decide its build's network outside a box - #3745
Draft
bryan-minimal wants to merge 1 commit into
Draft
bryan-minimal wants to merge 1 commit into
bryan-minimal wants to merge 1 commit into
Conversation
…outside a box Outside a box, a build that is handed its dependencies has the network whatever its spec declares. The orchestrator's local backend hands every build its dependencies, so every build it runs has the host's network. LocalBackend::needs_decide makes each spec's own needs decide instead, as they already do in a box. Nothing changes for a caller that does not ask. A patched build keeps the network either way. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Contributor
|
Important Draft PR not reviewedDraft PRs are not automatically reviewed by default.
To automatically review draft PRs, update your CodeRabbit configuration: reviews:
auto_review:
drafts: true
|
This branch has not been deployed
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
Outside a box, a build that is handed its dependencies (
override_deps) has the network whatever its spec declares. The orchestrator'sLocalBackendhands every build its dependencies, so every build it runs outside a box has the host's network. The package build service (build-servers' res-server) is such a caller: all of its builds run with the host network, including the ones whose specs declare noneeds.Measured on the registry at pkgs db9d2fdc (597 packages, two architectures, 1100 observed builds): 642 builds neither declare the network nor inherit a declaration from a build tool. All 642 had it anyway, and 26 of them used it (13 packages on both architectures, each a pip call that reaches PyPI).
This adds an opt-in,
LocalBackend::needs_decide, which sets a newSpecBuild::needs_decide. With it, a boxless build withoverride_depsgets whatdeclared_needssays, the same rule a build in a box already follows, and a build that declares nothing runs in an empty network namespace.mipandminkeep today's behaviour.needs_decideis only read when there is no build box.The alternative I considered is for the build service to implement
BuildBoxesand run its builds in build boxes on a host-plan network. That also moves each source fetch into a fetch process, which the build service is not ready for, so this is the smaller step. If you would rather the build service go straight to build boxes, say so and I will close this.Testing
Not compiled or run locally; CI is the test. One new unit test,
override_deps_needs_follow_the_spec_when_the_caller_says_so: a spec that declares nothing gets the isolated plan, a patched build keeps the network, and a spec that declaresdnsgets the host plan.Checklist
BREAKING CHANGE:footer present if this is a breaking change🤖 Generated with Claude Code