@devries-cameron20 / t3code Mirror · read-only
Fork 0

The best way to control Claude Code, Codex and more from any computer or phone

Mirrored from https://github.com/Camo67/t3code.git

Synced Nov 21, 06:00 UTC

main
ts 31 lines 1.45 KB
Raw
1 import * as AWS from "@alchemy.run/aws";
2 import * as Effect from "effect/Effect";
3 import { MicrovmBuildRole } from "./build-role.ts";
4
5 /**
6 * Bun baseline MicroVM image — the dumbest possible `Bun.serve` HTTP server,
7 * built from `contexts/microvm-bun/` the same way alchemy builds the effectful
8 * {@link import("./effectful-bun.ts").EffectfulBun} image (same MicroVM base, same bun install, same ARM_64 arch,
9 * same 512 MiB). The only difference is the absence of the Effect runtime and
10 * the alchemy bootstrap, so `effectful.readyMs − bun.readyMs` isolates the
11 * cold-start cost of alchemy's Effect abstraction with the runtime and CPU
12 * architecture held constant.
13 */
14 export class BunMicrovm extends AWS.Lambda.MicrovmImage<BunMicrovm>()("MicrovmBenchBun") {}
15
16 export default BunMicrovm.make(
17 MicrovmBuildRole.pipe(
18 Effect.map((buildRole) => ({
19 // External (Dockerfile) mode: the runtime is NOT chosen by alchemy's
20 // `runtime` prop (that only applies to effectful `main:` images). It is
21 // decided entirely by this context's Dockerfile, which installs and runs
22 // bun. Match the effectful EffectfulBun's image config: ARM_64, 512 MiB.
23 context: new URL("../contexts/microvm-bun/", import.meta.url).pathname,
24 buildRole,
25 resources: [{ minimumMemoryInMiB: 512 }],
26 cpuConfigurations: [{ architecture: "ARM_64" }],
27 })),
28 ),
29 // External (Dockerfile) mode — no Effect runtime to bundle.
30 Effect.succeed({}),
31 );