job
A container that runs to completion each time it is started.
A container that runs to completion each time it is started, and is not restarted when it exits cleanly — a migration, a report, a backfill. Start it by hand, or connect a schedule to it with connect traffic.
ackee.ack
ackee 1project "shop" {cloud = "gcp"region = "us-east1"gcpProject = "acme-shop"}job "migrate" {image = var.MIGRATE_IMAGEsize = "small"}database "main" {}connect env "migrate" -> "main"
Fields
| Field | Takes | Meaning |
|---|---|---|
| imagerequired | string | var.NAME | The container image to run. |
| size | "small" | "medium" | "large" default "small" | CPU and memory per copy, on the same ladder as service. Must be written out, not referenced. |
| command | list of strings | The command to run in place of the image's default one; the image's entrypoint still runs first, as with docker run image node mailer.js. Leave it out to run the image as built. |
| env | map | Environment variables, as for service. |
| build | map | Build and redeploy from a repository on every push — see source. |
Any other field is refused (AK204), and the error names the exact type to declare with node for the setting you wanted.
What it becomes
| Cloud | Becomes |
|---|---|
| AWS | An ECS task definition on Fargate, run on demand. |
| Google Cloud | A Cloud Run job. |
| Azure | A Container Apps job. |
Joins the shared network net: all three clouds.
Notes
- Timeouts and retries are spelled differently on each cloud, so they are not portable: declare the job with
nodeand its cloud's type to set them. - Schedules are not portable either — EventBridge, Cloud Scheduler and Azure each express time differently. Declare your cloud's schedule with
nodeand connect it to the job withconnect traffic.