Bake
A stock create installs the harnesses under cloud-init, which takes minutes. Baking pays that cost once:
pier bake # one throwaway instance + your .pier-bake.sh, snapshotted as an AMICreates from a baked image drop to about 60-90 seconds.
Images are toolchains, sessions are state
Section titled “Images are toolchains, sessions are state”Baked images are keyed to the repo, so one project’s toolchain never bleeds
into another’s. pier bake installs tools. Deps, migrations, and env
belong to .pier-setup.sh at boot.
Cloud-init is guarded and identical on stock and baked images. Every install step is a no-op when the image already has it. Baking is an optimization, never a requirement.
Lifecycle
Section titled “Lifecycle”Re-baking supersedes the old image. pier teardown sweeps all baked
images by tag.
- Bake hooks live only in baked images. A repo with a
.pier-bake.shthat was never baked runs stock. Setup then fails loudly, not silently. - Bake needs three extra AWS permissions:
ec2:CreateImage,ec2:DeregisterImageandec2:DeleteSnapshot.