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

feat!: Removed building/publishing Node.js 16 layers #263

Merged
merged 1 commit into from
Jul 31, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
4 changes: 2 additions & 2 deletions .github/workflows/nodejs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ jobs:

strategy:
matrix:
node-version: [16.x, 18.x, 20.x]
node-version: [18.x, 20.x]
steps:
- uses: actions/checkout@v4
- name: Use Node.js ${{ matrix.node-version }}
Expand All @@ -61,7 +61,7 @@ jobs:

strategy:
matrix:
node-version: [16.x, 18.x, 20.x]
node-version: [18.x, 20.x]

steps:
- uses: actions/checkout@v4
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/publish-node.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [16, 18, 20]
node-version: [18, 20]
steps:
- uses: actions/checkout@v4
- name: Use Node.js ${{ matrix.node-version }}.x
Expand Down
19 changes: 0 additions & 19 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -74,25 +74,6 @@ publish-java21-local: build-java21
-v "${HOME}/.aws:/home/newrelic-lambda-layers/.aws" \
newrelic-lambda-layers-java21

build-nodejs16x:
docker build \
--no-cache \
-t newrelic-lambda-layers-nodejs16x \
-f ./dockerfiles/Dockerfile.nodejs16x \
.

publish-nodejs16x-ci: build-nodejs16x
docker run \
-e AWS_ACCESS_KEY_ID \
-e AWS_SECRET_ACCESS_KEY \
newrelic-lambda-layers-nodejs16x

publish-nodejs16x-local: build-nodejs16x
docker run \
-e AWS_PROFILE \
-v "${HOME}/.aws:/home/newrelic-lambda-layers/.aws" \
newrelic-lambda-layers-nodejs16x

build-nodejs18x:
docker build \
--no-cache \
Expand Down
29 changes: 0 additions & 29 deletions dockerfiles/Dockerfile.nodejs16x

This file was deleted.

6 changes: 0 additions & 6 deletions libBuild.sh
Original file line number Diff line number Diff line change
Expand Up @@ -119,9 +119,6 @@ function layer_name_str() {
"python3.12")
rt_part="Python312"
;;
"nodejs16.x")
rt_part="NodeJS16X"
;;
"nodejs18.x")
rt_part="NodeJS18X"
;;
Expand Down Expand Up @@ -179,9 +176,6 @@ function s3_prefix() {
"python3.12")
name="nr-python3.12"
;;
"nodejs16.x")
name="nr-nodejs16.x"
;;
"nodejs18.x")
name="nr-nodejs18.x"
;;
Expand Down
70 changes: 1 addition & 69 deletions nodejs/publish-layers.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,64 +7,14 @@ DIST_DIR=dist

source ../libBuild.sh

NJS16X_DIST_ARM64=$DIST_DIR/nodejs16x.arm64.zip
NJS18X_DIST_ARM64=$DIST_DIR/nodejs18x.arm64.zip
NJS20X_DIST_ARM64=$DIST_DIR/nodejs20x.arm64.zip

NJS16X_DIST_X86_64=$DIST_DIR/nodejs16x.x86_64.zip
NJS18X_DIST_X86_64=$DIST_DIR/nodejs18x.x86_64.zip
NJS20X_DIST_X86_64=$DIST_DIR/nodejs20x.x86_64.zip

function usage {
echo "./publish-layers.sh [nodejs16x|nodejs18x|nodejs20x]"
}

function build-nodejs16x-arm64 {
echo "Building new relic layer for nodejs16.x (arm64)"
rm -rf $BUILD_DIR $NJS16X_DIST_ARM64
mkdir -p $DIST_DIR
npm install --prefix $BUILD_DIR newrelic@latest
mkdir -p $BUILD_DIR/node_modules/newrelic-lambda-wrapper
cp index.js $BUILD_DIR/node_modules/newrelic-lambda-wrapper
download_extension arm64
zip -rq $NJS16X_DIST_ARM64 $BUILD_DIR $EXTENSION_DIST_DIR $EXTENSION_DIST_PREVIEW_FILE
rm -rf $BUILD_DIR $EXTENSION_DIST_DIR $EXTENSION_DIST_PREVIEW_FILE
echo "Build complete: ${NJS16X_DIST_ARM64}"
}

function build-nodejs16x-x86 {
echo "Building new relic layer for nodejs16.x (x86_64)"
rm -rf $BUILD_DIR $NJS16X_DIST_X86_64
mkdir -p $DIST_DIR
npm install --prefix $BUILD_DIR newrelic@latest
mkdir -p $BUILD_DIR/node_modules/newrelic-lambda-wrapper
cp index.js $BUILD_DIR/node_modules/newrelic-lambda-wrapper
download_extension x86_64
zip -rq $NJS16X_DIST_X86_64 $BUILD_DIR $EXTENSION_DIST_DIR $EXTENSION_DIST_PREVIEW_FILE
rm -rf $BUILD_DIR $EXTENSION_DIST_DIR $EXTENSION_DIST_PREVIEW_FILE
echo "Build complete: ${NJS16X_DIST_X86_64}"
}

function publish-nodejs16x-arm64 {
if [ ! -f $NJS16X_DIST_ARM64 ]; then
echo "Package not found: ${NJS16X_DIST_ARM64}"
exit 1
fi

for region in "${REGIONS_ARM[@]}"; do
publish_layer $NJS16X_DIST_ARM64 $region nodejs16.x arm64
done
}

function publish-nodejs16x-x86 {
if [ ! -f $NJS16X_DIST_X86_64 ]; then
echo "Package not found: ${NJS16X_DIST_X86_64}"
exit 1
fi

for region in "${REGIONS_X86[@]}"; do
publish_layer $NJS16X_DIST_X86_64 $region nodejs16.x x86_64
done
echo "./publish-layers.sh [nodejs18x|nodejs20x]"
}

function build-nodejs18x-arm64 {
Expand Down Expand Up @@ -164,14 +114,6 @@ function publish-nodejs20x-x86 {
}

case "$1" in
"build-nodejs16x")
build-nodejs16x-arm64
build-nodejs16x-x86
;;
"publish-nodejs16x")
publish-nodejs16x-arm64
publish-nodejs16x-x86
;;
"build-nodejs18x")
build-nodejs18x-arm64
build-nodejs18x-x86
Expand All @@ -188,12 +130,6 @@ case "$1" in
publish-nodejs20x-arm64
publish-nodejs20x-x86
;;
"build-publish-nodejs16x-ecr-image")
build-nodejs16x-arm64
publish_docker_ecr $NJS16X_DIST_ARM64 nodejs16.x arm64
build-nodejs16x-x86
publish_docker_ecr $NJS16X_DIST_X86_64 nodejs16.x x86_64
;;
"build-publish-nodejs18x-ecr-image")
build-nodejs18x-arm64
publish_docker_ecr $NJS18X_DIST_ARM64 nodejs18.x arm64
Expand All @@ -206,10 +142,6 @@ case "$1" in
build-nodejs20x-x86
publish_docker_ecr $NJS20X_DIST_X86_64 nodejs20.x x86_64
;;
"nodejs16x")
$0 build-nodejs16x
$0 publish-nodejs16x
;;
"nodejs18x")
$0 build-nodejs18x
$0 publish-nodejs18x
Expand Down