Skip to content

Clean up the erlang per-arch repos too - #281

Merged
ericmj merged 3 commits into
mainfrom
docker-cleanup-erlang-repos
Jul 30, 2026
Merged

Clean up the erlang per-arch repos too#281
ericmj merged 3 commits into
mainfrom
docker-cleanup-erlang-repos

Conversation

@ericmj

@ericmj ericmj commented Jul 30, 2026

Copy link
Copy Markdown
Member

The erlang per-arch repos were left out of the cleanup because DockerChecker.expected_elixir_tags/0 reads those rows to decide which Elixir images to build. It ranks them by version rather than by date, so the newest tag of an old OTP line stays in use however old it gets and a plain age cutoff would delete it.

Keeping the erlang tags whose os_version the build matrix currently targets is enough to protect that, and costs 420 of the 71,061 stale erlang tags. Both sides read the same builds(): a build request whose os_version is not current is expired rather than built, so a request can never need a base image the cleanup has taken. The os_versions are re-read per batch so a base image released mid-run pulls the tags built against it back under protection, and the per-chunk re-check applies the same rule.

Every Elixir image is FROM hexpm/erlang-${ARCH}:${ERLANG}-${os}-${OS_VERSION}, and an elixir build request does not reserve that base tag. It does not need to, given the above, and request_jobs/1 already enqueues the erlang build instead of the elixir one when the base is missing.

:repos goes with it. It existed to point one node at each per-arch repo on the theory that Docker Hub metered per source IP; it meters per account, so a second node draws down the same budget and the two together get no more through than one. Nothing passes the option, so the repo list stops being a parameter and the filter that kept a caller from aiming the deleter at a manifest repo goes with it.

The dry run no longer claims a scheduled run stops at one batch. It has cleared the whole backlog since #279.

ericmj added 2 commits July 30, 2026 15:47
The erlang per-arch repos were left out because
DockerChecker.expected_elixir_tags/0 reads those rows to decide which
Elixir images to build. It ranks them by version rather than by date, so
the newest tag of an old OTP line stays in use however old it gets and a
plain age cutoff would delete it.

Keeping the erlang tags whose os_version the build matrix currently
targets is enough to protect that, and costs 420 of the 71,061 stale
erlang tags. The os_versions are re-read per batch so a base image
released mid-run pulls the tags built against it back under protection,
and the per-chunk re-check applies the same rule.

Docker Hub meters the API per account, not per source IP. A pod deleting
at 27 requests/minute from one node was pushed to 56 429s in 92 requests
by a second node bursting from a different IP, with x-ratelimit-remaining
reaching -534 on both. Scoping a repo per node cannot buy throughput.
It existed to point one node at each per-arch repo, which the account
budget makes pointless. Nothing passes it, so the per-arch repo list
stops being a parameter and the filter that kept a caller from aiming
the deleter at a manifest repo goes with it.

The dry run no longer claims a scheduled run stops at one batch; it has
cleared the whole backlog since #279.
@ericmj
ericmj marked this pull request as ready for review July 30, 2026 22:57
`x <> ALL('{}')` is true, so an empty os_version list protected no erlang
tag rather than every one of them. `builds()` is empty on a database
whose base_image_tags have never been populated, and it drops a line
whose regex matches nothing, so the input that means "the matrix could
not be read" was the input that deleted the most. It now holds the
erlang repos back entirely. A tag whose metadata carries no os_version
is spelled out as kept rather than left to `NULL <> ALL(...)`.

The os_versions are pinned for the run like the cutoff. Re-reading them
per batch removed protection as readily as it added it: a base image
released mid-run rotates the os_version it replaces out of the matrix,
and a run lasting days would then delete the erlang tags on it before
the checker had built their replacements.

An elixir request now reserves the erlang image it builds FROM. Expiring
a request only sets its state, leaving any build already enqueued, so a
job could outlive the protection its base image had and fail on a
missing FROM.
@ericmj
ericmj merged commit 417d841 into main Jul 30, 2026
4 checks passed
@ericmj
ericmj deleted the docker-cleanup-erlang-repos branch July 30, 2026 23:55
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.

1 participant