| 1 | import * as AWS from "alchemy/AWS"; |
| 2 | import * as Effect from "effect/Effect"; |
| 3 | import { MicrovmBuildRole } from "./build-role.ts"; |
| 4 | |
| 5 | /** |
| 6 | * Non-Effect ("external") MicroVM image — built server-side from a plain |
| 7 | * Dockerfile (a tiny Python HTTP server on :8080). No Effect program is |
| 8 | * bundled and no in-VM runtime is injected; it is the AWS analog of the |
| 9 | * Cloudflare `bun`/`remote` container variants. |
| 10 | */ |
| 11 | export class ExternalMicrovm extends AWS.Lambda.MicrovmImage<ExternalMicrovm>()( |
| 12 | "MicrovmBenchExternal", |
| 13 | ) {} |
| 14 | |
| 15 | export default ExternalMicrovm.make( |
| 16 | MicrovmBuildRole.pipe( |
| 17 | Effect.map((buildRole) => ({ |
| 18 | context: new URL("../contexts/microvm-python/", import.meta.url).pathname, |
| 19 | buildRole, |
| 20 | // Pin memory to match the effectful image so both fit the per-account |
| 21 | // MicroVM memory quota at the benchmark's concurrency. Keep the default |
| 22 | // x86_64 arch — forcing ARM_64 breaks the Python image build. |
| 23 | resources: [{ minimumMemoryInMiB: 512 }], |
| 24 | })), |
| 25 | ), |
| 26 | // External mode builds from the Dockerfile; there is no Effect runtime to |
| 27 | // bundle, so the impl shape is empty. |
| 28 | Effect.succeed({}), |
| 29 | ); |