From 6678938d9c8aa70c4315c985e8917e407313d5fb Mon Sep 17 00:00:00 2001 From: vincentsarago Date: Thu, 1 Feb 2024 15:19:32 +0100 Subject: [PATCH] revert to python 3.10 --- infrastructure/aws/cdk/app.py | 2 +- infrastructure/aws/lambda/Dockerfile | 6 ++---- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/infrastructure/aws/cdk/app.py b/infrastructure/aws/cdk/app.py index a2f3b04..07addf4 100644 --- a/infrastructure/aws/cdk/app.py +++ b/infrastructure/aws/cdk/app.py @@ -40,7 +40,7 @@ def __init__( id: str, memory: int = 1024, timeout: int = 30, - runtime: aws_lambda.Runtime = aws_lambda.Runtime.PYTHON_3_11, + runtime: aws_lambda.Runtime = aws_lambda.Runtime.PYTHON_3_10, concurrent: Optional[int] = None, permissions: Optional[List[iam.PolicyStatement]] = None, environment: Optional[Dict] = None, diff --git a/infrastructure/aws/lambda/Dockerfile b/infrastructure/aws/lambda/Dockerfile index 2474a90..cfd0baf 100644 --- a/infrastructure/aws/lambda/Dockerfile +++ b/infrastructure/aws/lambda/Dockerfile @@ -1,4 +1,4 @@ -ARG PYTHON_VERSION=3.11 +ARG PYTHON_VERSION=3.10 FROM --platform=linux/amd64 public.ecr.aws/lambda/python:${PYTHON_VERSION} @@ -15,10 +15,8 @@ COPY titiler/ titiler/ # and becaise we NEED to remove both boto3 and botocore to save space for the package # we have to force using old package version that seems `almost` compatible with Lambda env botocore # https://docs.aws.amazon.com/lambda/latest/dg/lambda-runtimes.html -# boto3-1.28.72 -# botocore-1.31.72 RUN python -m pip install --upgrade pip -RUN python -m pip install . "mangum>=0.10.0" "aiobotocore==2.7.0" -t /asset --no-binary pydantic +RUN python -m pip install . "mangum>=0.10.0" "botocore==1.29.76" "aiobotocore==2.5.0" -t /asset --no-binary pydantic # Reduce package size and remove useless files RUN cd /asset && find . -type f -name '*.pyc' | while read f; do n=$(echo $f | sed 's/__pycache__\///' | sed 's/.cpython-[0-9]*//'); cp $f $n; done;