aws / aws-lambda-base-images

Apache License 2.0
647 stars 107 forks source link

Add support for Python 3.12 #110

Closed michael-k closed 6 months ago

michael-k commented 11 months ago

Latest official update [2023-10-25]:

We are aiming to provide GA support for Python 3.12 in Lambda, as both a base container image and a managed runtime, by the end of 2023.


Python 3.12 was released on 2023-10-02.

harvey251 commented 9 months ago

I wonder how this is going, any timelines

mdgm88 commented 8 months ago

This looks relevant: https://github.com/aws/aws-lambda-base-images/issues/92#issuecomment-1737531040

jtuliani commented 8 months ago

Today, we have published a preview AWS Lambda base container image for Python 3.12. You can use this image to build and deploy Python 3.12 Lambda functions if using container images as your function deployment format.

This image is tagged ‘preview’ and should not be used for production workloads. We invite you to provide your feedback on this preview image below. We are aiming to provide GA support for Python 3.12 in Lambda, as both a base container image and a managed runtime, by the end of 2023.

The Python 3.12 preview image is based on the provided.al2023 preview image. Note the use of microdnf as the package manager when updating your Dockerfiles to use this preview.

fitz-res commented 8 months ago

That's awesome, thanks @jtuliani! Sounds like the team has done a great job improving the release process.

tlu-rs commented 7 months ago

Thank you @jtuliani for getting these back on track with much shorter lead times after LTS release as I now see nodejs20.x, python3.12 and Java 21 supported in aws-sdk-go. The latter two, python3.12 and Java 21, are not yet visible in the AWS Console but with this support should be any day.

jtuliani commented 7 months ago

Thank you @tlu-rs and @fitz-res. We have been investing in getting new runtimes out promptly once they reach LTS. However, please don't infer too much about the runtime release date from having the runtime identifier surface in the AWS CLI, SDK, or CDK. We are still several weeks away from Python 3.12 GA. Our target is to release before the end of the year.

MartinXPN commented 7 months ago

@jtuliani I was trying to upgrade my Dockerfiles to use the latest Python 3.12 base image but faced an issue when trying to install gcc-c++ and clang-tidy.

I had the following setup which used to work fine:

FROM public.ecr.aws/lambda/python:3.11

# Initial setup
RUN yum install -y gcc-c++ epel-release centos-release-scl clang-tools-extra

RUN pip install --upgrade pip
RUN pip install awslambdaric -t "${LAMBDA_TASK_ROOT}"
...

I've changed the first line to FROM public.ecr.aws/lambda/python:3.12 and now the build fails on the yum install step with Error: The command '/bin/sh -c yum install -y ...' returned a non-zero code: 127.

Is there something that I'm missing with this new version? Should I change the installation step?

mdgm88 commented 7 months ago

@MartinXPN see https://aws.amazon.com/blogs/compute/introducing-the-amazon-linux-2023-runtime-for-aws-lambda/

The 3.12 image is based on the provided.al2023 image, not the provided.al2 image used for older python runtimes.

mdgm88 commented 6 months ago

Looks like this has been released. I can see 3.12 as an available runtime in the AWS Management Console, and it is now listed as a supported runtime in the documentation: https://docs.aws.amazon.com/lambda/latest/dg/lambda-runtimes.html

mdgm88 commented 6 months ago

There is a post about it on the compute blog: https://aws.amazon.com/blogs/compute/python-3-12-runtime-now-available-in-aws-lambda/

jtuliani commented 6 months ago

We completed the GA launch of Python 3.12 support in Lambda yesterday. Thanks all who noticed already. Please do share any feedback.

https://aws.amazon.com/about-aws/whats-new/2023/12/aws-lambda-support-python-3-12/

PierreKiwi commented 6 months ago

Hello, Thanks for Python 3.12 support.

Is it still valid ? Or is the new target arch manylinux_2_28_aarch64 ?