From eeac0b3f2590bc5a3a6172faa04def74cc5ff598 Mon Sep 17 00:00:00 2001 From: Andrea Culot <95755271+andclt@users.noreply.github.com> Date: Thu, 15 Feb 2024 13:55:26 +0000 Subject: [PATCH] Remove Node14 from integ tests matrix since it is deprecated (#99) --- README.md | 1 - .../codebuild/buildspec.os.alpine.1.yml | 1 - .../codebuild/buildspec.os.alpine.2.yml | 4 +- .../codebuild/buildspec.os.alpine.4.yml | 102 ------------------ .../codebuild/buildspec.os.centos.yml | 1 - .../codebuild/buildspec.os.debian.1.yml | 1 - .../codebuild/buildspec.os.ubuntu.1.yml | 1 - .../integration/docker/Dockerfile.echo.alpine | 5 - .../docker/Dockerfile.echo.amazonlinux | 4 +- .../integration/docker/Dockerfile.echo.centos | 5 - .../integration/docker/Dockerfile.echo.debian | 5 - .../integration/docker/Dockerfile.echo.ubuntu | 5 - .../docker/Dockerfile.programmatic.alpine | 5 - 13 files changed, 4 insertions(+), 136 deletions(-) delete mode 100644 test/integration/codebuild/buildspec.os.alpine.4.yml diff --git a/README.md b/README.md index 041e0e2..97d3fad 100644 --- a/README.md +++ b/README.md @@ -10,7 +10,6 @@ You can include this package in your preferred base image to make that base imag ## Requirements The NodeJS Runtime Interface Client package currently supports NodeJS versions: - - 14.x - 16.x - 18.x - 20.x diff --git a/test/integration/codebuild/buildspec.os.alpine.1.yml b/test/integration/codebuild/buildspec.os.alpine.1.yml index a754022..e4c14cd 100644 --- a/test/integration/codebuild/buildspec.os.alpine.1.yml +++ b/test/integration/codebuild/buildspec.os.alpine.1.yml @@ -16,7 +16,6 @@ batch: DISTRO_VERSION: - "3.16" RUNTIME_VERSION: - - "14" - "16" - "18" phases: diff --git a/test/integration/codebuild/buildspec.os.alpine.2.yml b/test/integration/codebuild/buildspec.os.alpine.2.yml index 5117783..a452846 100644 --- a/test/integration/codebuild/buildspec.os.alpine.2.yml +++ b/test/integration/codebuild/buildspec.os.alpine.2.yml @@ -16,9 +16,9 @@ batch: env: variables: DISTRO_VERSION: - - "3.16" + - "3.18" RUNTIME_VERSION: - - "14" + - "20" phases: pre_build: commands: diff --git a/test/integration/codebuild/buildspec.os.alpine.4.yml b/test/integration/codebuild/buildspec.os.alpine.4.yml deleted file mode 100644 index a452846..0000000 --- a/test/integration/codebuild/buildspec.os.alpine.4.yml +++ /dev/null @@ -1,102 +0,0 @@ -version: 0.2 - -env: - variables: - OS_DISTRIBUTION: alpine - NODE_BINARY_LOCATION: "/usr/local/bin/node" - NPX_BINARY_LOCATION: "/usr/local/bin/npx" -batch: - build-matrix: - static: - ignore-failure: false - env: - type: LINUX_CONTAINER - privileged-mode: true - dynamic: - env: - variables: - DISTRO_VERSION: - - "3.18" - RUNTIME_VERSION: - - "20" -phases: - pre_build: - commands: - - export IMAGE_TAG="nodejs-${OS_DISTRIBUTION}-${DISTRO_VERSION}:${RUNTIME_VERSION}" - - echo "Extracting and including the Runtime Interface Emulator" - - SCRATCH_DIR=".scratch" - - mkdir "${SCRATCH_DIR}" - - tar -xvf test/integration/resources/aws-lambda-rie.tar.gz --directory "${SCRATCH_DIR}" - - > - cp "test/integration/docker/Dockerfile.programmatic.${OS_DISTRIBUTION}" \ - "${SCRATCH_DIR}/Dockerfile.programmatic.${OS_DISTRIBUTION}.tmp" - - > - echo "RUN apk add curl" >> \ - "${SCRATCH_DIR}/Dockerfile.programmatic.${OS_DISTRIBUTION}.tmp" - - > - echo "COPY ${SCRATCH_DIR}/aws-lambda-rie /usr/bin/aws-lambda-rie" >> \ - "${SCRATCH_DIR}/Dockerfile.programmatic.${OS_DISTRIBUTION}.tmp" - - > - if [[ -z "${DOCKERHUB_USERNAME}" && -z "${DOCKERHUB_PASSWORD}" ]]; - then - echo "DockerHub credentials not set as CodeBuild environment variables. Continuing without docker login." - else - echo "Performing DockerHub login . . ." - docker login -u $DOCKERHUB_USERNAME -p $DOCKERHUB_PASSWORD - fi - - echo "Building image ${IMAGE_TAG}" - - > - docker build . \ - -f "${SCRATCH_DIR}/Dockerfile.programmatic.${OS_DISTRIBUTION}.tmp" \ - -t "${IMAGE_TAG}" \ - --build-arg RUNTIME_VERSION="${RUNTIME_VERSION}" \ - --build-arg DISTRO_VERSION="${DISTRO_VERSION}" - build: - commands: - - set -x - - echo "Running Image ${IMAGE_TAG}" - - docker network create "${OS_DISTRIBUTION}-network" - - > - docker run \ - --detach \ - -e "NODE_BINARY_LOCATION=${NODE_BINARY_LOCATION}" \ - --name "${OS_DISTRIBUTION}-app" \ - --network "${OS_DISTRIBUTION}-network" \ - --entrypoint="" \ - "${IMAGE_TAG}" \ - sh -c '/usr/bin/aws-lambda-rie ${NODE_BINARY_LOCATION} index.mjs' - - sleep 2 - - > - docker run \ - --name "${OS_DISTRIBUTION}-tester" \ - --env "TARGET=${OS_DISTRIBUTION}-app" \ - --network "${OS_DISTRIBUTION}-network" \ - --entrypoint="" \ - "${IMAGE_TAG}" \ - sh -c 'curl -X POST "http://${TARGET}:8080/2015-03-31/functions/function/invocations" -d "{}" --max-time 10' - - actual="$(docker logs --tail 1 "${OS_DISTRIBUTION}-tester" | xargs)" - - expected='success' - - | - echo "Response: ${actual}" - if [[ "$actual" != "$expected" ]]; then - echo "fail! runtime: $RUNTIME - expected output $expected - got $actual" - echo "---------Container Logs: ${OS_DISTRIBUTION}-app----------" - echo - docker logs "${OS_DISTRIBUTION}-app" - echo - echo "---------------------------------------------------" - echo "--------Container Logs: ${OS_DISTRIBUTION}-tester--------" - echo - docker logs "${OS_DISTRIBUTION}-tester" - echo - echo "---------------------------------------------------" - exit -1 - fi - finally: - - echo "Cleaning up..." - - docker stop "${OS_DISTRIBUTION}-app" || true - - docker rm --force "${OS_DISTRIBUTION}-app" || true - - docker stop "${OS_DISTRIBUTION}-tester" || true - - docker rm --force "${OS_DISTRIBUTION}-tester" || true - - docker network rm "${OS_DISTRIBUTION}-network" || true - - docker rmi "${IMAGE_TAG}" || true diff --git a/test/integration/codebuild/buildspec.os.centos.yml b/test/integration/codebuild/buildspec.os.centos.yml index 586f4cf..3355a43 100644 --- a/test/integration/codebuild/buildspec.os.centos.yml +++ b/test/integration/codebuild/buildspec.os.centos.yml @@ -17,7 +17,6 @@ batch: - "stream8" - "stream9" RUNTIME_VERSION: - - "14" - "16" - "18" - "20" diff --git a/test/integration/codebuild/buildspec.os.debian.1.yml b/test/integration/codebuild/buildspec.os.debian.1.yml index 9978db7..de1fd34 100644 --- a/test/integration/codebuild/buildspec.os.debian.1.yml +++ b/test/integration/codebuild/buildspec.os.debian.1.yml @@ -17,7 +17,6 @@ batch: - "buster" - "bullseye" RUNTIME_VERSION: - - "14" - "16" - "18" - "20" diff --git a/test/integration/codebuild/buildspec.os.ubuntu.1.yml b/test/integration/codebuild/buildspec.os.ubuntu.1.yml index 2427e5a..7adb59b 100644 --- a/test/integration/codebuild/buildspec.os.ubuntu.1.yml +++ b/test/integration/codebuild/buildspec.os.ubuntu.1.yml @@ -18,7 +18,6 @@ batch: - "20.04" - "22.04" RUNTIME_VERSION: - - "14" - "16" phases: pre_build: diff --git a/test/integration/docker/Dockerfile.echo.alpine b/test/integration/docker/Dockerfile.echo.alpine index bba3735..10f1aab 100644 --- a/test/integration/docker/Dockerfile.echo.alpine +++ b/test/integration/docker/Dockerfile.echo.alpine @@ -40,11 +40,6 @@ RUN mkdir -p ${FUNCTION_DIR} WORKDIR ${FUNCTION_DIR}/deps/aws-lambda-ric COPY . . -# Node14 uses npm@6.14.18 by default which will downgrade permissions, if it's root, -# before running any build scripts: https://github.com/npm/npm/issues/3497 -# Starting from npm@7.0.0, when npm is run as root, -# scripts are always run with the effective uid and gid of the working directory owner. -RUN if [[ $(node -v | cut -c 1-3) == "v14" ]] ; then npm install -g npm@7 ; fi RUN make build && \ npm run test:unit diff --git a/test/integration/docker/Dockerfile.echo.amazonlinux b/test/integration/docker/Dockerfile.echo.amazonlinux index c17bfbd..b54956d 100644 --- a/test/integration/docker/Dockerfile.echo.amazonlinux +++ b/test/integration/docker/Dockerfile.echo.amazonlinux @@ -51,8 +51,8 @@ WORKDIR ${FUNCTION_DIR}/deps/aws-lambda-ric COPY . . # Node14 uses npm@6.14.18 by default which will downgrade permissions, if it's root, -# before running any build scripts: https://github.com/npm/npm/issues/3497 -# Starting from npm@7.0.0, when npm is run as root, +# before running any build scripts: https://github.com/npm/npm/issues/3497 +# Starting from npm@7.0.0, when npm is run as root, # scripts are always run with the effective uid and gid of the working directory owner. RUN if [[ $(node -v | cut -c 1-3) == "v14" ]] ; then npm install -g npm@7 ; fi RUN make build && \ diff --git a/test/integration/docker/Dockerfile.echo.centos b/test/integration/docker/Dockerfile.echo.centos index df40318..744be55 100644 --- a/test/integration/docker/Dockerfile.echo.centos +++ b/test/integration/docker/Dockerfile.echo.centos @@ -40,11 +40,6 @@ RUN mkdir -p ${FUNCTION_DIR} WORKDIR ${FUNCTION_DIR}/deps/aws-lambda-ric COPY . . -# Node14 uses npm@6.14.18 by default which will downgrade permissions, if it's root, -# before running any build scripts: https://github.com/npm/npm/issues/3497 -# Starting from npm@7.0.0, when npm is run as root, -# scripts are always run with the effective uid and gid of the working directory owner. -RUN if [[ $(node -v | cut -c 1-3) == "v14" ]] ; then npm install -g npm@7 ; fi RUN make build && \ npm run test:unit diff --git a/test/integration/docker/Dockerfile.echo.debian b/test/integration/docker/Dockerfile.echo.debian index 4581ad5..a611d8f 100644 --- a/test/integration/docker/Dockerfile.echo.debian +++ b/test/integration/docker/Dockerfile.echo.debian @@ -22,11 +22,6 @@ RUN mkdir -p ${FUNCTION_DIR} WORKDIR ${FUNCTION_DIR}/deps/aws-lambda-ric COPY . . -# Node14 uses npm@6.14.18 by default which will downgrade permissions, if it's root, -# before running any build scripts: https://github.com/npm/npm/issues/3497 -# Starting from npm@7.0.0, when npm is run as root, -# scripts are always run with the effective uid and gid of the working directory owner. -RUN if [ $(node -v | cut -c 1-3) = "v14" ] ; then npm install -g npm@7 ; fi RUN make build && \ npm run test:unit diff --git a/test/integration/docker/Dockerfile.echo.ubuntu b/test/integration/docker/Dockerfile.echo.ubuntu index bbabd50..890710a 100644 --- a/test/integration/docker/Dockerfile.echo.ubuntu +++ b/test/integration/docker/Dockerfile.echo.ubuntu @@ -48,11 +48,6 @@ RUN mkdir -p ${FUNCTION_DIR} WORKDIR ${FUNCTION_DIR}/deps/aws-lambda-ric COPY . . -# Node14 uses npm@6.14.18 by default which will downgrade permissions, if it's root, -# before running any build scripts: https://github.com/npm/npm/issues/3497 -# Starting from npm@7.0.0, when npm is run as root, -# scripts are always run with the effective uid and gid of the working directory owner. -RUN if [ $(node -v | cut -c 1-3) = "v14" ] ; then npm install -g npm@7 ; fi RUN make build && \ npm run test:unit diff --git a/test/integration/docker/Dockerfile.programmatic.alpine b/test/integration/docker/Dockerfile.programmatic.alpine index 1057cd2..5bcb4b7 100644 --- a/test/integration/docker/Dockerfile.programmatic.alpine +++ b/test/integration/docker/Dockerfile.programmatic.alpine @@ -40,11 +40,6 @@ RUN mkdir -p ${FUNCTION_DIR} WORKDIR ${FUNCTION_DIR}/deps/aws-lambda-ric COPY . . -# Node14 uses npm@6.14.18 by default which will downgrade permissions, if it's root, -# before running any build scripts: https://github.com/npm/npm/issues/3497 -# Starting from npm@7.0.0, when npm is run as root, -# scripts are always run with the effective uid and gid of the working directory owner. -RUN if [[ $(node -v | cut -c 1-3) == "v14" ]] ; then npm install -g npm@7 ; fi RUN make build && \ npm run test:unit