Skip to content

Load Project and Site-Packages from S3 #510

@mcrowson

Description

@mcrowson

Currently, the entire application and site packages are uploaded to Lambda. This issue proposes uploading the project contents and deps to S3 instead, and having the zappa handler load the project files.

Proposed Changes:

  • Zappa CLI: Zip up minimal handler application with Zappa and dependencies for lambda
  • Zappa CLI: Send project zip to S3
  • Handler: On handler initialization, load the project zip in S3 into /tmp/{project_name}
  • Handler: Add the /tmp/{project_name} to sys path.

The first time the application runs it will likely be slower pulling from S3, but if the application uses the keep_warm appropriately, then the subsequent loads shouldn't have the same slowdown due to lambda keeping /tmp around between function calls.

The benefit of this change would be allowing much larger applications to run on Lambda.

Thoughts? Am I missing something?
Credits to @mathom for suggesting P3 via S3 this way.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions