Skip to content

Commit

Permalink
revert to python 3.10
Browse files Browse the repository at this point in the history
  • Loading branch information
vincentsarago committed Feb 1, 2024
1 parent 8158c98 commit 6678938
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
2 changes: 1 addition & 1 deletion infrastructure/aws/cdk/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
6 changes: 2 additions & 4 deletions infrastructure/aws/lambda/Dockerfile
Original file line number Diff line number Diff line change
@@ -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}

Expand All @@ -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;
Expand Down

0 comments on commit 6678938

Please sign in to comment.