zappa / Zappa

Serverless Python
https://zappa.ws/zappa
MIT License
3.26k stars 364 forks source link

[Migrated] Update/deploy a lambda using a Docker container image #926

Closed jneves closed 5 months ago

jneves commented 3 years ago

Originally from: https://github.com/Miserlou/Zappa/issues/2192 by ian-whitestone

Background

As discussed in #2188, AWS recently announced container image support for AWS Lambda. This means you can now package and deploy lambda functions as container images, instead of using zip files. The container image based approach will solve a lot of headaches caused by the zip file approach, particularly with file sizes (container images can be up to 10GB) and the dependency issues we all know & love.

What does this PR do?

  1. Make the zappa update and zappa deploy commands accept a new docker_image_uri parameter. docker_image_uri must point to an image in Elastic Container Registry (ECR) that complies with these guidelines. Instructions on how to configure this docker image will be provided in an accompanying blog post.
  2. Add a new save-python-settings-file CLI command, which will be used to generate & save the zappa_settings.py file that must be included in your docker image

Reproducible example

See this repo which contains an example Dockerfile that can be used for testing.

Discussion points for reviewers

Future Work & Next Steps

ArtikUA commented 3 years ago

Keep in mind that Lambdas which are created from ECR have very long cold starts: for my project it's 4.5 seconds compared with 1.2 seconds before Looks like we need a feature like "concurrency" for warmups

ian-whitestone commented 3 years ago

Related post exploring cold starts with docker images: https://ianwhitestone.work/serverless-ml-deployments/

github-actions[bot] commented 5 months ago

Hi there! Unfortunately, this Issue has not seen any activity for at least 90 days. If the Issue is still relevant to the latest version of Zappa, please comment within the next 10 days if you wish to keep it open. Otherwise, it will be automatically closed.

github-actions[bot] commented 5 months ago

Hi there! Unfortunately, this Issue was automatically closed as it had not seen any activity in at least 100 days. If the Issue is still relevant to the latest version of Zappa, please open a new Issue.