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