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

chore: bump to node 21.1.0 #5361

Merged
merged 27 commits into from
Nov 9, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
bf27c7b
chore: bump to node 21.1.0
TimBeyer Nov 7, 2023
dedc25f
chore: fix linter complaint
TimBeyer Nov 7, 2023
3fe2016
chore: use new npm modules cache
TimBeyer Nov 7, 2023
c623722
fix: ts-node/esm module loader
TimBeyer Nov 7, 2023
e900a0e
fix: try to see if an explicit import hook register works to fix ts-n…
TimBeyer Nov 7, 2023
2599be5
chore: fix shebang lines
TimBeyer Nov 7, 2023
650f99a
fix: install nodejs using fnm (if needed)
stefreak Nov 7, 2023
0e82bcd
fix: checksum
stefreak Nov 7, 2023
783fc53
fix: use getAbi correctly
stefreak Nov 7, 2023
80e4a58
chore: test nodejs version as separate step
stefreak Nov 7, 2023
ceaf0f2
Merge branch 'main' into chore/bump-node
stefreak Nov 7, 2023
14dd9e4
fix: make nodejs install work with machine executor
stefreak Nov 7, 2023
29cb6cf
chore: update node-pty-prebuilt-multiarch to 0.11.10
stefreak Nov 7, 2023
4e9540a
chore: bump typescript types and eslint packages
TimBeyer Nov 9, 2023
7810c19
chore: make no-explicit-any a warning only
TimBeyer Nov 9, 2023
68e3f2d
fix: consistent versions for node-pty-multiarch
stefreak Nov 9, 2023
10a0dc4
fix: alpine docker sha hash
stefreak Nov 9, 2023
39caba1
fix: clean up unwanted log messages in the release binary
stefreak Nov 9, 2023
02e7fd8
fix: musl checksum
stefreak Nov 9, 2023
cd987a4
fix: avoid issues due to cache poisoning
stefreak Nov 9, 2023
2b29889
fix: wait until write stream is finished
stefreak Nov 9, 2023
ca1a764
fix: use pipeline to await until write stream really finished
stefreak Nov 9, 2023
debf085
fix: properly implement streaming
stefreak Nov 9, 2023
0884b19
chore: update circleci machine image
Nov 9, 2023
fe811f2
fix: add env var UV_USE_IO_URING=0 to avoid kernel bug
stefreak Nov 9, 2023
8886237
fix: tested error message became more detailed
TimBeyer Nov 9, 2023
946d649
Merge branch 'main' into chore/bump-node
TimBeyer Nov 9, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
73 changes: 52 additions & 21 deletions .circleci/continue-config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ version: 2.1
orbs:
win: circleci/[email protected]
rok8s-scripts: fairwinds/[email protected]
node: circleci/[email protected]
macos: circleci/[email protected]

parameters:
Expand All @@ -21,8 +20,16 @@ parameters:
GARDEN_DISABLE_ANALYTICS: "true"
GARDEN_K8S_BUILD_SYNC_MODE: "mutagen"

# Libuv 1.45.0 is affected by a kernel bug on certain kernels (Ubuntu 22)
# This leads to errors where Garden tool downloading errors with ETXTBSY
# Apparently file descriptor accounting is broken when using USE_IO_URING on older kernels
# See also: https://github.com/libuv/libuv/pull/4141/files
# TODO: Remove this once libuv 1.47 landed in a future NodeJS version, and we upgraded to it.
UV_USE_IO_URING: "0"


ubuntu-vm-runner: &ubuntu-vm-runner
image: "ubuntu-2204:2023.02.1"
image: "ubuntu-2204:2023.10.1"
docker_layer_caching: true

remote-docker: &remote-docker
Expand All @@ -31,7 +38,7 @@ parameters:
docker_layer_caching: true

runner-image: &runner-image
image: gardendev/circleci-runner:18.15.0-1@sha256:c830e29ab30a1c5b08cba4d041d3325ef6958aebeba1b10b1ee9566d7b1a4d42
image: gardendev/circleci-runner:21.1.0-1@sha256:1b773f6fcde1d9b65cb8a609c823076b3048104e73f04247e0fd86aa9bcc92dd

# Configuration for our node jobs
docker-runner: &docker-runner
Expand Down Expand Up @@ -98,23 +105,58 @@ commands:
context:
description: Set this to vm if installing in a VM, to avoid conflicting caches with the docker runs
type: string
node_version:
description: The node version to use
type: string
default: v21.1.0
steps:
# See also https://github.com/CircleCI-Public/node-orb/issues/158#issuecomment-1461095390
- run: rm -rf ~/.npm
- run: rm -rf ~/.npm ~/.fnm

- restore_cache:
keys:
# Prefer using the NPM cache for the package-lock hash, but fall back to any other cache too
- npm-v4-<<parameters.context>>-{{ checksum "package-lock.json" }}
- npm-v7-<<parameters.context>>-{{ checksum "package-lock.json" }}
# If you uncomment the next line, we also restore caches if package-lock.json changed in case there is no exact match.
# We decided not to do that for now for enhanced safety: Every time we update the lock file, we build the caches from scratch. Might be a little paranoid, but hardens against possible NPM bugs.
#- npm-v4-<<parameters.context>>
#- npm-v7-<<parameters.context>>

