Skip to content

CI: Cache/restore the npm network/package cache #43

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

Closed
wants to merge 3 commits into from

Conversation

DeeDeeG
Copy link
Member

@DeeDeeG DeeDeeG commented Jul 11, 2020

This saves/restores the caches of just the packages.
(Not the installed and/or compiled versions, which are in node_modules;
We have already been caching those for some time now.)

Requirements for Adding, Changing, or Removing a Feature

Requirements for Adding, Changing, or Removing a Feature

Issue or RFC Endorsed by Atom's Maintainers

Discussed here: #33 (comment)

Description of the Change

Cache not only the post-install node_modules folder, which we have been caching for some time now, but also the pre-install package/network cache that npm stores the packages from the registry in. This cache is there so you don't have to wait for your network connection to the registry, but can pull previously fetched packages straight from the hard disk.

In this case, caching it moves the network hit to "somewhere else in the Azure DevOps servers", which should hopefully be faster than hitting the npm registry.

Alternate Designs

Don't do this, and keep doing what we've been doing.

I'm trying this because I want to see if it is, in fact, faster. It's an experiment.

Possible Drawbacks

Could be slower than just hitting the npm package registry.

Or this could somehow be unreliable or add undesirable complexity. However, the Cache@2 task is very well-behaved, being more likely to gracefully step out of the way and not do anything if it can't fully restore a cache. And npm fairly heavily validates everything that goes into/come out of the cache. So hopefully there's no issue with keeping the network/package cache around for multiple runs.

Verification Process

Watch CI and see what happens.

Release Notes

N/A

@DeeDeeG DeeDeeG mentioned this pull request Jul 11, 2020
@aminya aminya force-pushed the always_restore_cache branch from e1929b3 to 6805390 Compare July 16, 2020 11:09
@aminya aminya force-pushed the always_restore_cache_plus_npm branch from 861ded2 to e1e2c0b Compare July 16, 2020 11:18
@DeeDeeG
Copy link
Member Author

DeeDeeG commented Jul 16, 2020

For the historical record: to the best of my knowledge, this PR was at commit 861ded2 before #46 was merged into master, and before this PR was then rebased on top of master again.

For convenience (and to keep that commit and its parents from being pruned), this branch exists to mark said commit, at least for now: pr-43-before-pr-46

@DeeDeeG
Copy link
Member Author

DeeDeeG commented Jul 18, 2020

I'm not sure this had any benefit. I think we can close?

@aminya if you don't mind I say we should close this.

@aminya
Copy link
Member

aminya commented Jul 18, 2020

Let's wait until we merge #50. I want to test and see if any time is saved.

@aminya aminya force-pushed the always_restore_cache branch from 6805390 to 06306b0 Compare July 19, 2020 17:56
@aminya aminya force-pushed the always_restore_cache branch from 06306b0 to cd3a463 Compare July 19, 2020 18:05
@aminya aminya changed the base branch from always_restore_cache to master July 25, 2020 07:19
@aminya aminya changed the base branch from master to always_restore_cache July 25, 2020 07:20
aminya and others added 2 commits July 25, 2020 02:25
This saves/restores the caches of just the packages as source code.
Not the installed and/or compiled versions, which are in node_modules.
(We have already been caching those for some time now.)

Co-Authored-By: deedeeg <[email protected]>
No need to "save time on network access"
if there won't be any network access at all!

Co-Authored-By: deedeeg <[email protected]>
@aminya aminya force-pushed the always_restore_cache_plus_npm branch from e1e2c0b to ee770ef Compare July 25, 2020 07:26
@DeeDeeG DeeDeeG force-pushed the always_restore_cache branch from c1f57f2 to 72c1d79 Compare July 31, 2020 01:33
@aminya
Copy link
Member

aminya commented Aug 12, 2020

This does not seem to have any benefits. I will close this.

@aminya aminya closed this Aug 12, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants