FORGE-439: capped Cloudflare apps lane for small/quick CI jobs #1262

Open
gmackie wants to merge 1 commit from FORGE-439-cf-apps-lane into main
Owner

The owner asked for Cloudflare CI to take small and quick jobs, so they stop waiting behind ForgeGraph's fan-out on hetzner-build. This adds one capped lane to the CI executor.

What it adds

  • Lane apps serves the label cf-light. Its runner, cloudflare-apps (uuid 61623539-…), is registered at the gmackie owner scope, so any gmackie repo can use it with runs-on: cf-light.
  • The pool polls Forgejo's user-level job search, /api/v1/user/actions/runners/jobs?labels=cf-light, with a read:user token. It starts one container per waiting job.
  • Bounds: CiRunnerContainer is standard-4 (4 vCPU / 12 GiB) with max_instances 4, and the lane's maxInFlight is 4. fg-merge is unchanged (small, max 2).
  • A one-minute cron calls pool.ensureRunning(). The alarm deletes itself when no lane has waiting jobs. An idle minute costs one job search, and no container starts without a waiting job.
  • The new secrets APPS_RUNNER_TOKEN and APPS_JOBS_TOKEN are already set on the Worker; the values were copied file to file and never printed.

Relation to FORGE-214. That issue retired the unbounded lanes (fg-shadow and the 32-instance cloudflare lane) for cost. This PR reopens exactly one capped lane, for small jobs only, at the owner's request. The bounded-deploy test now pins the new limits.

Cost. A 10-minute job on standard-4 costs roughly $0.05–0.07. With 4 in flight at most, the worst case is bounded.

Checks. ci-executor tests pass (19/19), typecheck passes, and wrangler deploy --dry-run succeeds.

🤖 Generated with Claude Code

The owner asked for Cloudflare CI to take small and quick jobs, so they stop waiting behind ForgeGraph's fan-out on hetzner-build. This adds one capped lane to the CI executor. **What it adds** - Lane `apps` serves the label `cf-light`. Its runner, `cloudflare-apps` (uuid 61623539-…), is registered at the gmackie owner scope, so any gmackie repo can use it with `runs-on: cf-light`. - The pool polls Forgejo's user-level job search, `/api/v1/user/actions/runners/jobs?labels=cf-light`, with a read:user token. It starts one container per waiting job. - Bounds: `CiRunnerContainer` is standard-4 (4 vCPU / 12 GiB) with max_instances 4, and the lane's maxInFlight is 4. fg-merge is unchanged (small, max 2). - A one-minute cron calls `pool.ensureRunning()`. The alarm deletes itself when no lane has waiting jobs. An idle minute costs one job search, and no container starts without a waiting job. - The new secrets `APPS_RUNNER_TOKEN` and `APPS_JOBS_TOKEN` are already set on the Worker; the values were copied file to file and never printed. **Relation to FORGE-214.** That issue retired the unbounded lanes (fg-shadow and the 32-instance `cloudflare` lane) for cost. This PR reopens exactly one capped lane, for small jobs only, at the owner's request. The bounded-deploy test now pins the new limits. **Cost.** A 10-minute job on standard-4 costs roughly $0.05–0.07. With 4 in flight at most, the worst case is bounded. **Checks.** ci-executor tests pass (19/19), typecheck passes, and `wrangler deploy --dry-run` succeeds. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
FORGE-439: capped Cloudflare apps lane for small/quick CI jobs
All checks were successful
CI / superseded (pull_request) Successful in 4s
Preview / cleanup (pull_request) Has been skipped
CI / gitleaks (pull_request) Successful in 1m12s
Executor lifecycle / executor (pull_request) Successful in 4m48s
Preview / deploy (pull_request) Has been skipped
CI / storybook (pull_request) Successful in 3m8s
CI / database-d1 (pull_request) Has been skipped
CI / unit-api (pull_request) Successful in 2m32s
CI / unit-web (pull_request) Successful in 3m15s
CI / go (pull_request) Successful in 2m31s
CI / checks (pull_request) Successful in 4m49s
CI / web-build (pull_request) Successful in 9m48s
CI / database (pull_request) Successful in 9m36s
forgegraph/ci CI passed
CI / ci (pull_request) Successful in 2m1s
Preview / e2e (pull_request) Has been skipped
Preview / release (pull_request) Has been skipped
f7440433d6
Adds a poll lane `apps` to the CI executor for jobs labelled `cf-light`
from any gmackie repository. Forgejo runner `cloudflare-apps` is registered
at the gmackie scope. The pool polls Forgejo's user-level job search with a
read:user token and starts one standard-4 container per waiting job, with at
most 4 in flight and max_instances 4.

A one-minute cron arms the pool alarm, which deletes itself when nothing is
waiting. fg-merge is unchanged. The bounded-deploy test now pins the new
limits instead of the FORGE-214 merge-only shape.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
All checks were successful
CI / superseded (pull_request) Successful in 4s
Preview / cleanup (pull_request) Has been skipped
CI / gitleaks (pull_request) Successful in 1m12s
Required
Details
Executor lifecycle / executor (pull_request) Successful in 4m48s
Preview / deploy (pull_request) Has been skipped
CI / storybook (pull_request) Successful in 3m8s
CI / database-d1 (pull_request) Has been skipped
CI / unit-api (pull_request) Successful in 2m32s
CI / unit-web (pull_request) Successful in 3m15s
CI / go (pull_request) Successful in 2m31s
CI / checks (pull_request) Successful in 4m49s
CI / web-build (pull_request) Successful in 9m48s
CI / database (pull_request) Successful in 9m36s
forgegraph/ci CI passed
CI / ci (pull_request) Successful in 2m1s
Required
Details
Preview / e2e (pull_request) Has been skipped
Preview / release (pull_request) Has been skipped
This pull request can be merged automatically.
This branch is out-of-date with the base branch
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin FORGE-439-cf-apps-lane:FORGE-439-cf-apps-lane
git switch FORGE-439-cf-apps-lane
Sign in to join this conversation.
No description provided.