Deploys Are Commits¶
Learning objectives
By the end of this module you should be able to:
- Explain why build duration is a reliability variable, not just a cost variable — and why shrinking a build window removes a failure class rather than a failure count.
- Describe content-addressed base images and why a hash comparison is a better rebuild decision-maker than a human.
- Explain what changes when the unit of deployment becomes an immutable digest promoted by a reviewed change record instead of a command typed at a terminal.
- Recognize when an environment being temporarily offline should be a non-event, and what makes it one.
A build that takes 46 minutes fails differently¶
Here's an inconvenient property of long-running work: the probability that something interrupts it scales with how long it runs. A machine restarts, a network blips, a laptop lid closes. None of these are anyone's fault, and none of them are worth a post-mortem — individually. Collectively, they mean a 46-minute build fails for environmental reasons at a rate a 3-minute build simply doesn't.
That reframes the goal. You don't harden a long build by retrying it more patiently; you make it short. And the way to make a heavy build short is to notice that almost none of it changes from day to day.
The base image and the hash that decides¶
A document-processing service is typically a few megabytes of your code sitting on gigabytes of dependencies — parsing libraries, OCR tooling, system packages — that change perhaps monthly. Splitting the image in two puts everything slow-changing in a base image and everything fast-changing in a thin layer copied on top. Routine builds drop from tens of minutes to a few, because they only rebuild what actually changed.
The interesting design question is: who decides when the base rebuilds? The wrong answer is a person, because people forget, and a base image that someone forgot to rebuild is a supply-chain drift you can't see. The right answer is a hash. Tag the base with a digest of its inputs — the dependency lockfile and the build recipe. When those inputs change, the tag changes, the registry doesn't have it yet, and the pipeline rebuilds — mechanically. When they haven't, the check is a ten-second lookup. Same inputs, same image, no meetings.
This only works if the inputs are actually pinned. A dependency list of "at least version X" resolves differently on different days, which quietly breaks the whole contract — so the hash covers a compiled lockfile of exact versions, and updating a dependency means changing that file in a reviewed change, where the new base gets built and tested before it's merged.
From "run this command" to "merge this change"¶
Most platforms deploy imperatively: a person or a script tells each environment to restart onto a new version. It works — until you ask operational questions. What exactly is running in region two? When did it change? Who changed it? Why does it differ from region one? Imperative deploys answer these with archaeology.
The declarative alternative inverts control. Environments continuously reconcile themselves against a declared desired state, and deploying means changing the declaration: promote the new build's immutable digest into the declaration, and every environment converges on it. The deploy is the change record. Rollback is reverting it. The audit trail is the history you already keep for code.
Two properties fall out that are easy to underestimate:
- The tested artifact is the deployed artifact, bit for bit. Digests don't float. A label like "latest" can point at different contents an hour apart; a digest can't.
- Offline environments stop being special. If a region is asleep or unreachable when the declaration changes, nothing needs to be replayed later — it converges the moment it returns, because convergence is its steady-state job, not a step someone performs.
The boundary still wins¶
One caveat keeps the design honest: some publishing jobs exist precisely because a resource is not reachable from the outside — pushing policy bundles to storage that lives inside a security boundary, for example. Moving builds to disposable hosted infrastructure is right for everything that talks to public registries; it is exactly wrong for the one job whose entire purpose is being inside the boundary. A mature pipeline is explicit about which jobs are which, so an infrastructure migration never silently breaks the one path that couldn't follow it.
The takeaway
Shrink the build until interruptions don't matter, let a hash decide what rebuilds, and make the deploy a reviewed, revertible change to a declaration that every environment — awake or not — converges on. At that point "what is running in production?" stops being a question you investigate and becomes a line you read.