Skip to content

[ci] fix npm install#60328

Merged
aslonnie merged 1 commit intoray-project:masterfrom
anyscale:lonnie-260120-npminstall
Jan 20, 2026
Merged

[ci] fix npm install#60328
aslonnie merged 1 commit intoray-project:masterfrom
anyscale:lonnie-260120-npminstall

Conversation

@aslonnie
Copy link
Collaborator

install from tarball from official source, rathar than deb.

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request refactors the Node.js installation in the CI script, switching from apt-get on Linux to a direct tarball download from nodejs.org. This is a positive change that increases control and consistency. The macOS installation logic is also cleaned up. I've added a few suggestions to further improve the script's robustness and ensure deterministic builds across platforms.

Comment on lines +167 to +168
NODE_VERSION="14"
nvm install $NODE_VERSION
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

To ensure deterministic and reproducible builds on macOS, it's best to install a specific version of Node.js, similar to how it's done for Linux (14.21.3). Using nvm install 14 will install the latest version in the v14 line, which can change over time and potentially introduce unexpected issues.

Suggested change
NODE_VERSION="14"
nvm install $NODE_VERSION
NODE_VERSION="14.21.3"
nvm install $NODE_VERSION

sudo apt-get install -y nodejs
return
fi
if [[ ! -n "${BUILDKITE-}" ]] ; then
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

For better readability and to use a more common idiom for checking if a variable is unset or empty, you can simplify [[ ! -n "${BUILDKITE-}" ]] to [[ -z "${BUILDKITE-}" ]].

Suggested change
if [[ ! -n "${BUILDKITE-}" ]] ; then
if [[ -z "${BUILDKITE-}" ]] ; then

Comment on lines +177 to +183
if [[ "$(uname -m)" == "x86_64" ]]; then
NODE_URL="https://nodejs.org/dist/v${NODE_VERSION_FULL}/node-v${NODE_VERSION_FULL}-linux-x64.tar.xz"
NODE_SHA256="05c08a107c50572ab39ce9e8663a2a2d696b5d262d5bd6f98d84b997ce932d9a"
else # aarch64
NODE_URL="https://nodejs.org/dist/v${NODE_VERSION_FULL}/node-v${NODE_VERSION_FULL}-linux-arm64.tar.xz"
NODE_SHA256="f06642bfcf0b8cc50231624629bec58b183954641b638e38ed6f94cd39e8a6ef"
fi
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The current logic assumes that any non-x86_64 architecture is aarch64. To make the script more robust and prevent it from downloading the wrong binary on other architectures, it's better to add an explicit check for aarch64 and fail with an error message for any other unsupported architecture.

Suggested change
if [[ "$(uname -m)" == "x86_64" ]]; then
NODE_URL="https://nodejs.org/dist/v${NODE_VERSION_FULL}/node-v${NODE_VERSION_FULL}-linux-x64.tar.xz"
NODE_SHA256="05c08a107c50572ab39ce9e8663a2a2d696b5d262d5bd6f98d84b997ce932d9a"
else # aarch64
NODE_URL="https://nodejs.org/dist/v${NODE_VERSION_FULL}/node-v${NODE_VERSION_FULL}-linux-arm64.tar.xz"
NODE_SHA256="f06642bfcf0b8cc50231624629bec58b183954641b638e38ed6f94cd39e8a6ef"
fi
if [[ "$(uname -m)" == "x86_64" ]]; then
NODE_URL="https://nodejs.org/dist/v${NODE_VERSION_FULL}/node-v${NODE_VERSION_FULL}-linux-x64.tar.xz"
NODE_SHA256="05c08a107c50572ab39ce9e8663a2a2d696b5d262d5bd6f98d84b997ce932d9a"
elif [[ "$(uname -m)" == "aarch64" ]]; then
NODE_URL="https://nodejs.org/dist/v${NODE_VERSION_FULL}/node-v${NODE_VERSION_FULL}-linux-arm64.tar.xz"
NODE_SHA256="f06642bfcf0b8cc50231624629bec58b183954641b638e38ed6f94cd39e8a6ef"
else
echo "Unsupported architecture for nodejs download: $(uname -m)" >&2
exit 1
fi

