-
Notifications
You must be signed in to change notification settings - Fork 46
APMSVLS-212 Reducing Python Lambda Layer Size #667
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
Conversation
Dockerfile
Outdated
| # benchmark uses pre-built wheels instead of building from sources. | ||
| RUN find ./python/lib/$runtime/site-packages/ddtrace -name "*.so" -exec strip -g {} \; | ||
| RUN find ./python/lib/$runtime/site-packages -name "*.so" -exec strip -g {} \; | ||
| # RUN find ./python/lib/$runtime/site-packages/ddtrace -name "*.so" -exec strip -g {} \; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hGreat idea! I'm surprised we weren't already stripping all the binaries in site-packages. Good find.
|
/merge |
|
View all feedbacks in Devflow UI.
The expected merge time in
The merge request has been interrupted because the build 80812596 took longer than expected. The current limit for the base branch 'main' is 120 minutes. |
|
/merge |
|
View all feedbacks in Devflow UI.
The expected merge time in
|
What does this PR do?
Applies
strip --strip-unneededto all.sofiles included in the Python lambda layer.Motivation
Frequent increases in Python lambda layer size, exceeding checks.
Stripping binaries further (originally only applied
strip --strip-debug) can reduce the unzipped layer size by about 2.5MB.Testing Guidelines
Ran serverless e2e tests and manually inspected traces on a Python sample app. Manually checked that profiling and appsec still produced appropriate output. Used layer
arn:aws:lambda:us-west-2:425362996713:layer:Python312-strip-unneeded-rithika:1on an ARM Python 3.12 lambda function.Additional Notes
Types of Changes
Check all that apply