Skip to content

Commit

Permalink
feat(node-v21): added support for node v21 (#947)
Browse files Browse the repository at this point in the history
refs 144547
  • Loading branch information
aryamohanan authored and kirrg001 committed Dec 11, 2023
1 parent 6c90a13 commit 64cc797
Show file tree
Hide file tree
Showing 19 changed files with 38 additions and 27 deletions.
25 changes: 24 additions & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -311,6 +311,29 @@ memcached: &memcached
- image: memcached:1.6.9

jobs:
"node-21":
docker:
- image: cimg/node:21.2
- <<: *zookeeper
- <<: *elasticsearch
- <<: *mongo
- <<: *redis
- <<: *kafka
- <<: *schema-registry
- <<: *mysql
- <<: *postgres
- <<: *mssql
- <<: *rabbitmq
- <<: *nats
- <<: *nats-streaming
- <<: *memcached
- <<: *couchbase
- <<: *couchbase-setup
- <<: *localstack
<<: *shared
parallelism: << pipeline.parameters.executors >>
resource_class: large

"node-20":
docker:
- image: cimg/node:20.9
Expand Down Expand Up @@ -476,7 +499,6 @@ workflows:
equal: [ scheduled_pipeline, << pipeline.trigger_source >> ]
jobs:
- "node-18"

other-nodejs-versions:
when:
or:
Expand All @@ -486,6 +508,7 @@ workflows:
# by providing the parameter "workflow: other-nodejs-versions"
- equal: [ other-nodejs-versions, << pipeline.parameters.workflow >> ]
jobs:
- "node-21"
- "node-20"
- "node-16"
- "node-14"
Expand Down
7 changes: 0 additions & 7 deletions native-dep-packs/Dockerfile.standard
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,5 @@ ARG BASE_IMAGE
FROM ${BASE_IMAGE}
WORKDIR /instana

RUN apt -y update
RUN apt install build-essential zlib1g-dev libncurses5-dev libgdbm-dev libnss3-dev libssl-dev libsqlite3-dev libreadline-dev libffi-dev curl libbz2-dev -y
RUN curl -O https://www.python.org/ftp/python/3.8.2/Python-3.8.2.tar.xz
RUN tar -xf Python-3.8.2.tar.xz
RUN cd Python-3.8.2 && ./configure --enable-optimizations && make -j 4 && make altinstall
RUN rm /usr/bin/python3
RUN ln -s /usr/local/bin/python3.8 /usr/bin/python3

RUN npm install @instana/collector@latest
3 changes: 2 additions & 1 deletion native-dep-packs/rebuild-precompiled-addons.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@ declare -A ABI_VERSIONS=( \
["93"]="16.20.2" \
["108"]="18.18.2" \
["115"]="20.3.0" \
)
["120"]="21.2.0" \
)

LIBC_VARIANTS=( \
"glibc" \
Expand Down
Binary file not shown.
Binary file not shown.
Binary file not shown.
8 changes: 0 additions & 8 deletions packages/autoprofile/precompile/Dockerfile.standard
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,4 @@ FROM ${BASE_IMAGE}

WORKDIR /opt/autoprofile

RUN apt -y update
RUN apt install build-essential zlib1g-dev libncurses5-dev libgdbm-dev libnss3-dev libssl-dev libsqlite3-dev libreadline-dev libffi-dev curl libbz2-dev -y
RUN curl -O https://www.python.org/ftp/python/3.8.2/Python-3.8.2.tar.xz
RUN tar -xf Python-3.8.2.tar.xz
RUN cd Python-3.8.2 && ./configure --enable-optimizations && make -j 4 && make altinstall
RUN rm /usr/bin/python3
RUN ln -s /usr/local/bin/python3.8 /usr/bin/python3

ENTRYPOINT ["node", "precompile/build-wrapper"]
5 changes: 2 additions & 3 deletions packages/autoprofile/precompile/build-all-addons.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,11 @@ const LIBC_FAMILIES = [GLIBC, MUSL];
// Maintenance Note:
// This should be kept in sync with native-dep-packs/rebuild-precompiled-addons.sh -> ABI_VERSIONS.
const ABI_VERSIONS = {
// 14.17.x was no longer working
// https://stackoverflow.com/questions/76094428/debian-stretch-repositories-404-not-found
83: '14.21.3',
93: '16.20.2',
108: '18.18.2',
115: '20.3.0'
115: '20.3.0',
120: '21.2.0'
};

function buildForPlatform(platform) {
Expand Down
2 changes: 1 addition & 1 deletion packages/autoprofile/precompile/build-single-addon.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ const os = require('os');

module.exports = exports = function buildSingleAddOn(abi, version) {
const platform = os.platform();
const arch = process.arch;
const arch = process.arch === 'arm64' ? 'x64' : process.arch;

let family = null;
if (platform === 'linux') {
Expand Down
5 changes: 1 addition & 4 deletions packages/autoprofile/precompile/docker-opts.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,7 @@ module.exports = exports = function getDockerOpts(family, version) {
const targetNodeVersion = version || nodeJsVersion;

if (family === GLIBC) {
// NOTE: debian stretch was no longer working good with some Node versions
// https://stackoverflow.com/questions/76094428/debian-stretch-repositories-404-not-found
// https://stackoverflow.com/questions/52083380/in-docker-image-names-what-is-the-difference-between-alpine-jessie-stretch-an
baseImage = `node:${targetNodeVersion}-buster`;
baseImage = `node:${targetNodeVersion}`;
distro = 'standard';
} else if (family === MUSL) {
baseImage = `node:${targetNodeVersion}-alpine`;
Expand Down
1 change: 1 addition & 0 deletions packages/collector/test/nativeModuleRetry/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ describe('retry loading native addons', function () {
break;
}
}

expect(foundAtLeastOneUnsupported).to.be.true;

// The for loop above ensures that the first metric POST that had the libuv payload
Expand Down
8 changes: 6 additions & 2 deletions packages/collector/test/tracing/cloud/gcp/storage/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

const { expect } = require('chai');
const { fail } = expect;
const semver = require('semver');

const constants = require('@instana/core').tracing.constants;
const supportedVersion = require('@instana/core').tracing.supportedVersion;
Expand Down Expand Up @@ -49,11 +50,14 @@ if (
});
} else {
let mochaSuiteFn;
// There is bug in node 21.2.0, more details please see
// https://github.com/googleapis/nodejs-storage/issues/2368

if (!supportedVersion(process.versions.node) || !process.env.GCP_PROJECT) {
if (!supportedVersion(process.versions.node) || !process.env.GCP_PROJECT ||
semver.gte(process.versions.node, '21.2.0')) {
mochaSuiteFn = describe.skip;
} else {
mochaSuiteFn = describe;
mochaSuiteFn = describe;
}

mochaSuiteFn('tracing/cloud/gcp/storage', function () {
Expand Down
1 change: 1 addition & 0 deletions packages/core/test/tracing/supportedVersion_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ describe('supported versions for Node.js auto tracing', () => {
expect(supportedTracingVersion('16.1.0')).to.equal(true);
expect(supportedTracingVersion('18.1.1')).to.equal(true);
expect(supportedTracingVersion('20.0.0')).to.equal(true);
expect(supportedTracingVersion('21.2.0')).to.equal(true);
});

it('must report various Node.js versions as not supported', () => {
Expand Down
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.

0 comments on commit 64cc797

Please sign in to comment.