Comment on lines +186 to +190
curl -fsSL "${NODE_URL}" -o /tmp/node.tar.xz
echo "$NODE_SHA256 /tmp/node.tar.xz" | sha256sum -c -
sudo mkdir -p "$NODE_DIR"
sudo tar -xf /tmp/node.tar.xz -C "$NODE_DIR" --strip-components=1
rm /tmp/node.tar.xz
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

Using a hardcoded filename in /tmp can be problematic. It's safer to use mktemp to create a unique temporary file. Additionally, using a trap ensures that the temporary file is cleaned up automatically, even if the script fails midway. This improves the script's robustness.

Suggested change
curl -fsSL "${NODE_URL}" -o /tmp/node.tar.xz
echo "$NODE_SHA256 /tmp/node.tar.xz" | sha256sum -c -
sudo mkdir -p "$NODE_DIR"
sudo tar -xf /tmp/node.tar.xz -C "$NODE_DIR" --strip-components=1
rm /tmp/node.tar.xz
local tmpfile
tmpfile=$(mktemp)
trap 'rm -f "${tmpfile}"' RETURN
curl -fsSL "${NODE_URL}" -o "${tmpfile}"
echo "$NODE_SHA256 ${tmpfile}" | sha256sum -c -
sudo mkdir -p "$NODE_DIR"
sudo tar -xf "${tmpfile}" -C "$NODE_DIR" --strip-components=1

Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

@aslonnie aslonnie added the go add ONLY when ready to merge, run all tests label Jan 20, 2026
@aslonnie aslonnie force-pushed the lonnie-260120-npminstall branch from 68afdf0 to 97a194a Compare January 20, 2026 18:45
install from tarball from official source, rathar than deb.

Signed-off-by: Lonnie Liu <lonnie@anyscale.com>
@aslonnie aslonnie force-pushed the lonnie-260120-npminstall branch from 97a194a to ab46af4 Compare January 20, 2026 18:47
@aslonnie aslonnie requested review from a team and eicherseiji January 20, 2026 18:50
@ray-gardener ray-gardener bot added the devprod label Jan 20, 2026
Copy link
Contributor

@eicherseiji eicherseiji left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like unrelated failures due to 1) PyTorch CDN issues and 2) Ray Data __repr__ changes for writing-code-snippets.rst:163: DocTestFailure

@aslonnie
Copy link
Collaborator Author

yeah.. seems that this at least fixed the npm issue.. I am merging this.

@aslonnie aslonnie merged commit 6bc5e85 into ray-project:master Jan 20, 2026
5 of 6 checks passed
@dayshah dayshah deleted the lonnie-260120-npminstall branch January 27, 2026 23:23
dayshah pushed a commit to dayshah/ray that referenced this pull request Jan 27, 2026
install from tarball from official source, rathar than deb.

Signed-off-by: Lonnie Liu <lonnie@anyscale.com>
jinbum-kim pushed a commit to jinbum-kim/ray that referenced this pull request Jan 29, 2026
install from tarball from official source, rathar than deb.

Signed-off-by: Lonnie Liu <lonnie@anyscale.com>
Signed-off-by: jinbum-kim <jinbum9958@gmail.com>
400Ping pushed a commit to 400Ping/ray that referenced this pull request Feb 1, 2026
install from tarball from official source, rathar than deb.

Signed-off-by: Lonnie Liu <lonnie@anyscale.com>
Signed-off-by: 400Ping <jiekaichang@apache.org>
ryanaoleary pushed a commit to ryanaoleary/ray that referenced this pull request Feb 3, 2026
install from tarball from official source, rathar than deb.

Signed-off-by: Lonnie Liu <lonnie@anyscale.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

devprod go add ONLY when ready to merge, run all tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants