Repository navigation
[CI] Only save the pretrained model cache on pushes to main - #2179
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #2179 +/- ##
=======================================
Coverage 97.62% 97.62%
=======================================
Files 170 170
Lines 10744 10744
=======================================
Hits 10489 10489
Misses 255 255
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
The models are cached with actions/cache, which saves in a post-job step whenever the restore missed. A pull request that misses writes its own branch-scoped copy, and such a copy is visible only to that pull request. doctr-models-pytest-torch-v1 is 5.7 GB against a 10 GB repository limit, so one of those pushes main's entry out and the next run misses again. Every cache the repository holds today is scoped to a single pull request, and there is none on refs/heads/main: 5678838518 refs/pull/2177/merge doctr-models-pytest-torch-v1 437478278 refs/pull/2177/merge setup-python-... 7394980 refs/pull/2177/merge torchinductor-... 3372 refs/pull/2177/merge index-torch-viz-html-... So keep actions/cache on pushes, where its post-job save is what fills main's entry, and restore only on everything else. Twenty jobs across main.yml, references.yml, scripts.yml and demo.yml take this cache from the input's default, so the choice belongs in the action rather than in a save step per workflow.
179a4ed to
3ea89cb
Compare
|
Reworked. The first version added a save step to each workflow, which was both wider and incomplete: I had missed that This version branches on the event inside |
felixdittrich92
left a comment
There was a problem hiding this comment.
@quotentiroler Really nice addition thanks a lot 👍
Follows up #2171 (point 2).
The models are cached with
actions/cache, which saves in a post-job step whenever the restore missed. A pull request that misses writes its own branch-scoped copy, and such a copy is visible only to that pull request.doctr-models-pytest-torch-v1is 5.7 GB against a 10 GB repository limit, so one of those pushes main's entry out and the next run misses again. Every cache the repository holds right now is scoped to a single pull request, and there is none onrefs/heads/main:So keep
actions/cacheon pushes, where its post-job save is what fills main's entry, and restore only on everything else.Twenty jobs take this cache from the input's default (14 in
references.yml, 3 inscripts.yml, 2 inmain.yml, 1 indemo.yml), so the choice belongs in the action rather than in a save step per workflow.Testing
actionlintreports nothing in.github/actions/setup-env/action.yml, on this branch and on main.The caching itself only shows on real runs, so the first push to main after merge is what fills the entry. On this PR's own run you can see the miss it is about:
evaluate-text-recognitionloggedCache not found for input keys: doctr-models-evaluate-text-recognition-v1.The
references / evaluate-text-recognitionfailure here is a network timeout (URLError: [Errno 110] Connection timed out) in the evaluation step, unrelated to this change. It reproduces on #2178, which touches no CI.