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(node): bump from 18 to 22 #2671

Open
wants to merge 12 commits into
base: main
Choose a base branch
from
8 changes: 4 additions & 4 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -441,7 +441,7 @@ jobs:

test-server: &test-server-job
docker:
- image: cimg/node:18.19.0
- image: cimg/node:22.6.0
- image: cimg/redis:7.2.4
- image: 'speckle/speckle-postgres'
environment:
Expand Down Expand Up @@ -618,7 +618,7 @@ jobs:

test-frontend-2:
docker: &docker-node-browsers-image
- image: cimg/node:18.19.0-browsers
- image: cimg/node:22.6.0-browsers
resource_class: xlarge
steps:
- checkout
Expand Down Expand Up @@ -682,7 +682,7 @@ jobs:

test-preview-service:
docker:
- image: cimg/node:18.19.0
- image: cimg/node:22.6.0-browsers
- image: cimg/postgres:16.4@sha256:2e4f1a965bdd9ba77aa6a0a7b93968c07576ba2a8a7cf86d5eb7b31483db1378
environment:
POSTGRES_DB: preview_service_test
Expand Down Expand Up @@ -809,7 +809,7 @@ jobs:
ui-components-chromatic:
resource_class: medium+
docker: &docker-node-image
- image: cimg/node:18.19.0
- image: cimg/node:22.6.0
steps:
- checkout
- restore_cache:
Expand Down
6 changes: 3 additions & 3 deletions .circleci/deployment/helm-chart-shell.nix
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
{ pkgs ? import (fetchTarball "https://github.com/NixOS/nixpkgs/archive/5b7cd5c39befee629be284970415b6eb3b0ff000.tar.gz") {} }:
{ pkgs ? import (fetchTarball "https://github.com/NixOS/nixpkgs/archive/63dacb46bf939521bdc93981b4cbb7ecb58427a0.tar.gz") {} }:

