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

main
ts 47 lines 1.81 KB
Raw
1 import { Task } from "@alchemy.run/aws/ECS/Task";
2 import * as Effect from "effect/Effect";
3 import { isolatedProject } from "../../../IsolatedProject.ts";
4
5 /**
6 * The isolated consumer project this task is bundled from (see
7 * `test/IsolatedProject.ts`): `main` lives outside the repository, so the
8 * bundle `cwd` resolves none of alchemy's dependencies — the bun bootstrap's
9 * own imports (`@distilled.cloud/aws/*`, `@effect/platform-bun`, …) must be
10 * anchored by the bundler, not found by accident from the project root.
11 */
12 export const project = isolatedProject("ecs-task", import.meta.filename, ["@alchemy.run/aws"]);
13
14 /**
15 * Regression fixture for the generated bun bootstrap's imports: before the
16 * virtual-entry plugin anchored them, an isolated project left them
17 * `[UNRESOLVED_IMPORT]` / external and the container died at boot with
18 * `Cannot find module …`.
19 *
20 * The `{ run }` impl logs a marker and completes, so a successful boot is
21 * observable as the Fargate task stopping with container exit code 0.
22 */
23 export class IsolatedProjectTask extends Task<IsolatedProjectTask>()("EcsIsolatedProjectTask") {}
24
25 export default IsolatedProjectTask.make(
26 {
27 main: project.main,
28 // Docker Hub's `oven/bun`; the public.ecr.aws default mirror rate-limits
29 // anonymous pulls during local builds (see fixtures/task.ts).
30 image: "oven/bun:1",
31 cpu: 256,
32 memory: 512,
33 // Build/run on ARM64 so an image built on an Apple Silicon host matches
34 // the Fargate runtime architecture (Graviton).
35 runtimePlatform: {
36 cpuArchitecture: "ARM64",
37 operatingSystemFamily: "LINUX",
38 },
39 taskName: "alchemy-test-ecs-isolated-project",
40 },
41 Effect.gen(function* () {
42 return {
43 // One-shot entry: log the marker and exit 0.
44 run: Effect.log("alchemy-isolated-project-ran"),
45 };
46 }),
47 );