-
Notifications
You must be signed in to change notification settings - Fork 30
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
Always restore cache #33
base: master
Are you sure you want to change the base?
Conversation
Okay, we can try this. Better to use fallbacks though. Hits the more specific match if it can, then falls back to a more generic/loose match if possible. Keep everything in the Add |
Something like this: key: 'npm | "$(Agent.OS)" | "$(buildArch)" | apm/package.json, apm/package-lock.json, script/vsts/platforms/windows.yml'
restoreKeys: |
npm | "$(Agent.OS)" | "$(buildArch)" | apm/package.json, apm/package-lock.json
npm | "$(Agent.OS)" | "$(buildArch)" Oh and apparently we can cache the "system global npm package cache" somehow, not just the installed |
3345ae7
to
6413b15
Compare
Done in b766569 |
If we set this we can cache one more part of CI to run strictly from Azure servers. (Avoid network calls to npmjs.com). |
Nice |
Where do we need the global npm cache? It is better to first fix the current caching system before trying new folders. |
👍 Agreed. |
Maybe the new runs will upload their caches as the strict identifier AND the loose identifiers. So we might have plenty of chances to hit cache going forward. I'd like to see if that's what happens at the cache save for the current run. By the way, we should make sure it still bootstraps after an inexact cache hit, right? I think we are already set to do that, because |
I removed bootstrap skipping in 6413b15. If we want to use cache when we change package.json, etc, we need to remove this line. |
If we get an exact cache restore for all three, then we do want to skip bootstrapping IMO. It would be a plain win to revert that, IMO. Bootstrap skipping is nice. It only skips when all three are perfectly exactly matched. I was thinking ahead to inexact hits/restores I guess, but never followed up. You are on a roll with these by the way. We are going to give upstream a bit of a heart attack if we try to post these to them though, lol. No one likes an outside contributor saying "Hey, I can contribute a change to the thing that lets you know if you broke your app!" And even for our own sake we should watch this closely that it doesn't, well, break our CI to do inexact cache restores and re-bootstrap on top of that. Anyway, if it interests us, no reason we can't do it. Upstream and us don't have to say exactly close. Just close enough that we can track and integrate on top of their work. And hopefully upstream stuff to benefit the widest community possible. (And hey, upstreaming helps to ensure they don't break our stuff, lol. So we make it "our [collective] stuff" and help them out. Open source is beautiful.) |
6413b15
to
b766569
Compare
OK. I reverted that. I changed the target branch for simpler diff. |
Maybe we can cache Windows build tools and dependencies... I'm just afraid we're going to have nothing but 39 cache steps pretty soon. |
Those don't take much time. I prefer caching for something that takes a lot of time. If we could write the cache steps in a more compact way, we could try that. see #1 (comment) |
I just realized we haven't run the PR pipeline on I think we should manually run the PR Pipeline for Edit: That would be hard to remember, though. We may as well run it on a schedule. Once every day maybe. |
@DeeDeeG We can set a pull request trigger for the master branch. That should be possible in Azure UI. |
@aminya Good idea! It should also be possible in the yaml if you prefer. Something like
|
3781498
to
44183eb
Compare
b766569
to
6641f92
Compare
bdf0219
to
82d8c06
Compare
6641f92
to
e1929b3
Compare
I don't support this PR's approach. I think it's working alright as it is. Can we close this? |
Could you give us a reason for your opinion? If I want to do this I will revert your commits that remove |
It casts a wider net for restoring stuff, including things that might be out of date for reasons we haven't foreseen or prepared for. Dealing with potentially more diverse inputs from more scenarios makes the job of handling it correctly harder, including handling weird edge cases. "Trusting that Part of the tradeoff with CI is that you make it a simple, clean install, no matter what, and maybe you can optimize within that rule. I just feel like this violates the principle of CI, that you should never wonder of your CI caused a bug; It should be as clear as possible that CI did NOT cause the bug. And in case CI did cause a bug, you'd want it to be obvious. The failure modes if this doesn't work out would be maddeningly obscure. I don't like that this adds complexity, both in terms of real exposure to more diverse behavior, and in terms of how one needs to mentally model the cache restoration if debugging it. Atom is a very large app with some weird edge cases (custom I am also not confident in our track record of properly waiting to vet things, when the things that can go wrong are obscure. There are a lot of edge cases I still haven't wrapped my mind around with this one, and I feel like we're walking into a trap of our own making on this. Finally: Minimal benefit. This can at most save "[time to fully bootstrap] - [time to restore whichever caches were hit]". Which is usually on the order of seven to fourteen minutes or so, I think. The amount of time to debug this, and the lack of peace of mind (did CI restore something that's now broken in this new context?), is not worth that. Once a PR has had a single passing build stage of any commit, it should be able to restore the bootstrap from that. We certainly haven't collected the information to do a cost-benefit analysis. I can't list the pros clearly, nor the cons. We're just skipping part of the process where you finalize then re-review the final design, IMO. Once something is thrown together that passes CI, we post it to |
P.S. by using |
I'd much prefer us push something like this PR over the finish line at upstream: atom#18808 |
Sorry, the comment and close issue button are right next to each-other! Did not mean to close this. |
f3c93bd
to
e1645f5
Compare
87c664d
to
67dcaef
Compare
d5b2b31
to
1808785
Compare
What's the news on this PR? It is inactive for some time.... |
Edit: turns out
npm ci
deletes all the restored cache. This PR means we should decide between the reliability of CI vs the time it takes to bootstrapWe should restore the
node_modules
cache even if we change package.json.npm install
is smart enough to not redo everything from scratch! In this case, however, we should not skip the bootstrap phase completely. It will automatically become faster due to npm's smartness.This branch is based on #31. Needs rebase and adding it for other platforms for final merging.