| 1 | import * as Kubernetes from "@/Kubernetes"; |
| 2 | import * as Effect from "effect/Effect"; |
| 3 | import { TestLocalCluster } from "./local.ts"; |
| 4 | |
| 5 | /** |
| 6 | * An Effect program run as a one-shot Job on the local cluster: bundled, |
| 7 | * built for the node architecture, pushed to the cluster's registry, and |
| 8 | * pulled by the node. |
| 9 | */ |
| 10 | export default Kubernetes.Job( |
| 11 | "LocalEffectJob", |
| 12 | Effect.gen(function* () { |
| 13 | const cluster = yield* TestLocalCluster; |
| 14 | return { |
| 15 | cluster, |
| 16 | main: import.meta.url, |
| 17 | name: "local-effect-job", |
| 18 | backoffLimit: 1, |
| 19 | }; |
| 20 | }), |
| 21 | Effect.gen(function* () { |
| 22 | return { |
| 23 | run: Effect.log("local effect job ran"), |
| 24 | }; |
| 25 | }), |
| 26 | ); |