| 1 | { |
| 2 | "$schema": "../../node_modules/wrangler/config-schema.json", |
| 3 | "name": "g1t-runner", |
| 4 | "account_id": "1e6f2cffa3f445920836e8ebe446bb58", |
| 5 | "compatibility_date": "2026-09-26", |
| 6 | "main": "./src/index.ts", |
| 7 | "workers_dev": false, |
| 8 | // One image (the base plus the runner binary), on three machine sizes. |
| 9 | // scripts/deploy.mjs deploys with each image set to the reference it |
| 10 | // built and pushed ("The runner's images" in |
| 11 | // docs.g1t.sh/guides/deploy-to-cloudflare/), so a deploy builds |
| 12 | // nothing; "./Dockerfile" here is for building by hand. |
| 13 | "containers": [ |
| 14 | { |
| 15 | "class_name": "AttemptSandbox", |
| 16 | "image": "./Dockerfile", |
| 17 | "instance_type": "standard-1", |
| 18 | "max_instances": 20, |
| 19 | // A deploy replaces sandboxes. Ones that are busy are given this |
| 20 | // long, in seconds, to finish first, so shipping g1t does not |
| 21 | // kill work in the middle. |
| 22 | "rollout_active_grace_period": 7200 |
| 23 | }, |
| 24 | { |
| 25 | // Workflow jobs with `runs-on: g1t-2core`: 2 vCPU, 8 GiB, 16 GB. |
| 26 | "class_name": "Sandbox2Core", |
| 27 | "image": "./Dockerfile", |
| 28 | "instance_type": "standard-3", |
| 29 | "max_instances": 10, |
| 30 | "rollout_active_grace_period": 7200 |
| 31 | }, |
| 32 | { |
| 33 | // Workflow jobs with `runs-on: g1t-4core`: 4 vCPU, 12 GiB, 20 GB. |
| 34 | "class_name": "Sandbox4Core", |
| 35 | "image": "./Dockerfile", |
| 36 | "instance_type": "standard-4", |
| 37 | "max_instances": 10, |
| 38 | "rollout_active_grace_period": 7200 |
| 39 | } |
| 40 | ], |
| 41 | "durable_objects": { |
| 42 | "bindings": [ |
| 43 | { "name": "SANDBOX", "class_name": "AttemptSandbox" }, |
| 44 | { "name": "SANDBOX_2CORE", "class_name": "Sandbox2Core" }, |
| 45 | { "name": "SANDBOX_4CORE", "class_name": "Sandbox4Core" } |
| 46 | ] |
| 47 | }, |
| 48 | "migrations": [ |
| 49 | { "tag": "v1", "new_sqlite_classes": ["AttemptSandbox"] }, |
| 50 | { "tag": "v2", "new_sqlite_classes": ["Sandbox2Core", "Sandbox4Core"] }, |
| 51 | { "tag": "v3", "new_sqlite_classes": ["AgentComputer"] }, |
| 52 | // Workspace agents' computers are gone, and with them their objects. |
| 53 | { "tag": "v4", "deleted_classes": ["AgentComputer"] } |
| 54 | ], |
| 55 | "services": [ |
| 56 | { "binding": "IDENTITY", "service": "g1t-identity" }, |
| 57 | { "binding": "REPOS", "service": "g1t-repos" }, |
| 58 | { "binding": "WORK", "service": "g1t-work" }, |
| 59 | { "binding": "BILLING", "service": "g1t-billing" }, |
| 60 | { "binding": "ACTIONS", "service": "g1t-actions" }, |
| 61 | { "binding": "DEPLOYMENTS", "service": "g1t-deployments" }, |
| 62 | // The event bus: abuse.flagged, when a sandbox looks like it is mining. |
| 63 | { "binding": "EVENTS", "service": "g1t-events" } |
| 64 | ], |
| 65 | // A sweep for lifecycle steps whose trigger was missed or whose sandbox |
| 66 | // died before reporting, which also starts queued nightly backups. |
| 67 | "triggers": { "crons": ["*/5 * * * *"] }, |
| 68 | // Events it reacts to: a pull request that may now merge by its |
| 69 | // repository's settings, a merge check or the merge queue to start. |
| 70 | "queues": { |
| 71 | "consumers": [{ "queue": "g1t-events-runner", "max_batch_size": 20, "max_batch_timeout": 1, "max_retries": 3, "dead_letter_queue": "g1t-events-dlq" }] |
| 72 | }, |
| 73 | "vars": { |
| 74 | "CLOUDFLARE_ACCOUNT_ID": "1e6f2cffa3f445920836e8ebe446bb58", |
| 75 | // Guardrails' network list is enforced by starting sandboxes without |
| 76 | // internet and passing their HTTP(S) through this Worker. "off" opens |
| 77 | // every sandbox's network again, whatever its guardrails say. |
| 78 | "EGRESS": "enforce", |
| 79 | // Sandboxes stop themselves when they look like they are mining |
| 80 | // (crates/runner abuse.rs). "off" turns the CPU watch off; miners |
| 81 | // named in commands are refused either way. |
| 82 | "ABUSE_WATCH": "on", |
| 83 | // Each workflow job gets a Docker Engine of its own, inside its |
| 84 | // sandbox, started the first time a step uses Docker or the job has |
| 85 | // `services:` or `container:` (crates/runner docker/). "off" gives |
| 86 | // jobs none. |
| 87 | "DOCKER": "on", |
| 88 | // Nightly backups (src/backup.ts): each sweep starts this many of the |
| 89 | // backups the repos service queued, with at most BACKUPS_RUNNING at |
| 90 | // once. "0" starts none. |
| 91 | "BACKUPS_PER_SWEEP": "4", |
| 92 | "BACKUPS_RUNNING": "6" |
| 93 | }, |
| 94 | // Every log kept: few requests, and a failed run must be traceable. |
| 95 | "observability": { "enabled": true, "head_sampling_rate": 1 } |
| 96 | } |