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