-
Notifications
You must be signed in to change notification settings - Fork 31
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix GHA caches #719
Fix GHA caches #719
Conversation
be38bc1
to
ff188d7
Compare
3bc12eb
to
d7f1409
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
9a320f4
to
5919494
Compare
Thanks for the explainer! Some noob questions: What is the 123 in Do we even need caches of branches. Like, shouldn't they always be close enough to main to make the cache from main basically good enough? What about branches from forks, same as branches from nod.ai? |
123 is
Now this is on point - we don't, in fact @ScottTodd suggested (obliquely) that we just do away with caches on PRs and only cache on push to main. I keep fiddling with this PR trying to figure out why ccache is still missing/hitting on and off and I'm about to give up and do exactly this (remove caches for PRs).
I'm always confused about this - you're the one that pointed out to me that the linux script/action has always successfully cached things, even for forks. So according to that logic, everything here should work for forks. But reading the docs, which talk about how feature branches that share a common ancestor can share caches, it doesn't make sense to me - |
5919494
to
5d50235
Compare
Makes sense
Good to know. Caching just main might also mean llvm (via iree) is built less frequently in CI. Situation I have in mind: I make a PR before iree is bumped, and then I'm stuck with the cache for that PR, even after main has a cache with the bumped llvm.
Maybe the strictness needs to be introduced by other means. The first time you make a PR to IREE/torch-mlir, you need to request someone in the IREE team starts CI. If that's what you mean by 'stricter checking'. For my part I'm glad branches 'just work'. |
5d50235
to
e1d45d8
Compare
We have a few different workflows doing different things:
I have some ideas for other experiments to try tracked at iree-org/iree#18185. |
f79daaf
to
e3af51c
Compare
be3bcb5
to
c3ee770
Compare
I'm changing this PR to just not create caches for PRs. Let's see how that goes for a while. |
For the future: EDIT: but it does help on windows 🤷 In truth - you can actually pass |
7f9f3c2
to
1425494
Compare
1425494
to
7d0888a
Compare
GHA (github action) caches aren't mutable so currently we're timestamping them:
Thus PRs that run will upload new caches and push out old but useful caches, e.g., caches from main that could be used by PRs.
This PR tries to mitigate that by using either PR number (in case the cache is produced by a PR) orgithub.ref_name-N
whereN
always increments (in case the cache is produced by a branch run, like cache warming onmain
) to label the cache. The overwrite is done by first deleting any existing cache by that name and then uploading the new cache to the same label/key.So PR caches look like thisand will be fixed/reused for the duration of the PR.And caches produced bymain
look likeFYI for anyone wondering how this all works - the
restore-keys
arelongest prefix matched(see #719 (comment)); sowill create a cache with the aforementioned name but then restore the cache with
longest match(see #719 (comment)) starting fromlinux-build-test-cpp-
(including caches created by main).~~see #719 (comment)