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

Closed
kenhuang opened this issue Jun 4, 2020 · 9 comments
Closed

Reduce latency when new node versions are released #160

kenhuang opened this issue Jun 4, 2020 · 9 comments
Labels
enhancement New feature or request

Comments

@kenhuang
Copy link

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

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.

@gabrielschulhof
Copy link

@maxim-lobanov
Copy link
Contributor

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 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

@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

@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 bryanmacfarlane added the enhancement New feature or request label Jun 26, 2020
@bryanmacfarlane
Copy link
Member

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 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 =)

@dmitry-shibanov
Copy link
Contributor

Hello everyone. The check-latest input was added. By default it has false value. When it's true first of all it will try to find the latest in node-versions repository. If it's not found it'll fall back to the previous logic.

Related pull request: #165

For now I'm closing the issue. If you have any concerns feel free to ping us.

HelinaBerhane added a commit to bit-bob/Tasks that referenced this issue Sep 20, 2023
to avoid issues downloading new versions
see actions/setup-node#160 (comment) for more context
HelinaBerhane added a commit to bit-bob/Tasks that referenced this issue Sep 25, 2023
to avoid issues downloading new versions
see actions/setup-node#160 (comment) for more context
undergroundwires added a commit to undergroundwires/privacy.sexy that referenced this issue Mar 30, 2024
This commit upgrades Node.js version to v20.x in CI/CD environment.

Previously used Node 18.x is moving towards end-of-life, with a planned
date of 2025-04-30. In contrast, Node 20.x has been offering long-term
support (LTS) since 2023-10-24. This makes Node 20.x a stable and
recommended version for production environments.

This commit also configures `actions/setup-node` with the
`check-latest` flag to always use the latest Node 20.x version, keeping
CI/CD setup up-to-date with minimal maintenance.
Details:
- actions/setup-node#165
- actions/setup-node#160

Using Node 20.x in CI/CD environments provides better compatibility with
Electron v29.0 which moves to Node 20.x.
Details:
- electron/electron#40343

This upgrade improves network connection handling in CI/CD pipelines
(where issues occur due to GitHub runners not supporting IPv6).
Details:
- actions/runner#3138
- actions/runner-images#668
- actions/runner#3213
- actions/runner-images#9540

Node 20.x adopts the Happy Eyeballs algorithm for improved IPv6
connectivity.
- nodejs/node#40702
- nodejs/node#41625
- nodejs/node#44731

This mitigates issues like `UND_ERR_CONNECT_TIMEOUT` and localhost DNS
resolution in CI/CD environments:
Details:
- nodejs/node#40537
- actions/runner#3213
- actions/runner-images#9540

Node 20 introduces `setDefaultAutoSelectFamily`, a global function from
Node 19.4.0, enabling better IPv4 support, especially in environments
with limited or problematic IPv6 support.
Details:
- nodejs/node#45777

Node 20.x defaults to the new `autoSelectFamily`, improving network
connection reliability in GitHub runners lacking full IPv6 support.
Details:
- nodejs/node#46790
undergroundwires added a commit to undergroundwires/privacy.sexy that referenced this issue Mar 30, 2024
This commit upgrades Node.js version to v20.x in CI/CD environment.

Previously used Node 18.x is moving towards end-of-life, with a planned
date of 2025-04-30. In contrast, Node 20.x has been offering long-term
support (LTS) since 2023-10-24. This makes Node 20.x a stable and
recommended version for production environments.

This commit also configures `actions/setup-node` with the
`check-latest` flag to always use the latest Node 20.x version, keeping
CI/CD setup up-to-date with minimal maintenance.
Details:
- actions/setup-node#165
- actions/setup-node#160

Using Node 20.x in CI/CD environments provides better compatibility with
Electron v29.0 which moves to Node 20.x.
Details:
- electron/electron#40343

This upgrade improves network connection handling in CI/CD pipelines
(where issues occur due to GitHub runners not supporting IPv6).
Details:
- actions/runner#3138
- actions/runner-images#668
- actions/runner#3213
- actions/runner-images#9540

Node 20.x adopts the Happy Eyeballs algorithm for improved IPv6
connectivity.
- nodejs/node#40702
- nodejs/node#41625
- nodejs/node#44731

This mitigates issues like `UND_ERR_CONNECT_TIMEOUT` and localhost DNS
resolution in CI/CD environments:
Details:
- nodejs/node#40537
- actions/runner#3213
- actions/runner-images#9540

Node 20 introduces `setDefaultAutoSelectFamily`, a global function from
Node 19.4.0, enabling better IPv4 support, especially in environments
with limited or problematic IPv6 support.
Details:
- nodejs/node#45777

Node 20.x defaults to the new `autoSelectFamily`, improving network
connection reliability in GitHub runners lacking full IPv6 support.
Details:
- nodejs/node#46790
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

6 participants