- run:
name: Install NodeJS
command: |
if [[ "$(node --version)" != "<<parameters.node_version>>" ]]; then
export PATH="$HOME/.fnm:$PATH"
echo 'export PATH="$HOME/.fnm:$PATH"' >> $BASH_ENV

# Install fnm if it's not already installed
if which fnm; then
echo "Using cached fnm installation"
else
curl -fsSL https://raw.githubusercontent.com/Schniz/fnm/9d0dd1b04521ac4a1c25bb91a65323dbb691e40c/.ci/install.sh | bash -s -- --install-dir "$HOME/.fnm" --force-install
fi

eval "`fnm env --fnm-dir "$HOME/.fnm-cache"`"
fnm env --fnm-dir "$HOME/.fnm-cache" >> $BASH_ENV

fnm use "<<parameters.node_version>>" --fnm-dir "$HOME/.fnm-cache" --install-if-missing
fnm default "<<parameters.node_version>>" --fnm-dir "$HOME/.fnm-cache"
fi
- run:
name: Test NodeJS version
command: |
if [[ "$(node --version)" != "<<parameters.node_version>>" ]]; then
echo "NodeJS installation failed. Expected version: <<parameters.node_version>>; Actually got: $(node --version)"
exit 1
fi

- run: npm ci --prefer-offline --cache ~/.npm --no-audit

- save_cache:
key: npm-v4-<<parameters.context>>-{{ checksum "package-lock.json" }}
key: npm-v7-<<parameters.context>>-{{ checksum "package-lock.json" }}
paths:
- ~/.npm
- ~/.fnm
- ~/.fnm-cache
- node_modules
- cli/node_modules
- core/node_modules
Expand Down Expand Up @@ -251,13 +293,11 @@ commands:

# To be able to run cargo
source "$HOME/.cargo/env"
echo 'export PATH="$HOME/.cargo/bin:$PATH"' >> $BASH_ENV

# Cargo builds the other targets in Docker
cargo install cross --git https://github.com/cross-rs/cross

# So that cross can be called
source "$HOME/.cargo/env"

run_npm_dist:
description: Package built code into executables and persist to dist directory
parameters:
Expand Down Expand Up @@ -285,17 +325,12 @@ commands:
- restore_cache:
keys:
- node-cache-v2-<<parameters.context>>-{{ checksum "cli/src/build-pkg.ts" }}
- node-cache-v2-<<parameters.context>>
# Nuke caches fully on every change; Otherwise weird things can happen if the cache is poisoned.
# - node-cache-v2-<<parameters.context>>

- run:
name: Run dist script
command: |
# This is already done in the step that installs rust
# It also work on the native macos runner,
# but somehow it doesn't work for the docker based runner.
# We just source it again so we're sure it's available for the next steps
source "$HOME/.cargo/env"

npm run dist -- --version "<<parameters.version>>" <<parameters.targets>>

# We cache the node archives because the NodeJS download mirror is unreliable
Expand Down Expand Up @@ -382,8 +417,6 @@ jobs:
default: ""
steps:
- checkout
- node/install:
node-version: '18.18.2'
- install_rust
# We need rosetta for running the tests for x86_64
- macos/install-rosetta
Expand All @@ -410,8 +443,6 @@ jobs:
default: ""
steps:
- checkout
- node/install:
node-version: '18.18.2'
- install_rust
- run:
name: "Install rollup linux"
Expand Down
3 changes: 2 additions & 1 deletion .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@
" "
]],
"@typescript-eslint/no-unused-vars": ["error", { "argsIgnorePattern": "^_", "varsIgnorePattern": "^_", "destructuredArrayIgnorePattern": "^_" }],
"@typescript-eslint/consistent-type-imports": "error"
"@typescript-eslint/consistent-type-imports": "error",
"@typescript-eslint/no-explicit-any": "warn"
}
}
4 changes: 2 additions & 2 deletions .github/workflows/publish-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@ jobs:
- name: Set Environment Variables
run: echo "SHORT_SHA=$(echo "$GITHUB_SHA" | cut -c1-8)" >> "$GITHUB_ENV"
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- name: Use Node.js 18.x
- name: Use Node.js 21.x
uses: actions/setup-node@8f152de45cc393bb48ce5d89d36b731f54556e65 # v4.0.0
with:
node-version: 18.x
node-version: 21.x
- name: Build package
run: |
npm ci
Expand Down
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
18.15
21.1

2 changes: 1 addition & 1 deletion cli/bin/garden-debug.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env node --inspect --stack-trace-limit=1000 --max-semi-space-size=64
#!/usr/bin/env -S node--inspect --stack-trace-limit=1000 --max-semi-space-size=64
/*
* Copyright (C) 2018-2023 Garden Technologies, Inc. <[email protected]>
*
Expand Down
Loading