Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issues with remote (backend) function building & size constraints ("Unzipped size must be smaller than..") #3908

Open
3 tasks done
e-simpson opened this issue Jan 29, 2024 · 3 comments
Labels
feature-request New feature or request

Comments

@e-simpson
Copy link

Before opening, please confirm:

Amplify Hosting feature

Backend builds, Deployments

Is your feature request related to a problem? Please describe:

I am having issues packaging my python-based amplify function, due to its size being very close to what seems to be the maximum size. The maximum for a lambda as stated in the amplify backend build logs seems to be 262144000 bytes. Although from the following it seems to be around 150 MB (unzipped)?

I have attempted:

  1. 43MB zipped, 148.1 MB unzipped
    local amplify push builds and hosts
    remote amplify build builds and hosts

  2. 39.5MB zipped, 154MB unzipped
    local amplify push: locally builds and hosts
    remote amplify build: build fails with size error "Unzipped size must be smaller than...".

In 2., after the local amplify push, the built function/lambda is visible in the lambda portal list, and I can download and unzip it to see the correct deps are there. However, any future Amplify builds will fail due to it not being able to package this lambda. I am wondering if this discrepancy is related to:

  • Using macOS to locally build the lambda dist and amplify hosting using I assume linux. So the builds packs must vary?
  • Additional packages that the remote build includes that differ to what are included locally?

I have pipenv clean'd my function folder. Unfortunately, these dependencies are as minimal that I can get them (for the use case). Will have to write around this for now.

Describe how you'd like this feature to work

I think there should be:

  • Some clarity in the docs surrounding this issue and the general size constraints
    • What is the true maximum I can include in my function?
    • What size does Amplify hosting add to packages?
    • How does the local function build differ from the remote build?
  • If possible, some Amplify build options to
    • Potentially disable or remove some of the auto-installed packages
    • Disable remote function builds

Not really sure how easy this would be or if there is anyway to accomplish this currently. Appreciate any information on this.

@e-simpson e-simpson added the feature-request New feature or request label Jan 29, 2024
Copy link

This has been identified as a feature request. If this feature is important to you, we strongly encourage you to give a 👍 reaction on the request. This helps us prioritize new features most important to you. Thank you!

@e-simpson
Copy link
Author

Some additional info,
I am using macOS Sonoma 14.2.1, pipenv 2023.11.15, python 3.8.18. And a package you can use to test what's happening in 2 is the python SimpleITK (view on pypi) package

@e-simpson
Copy link
Author

Ok.. not sure what's going on here. I have just built a new test:

  1. 60MB zipped, 165.2MB unzipped
    locally builds and pushes ok
    remote builds successfully

I downloaded the remote package via the lambda portal and it is showing
71.5MB zipped, 202MB unzipped

Not sure why the 2. test from my first post failed, as the local build unzipped is larger in this test.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature-request New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant