FORGE-79: Cloudflare Containers CI executor (proof of concept) #686
No reviewers
Labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
gmackie/ForgeGraph!686
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "FORGE-79-cf-executor-poc"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Issue: https://tasks.gmac.io/gmacko/issue/FORGE-79 · plan: https://xev2v724is67.postplan.dev (phase 2) · aligned with FORGE-67 (executor only; it owns the control plane)
What
apps/ci-executor: a Worker with aCiRunnerContainer(@cloudflare/containers0.3.7,standard-4, max 4 instances). Each container runsforgejo-runner one-job --wait --label cloudflare:host, claims exactly one task, and exits.POST /run?count=N(bearerEXECUTOR_ADMIN_TOKEN) starts containers by hand for now; autoscaling is phase 3.container/Dockerfile): Node 24.14, pnpm 10.19, PostgreSQL 17 (PGDG), gitleaks 8.30.1, git, and forgejo-runner 13.0.0 pinned by sha256. No credentials are baked in.entrypoint.shwritesRUNNER_TOKENto a 0600 file for--token-urland unsets it before exec, so job steps don't inherit it.cf-executor-smoke.yml:runs-on: cloudflare, on PRs touching the executor. It runs checkout, toolchain versions, the same gitleaks scan asci.yml, and PostgreSQL started as a process (host mode has no service containers). It is not a required check.Already in place (outside this diff)
cf-containers, registered with a shared secret, scoped to gmackie/ForgeGraph (the CLI ignored--scope, so repo_id was set on that row directly), labelcloudflare. No job on the instance had ever requested that label.forgegraph-ci-executor.gmac.workers.dev. SecretsRUNNER_TOKENandEXECUTOR_ADMIN_TOKENare set, preview URLs are off,/healthreturns 200, and/runwithout a token returns 401.registry.cloudflare.com/<account>/forgegraph-ci-executor:poc1. wrangler's own build passes--provenance, which podman rejects, so the config references the pushed image.Verification so far
one-jobwith afile://token authenticated as runner #28, declaredcloudflare, and exited on "no task received" (run on hetzner-ci, no task).RUNNER_TOKENabsent from the environment.apps/ci-executortsc --noEmitis clean, and the workflows parse (10 files)./runand confirm it claims and passes the job on Cloudflare.Known limits (phase 3+)
Host mode shares the container with the job, so a job step could read the runner token file. That token is repo-scoped, and each container runs one job, but per-task tokens or
--handleassignment (asked of FORGE-67) would remove this exposure. Pool autoscaling and moving realci.ymljobs are later phases.🤖 Generated with Claude Code
Preview environment is live: https://pr-686-forgegraph.forgegraf.com
Deployed
117d9cbewith the beta stage's environment. It redeploys on every push and is destroyed when this PR closes.Preview environment is live: https://pr-686-forgegraph.forgegraf.com
Deployed
117d9cbewith the beta stage's environment. It redeploys on every push and is destroyed when this PR closes.117d9cbebc0c81e05fc7Preview environment is live: https://pr-686-forgegraph.forgegraf.com
Deployed
0c81e05fwith the beta stage's environment. It redeploys on every push and is destroyed when this PR closes.0c81e05fc793dc978960Preview environment is live: https://pr-686-forgegraph.forgegraf.com
Deployed
93dc9789with the beta stage's environment. It redeploys on every push and is destroyed when this PR closes.