docker-lambda icon indicating copy to clipboard operation
docker-lambda copied to clipboard

feat: Add python3.9 runtime

Open GordonSo opened this issue 3 years ago • 14 comments

Now that amazon added support for Python 3.9 it would be great to add Python 3.9 support https://aws.amazon.com/tw/about-aws/whats-new/2021/08/aws-lambda-adds-support-python-3-9/

This is an attempt to mimic: https://github.com/lambci/docker-lambda/commit/a94337ae2410a94a9ac878622eb82b26bc385a92#diff-0af1966588ced06e3143ae720245c9b7aeaae213c6921c12c742a166679cc505

But this has a dependency on the image being added to s3 see: https://github.com/lambci/lambci/issues/138

GordonSo avatar Sep 05 '21 20:09 GordonSo

Any chance a maintainer can have a look at this PR please?

jaidisido avatar Oct 05 '21 08:10 jaidisido

Just dropping by to let you know that I've created a fork of the project with Python 3.9 and ARM64 support. See my comment here for more details.

mLupine avatar Oct 14 '21 12:10 mLupine

Hi @mhart, lambda added 3.9 in Aug this year -- would be great if you could review & merge this.

kukushking avatar Nov 01 '21 14:11 kukushking

Hi @mhart can we please review this and merge? Thanks

arhant avatar Nov 04 '21 16:11 arhant

Hi! @mhart any chance this PR to be reviewed and merged? Thanks

vhuliai-beetroot avatar Nov 05 '21 08:11 vhuliai-beetroot

+1 for python 3.9

Strateus avatar Nov 15 '21 17:11 Strateus

Can someone (@mhart ?) please approve and merge this PR? It's taking too long

BassplayerPatrick avatar Jan 18 '22 14:01 BassplayerPatrick

Would be possible to add python3.10 so when AWS would add support for it in lambda, this container would be already available?

takeda avatar Jan 25 '22 07:01 takeda

Merge pleeeaassseee

brianantonelli avatar Feb 01 '22 16:02 brianantonelli

Why we not merge this PR?

mrnonz avatar Feb 02 '22 09:02 mrnonz

Looks like somebody already forked this project and solved it several months ago:

https://github.com/mLupine/docker-lambda

https://hub.docker.com/r/mlupin/docker-lambda

This repo hasn't been touched in a year now.

takeda avatar Feb 04 '22 06:02 takeda

Since this repo seems to be dead for almost 2 years now, My colleague and I went searching for other solutions. One solution was to use the fork, created by mlupine, but because that's also a one-man-operation and the last update was 9 months ago, we searched further and guess what? We seem to have found a solution in AWS!! Recently AWS added support for Lambda Container Images and provides base images for Lambda. Look here: https://aws.amazon.com/blogs/aws/new-for-aws-lambda-container-image-support for all information and documentation.

BassplayerPatrick avatar Nov 01 '22 19:11 BassplayerPatrick

Since this repo seems to be dead for almost 2 years now, My colleague and I went searching for other solutions. One solution was to use the fork, created by mlupine, but because that's also a one-man-operation and the last update was 9 months ago, we searched further and guess what? We seem to have found a solution in AWS!! Recently AWS added support for Lambda Container Images and provides base images for Lambda. Look here: https://aws.amazon.com/blogs/aws/new-for-aws-lambda-container-image-support for all information and documentation.

That's correct, and if you use serverless deployment, there is an ECR section under provider:

  ecr:
    images:
      baseimage:
        buildArgs:
        cacheFrom:
        path: "./"
        file: "Dockerfile"
        platform: linux/amd64  # see: https://github.com/aws/aws-lambda-base-images/issues/26

which will build and upload the docker image into ECR service for you. And the function handlers can reference the container image with a command path in a similar way as how it'd reference the code path previously.

*You'd need docker available on the deployment pipeline agent. **Also remember to set up a life-policy rule to tidy up images from previous deployments on ECR.

The serverless page for referencing-container-image-as-a-target has more details.

The advantage is that you can build and use one of AWS's images or customize your own and maintain them on ECR service. As a side-effect, you'd also overcome the 250Mb size limit that AWS Lambda has to offer (since the container route supports up to 10Gb). But I trust that there will be a longer cold-start using an image, so the container option may not be for everybody depending on the non-functional requirements.

GordonSo avatar Nov 01 '22 21:11 GordonSo

@GordonSo pretty please with cherry sprinkles on top can we merge this PR in. This PR is blocking me from testing mocking a lambda on python 3.9 runtime with the moto framework

karkir0003 avatar Jan 15 '23 21:01 karkir0003