Hi, when looking the source code I came across the...
# general
l
Hi, when looking the source code I came across the lambda layer target. Will this be part of the 2.17 release, combined with the changes to the aws lambda layout?
b
huh…. well now i have a dumb question - if the point of Lambdex was to take all of the dependencies of your code and bundle them all up together, what would be the point of needing a layer?
h
build-time performance, I believe
b
ahhhhh okay, cool!
h
If you have deps that rarely change, rebuilding them all into the same pex can be laborious
b
makes sense. now my own hamster wheel is turning about our own lambda dependencies
l
Yes, this is the main benefit. Further, your lambda zip can only be 50MB unzipped. With layers you can increase the total to 250MB.
b
yeah my initial guess was going to be size-related
it’s really a shame that there’s such a nontrivial startup penalty for containers
l
Yes, currently Docker provides the smoothes deployment. If I have the option to build layers somewhat easy I would prefer to move back to using a python runtime.
b
Categorisation of lambda changes: • 2.17: ◦ new layout available • 2.18: ◦ new layout is the default ◦
python_aws_lambda_layer
target ◦ function target renamed to
python_aws_lambda_function
◦ inferring a runtime from interpreter constraints, if unambiguous ◦ providing fixed complete platform JSONs for known runtimes • 2.19 (future) ◦ remove the old layout
Putting deps in a layer also makes the main function package much smaller, which can probably get it below the 3MB(?) limit for editing in the console UI. A colleague has flagged that this is handy in dev environments, to reduce the debugging loop: add debug info/make changes to a deployed function directly, instead of needing to go through a whole redeploy. (Depending on how annoying redeploys are, of course; and not for prod!)
❤️ 2
l
@broad-processor-92400 Thanks for the information. I am really exited for
python_aws_lambda_layer
, this will make our deployment process a lot smoother. 2.18rc should be released in around 6 weeks? I do not want to upgrade to the dev version. I think this will be too big of a risk.
b
I don’t know the timeline for 2.18rc. I’d hope for sooner (as soon as 2.17 is out, but I don’t know where that is up to). If you’re in a position to test 2.18 (eg locally and/or in a dev environment, not in prod: I agree with your reticence to use a dev release day-to-day) and provide feedback/validate on the new Lambda functionality, that’d be appreciated. Currently the only experimentation/testing I’ve heard of so far is what I did while implementing and on my own work repo, so having others check it works smoothly early would be great!
l
Sure I will try it out. I already tried 2.17, works as expected. I will try out 2.18 in the coming days. Is there a open GitHub Issue to provide feedback?
b
Thank you! Not yet, but that’s a good idea. When I’m next at a computer, I’ll turn my summary message above into a discussion
1
l
@broad-processor-92400 is the `python_aws_lambda_layer`` activated in
2.18.0.dev6
? I get
Name 'python_aws_lambda_layer' is not defined.
b
Hmmm, that’s a surprise. I’ll look in a bit… thanks
Ooops! It's not properly exposed from the backend yet. https://github.com/pantsbuild/pants/pull/19550 fixes it, thanks!
l
@broad-processor-92400 It seems the
package
goal is not exported in
2.18.0.dev7
Edit: It seems like your PR was merged, but the goal still does not exist.
b
Yeah sorry, there’s another fix too, that isn’t in dev7: https://github.com/pantsbuild/pants/pull/19562 I think that’s finally there, though… 😅
l
Ok, perfect .I will try it out as soon as it is released.
👍 1