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

main
ts 30 lines 1.34 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 * Node baseline MicroVM image — the dumbest possible `http.createServer`
7 * server, built from `contexts/microvm-node/` the same way alchemy builds the
8 * effectful node {@link import("./effectful-node.ts").EffectfulNode} image (same
9 * MicroVM base, same `dnf install -y nodejs`, same ARM_64 arch, same 512 MiB).
10 * `effectfulNode.readyMs − node.readyMs` isolates the alchemy/Effect cold-start
11 * tax on the runtime the Lambda VMs already ship.
12 */
13 export class NodeMicrovm extends AWS.Lambda.MicrovmImage<NodeMicrovm>()("MicrovmBenchNode") {}
14
15 export default NodeMicrovm.make(
16 MicrovmBuildRole.pipe(
17 Effect.map((buildRole) => ({
18 // External (Dockerfile) mode: the runtime is decided by this context's
19 // Dockerfile (installs + runs node), NOT by alchemy's `runtime` prop —
20 // that only applies to effectful `main:` images. Match the effectful
21 // EffectfulNode's image config: ARM_64, 512 MiB.
22 context: new URL("../contexts/microvm-node/", import.meta.url).pathname,
23 buildRole,
24 resources: [{ minimumMemoryInMiB: 512 }],
25 cpuConfigurations: [{ architecture: "ARM_64" }],
26 })),
27 ),
28 // External (Dockerfile) mode — no Effect runtime to bundle.
29 Effect.succeed({}),
30 );