Skip to content
This repository has been archived by the owner on Jan 15, 2023. It is now read-only.

feat: Add python3.9 runtime #348

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

GordonSo
Copy link

@GordonSo GordonSo commented Sep 5, 2021

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:
a94337a#diff-0af1966588ced06e3143ae720245c9b7aeaae213c6921c12c742a166679cc505

But this has a dependency on the image being added to s3 see: lambci/lambci#138

@jaidisido
Copy link

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

@mLupine
Copy link

mLupine commented Oct 14, 2021

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.

@kukushking
Copy link

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

@arhant
Copy link

arhant commented Nov 4, 2021

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

@vhuliai-beetroot
Copy link

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

@Strateus
Copy link

+1 for python 3.9

@BassplayerPatrick
Copy link

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

@takeda
Copy link

takeda commented Jan 25, 2022

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

@brianantonelli
Copy link

Merge pleeeaassseee

@mrnonz
Copy link

mrnonz commented Feb 2, 2022

Why we not merge this PR?

@takeda
Copy link

takeda commented Feb 4, 2022

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.

@BassplayerPatrick
Copy link

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.

@GordonSo
Copy link
Author

GordonSo commented Nov 1, 2022

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.

@karkir0003
Copy link

@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

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet