Skip to content
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

Reduce latency when new node versions are released #160

Open
kenhuang opened this issue Jun 4, 2020 · 8 comments
Open

Reduce latency when new node versions are released #160

kenhuang opened this issue Jun 4, 2020 · 8 comments
Labels

Comments

@kenhuang
Copy link

@kenhuang kenhuang commented Jun 4, 2020

Hi there:

Thanks for this library. Just found that the node-version option is not downloading the latest node release.

v10.21.0 release notes:
https://nodejs.org/en/blog/vulnerability/june-2020-security-releases/

Our setup:

- uses: actions/setup-node@v1
  with:
    node-version: 10.x
    registry-url: "https://registry.npmjs.org"

Logs:

Run actions/setup-node@v1
/usr/bin/docker exec  be3164773b20b9e565b79dfa087a0d06395e9681e0de57453920d34a25c07234 sh -c "cat /etc/*release | grep ^ID"
/__t/node/10.20.1/x64/bin/node --version
v10.20.1
/__t/node/10.20.1/x64/bin/npm --version
6.14.4

Update:
seems related to this change: #147

Regards
Ken

@gabrielschulhof
Copy link

@gabrielschulhof gabrielschulhof commented Jun 9, 2020

The same thing is true when specifying "v12.x". If one wants the latest version one must specify it explicitly. I needed something later than the version 12.16.3 it was grabbing when given "v12.x", so I wrote "v12.18.0" for my node-version. This is not that great though, since I wish to always use the latest release.

@maxim-lobanov
Copy link
Contributor

@maxim-lobanov maxim-lobanov commented Jun 11, 2020

Hello everyone, just to clarify how it works:

  1. actions/setup-node is trying to find version that satisfy your version spec on image
  2. If it is found - it is applied (to avoid spending time for downloading).
  3. If it is not found, it downloads latest satisfied version and install it in runtime.

Unfortunately, pre-cached versions are updated with small delay (usually, not longer than 1-1.5 weeks because images rollout takes much effort) so if you specify full version, action doesn't find it on image and downloads and installs it in runtime. If you just specify 10.x, it resolves to pre-cached version that can be outdated due to image.

@bryanmacfarlane , may be some flag similar to checkLatest in Azure DevOps UseNode task can be implemented to fix this problem. If checkLatest flag is true, we determine latest version firstly, search it on image and download if it is not found. It will help in cases where 1-2 weeks delay is not acceptable.

@bryanmacfarlane
Copy link
Member

@bryanmacfarlane bryanmacfarlane commented Jun 11, 2020

Yes, @maxim-lobanov is correct. You can specify the exact version you need and we'll read through the cache and I'm happy to add the checkLatest input to ensure you always have latest. However, realize that using that option will be trading getting the absolute latest (with no latency) for fragility when a new version is released (your scenario) - examples in this issue. We could also consider if checkLatest is specified and it fails, print a warning but fall back to latest in cache. I guess that would make it tryCheckLatest ;)

If you don't mind, I'm going to morph this issue into a tracking item for adding option to always get latest. OK?

@maxim-lobanov
Copy link
Contributor

@maxim-lobanov maxim-lobanov commented Jun 12, 2020

@bryanmacfarlane , That sounds good to me!
Probably, we can determine the latest version based on manifest instead of nodejs.org. In this case, we will keep good stability. We are trying to keep manifest up-to-date and upload new versions in 1 day that should be acceptable timeline (considering automation of uploading new versions in future).

@bryanmacfarlane
Copy link
Member

@bryanmacfarlane bryanmacfarlane commented Jun 25, 2020

@kenhuang

It's not related to #147

You're using v1 ( uses: actions/setup-node@v1) and those changes only went to v2-beta

@bryanmacfarlane
Copy link
Member

@bryanmacfarlane bryanmacfarlane commented Jun 26, 2020

I think we should enhance the actions/node-versions releases so they are updated everyday. That (1) provides the reliability we get from releases / CDN while at the same time (2) offering new versions with minimal latency. Reading through directly to node dist will completely eliminate the latency but at the same time, it will expose the fragility of failed downtimes when new releases are made from node - the very scenario here.

@bryanmacfarlane bryanmacfarlane changed the title Outdated 10.x, 10.21.0 is released, still using 10.20.1 Reduce latency when new node versions are released Jun 26, 2020
@debborafernandess
Copy link

@debborafernandess debborafernandess commented Sep 4, 2020

Hello everyone, just to clarify how it works:

  1. actions/setup-node is trying to find version that satisfy your version spec on image
  2. If it is found - it is applied (to avoid spending time for downloading).
  3. If it is not found, it downloads latest satisfied version and install it in runtime.

Unfortunately, pre-cached versions are updated with small delay (usually, not longer than 1-1.5 weeks because images rollout takes much effort) so if you specify full version, action doesn't find it on image and downloads and installs it in runtime. If you just specify 10.x, it resolves to pre-cached version that can be outdated due to image.

@bryanmacfarlane , may be some flag similar to checkLatest in Azure DevOps UseNode task can be implemented to fix this problem. If checkLatest flag is true, we determine latest version firstly, search it on image and download if it is not found. It will help in cases where 1-2 weeks delay is not acceptable.

This enlightenment was awesome!
Helped me configure my project in just 5 minutes, tks for that @maxim-lobanov =)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
5 participants
You can’t perform that action at this time.