-
Notifications
You must be signed in to change notification settings - Fork 37
ci: updated aws Lambda base image to node:20 #1728
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For what are we using this Dockerfile?
And where do we reference this file?
In my understanding, this docker image is the base image used when building the image for aws lambda, https://github.com/instana/nodejs/blob/main/packages/aws-lambda/layer/bin/publish-layer.sh#L376 |
Yeah I saw this too, but I wasn't sure. But I can see a I think we should pass the Node version as an argument.
Dockerfile
This
Either we use our development version or define the version in the publish-layer script. In general: It seems there is a poor support for Lambda layers in a Docker container. Because we only build the image with a specific AWS Lambda Node.js version always for the latest version. Our docs may need to make that clear. See https://www.ibm.com/docs/de/instana-observability/1.0.293?topic=lambda-aws-native-tracing-nodejs#instana-lambda-layer-for-container-based-functions |
I guess its good to do supportedVersions="--compatible-runtimes nodejs18.x nodejs20.x nodejs22.x"
dockerNodeVersion="grab the lowest or highest supported node version from $supportedVersions" |
+1 for using |
a4c74c8
to
acc5922
Compare
acc5922
to
b7b5e4a
Compare
As recommended, I have added the development version for the Docker image. Since v18 has already reached its end of life, and v22 officially added AWS support in November 2024, this update aligns with the current standards. Please share your thoughts |
# The Node.js version to use for building the Docker image. | ||
# This should be aligned with one of the supported runtimes above. | ||
# We're using a development version. | ||
NODE_VERSION_TO_BUILD="20" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we define the development version in a single constants file and reference it across all packages?
This would help improve maintainability since the version is repeated in multiple places.
P.S.: This might be out of scope for this PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good suggestion, we can certainly consider doing that.
# The Node.js version to use for building the Docker image. | ||
# This should be aligned with one of the supported runtimes above. | ||
# We're using a development version. | ||
NODE_VERSION_TO_BUILD="20" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Any reason we are not using
NVMRC_PATH="$ROOT_DIR/.nvmrc"
NODEJS_VERSION=$(cat "$NVMRC_PATH")
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's a good suggestion—I hadn't thought of it that way. I was only considering a generic file where we could define the version and use it everywhere. But reading from the .nvmrc file makes sense, especially since we're using the development version of Node for the images.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
pre-approving
0059ec1
to
b617b07
Compare
We already dropped support for Node.js 16 aws lambda runtime in the last major release, we missed to update the dockerfile.
Updated the base image in the Dockerfile to public.ecr.aws/lambda/nodejs:22 to align with the latest Node.js version for AWS Lambda.