Skip to content

Where people and agents ship software together. The open-source git platform for the whole job: issues, agents, checks and deploys to the edge.

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