From f283247ce5e7122b3f4e05bbbf4e556c84503598 Mon Sep 17 00:00:00 2001 From: Andrea Culot Date: Wed, 14 Feb 2024 18:42:47 +0000 Subject: [PATCH] Remove Node14 from integ tests matrix since it is deprecated --- 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 | 17 +-- .../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(+), 149 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..17e962f 100644 --- a/test/integration/docker/Dockerfile.echo.amazonlinux +++ b/test/integration/docker/Dockerfile.echo.amazonlinux @@ -12,16 +12,8 @@ ARG DISTRO_VERSION # Install Py3 required to build Node16+ RUN if [[ "${DISTRO_VERSION}" == "2" ]] ; then amazon-linux-extras install python3.8 && update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.8 1 ; fi # Install NodeJS -RUN if [[ "${RUNTIME_VERSION}" == "14" ]]; then \ - yum install -y tar gzip xz && \ - AARCH="$([[ "$(arch)" == "x86_64" ]] && echo "x64" || echo "arm64")" && \ - NODE_URL="https://nodejs.org/download/release/v14.21.3/node-v14.21.3-linux-$AARCH.tar.xz" && \ - curl -fL "$NODE_URL" | tar -C /usr --strip-components 1 -xJf - && \ - yum clean all -q && rm -rf /var/cache/yum ; \ -else \ - yum install https://rpm.nodesource.com/pub_${RUNTIME_VERSION}.x/nodistro/repo/nodesource-release-nodistro-1.noarch.rpm -y && \ - yum install nodejs -y --setopt=nodesource-nodejs.module_hotfixes=1s ; \ -fi +RUN yum install https://rpm.nodesource.com/pub_${RUNTIME_VERSION}.x/nodistro/repo/nodesource-release-nodistro-1.noarch.rpm -y && \ + yum install nodejs -y --setopt=nodesource-nodejs.module_hotfixes=1s; # Stage 2 - build function and dependencies FROM node-amazonlinux AS build-image @@ -50,11 +42,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.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