From 22f251646255ad135e12fdc0d9cf715c5c693921 Mon Sep 17 00:00:00 2001 From: Quinn Sinclair Date: Mon, 10 Jun 2024 11:39:35 +0000 Subject: [PATCH 1/4] Fix alpine image breaking due to missing dependencies and curl Context: `libexecinfo-dev` couldn't be found on alpine --- tests/integration/docker/Dockerfile.echo.alpine | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/tests/integration/docker/Dockerfile.echo.alpine b/tests/integration/docker/Dockerfile.echo.alpine index 9b239e4..a53efc0 100644 --- a/tests/integration/docker/Dockerfile.echo.alpine +++ b/tests/integration/docker/Dockerfile.echo.alpine @@ -14,14 +14,14 @@ RUN apk add --no-cache \ FROM python-alpine AS build-image # Install aws-lambda-cpp build dependencies RUN apk add --no-cache \ - build-base \ - libtool \ - autoconf \ - automake \ - libexecinfo-dev \ - make \ - cmake \ - libcurl + build-base \ + libtool \ + autoconf \ + automake \ + elfutils-dev \ + make \ + cmake \ + libcurl # Include global args in this stage of the build ARG RIC_BUILD_DIR="/home/build/" From 3a7d01e2d6e0c0f11e8bac4ef631ed1eceef7932 Mon Sep 17 00:00:00 2001 From: Quinn Sinclair <52372765+m-rph@users.noreply.github.com> Date: Tue, 18 Jun 2024 11:09:04 +0100 Subject: [PATCH 2/4] Relax simplejson dependency and keep it backwards compatible (#152) Simplejson had a breaking change from 3.18.4 (existing) going to 3.19 where the default behaviour of the JSONEncoder changed with respect to NaN handling. We address that in a backwards compatible way by passing `allow_nan=True`. --- awslambdaric/lambda_runtime_marshaller.py | 4 ++-- requirements/base.txt | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/awslambdaric/lambda_runtime_marshaller.py b/awslambdaric/lambda_runtime_marshaller.py index 42ee127..3b28313 100644 --- a/awslambdaric/lambda_runtime_marshaller.py +++ b/awslambdaric/lambda_runtime_marshaller.py @@ -16,9 +16,9 @@ class Encoder(json.JSONEncoder): def __init__(self): if os.environ.get("AWS_EXECUTION_ENV") == "AWS_Lambda_python3.12": - super().__init__(use_decimal=False, ensure_ascii=False) + super().__init__(use_decimal=False, ensure_ascii=False, allow_nan=True) else: - super().__init__(use_decimal=False) + super().__init__(use_decimal=False, allow_nan=True) def default(self, obj): if isinstance(obj, decimal.Decimal): diff --git a/requirements/base.txt b/requirements/base.txt index 135561f..819c723 100644 --- a/requirements/base.txt +++ b/requirements/base.txt @@ -1 +1 @@ -simplejson==3.18.4 +simplejson>=3.18.4 From 1d061f4301906fefa9acc43f34249fc9b4d733dc Mon Sep 17 00:00:00 2001 From: Quinn Sinclair <52372765+m-rph@users.noreply.github.com> Date: Wed, 19 Jun 2024 12:50:40 +0100 Subject: [PATCH 3/4] [153] Have PR workflow run against all OSes (#154) Mirrors the structure of the NodeJS ric with respect to github actions to run integ tests against all vendors. Issues with particular vendors won't be fixed in this PR to keep it short. Drops: python 3.7 in all but al1 --- .github/workflows/test-on-push-and-pr.yml | 46 ++++++++++++++++--- Makefile | 6 ++- tests/integration/codebuild-local/test_all.sh | 7 ++- .../codebuild/buildspec.os.alpine.yml | 1 - .../codebuild/buildspec.os.centos.yml | 1 - .../codebuild/buildspec.os.debian.yml | 1 - .../codebuild/buildspec.os.ubuntu.yml | 1 - 7 files changed, 49 insertions(+), 14 deletions(-) diff --git a/.github/workflows/test-on-push-and-pr.yml b/.github/workflows/test-on-push-and-pr.yml index fe17cda..f12bf0e 100644 --- a/.github/workflows/test-on-push-and-pr.yml +++ b/.github/workflows/test-on-push-and-pr.yml @@ -12,11 +12,45 @@ jobs: steps: - uses: actions/checkout@v2 - env: - GITHUB_WORKSPACE: / - - name: Set up python - uses: actions/setup-python@v2 - with: - python-version: '3.8' - name: Run 'pr' target run: make pr + + alpine: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + - name: Run alpine integration tests + run: DISTRO=alpine make test-integ + + amazonlinux: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + - name: Run amazonlinux integration tests + run: DISTRO=amazonlinux make test-integ + + centos: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + - name: Run centos integration tests + run: DISTRO=centos make test-integ + + debian: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + - name: Run debian integration tests + run: DISTRO=debian make test-integ + + ubuntu: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + - name: Run ubuntu integration tests + run: DISTRO=ubuntu make test-integ \ No newline at end of file diff --git a/Makefile b/Makefile index ab2ba46..ff99587 100644 --- a/Makefile +++ b/Makefile @@ -21,7 +21,7 @@ test-smoke: setup-codebuild-agent .PHONY: test-integ test-integ: setup-codebuild-agent - CODEBUILD_IMAGE_TAG=codebuild-agent tests/integration/codebuild-local/test_all.sh tests/integration/codebuild/. + CODEBUILD_IMAGE_TAG=codebuild-agent DISTRO="$(DISTRO)" tests/integration/codebuild-local/test_all.sh tests/integration/codebuild/. .PHONY: check-security check-security: @@ -41,7 +41,9 @@ dev: init test # Verifications to run before sending a pull request .PHONY: pr -pr: init check-format check-security dev test-smoke +pr: init check-format check-security dev setup-codebuild-agent + CODEBUILD_IMAGE_TAG=codebuild-agent DISTRO="$(DISTRO)" tests/integration/codebuild-local/test_all.sh tests/integration/codebuild + .PHONY: clean clean: diff --git a/tests/integration/codebuild-local/test_all.sh b/tests/integration/codebuild-local/test_all.sh index 0c5168c..1a09241 100755 --- a/tests/integration/codebuild-local/test_all.sh +++ b/tests/integration/codebuild-local/test_all.sh @@ -5,6 +5,7 @@ set -euo pipefail CODEBUILD_IMAGE_TAG="${CODEBUILD_IMAGE_TAG:-al2/x86_64/standard/3.0}" DRYRUN="${DRYRUN-0}" +DISTRO="${DISTRO:=""}" function usage { echo "usage: test_all.sh buildspec_yml_dir" @@ -51,10 +52,12 @@ main() { usage exit 1 fi - + BUILDSPEC_YML_DIR="$1" + echo $DISTRO $BUILDSPEC_YML_DIR + ls $BUILDSPEC_YML_DIR HAS_YML=0 - for f in "$BUILDSPEC_YML_DIR"/*.yml ; do + for f in "$BUILDSPEC_YML_DIR"/*"$DISTRO"*.yml ; do [ -f "$f" ] || continue; do_one_yaml "$f" HAS_YML=1 diff --git a/tests/integration/codebuild/buildspec.os.alpine.yml b/tests/integration/codebuild/buildspec.os.alpine.yml index da09a26..8d13f9e 100644 --- a/tests/integration/codebuild/buildspec.os.alpine.yml +++ b/tests/integration/codebuild/buildspec.os.alpine.yml @@ -19,7 +19,6 @@ batch: - "3.14" - "3.15" RUNTIME_VERSION: - - "3.7" - "3.8" - "3.9" - "3.10" diff --git a/tests/integration/codebuild/buildspec.os.centos.yml b/tests/integration/codebuild/buildspec.os.centos.yml index 4058a1e..e6930b9 100644 --- a/tests/integration/codebuild/buildspec.os.centos.yml +++ b/tests/integration/codebuild/buildspec.os.centos.yml @@ -17,7 +17,6 @@ batch: DISTRO_VERSION: - "7" RUNTIME_VERSION: - - "3.7" - "3.8" - "3.9" - "3.10" diff --git a/tests/integration/codebuild/buildspec.os.debian.yml b/tests/integration/codebuild/buildspec.os.debian.yml index 628fd95..7365f07 100644 --- a/tests/integration/codebuild/buildspec.os.debian.yml +++ b/tests/integration/codebuild/buildspec.os.debian.yml @@ -18,7 +18,6 @@ batch: - "buster" - "bullseye" RUNTIME_VERSION: - - "3.7" - "3.8" - "3.9" - "3.10" diff --git a/tests/integration/codebuild/buildspec.os.ubuntu.yml b/tests/integration/codebuild/buildspec.os.ubuntu.yml index b876817..2e312f6 100644 --- a/tests/integration/codebuild/buildspec.os.ubuntu.yml +++ b/tests/integration/codebuild/buildspec.os.ubuntu.yml @@ -18,7 +18,6 @@ batch: - "20.04" - "22.04" RUNTIME_VERSION: - - "3.7" - "3.8" - "3.9" - "3.10" From 57e70f5c0811aca9a65536ef45f0af6631160e72 Mon Sep 17 00:00:00 2001 From: Sean O Brien Date: Wed, 19 Jun 2024 14:04:00 +0100 Subject: [PATCH 4/4] Bump to version 2.0.12. (#155) --- RELEASE.CHANGELOG.md | 6 ++++++ awslambdaric/__init__.py | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/RELEASE.CHANGELOG.md b/RELEASE.CHANGELOG.md index 854b8b3..572f874 100644 --- a/RELEASE.CHANGELOG.md +++ b/RELEASE.CHANGELOG.md @@ -1,3 +1,9 @@ +### June 19, 2024 + +`2.0.12`: + +- Relax simplejson dependency and keep it backwards compatible ([#153](https://github.com/aws/aws-lambda-python-runtime-interface-client/pull/152)) + ### March 27, 2024 `2.0.11`: diff --git a/awslambdaric/__init__.py b/awslambdaric/__init__.py index 58ca90b..c0d8290 100644 --- a/awslambdaric/__init__.py +++ b/awslambdaric/__init__.py @@ -2,4 +2,4 @@ Copyright 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved. """ -__version__ = "2.0.11" +__version__ = "2.0.12"