Skip to content

AMI upload, the production way - #343

Merged
daandemeyer merged 4 commits into
mainfrom
ami-upload
Oct 20, 2026
Merged

daandemeyer merged 4 commits into
mainfrom
ami-upload

Conversation

@martinpitt

Copy link
Copy Markdown
Member

A bin/tine ami alias is convenient for developers, but not suitable for production: we don't want the "build" step to have access to the AWS credentials. Split the AMI metadata build, and do the upload from two explicitly given file paths (disks and registration metadata). See individual commits for details.

The importer assembled the `RegisterImage` parameters from the bundle's
parameter JSON and a separate `uefi-data` file. Merge the latter into the
former at build time, so that the parameter JSON becomes complete
(everything except the disk itself). This makes the `[ami][uefi-data]`
subtarget redundant, so drop it.

Signed-off-by: Martin Pitt <martin@amutable.com>
The importer took the `[ami]` bundle directory and assumed its layout,
so it could only import the build in buck-out/. Make it independent of
that layout, and let it take the disk and the parameters as two separate
path arguments.

Signed-off-by: Martin Pitt <martin@amutable.com>
The [ami] bundle linked into buck-out, which was problematic: the
RegisterImage JSON could not be published as part of a release, and it
tied the *upload* of the AMI (which needs AWS credentials) to the build
(which shouldn't have access to these credentials).

Replace the bundle with a `<basename>.ami.json` that `[ami]` publishes;
that plus the disk is now everything that's necessary to upload an AMI,
outside of a built buck tree.

Signed-off-by: Martin Pitt <martin@amutable.com>
A release carries the disk as [raw.zst], as the raw is too big to copy
around. Stream a .raw.zst disk into the snapshot.

Update the docs to show how to import an AMI from the two released files
(.raw.zst and .ami.json), as that's how it should happen in production.

Signed-off-by: Martin Pitt <martin@amutable.com>
@daandemeyer
daandemeyer merged commit 7af46c2 into main Oct 20, 2026
2 checks passed
@daandemeyer
daandemeyer deleted the ami-upload branch October 20, 2026 17:08
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.

2 participants