let
corepack = pkgs.stdenv.mkDerivation {
name = "corepack";
buildInputs = [ pkgs.nodejs-18_x ];
buildInputs = [ pkgs.nodejs_22 ];
phases = [ "installPhase" ];
installPhase = ''
mkdir -p $out/bin
Expand All @@ -15,7 +15,7 @@ in pkgs.mkShell {
pkgs.docker
pkgs.kind
pkgs.kubectl
pkgs.nodejs-18_x
pkgs.nodejs_22
pkgs.ctlptl
pkgs.crane
pkgs.kubernetes-helm
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ We have a detailed section on [deploying a Speckle server](https://speckle.guide
## TL;DR

We're using yarn and its workspaces functionalities to manage the monorepo.
Make sure you are using [Node](https://nodejs.org/en) version 18.
Make sure you are using [Node](https://nodejs.org/en) version 22.
To get started, run:

1. `corepack enable`
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"name": "root",
"private": true,
"engines": {
"node": "^18.19.0"
"node": "^22.6.0"
},
"scripts": {
"build": "yarn workspaces foreach -ptvW run build",
Expand Down
2 changes: 1 addition & 1 deletion packages/dui3/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"version": "0.0.1",
"private": true,
"engines": {
"node": "^18.19.0"
"node": "^22.6.0"
},
"scripts": {
"build": "nuxt build",
Expand Down
7 changes: 6 additions & 1 deletion packages/fileimport-service/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -15,17 +15,22 @@ WORKDIR /speckle-server
ARG TINI_VERSION=v0.19.0
ENV TINI_VERSION=${TINI_VERSION}

# hadolint ignore=DL3008
RUN apt-get update -y \
&& DEBIAN_FRONTEND=noninteractive apt-get install -y \
--no-install-recommends \
ca-certificates=20240203 \
curl=8.5.0-2ubuntu10.6 \
gosu=1.17-1ubuntu0.24.04.2 \
&& curl -fsSL https://deb.nodesource.com/setup_18.x | bash - \
&& curl -fsSL https://github.com/krallin/tini/releases/download/${TINI_VERSION}/tini -o /usr/bin/tini \
&& chmod +x /usr/bin/tini \
&& curl -fsSL https://deb.nodesource.com/setup_22.x -o nodesource_setup.sh \
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ubuntu noble doesn't package Node version 22, so we have to install it via nodesource

&& gosu root:root bash nodesource_setup.sh \
&& DEBIAN_FRONTEND=noninteractive apt-get install -y \
--no-install-recommends \
nodejs=18.20.5-1nodesource1 \
nodejs \
&& echo ">>>>>> NODE Version: $(node --version)" \
&& npm install -g [email protected] \
&& corepack enable \
&& DEBIAN_FRONTEND=noninteractive apt-get remove curl -y \
Expand Down
2 changes: 1 addition & 1 deletion packages/fileimport-service/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"url": "git+https://github.com/specklesystems/speckle-server.git"
},
"engines": {
"node": "^18.19.0"
"node": "^22.6.0"
},
"scripts": {
"dev": "cross-env POSTGRES_URL=postgres://speckle:[email protected]/speckle NODE_ENV=development LOG_PRETTY=true SPECKLE_SERVER_URL=http://127.0.0.1:3000 nodemon --no-experimental-fetch ./src/daemon.js",
Expand Down
6 changes: 3 additions & 3 deletions packages/frontend-2/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM node:18-bookworm-slim@sha256:408f8cbbb7b33a5bb94bdb8862795a94d2b64c2d516856824fd86c4a5594a443 AS build-stage
FROM node:22-bookworm-slim@sha256:221ee67425de7a3c11ce4e81e63e50caaec82ede3a7d34599ab20e59d29a0cb5 AS build-stage
ARG NODE_ENV=production
ARG SPECKLE_SERVER_VERSION=custom

Expand Down Expand Up @@ -33,7 +33,7 @@ RUN yarn workspaces foreach -W run build
# hadolint ignore=DL3059
RUN find ./packages/frontend-2/.output/ -type f \( -name "*.js.map" -o -name "*.mjs.map" -o -name "*.cjs.map" \) -exec rm -f {} \;

ENV TINI_VERSION v0.19.0
ENV TINI_VERSION=v0.19.0
RUN apt-get update -y \
&& DEBIAN_FRONTEND=noninteractive apt-get install -y \
--no-install-recommends \
Expand All @@ -46,7 +46,7 @@ RUN apt-get update -y \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*

FROM gcr.io/distroless/nodejs18-debian12:nonroot@sha256:afdea027580f7afcaf1f316b2b3806690c297cb3ce6ddc5cf6a15804dc1c790f AS production-stage
FROM gcr.io/distroless/nodejs22-debian12:nonroot@sha256:ed26b3ab750110c51d9dbdfd6c697561dc40a01c296460c3494d47b550ef4126 AS production-stage
ARG NODE_ENV=production
ENV NODE_ENV=${NODE_ENV}

Expand Down
4 changes: 2 additions & 2 deletions packages/preview-service/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# NOTE: Docker context should be set to git root directory, to include the viewer
ARG NODE_ENV=production

FROM node:18-bookworm-slim@sha256:408f8cbbb7b33a5bb94bdb8862795a94d2b64c2d516856824fd86c4a5594a443 AS build-stage
FROM node:22-bookworm-slim@sha256:221ee67425de7a3c11ce4e81e63e50caaec82ede3a7d34599ab20e59d29a0cb5 AS build-stage

ARG NODE_ENV
ENV NODE_ENV=${NODE_ENV}
Expand Down Expand Up @@ -47,7 +47,7 @@

# google-chrome-stable is only available for amd64 so we have to fix the platform
# hadolint ignore=DL3029
FROM --platform=linux/amd64 node:18-bookworm-slim@sha256:408f8cbbb7b33a5bb94bdb8862795a94d2b64c2d516856824fd86c4a5594a443 AS node
FROM --platform=linux/amd64 node:22-bookworm-slim@sha256:221ee67425de7a3c11ce4e81e63e50caaec82ede3a7d34599ab20e59d29a0cb5 AS node

Check warning on line 50 in packages/preview-service/Dockerfile

View workflow job for this annotation

GitHub Actions / Build Preview Service

FROM --platform flag should not use a constant value

FromPlatformFlagConstDisallowed: FROM --platform flag should not use constant value "linux/amd64" More info: https://docs.docker.com/go/dockerfile/rule/from-platform-flag-const-disallowed/

SHELL ["/bin/bash", "-o", "pipefail", "-c"]
# Install tini and fonts
Expand Down
2 changes: 1 addition & 1 deletion packages/preview-service/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
},
"type": "module",
"engines": {
"node": "^18.19.0"
"node": "^22.6.0"
},
"scripts": {
"build:tsc:watch": "tsc -p ./tsconfig.build.json --watch",
Expand Down
6 changes: 3 additions & 3 deletions packages/server/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
ARG NODE_ENV=production
ARG SPECKLE_SERVER_VERSION=custom

FROM node:18-bookworm-slim@sha256:408f8cbbb7b33a5bb94bdb8862795a94d2b64c2d516856824fd86c4a5594a443 AS build-stage
FROM node:22-bookworm-slim@sha256:221ee67425de7a3c11ce4e81e63e50caaec82ede3a7d34599ab20e59d29a0cb5 AS build-stage
ARG NODE_ENV
ARG SPECKLE_SERVER_VERSION
WORKDIR /speckle-server
Expand Down Expand Up @@ -47,7 +47,7 @@ RUN yarn workspaces foreach -W run build

# install only production dependencies
# we need a clean environment, free of build dependencies
FROM node:18-bookworm-slim@sha256:408f8cbbb7b33a5bb94bdb8862795a94d2b64c2d516856824fd86c4a5594a443 AS dependency-stage
FROM node:22-bookworm-slim@sha256:221ee67425de7a3c11ce4e81e63e50caaec82ede3a7d34599ab20e59d29a0cb5 AS dependency-stage
ARG NODE_ENV
ARG SPECKLE_SERVER_VERSION

Expand All @@ -64,7 +64,7 @@ COPY packages/objectloader/package.json ./packages/objectloader/
WORKDIR /speckle-server/packages/server
RUN yarn workspaces focus --production

FROM gcr.io/distroless/nodejs18-debian12:nonroot@sha256:afdea027580f7afcaf1f316b2b3806690c297cb3ce6ddc5cf6a15804dc1c790f AS production-stage
FROM gcr.io/distroless/nodejs22-debian12@sha256:9f0d01f30f6899ac92abb0cba7d394320167f426687eaafd90f2293c97534ee6 AS production-stage
ARG NODE_ENV
ARG SPECKLE_SERVER_VERSION

Expand Down
2 changes: 1 addition & 1 deletion packages/server/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"url": "https://github.com/specklesystems/Server.git"
},
"engines": {
"node": "^18.19.0"
"node": "^22.6.0"
},
"scripts": {
"build": "tsc -p ./tsconfig.build.json",
Expand Down
2 changes: 1 addition & 1 deletion packages/tailwind-theme/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
"./fonts/*": "./fonts/*"
},
"engines": {
"node": "^18.19.0"
"node": ">=18.19.0"
},
"peerDependencies": {
"postcss": "^8.4.18",
Expand Down
6 changes: 3 additions & 3 deletions packages/webhook-service/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
ARG NODE_ENV=production

FROM node:18-bookworm-slim@sha256:408f8cbbb7b33a5bb94bdb8862795a94d2b64c2d516856824fd86c4a5594a443 AS build-stage
FROM node:22-bookworm-slim@sha256:221ee67425de7a3c11ce4e81e63e50caaec82ede3a7d34599ab20e59d29a0cb5 AS build-stage

ARG NODE_ENV
ENV NODE_ENV=${NODE_ENV}
Expand Down Expand Up @@ -40,7 +40,7 @@ RUN apt-get update -y \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*

FROM node:18-bookworm-slim@sha256:408f8cbbb7b33a5bb94bdb8862795a94d2b64c2d516856824fd86c4a5594a443 AS dependency-stage
FROM node:22-bookworm-slim@sha256:221ee67425de7a3c11ce4e81e63e50caaec82ede3a7d34599ab20e59d29a0cb5 AS dependency-stage
# yarn install
ARG NODE_ENV
ENV NODE_ENV=${NODE_ENV}
Expand All @@ -58,7 +58,7 @@ COPY packages/shared/package.json ./packages/shared/
WORKDIR /speckle-server/packages/webhook-service
RUN yarn workspaces focus --production

FROM gcr.io/distroless/nodejs18-debian12:nonroot@sha256:afdea027580f7afcaf1f316b2b3806690c297cb3ce6ddc5cf6a15804dc1c790f AS production-stage
FROM gcr.io/distroless/nodejs22-debian12:nonroot@sha256:ed26b3ab750110c51d9dbdfd6c697561dc40a01c296460c3494d47b550ef4126 AS production-stage
ARG NODE_ENV
ENV NODE_ENV=${NODE_ENV}

Expand Down
2 changes: 1 addition & 1 deletion packages/webhook-service/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
},
"homepage": "https://github.com/specklesystems/speckle-server#readme",
"engines": {
"node": "^18.19.0"
"node": "^22.6.0"
},
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
Expand Down