-
Notifications
You must be signed in to change notification settings - Fork 48
chore: add make commands to package and clean zip #885
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
chore: add make commands to package and clean zip #885
Conversation
Minimum allowed coverage is Generated by 🐒 cobertura-action against c8b72aa |
922dc9f
to
b69ad53
Compare
Signed-off-by: Kavindu Dodanduwa <kavindu.dodanduwa@elastic.co>
b69ad53
to
897879a
Compare
Signed-off-by: Kavindu Dodanduwa <kavindu.dodanduwa@elastic.co>
74a9cd3
to
9ecdce9
Compare
@@ -1,4 +1,4 @@ | |||
elastic-apm==6.19.0 | |||
elastic-apm==6.23.0 |
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.
@zmoog I had to bump this dependency to get everything working end to end. I think this is due to python 3.12 bump
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.
What kind of error did you get?
Thanks for adding this! Do we need to also update the local testing guide to include this? |
Signed-off-by: Kavindu Dodanduwa <kavindu.dodanduwa@elastic.co>
I have updated our documentation with commit 5d8c56b :) |
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.
Thanks, this help building the .zip file on non linux/amd64 machines.
Once merged, the PR #886 will probably fix the CI failure.
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.
Pull Request Overview
This PR enhances the local testing guide by adding Makefile commands that allow developers to package and clean the ESF Lambda zip locally.
- Added Makefile instructions for building (make package) and cleaning (make clean) the Lambda zip.
- Updated the README headings and text to clearly separate build and deployment steps.
Files not reviewed (1)
- Makefile: Language not supported
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.
Thanks for updating the doc!
@Kavindu-Dodan, here's a quick test run: ➜ make package
[....]
➜ unzip -l local_esf.zip | grep '.so$'
270976 05-05-2025 11:32 orjson/orjson.cpython-312-darwin.so
86960 05-05-2025 11:32 wrapt/_wrappers.cpython-312-darwin.so
115744 05-05-2025 11:32 charset_normalizer/md.cpython-312-darwin.so
482040 05-05-2025 11:32 charset_normalizer/md__mypyc.cpython-312-darwin.so
361928 05-05-2025 11:32 yaml/_yaml.cpython-312-darwin.so
240064 05-05-2025 12:31 orjson/orjson.cpython-312-aarch64-linux-gnu.so
188792 05-05-2025 12:31 wrapt/_wrappers.cpython-312-aarch64-linux-gnu.so
321960 05-05-2025 12:31 charset_normalizer/md__mypyc.cpython-312-aarch64-linux-gnu.so
69856 05-05-2025 12:31 charset_normalizer/md.cpython-312-aarch64-linux-gnu.so
2402440 05-05-2025 12:31 yaml/_yaml.cpython-312-aarch64-linux-gnu.so
244680 05-09-2025 17:28 orjson/orjson.cpython-312-x86_64-linux-gnu.so
221464 05-09-2025 17:28 wrapt/_wrappers.cpython-312-x86_64-linux-gnu.so
16120 05-09-2025 17:28 charset_normalizer/md.cpython-312-x86_64-linux-gnu.so
280856 05-09-2025 17:28 charset_normalizer/md__mypyc.cpython-312-x86_64-linux-gnu.so
2481784 05-09-2025 17:28 yaml/_yaml.cpython-312-x86_64-linux-gnu.so And here's the latest .zip file from the release v.19.0: ➜ curl http://esf-dependencies.s3.amazonaws.com/lambda-v1.19.0.zip --output lambda-v1.19.0.zip
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 16.7M 100 16.7M 0 0 23.4M 0 --:--:-- --:--:-- --:--:-- 23.4M
➜ unzip -l lambda-v1.19.0.zip | grep '.so$'
2371056 12-13-2024 11:41 yaml/_yaml.cpython-39-x86_64-linux-gnu.so
189200 12-13-2024 11:41 wrapt/_wrappers.cpython-39-x86_64-linux-gnu.so
277160 12-13-2024 11:41 charset_normalizer/md__mypyc.cpython-39-x86_64-linux-gnu.so
16064 12-13-2024 11:41 charset_normalizer/md.cpython-39-x86_64-linux-gnu.so
237872 12-13-2024 11:41 orjson/orjson.cpython-39-x86_64-linux-gnu.so ➜ du -sh local_esf.zip lambda-v1.19.0.zip
20M local_esf.zip
17M lambda-v1.19.0.zip The updated We could target Linux only. I would keep x86_64 and aarch64 architectures because we'll probably add aarch64 deployment support in ESF. |
@zmoog thanks for the detailed analysis. I used Also, I think when building on Mac, pip by default include [1] - https://docs.aws.amazon.com/lambda/latest/dg/python-package.html#python-package-native-libraries |
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.
LGTM
What does this PR do?
Adds simple Make commands to package lambda zip locally. This is in addition to existing dev corner local testing guide [1]
To build lambda zip -
make package
To clean it up -
make clean
The zip is named
local_esf.zip
Why is it important?
This allows developers to package lambda without the need of extra tools.
[1] - https://github.com/elastic/elastic-serverless-forwarder/tree/main/dev-corner/how-to-test-locally