Skip to content

feat: add panda build command for Docker image builds#98

Open
qu0b wants to merge 6 commits intomasterfrom
qu0b/build-command
Open

feat: add panda build command for Docker image builds#98
qu0b wants to merge 6 commits intomasterfrom
qu0b/build-command

Conversation

@qu0b
Copy link
Copy Markdown
Member

@qu0b qu0b commented Apr 10, 2026

Summary

  • Adds panda build <client> CLI command for triggering Docker image builds in eth-client-docker-image-builder
  • Routes through the proxy so the GitHub token is centralized (no token needed on the client machine)
  • --wait flag blocks until the build completes — designed for agent workflows
  • Three-layer implementation: proxy handler -> server endpoint -> CLI command

Usage

# Trigger and return immediately
panda build geth
panda build geth --ref master
panda build lighthouse --ref unstable

# Trigger and wait for completion (agent workflows)
panda build geth --ref master --wait
panda build geth --ref master --wait --json

# Overrides
panda build geth --repo ethereum/go-ethereum --ref my-branch
panda build geth --tag my-custom-tag

Architecture

panda build geth --ref master
  -> POST server /api/v1/build/trigger
    -> POST proxy /github/actions/trigger
      -> POST github.com/.../actions/workflows/build-push-geth.yml/dispatches

panda build geth --wait  (polls until done)
  -> POST server /api/v1/build/status
    -> POST proxy /github/actions/run-status
      -> GET github.com/.../actions/runs/{id}

Proxy config

Requires a GitHub token with actions:write on the target repo:

github:
  token: "${GITHUB_TOKEN}"

Files changed

File Change
pkg/proxy/handlers/github.go New — GitHub Actions trigger + run-status handlers
pkg/proxy/server_config.go Add GitHubAPIConfig struct
pkg/proxy/server.go Wire GitHub handler + routes
pkg/server/api.go Add build trigger + status endpoints
pkg/serverapi/types.go Add build request/response types
pkg/cli/build.go Newpanda build command with --wait
pkg/cli/server_helpers.go Add triggerBuild() + getBuildStatus() helpers

Test plan

  • go build ./... compiles
  • go test ./... passes
  • golangci-lint clean on changed packages
  • Manual: configure proxy with github.token, run panda build geth --ref master, verify workflow dispatched
  • Manual: run panda build geth --ref master --wait, verify it polls and returns on completion

qu0b added 6 commits April 10, 2026 16:32
The Dora epoch API returns `globalparticipationrate` as an integer
percentage (0-100). The CLI text formatter was multiplying by 100 again,
producing values like 4400% instead of 44%.
Route build triggers through the proxy (centralized GitHub token) to
dispatch GitHub Actions workflows in eth-client-docker-image-builder.

Usage: panda build <client> [--ref REF] [--repo REPO] [--tag TAG]

Three-layer implementation:
- Proxy: new /github/actions/trigger endpoint + GitHubConfig
- Server: POST /api/v1/build/trigger passthrough to proxy
- CLI: `panda build` cobra command
After triggering a workflow dispatch, the proxy now finds the
corresponding GitHub Actions run ID by polling recent runs. A new
run-status endpoint lets the CLI check progress.

With --wait, `panda build` blocks until the run completes and exits
non-zero on failure — designed for agent workflows that need to
wait for the image before continuing.
Two safety guards to prevent runaway agents:

1. Per-workflow cooldown (2 min) — can't re-trigger the same
   workflow until the cooldown expires
2. Global cap (10 triggers per 10 min) — hard limit across all
   workflows regardless of which client

Returns 429 with a clear message explaining the limit and when
the caller can retry.
The created filter had a malformed URL encoding (stray colon).
Replace with client-side timestamp comparison against the most
recent runs list, which is simpler and reliable.
`panda build geth` now waits for the build to finish and exits
non-zero on failure. Use `--no-wait` to fire and forget.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant