Repository navigation
feat(infra): roll the dev platform release from CI on main (§14.2's Helm half) - #353
Merged
Merged
Conversation
…elm half) Completes infrastructure.md §14.2. The Terraform half landed in #352; this is "Dev platform releases apply from CI on `main`; `make dev-up` stays a human command." ## §14.2's clause had no target, so this gives it one `er-platform` is only ever installed into a PER-DEVELOPER namespace: its `developer` value defaults to the release namespace and names the §9 Secrets Manager entries `er/{environment}/{developer}/…`. There is no shared dev release. That left two readings of "applies from CI on main": (a) redeploy every developer's namespace — which restarts a pod someone is mid-debug on, and contradicts the very next clause in the same sentence; (b) give CI a namespace of its own. (b), by operator decision. CI owns exactly one namespace and cannot touch a developer's; `make dev-up` is untouched. The namespace is **`ci`**, not the suggested `dev`: the name becomes the `developer` value and lands in secret paths, where `er/dev/dev/erserver` reads like a mistake, and `ci` cannot collide with a real developer's name. ## Promote-by-digest, enforced rather than assumed §14.2 requires a deploy to pass a DIGEST, never a tag, and to gate on that digest being present first — and `er-platform`'s own values.yaml already cites that section next to its `digest` fields. The job resolves both digests from ECR and refuses to continue if either is absent. Images are sha-tagged and built only when their own tree moved, so for any given commit one of them may legitimately have no sha tag. That case reuses the newest digest already in the registry — which IS what is running — and logs that it did. Nothing is ever deployed by tag. `needs: [detect, er-api, er-web]` with `always() && !cancelled()`, because a rust-only commit SKIPS er-web and a plain `needs` would skip the deploy with it. A skipped image job and a FAILED one must not mean the same thing, so the first step inspects both results and refuses to deploy a failed build rather than rolling out a half-built commit. `--atomic` on the platform release: a failed upgrade rolls back instead of leaving half a release in the namespace. ## Also - `images.yml` now triggers on `infra/k8s/**` and `scripts/dev_env.sh`, because a change to either IS a platform release even when no image moved. Previously a chart-only commit would have deployed nothing. - The namespace's EFS access point and secrets come from the same `scripts/dev_env.sh up` that `make dev-up` runs, so CI and a human provision a namespace identically rather than by two drifting paths. - The eks module gains a `cluster_arn` output, so the role's `eks:DescribeCluster` is scoped to this cluster instead of `*`. - helm is a version-pinned tarball, not a third-party action — the same choice rust.yml's disk-reclaim step documents, and it avoids adding a `uses:` whose SHA I would have had to pin. ## NOT verified, and one caveat worth reading `er-ci-deploy-dev` does not exist until `envs/dev` is applied, so this job's first run fails at role assumption exactly as infra.yml's plan jobs do. Nothing here has touched the live cluster. The role gets cluster-admin, because that is what this module's `admin_principal_arns` grants (the access entry associates AmazonEKSClusterAdminPolicy). A namespace-scoped access entry is the narrower shape and is worth doing if this role gains a second caller; for one namespace-scoped release whose trust is pinned to pushes on `main`, the extra moving part buys little. Said out loud in eks.tf rather than left to be noticed. Prefer making the first real rollout a deliberate `workflow_dispatch` rather than whatever the next merge happens to be. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Completes infrastructure.md §14.2. The Terraform half landed in #352; this is
"Dev platform releases apply from CI on
main;make dev-upstays a humancommand."
§14.2's clause had no target, so this gives it one
er-platformis only ever installed into a PER-DEVELOPER namespace: itsdevelopervalue defaults to the release namespace and names the §9 SecretsManager entries
er/{environment}/{developer}/…. There is no shared devrelease. That left two readings of "applies from CI on main":
(a) redeploy every developer's namespace — which restarts a pod someone is
mid-debug on, and contradicts the very next clause in the same sentence;
(b) give CI a namespace of its own.
(b), by operator decision. CI owns exactly one namespace and cannot touch a
developer's;
make dev-upis untouched.The namespace is
ci, not the suggesteddev: the name becomes thedevelopervalue and lands in secret paths, whereer/dev/dev/erserverreadslike a mistake, and
cicannot collide with a real developer's name.Promote-by-digest, enforced rather than assumed
§14.2 requires a deploy to pass a DIGEST, never a tag, and to gate on that
digest being present first — and
er-platform's own values.yaml already citesthat section next to its
digestfields. The job resolves both digests fromECR and refuses to continue if either is absent.
Images are sha-tagged and built only when their own tree moved, so for any given
commit one of them may legitimately have no sha tag. That case reuses the newest
digest already in the registry — which IS what is running — and logs that it
did. Nothing is ever deployed by tag.
needs: [detect, er-api, er-web]withalways() && !cancelled(), because arust-only commit SKIPS er-web and a plain
needswould skip the deploy with it.A skipped image job and a FAILED one must not mean the same thing, so the first
step inspects both results and refuses to deploy a failed build rather than
rolling out a half-built commit.
--atomicon the platform release: a failed upgrade rolls back instead ofleaving half a release in the namespace.
Also
images.ymlnow triggers oninfra/k8s/**andscripts/dev_env.sh, becausea change to either IS a platform release even when no image moved. Previously
a chart-only commit would have deployed nothing.
scripts/dev_env.sh upthatmake dev-upruns, so CI and a human provision anamespace identically rather than by two drifting paths.
cluster_arnoutput, so the role'seks:DescribeClusteris scoped to this cluster instead of*.rust.yml's disk-reclaim step documents, and it avoids adding a
uses:whoseSHA I would have had to pin.
NOT verified, and one caveat worth reading
er-ci-deploy-devdoes not exist untilenvs/devis applied, so this job'sfirst run fails at role assumption exactly as infra.yml's plan jobs do. Nothing
here has touched the live cluster.
The role gets cluster-admin, because that is what this module's
admin_principal_arnsgrants (the access entry associatesAmazonEKSClusterAdminPolicy). A namespace-scoped access entry is the narrower
shape and is worth doing if this role gains a second caller; for one
namespace-scoped release whose trust is pinned to pushes on
main, the extramoving part buys little. Said out loud in eks.tf rather than left to be noticed.
Prefer making the first real rollout a deliberate
workflow_dispatchratherthan whatever the next merge happens to be.
Co-Authored-By: Claude Opus 5 (1M context) [email protected]
🤖 Generated with Claude Code