Skip to content
Myr

wrangler.jsonc

This file

Path

apps/sandbox/wrangler.jsonc

132 lines · 4.5 KiB

Last changed by

Merge infra/drop-demo into mainoscabrielbefore adoptionc49b6bf

History of this file

Take it

1{2  // The sandbox Worker: the Checker and the Lander, each a Durable Object3  // with its own container, reached only through the platform's `SANDBOX`4  // service binding (its default entrypoint's RPC). It has no Artifacts5  // binding of any kind: tokens arrive in jobs, minted per job by the6  // platform. Deploy only through infra/deploy.ts, to an explicit stage.7  //8  // The top level is stage `local`: it builds and types the Worker and is9  // never deployed. Each stage under `env` repeats the containers and10  // Durable Objects, since wrangler does not inherit them.11  "$schema": "node_modules/wrangler/config-schema.json",12  "name": "sandbox",13  "main": "src/worker.ts",14  "compatibility_date": "2026-10-05",15  // The Sandbox SDK's `Files` needs it.16  "compatibility_flags": ["nodejs_compat"],17  "minify": true,18  // A stack trace in the logs, or an Issue, names the source.19  "upload_source_maps": true,20  "workers_dev": false,21  "preview_urls": false,22  // The Worker's own: every invocation's logs and trace, unsampled, and23  // Issues. Every stage inherits it; a container's logs are its own, below.24  "observability": {25    "enabled": true,26    "logs": {27      "enabled": true,28      "head_sampling_rate": 1,29      "invocation_logs": true,30    },31    "traces": { "enabled": true, "head_sampling_rate": 1 },32    "issues": { "enabled": true },33  },34  "migrations": [{ "tag": "v1", "new_sqlite_classes": ["Checker", "Lander"] }],35  "durable_objects": {36    "bindings": [37      { "name": "CHECKER", "class_name": "Checker" },38      { "name": "LANDER", "class_name": "Lander" },39    ],40  },41  // Untrusted answer code runs in a Checker; the Lander runs only git and42  // Bun. One container per Durable Object, which picks its instance size when43  // it starts it (`ctx.container.start`).44  //45  // A container's own logs are off in a Checker: held-back checks run there,46  // and nothing a sealed check writes may reach a log (principle 7). They are47  // on in the Lander, which reads and writes only the public namespace's48  // repos (canonical and forks), never a layer, and hands git its token in49  // env, never in a URL or an argument. Each stage sets both again: a50  // container that leaves `observability` out keeps whatever it last had.51  "containers": [52    {53      "class_name": "Checker",54      "scheduling_policy": "durable_object",55      "observability": { "enabled": false },56      "images": { "check": { "dockerfile": "./images/check.Dockerfile" } },57    },58    {59      "class_name": "Lander",60      "scheduling_policy": "durable_object",61      "observability": { "enabled": true },62      // The repo root, so the image can carry the sdk for `bundleRules`63      // (land.Dockerfile.dockerignore admits only what it copies).64      "images": {65        "land": {66          "dockerfile": "./images/land.Dockerfile",67          "build_context": "../..",68        },69      },70    },71  ],72  "env": {73    "dev-oscabriel": {74      "durable_objects": {75        "bindings": [76          { "name": "CHECKER", "class_name": "Checker" },77          { "name": "LANDER", "class_name": "Lander" },78        ],79      },80      "containers": [81        {82          "class_name": "Checker",83          "scheduling_policy": "durable_object",84          "observability": { "enabled": false },85          "images": {86            "check": { "dockerfile": "./images/check.Dockerfile" },87          },88        },89        {90          "class_name": "Lander",91          "scheduling_policy": "durable_object",92          "observability": { "enabled": true },93          "images": {94            "land": {95              "dockerfile": "./images/land.Dockerfile",96              "build_context": "../..",97            },98          },99        },100      ],101    },102    "prod": {103      "durable_objects": {104        "bindings": [105          { "name": "CHECKER", "class_name": "Checker" },106          { "name": "LANDER", "class_name": "Lander" },107        ],108      },109      "containers": [110        {111          "class_name": "Checker",112          "scheduling_policy": "durable_object",113          "observability": { "enabled": false },114          "images": {115            "check": { "dockerfile": "./images/check.Dockerfile" },116          },117        },118        {119          "class_name": "Lander",120          "scheduling_policy": "durable_object",121          "observability": { "enabled": true },122          "images": {123            "land": {124              "dockerfile": "./images/land.Dockerfile",125              "build_context": "../..",126            },127          },128        },129      ],130    },131  },132}