-
Notifications
You must be signed in to change notification settings - Fork 54
Use my template ? #7
Comments
My condolences.
Can you explain the "fall back when the freeze plan is different" bit? does it mean that if the freeze file is different from the cache, it will not start from scratch and will instead pick a random cache entry which uses the same OS and GHC? |
Exactly. |
A bit more precise: The newest cache entry with same OS + GHC is used. See here for the docs. Also, I would suggest some minor updates: https://gist.github.com/amesgen/f39e84a911cfc843bf9f7298f1dd22d9 (also see the diff)
|
these are really good suggestions, i'll have a go at iterating on these later today/this week also instead of using the hash of the freeze file, i noticed in the new haskell-ci style template that they have also thanks @amesgen for answering samuel's question, i didnt have time this past weekend .. |
The current best practice in order to get the cache behaving most efficient with cabal is to cache everything by utilizing The subtle bit is in the key. What you want is you want to always upload the new cache in an append only manner for hermetic caches like cabal's (or bazel's, etc), but this is not possible with github's cache by default as they don't upload the new cache on a cache-hit. So what you do is:
|
To answer the original question at the top, I'd be perfectly happy to expand out the examples and include something very similar to yours. I plan to eventually have an examples directory where all the examples live and run most of them automatically in github actions (as well as having the simplest ones in the README). I'll be sure to include an example utilizing |
Glad to hear you want automatic caching, since I already did that in setup-agda, so it won't be too much trouble making a PR with this. |
I observed that CI does not run for some PRs. Actually, there was no explicit trigger. This PR adds this trigger (`pull_request`) plus a manual trigger (`workflow_dispatch`). It also restricts the `push` trigger to the `master` branch, to avoid duplicate runs when opening a PR. This means that CI basically only runs if you open a PR (or push to master, of course). So if you want to test changes, it is not sufficient to push to your feature branch, you also need to open a PR. (Of course, more branch patterns could be added to the `push` trigger if one wants to run CI on new features without opening PRs.) The PR also refines the cache logic to: haskell/actions#7 (comment)
@hazelweakly wrote:
So, if I understand this correctly, some cache (usually the most recent) will always restored, and the updated build dirs will always be recached. Isn't this risking that the build dirs grow out of hand, accumulating old builds? Would be nice to get some stats on the cache contents after a 1000 CI runs... |
i think github evicts caches after a month, but i'm not current on the
details
…On Tue, May 17, 2022 at 1:14 PM Andreas Abel ***@***.***> wrote:
@hazelweakly <https://github.com/hazelweakly> wrote:
2. But, given that it's harmless to have bad stuff in the cache, what I
tend to do is set multiple cache fallbacks,
So, if I understand this correctly, some cache (usually the most recent)
will always restored, and the updated build dirs will always be recached.
Isn't this risking that the build dirs grow out of hand, accumulating old
builds? cabal does not clean up old builds, and it is eager to rebuild
stuff with a new hash if some dependency changed somewhere, or a stone fell
off the volcano on Mars. So, wouldn't the cache entry grow fatter and
fatter until it squeezes other entries out of the cache or busts the GitHub
cache limit in the end?
Would be nice to get some stats on the cache contents after a 1000 CI
runs...
—
Reply to this email directly, view it on GitHub
<#7 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAABBQWXYOYRJU3DLQX5TILVKPHYDANCNFSM4UZYINRQ>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
This would not help if you use CI continuously (e.g. in Agda it runs daily) and the cached directory accumulates old builds. Github cannot shrink a cache entry (how would it know what to discard?), it can only remove it. So if your entries grow to big, caching becomes dysfunctional. |
I think each time you save it’s a different hash digest key. …
…On Thu, May 19, 2022 at 10:34 AM Andreas Abel ***@***.***> wrote:
i think github evicts caches after a month
This would not help if you ruse CI continuously (e.g. in Agda it runs
daily) and the *cached directory accumulates old builds*. Github cannot
shrink a cache entry, it can only remove it. So if your entries grow to
big, caching becomes disfunctional.
—
Reply to this email directly, view it on GitHub
<#7 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAABBQQYX7GMP6ZNBPPWM3LVKZGPDANCNFSM4UZYINRQ>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
https://github.com/cartazio/ralist/blob/cd2a6c65baf4b4ee7f8d316e57e282087f89c07e/.github/workflows/hs-matrix.yml
Or provide it as an example.
I still wanna tweak some things. But it has a lot of nice things like working caching. Plus a small digital memorial for my recently passed grand parent
The text was updated successfully, but these errors were encountered: