feat(cli): panda buildoor — drive per-slot action plans and jq transforms#323
Open
qu0b wants to merge 4 commits into
Open
feat(cli): panda buildoor — drive per-slot action plans and jq transforms#323qu0b wants to merge 4 commits into
qu0b wants to merge 4 commits into
Conversation
…orms
Adds a buildoor command group so tests can hot-patch builder payloads from
panda, the sanctioned replacement for baking overrides into buildoor itself
(cf. buildoor#146 reverting the gaslimit adjust):
panda buildoor transform <network> <instance> --slots +2,+3 \
--payload '.gas_limit = 300000000'
Server-side buildoor.* operations resolve a network's instances through the
buildoor overview service advertised by cartographoor, proxy the instance
action-plan API (plans, slot results, overview, test-transform), and pass
mutations through verbatim with the caller's authenticatoor bearer token —
buildoor keeps ownership of the PlanUpdate schema, validation, and auditing.
The CLI resolves +N/+-N slot offsets against the instance's current slot,
exposes test-transform for validating jq expressions against captured
artifacts before committing them, and offers plan-update as the raw
PlanUpdate escape hatch for non-transform categories.
Companion runbook for the panda buildoor command group: instance discovery, transform validation via test-transform, freeze semantics, authenticatoor tokens, and outcome verification through slot results.
…python
Registers a buildoor module (DefaultEnabled, mirrors dora) so sandbox code
can drive the same buildoor.* operations as the CLI:
from ethpandaops import buildoor
buildoor.set_transforms(net, inst, token, slots=[s+2],
payload='.gas_limit = 300000000')
Ships the python wrapper (list_networks/list_instances/get_overview/
get_action_plan/get_slot_results/test_transform/update_action_plan/
set_transforms), sandbox env gating via ETHPANDAOPS_BUILDOOR_NETWORKS,
Python API docs, and searchable examples. Requires a sandbox image rebuild
(modules/*/python/*.py is copied in at build time).
…redential boundary
Corrects the auth design: mutations no longer require users to hand-carry
devnet tokens. Following the platform's established patterns (authentik OIDC
at the proxy, workflow-style capability advert, ethnode-style dynamic devnet
routing), the proxy now owns the devnet credential:
- proxy: /buildoor/{network}/{instance}/api/* route. The proxy mints a JWT
per devnet from its authenticatoor (auth.<network>/auth/token) using a
CF Access service token (authenticatoor allowServiceTokens; subject =
token common name), caches it until near expiry, and injects it as the
upstream bearer. static_token supports local setups. allowed_orgs gates
the route and hides the advert (mirrors workflow); only /api/ paths proxy.
- discovery: BuildoorAdvert capability + BuildoorInfoProvider/BuildoorRoute
(client + router), so the server routes mutations to the first proxy that
advertises buildoor.
- server: update_action_plan prefers the proxy route; an explicit caller
token still goes direct and keeps per-user attribution in buildoor's own
audit log (the proxy path attributes the human via the proxy audit).
- CLI/Python: token now optional; help and runbook describe both paths.
Verified end-to-end against glamsterdam-devnet-7: CLI (no token) → server →
proxy route → live instance; the injected bearer reached buildoor and its
401 for the test token propagated back with the remedy hint.
Hosted activation needs platform provisioning: a CF Access service token in
the devnet auth applications' Access policy + the buildoor block (secret) in
panda-proxy values.
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
Adds a
panda buildoorcommand group so tests can hot-patch builder payloads on devnet buildoor instances from panda — the sanctioned replacement for baking overrides into buildoor itself (cf. ethpandaops/buildoor#146 reverting the gaslimit adjust in favor of action-plan jq transforms):Commands
networks/instances <network>— discover devnets with buildoor and their builder instances (live from the overview service's host list; addressed by short name, e.g.prysm-ethrex-1)overview— instance status (current slot, services)plan/results— action plans and attempt-level outcome history (defaults to current−8..current+24 forplan)transform— set/cleartransforms.payload|bid|envelopejq expressions on future slots (--slots 123,+2or--from/--to;+N/+-Nresolve against the instance's current slot)test-transform— run an expression through buildoor's production gojq path against a captured artifact or template, without touching any planplan-update— raw PlanUpdate JSON escape hatch for the non-transform categories (bid.bid_value_gwei, reveal gating, …)Design
Server-side
buildoor.*operations: resolve the network's buildoor overview URL from cartographoor, fetch/api/overview/hostsfor per-instance API URLs, and proxy the instance action-plan API. Buildoor keeps ownership of the PlanUpdate schema — updates pass through verbatim, and its errors surface with remedies (bad jq → 400, frozen/past slot → 409 + "target slots ≥2 ahead", missing token → 401 + token hint).Auth — the proxy is the credential boundary (matching the platform's authentik/workflow/ethnode patterns): the proxy gains a
/buildoor/{network}/{instance}/api/*route that mints per-devnet authenticatoor JWTs with a proxy-held CF Access service token (auth.<network>/auth/token,allowServiceTokens— subject = the token's common name), caches them, and injects them upstream;allowed_orgsgates the route and hides the discovery advert, and the server routes mutations to the first proxy advertising buildoor. An explicit--token/PANDA_BUILDOOR_TOKENstill goes direct and keeps per-user attribution in buildoor's own audit log (proxy path: human attributed in the proxy audit, service subject in buildoor's).Hosted activation checklist (platform): create a CF Access service token, add it to the devnet auth applications' Access policy, and set
buildoor: {cf_access_client_id/secret, allowed_orgs: [ethpandaops:Core]}in panda-proxy values.static_tokensupports local proxies.Python surface: a
buildoormodule (DefaultEnabled, mirrors dora) exposes the same operations to sandbox code —from ethpandaops import buildoor; buildoor.set_transforms(net, inst, token, slots=[s+2], payload='.gas_limit = 300000000')— with Python API docs and searchable examples. Needs a sandbox image rebuild (modules/*/python/*.pyis copied in at build time).Includes a
runbooks://buildoor_action_planrunbook covering the workflow, freeze semantics, and failure modes (CLI + Python surfaces).Testing
go test ./pkg/server ./pkg/cli ./runbooks(incl. race),go vet,golangci-lint: clean.test-transformreturned the transformed template payload withgas_limit: 300000000;plan/resultsreads with relative slot offsets resolved correctly; unsynced instance (current_slot=0) fails fast; bad token → 401 with hint.