Log in to Docker Hub before image pulls in reusable build workflows #37
Labels
No labels
priority/P0
priority/P1
priority/P2
priority/P3
size/L
size/M
size/S
size/XL
size/XS
state/done
state/in-progress
state/in-review
state/needs-refinement
state/ready
type/bug
type/chore
type/feature
type/refactor
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
amtronics/platform-actions#37
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Context
Reusable build and release workflows pull base images from
docker.ioanonymously. All repositories share one home IP, so Docker Hub's anonymous per-IP pull cap turns a burst of releases intotoomanyrequestsfailures. A public-repo read-only token (DOCKER_HUB_READ_PUBLIC) exists; workflows have to use it. The runner-side login is a separate issue inamtronics/infrastructure-vps.Scope
docker login docker.iostep in every reusable workflow that builds or pulls images, reading the token and username from secrets; registering the secret on every org and on theahmaduser's repositories; documenting the secret.Acceptance criteria
docker.ioare authenticated.Runner side: amtronics/infrastructure-vps#395.
Taking this. Plan, and two things about the scope that are worth settling before I write anything rather than after.
What changes.
templates/release.ymlis the only thing here that builds images: it runsdocker/build-push-actionand logs in togit.ahmadelmasri.com, but the base images in eachDockerfilecome fromdocker.ioanonymously. Adocker/login-actionstep againstdocker.io, guarded so it is skipped when the secret is absent, goes before the build.README.mdgains the secret's row.Ambiguity 1 — "reusable workflow" is not what this repo ships, and it changes what the first acceptance criterion can mean. There is no
workflow_callhere.templates/release.ymlis copied into each app, so changing it authenticates new copies and any app that re-converges, and does nothing for the copies already inahmad/portfolio,ahmad/expiro,ahmad/imamahand the rest. Safest interpretation, and the one I am taking: fix the single source, and treat retrofitting the existing copies as separate work per repository rather than quietly editing six repos from an issue that names none of them. I will list which copies need it when I open the PR so the follow-up is a known quantity, not a discovery.Ambiguity 2 — the guard has to survive a secret that is not there, and Forgejo does not evaluate
secretsin a job-levelif. The criterion asks for a visible warning rather than a failure.if: ${{ secrets.X != '' }}is not reliable at that level, so the step maps the secret intoenvand tests the variable inside the step: authenticate when it is set, print a warning and carry on when it is not. That also keeps the action honest with this repo being public — the credential arrives from the caller and is never referenced anywhere but the caller's ownsecretscontext.What I am not doing: registering the secret. The third criterion — the secret present on each org and repository, read back by name — is credential handling, which I escalate rather than perform. I will not read
DOCKER_HUB_READ_PUBLICout of the workspace store or POST it anywhere. When the PR is up I will say exactly which scopes need it and how to verify presence by name, and that step stays with the platform admin.So this PR closes the first, second and fourth criteria; the third is handed over explicitly rather than left looking done.
PR #41 is merged (
a41b99eb). Recording what is done, what is left, and one correction that matters for how this issue reads.Done — criteria 1, 2 and 4.
templates/release.ymllogs in todocker.iobefore building, guarded so a caller without the secrets warns and builds anonymously instead of failing; the README documents both secrets by name, type, scope and location. Verified by mutation, and independently reproduced in review: deleting the guard produces exactly the failure criterion 2 forbids.Correction, raised in review and worth having in the issue itself: this does not fix the failures the fleet actually had today. Every captured tail says the same thing:
That is a connectivity failure, not
toomanyrequests. And it times out reachingauth.docker.io— the very endpointdocker logintalks to — so an authenticated pull would have failed at the same handshake. The hours lost onahmad/expiro#31overnight were that, not the pull limit.This issue is still correct and worth having: the per-IP anonymous cap is real, shared by every repository here, and unguarded. But it is a fix for a problem the fleet will have, not the one it just had. The one it just had is
amtronics/infrastructure-vps#395. Saying so here because "authenticate Docker Hub pulls" reads like the answer to what everyone watched fail, and treating it as such would leave the real cause unattended.Left — criterion 3, and it is yours: registering the secrets.
DOCKER_HUB_USERamtronics,bayan,suhba; and theahmaduser's repositoriesDOCKER_HUB_READ_PUBLICI have not read either value or sent it anywhere; that is credential handling and I escalate it rather than perform it. Presence can be confirmed without exposing anything —
GET /api/v1/orgs/{org}/actions/secretsandGET /api/v1/repos/{owner}/{repo}/actions/secretsreturn names only.Until they exist, every build warns and pulls anonymously, which is exactly today's behaviour — so nothing regresses while this waits.
Also left, tracked elsewhere: #42 propagates the step to the eleven repositories already holding a copy of the template, and #43 covers the template being unvalidated by the checker — raised in review too, since this PR is the first to put shell there that eleven repositories will copy.
Unassigning myself and returning this to
state/ready: the code half is merged and the half that remains is not mine to do.