Skip to content

ci(aws): mirror AMIs to satellite regions and publish IDs on download page#50

Merged
passcod merged 3 commits into
mainfrom
mirror-amis-to-regions
Jun 21, 2026
Merged

ci(aws): mirror AMIs to satellite regions and publish IDs on download page#50
passcod merged 3 commits into
mainfrom
mirror-amis-to-regions

Conversation

@passcod

@passcod passcod commented Jun 21, 2026

Copy link
Copy Markdown
Member

Summary

Two changes that together cover region-mirroring and consumer
discoverability of the published AMIs:

1. Mirror published AMIs to satellite regions

AMIs are region-scoped: the AMI #49 registers in ap-southeast-2 is
only directly launchable from ap-southeast-2. Consumers in other
regions would otherwise have to aws ec2 copy-image it themselves.

Adds a copy-amis matrix job that fans out per (arch × suite ×
target-region) and a scripts/copy-ami-to-region.sh script. For each
target it copies the source AMI, polls until it's available, tags
the backing snapshot, publishes the copy via launch / create-volume
permissions, and verifies Public=True. Idempotent: skips if the
named AMI already exists in the target region.

Target regions: ap-southeast-6, eu-central-5, ap-south-1,
us-east-1. ap-southeast-2 is the source.

2. Publish AMI IDs in the release manifest and download page

register-ami and copy-amis each now emit a small JSON fragment
with the AMI ID, region, arch, suite, and Ubuntu version they
produced. release-aggregate downloads them all, adds them to
manifest.json under a new amis field, and renders a "Launch on
AWS" table on the download page with a one-click AWS console URL per
(region × arch × suite).

release-aggregate now needs both register-ami and copy-amis,
but uses always() + explicit result checks so a partial
copy-amis failure (e.g. an opt-in region that isn't enabled yet)
doesn't block the release. Fragments from failed satellite regions
simply don't appear in the table.

passcod added 2 commits June 22, 2026 06:12
AMIs are region-scoped: the AMI registered by register-ami in
ap-southeast-2 is only directly launchable from ap-southeast-2.
Consumers in other regions would otherwise have to copy-image
themselves before they could launch.

Add a copy-amis matrix job that fans out one (arch × suite × region)
job per target — ap-southeast-6, eu-central-5, ap-south-1, and
us-east-1 — and a copy-ami-to-region.sh script that does the copy,
waits for the new AMI to reach 'available', tags the backing snapshot,
and makes both the copy and its snapshot public. Idempotent: skips if
the named AMI already exists in the target region.
The release-aggregate job already builds the manifest.json + index.html
that consumers see at tools.ops.tamanu.io/linux-images/<version>/. Make
register-ami and copy-amis each emit a small JSON fragment with the
AMI ID, region, arch, suite, and Ubuntu version of the AMI they
produced (or already-found, on idempotent re-runs). release-aggregate
downloads them all, includes them in manifest.json under a new `amis`
field, and renders a 'Launch on AWS' table on the download page with
a one-click console URL per (region × arch × suite).

The job's needs now include register-ami and copy-amis to make sure
the fragments are present, but copy-amis can partially fail without
blocking the release — release-aggregate uses always() + explicit
result checks to require only the strictly necessary jobs (image
builds + register-ami). Fragments from failed satellite regions
simply don't appear in the table.
@passcod passcod changed the title ci(aws): mirror published AMIs to satellite regions ci(aws): mirror AMIs to satellite regions and publish IDs on download page Jun 21, 2026
eu-central-5 doesn't exist; the satellite region is Zurich
(eu-central-2).
@passcod passcod enabled auto-merge June 21, 2026 20:11
@passcod passcod merged commit 6ad6fe2 into main Jun 21, 2026
67 of 69 checks passed
@passcod passcod deleted the mirror-amis-to-regions branch June 21, 2026 20:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant