amplify-hosting
amplify-hosting copied to clipboard
Issues with remote (backend) function building & size constraints ("Unzipped size must be smaller than..")
Before opening, please confirm:
- [X] I have checked to see if my question is addressed in the FAQ.
- [X] I have searched for duplicate or closed issues.
- [X] I have removed any sensitive information from my code snippets and submission.
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:
-
43MB zipped, 148.1 MB unzipped local amplify push
builds and hostsremote amplify buildbuilds and hosts -
39.5MB zipped, 154MB unzipped local amplify push:
locally builds and hostsremote 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.
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!
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
Ok.. not sure what's going on here. I have just built a new test:
- 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.
If you are still experiencing this can you open an AWS support case?
This issue is now closed. Comments on closed issues are hard for our team to see. If you need more assistance, please open a new issue that references this one.
This issue has been automatically locked.