Repository navigation
Publish Docker on the daily schedule, and move layer cache off the Actions quota - #10429
Conversation
…tions quota Two changes to one workflow, both aimed at the same symptom: the repo sat at 51.71GB of a 50GB Actions cache. Publish on the schedule, not on every merge. on.push.branches was [main] with no paths filter, so every merge built both images for two architectures and pushed them. That was 23 runs on 2026-09-06 and 14 on 2026-09-05, against one scheduled run each day. The cron already fires at 18:17 UTC, which is 11:17 in San Francisco under PDT, so that becomes the cadence for main. Tag pushes still publish immediately: a release with no image until the next morning would be worse than the spend. Dropping the main push trigger takes this workflow out of the scan in tests/studio/test_main_runs_survive_merge_bursts.py, which selects on push.branches containing main, so it needs no exemption there. The per-sha concurrency key is kept, since a scheduled run can still overlap a dispatch, and its comment now describes that rather than merge bursts. Move the layer cache to the registry. cache-to on the base build was type=gha,mode=max. mode=max exports every intermediate layer, and with several concurrent runs it wrote 127 blob entries totalling 32GB in one morning, 61% of the repo's cache, starving the GGUF model and pip caches that share the budget. A cache tag on the image's own Docker Hub repo has no such budget, so mode=max keeps its rebuild speed with no eviction pressure. Both jobs already log in to Docker Hub before building, which covers reading and writing the cache ref. The Studio build stays at mode=min. Its comment blamed the GHA quota, which no longer applies, but the remaining cost is Hub storage rather than a hard budget, so raising it is a separate decision from moving the transport. The buildcache-* tags are not touched by the cleanup job: it drops this run's core-build-/build-<run_id> handles and, on schedule, nightly pins matched by an explicit nightly-YYYY.MM.DD glob. lint_workflow_triggers.py clean; 49 docker-publish tests and the merge-burst suite pass.
|
You have reached your Codex usage limits for security reviews. Please try again later. |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: b58d184dc0
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| # moment a newer one is queued), so the earlier one would publish no image at all. | ||
| # Merges no longer trigger this workflow, so the burst it now guards against is a | ||
| # scheduled run overlapping a workflow_dispatch, rather than a merge burst. Keeping | ||
| # the per-sha key costs nothing and still prevents a dispatch being discarded. |
There was a problem hiding this comment.
Give each main publication its own concurrency key
The retained group is keyed by github.sha, not by the run, so a scheduled run and a workflow_dispatch on main normally have the same group whenever no commit lands between them. GitHub cancels an existing pending run when a newer run enters that group; therefore an overlapping manual dispatch can discard the scheduled run. Now that main pushes no longer publish, this can skip the only stable-image publication for that day. Include an event- or run-specific component for these main runs rather than relying on the SHA.
Useful? React with 👍 / 👎.
| on: | ||
| push: | ||
| branches: [main] | ||
| # Deliberately NOT branches: [main]. Publishing on every merge meant 23 runs on |
There was a problem hiding this comment.
Update the documented stable-tag cadence
After removing the main-branch push trigger, docker/DOCKERHUB.md:16 still tells users that latest and core move with every push to main. This file is automatically copied to the public Docker Hub page by the workflow, so users may expect a just-merged fix to be available immediately even though the tags now move only during the daily run. Update the published description to state the new daily cadence.
Useful? React with 👍 / 👎.
The repo is over its Actions cache budget:
active_caches_size_in_bytesreports 55.5GB across 146 caches against a 50GB limit. Two changes to one workflow, both aimed at that.1. Publish on the schedule, not on every merge
on.push.brancheswas[main]with nopaths:filter, so every merge built both images for two architectures and pushed them:The scheduled run was 1 in 24. The cron already fires at
17 18 * * *, which the existing comment notes is 11:17 in San Francisco under PDT, so that becomes the cadence for main.Tag pushes still publish immediately. A release sitting without an image until the next morning would be worse than the spend, so
tags: ['v*']is untouched. Say the word if you want tags on the schedule too.Dropping the main push trigger takes this workflow out of the scan in
tests/studio/test_main_runs_survive_merge_bursts.py, which selects onpush.branchescontaining main (_runs_on_main_push, line 134), so it needs no entry inQUOTA_BOUND. The per-sha concurrency key is kept, since a scheduled run can still overlap aworkflow_dispatch, and its comment now describes that rather than merge bursts.2. Move the layer cache off the Actions quota
cache-toon the base build wastype=gha,scope=build-...,mode=max.mode=maxexports every intermediate layer, and with several runs in flight at once it produced:buildkit-blob-1-sha256:*entries, 32.07GB, 61% of the entire repo cacherefs/heads/mainThat budget is shared with caches that are far more expensive to rebuild: 4.94GB for a gemma-4-E4B GGUF, 3.51GB for gemma-4-E2B on macOS, 12.98GB of model weights across 6 entries. Self-renewing buildkit churn permanently occupying 61% of a 50GB budget means LRU eventually evicts the multi-GB HF downloads to make room for layers that a rebuild would regenerate anyway.
Switching to
type=registryputs the cache on a tag in the image's own Docker Hub repo, which has no such budget, somode=maxis kept and rebuild speed is unchanged. Both jobs already rundocker/login-actionbefore building, which covers reading and writing the cache ref.There is a note worth preserving here: the Studio build at line 444 already used
mode=min, with the commentmode=max here would blow the 10GB GHA quota and evict the base build's cache. That diagnosis was correct, it was just applied to the smaller of the two images while the base build keptmode=max. This PR resolves that asymmetry by removing the constraint rather than by degrading the base build.The Studio build stays at
mode=min. Its stated reason no longer applies, but the remaining cost is Hub storage rather than a hard budget, so raising it is a separate decision from moving the transport.Safety
The
buildcache-core-*andbuildcache-studio-*tags are not touched by thecleanupjob. It drops this run'score-build-<run_id>andbuild-<run_id>handles, and on schedule prunes nightly pins matched by an explicitnightly-YYYY.MM.DD/core-nightly-YYYY.MM.DDglob. Neither matches.Checks
scripts/lint_workflow_triggers.py:OK: scanned 45 workflow file(s)tests/python/test_docker_publish_tag_scheme.py,test_docker_hub_readme.py,test_docker_publish_ref_freeze.py: 49 passedtests/studio/test_main_runs_survive_merge_bursts.py: 8 passedNot included
This does not delete the 32GB already in the cache. That is an Actions write and needs a credential with
actions: write; happy to follow up, though GitHub will also evict it by LRU once the inflow stops.