-
Notifications
You must be signed in to change notification settings - Fork 13
Breaking changes in AWS Linux 2 / Lambda nodejs10.x #14
Comments
Definitely makes sense to me 👍. There's no specific reason we're not on 1.0 yet, just an initial abundance of caution, bumping sounds like the right idea. |
I think I partially misunderstood AWS's Lambda container rollout plan, which can be summarized as:
What's not yet clear is whether a git package that bundles all its own dependencies will be compatible with both container environments (and assuming it was, whether it would be a tenable file size). So, this begs a question of direction. Since there's now effectively a fork in Lambda environments, do we maintain a version for each? I could see doing a minor bump right away with the latest git currently available in That's tidy, but could be frustrating for anyone installing Fwiw, sounded a bit like mhart was going to build an entirely new layer to solve for this, but layers are just ARNs, so they don't really have the NPM (and soon GH Registry) namespace considerations of this module. |
Can we easily detect the AWS Linux version in use from Node at runtime? By the sound of it, for now the Node version is a clear marker, though it's unclear if that'll always be true. Given we can, I'd split the package by versions as you suggest, but leave a check in each that warns and exits hard if it's run in the wrong environment, and then leave the npm E.g, assuming in the short-term that AWS Linux 1 is still the common use case, I'd publish:
with the At some point later on we can finalize 2.0.0 if everything looks good, and start pointing How does that sound? Potentially frustrating for anybody on the wrong side of our |
News: Node 10 git binary is a go! lambci/git-lambda-layer#13 (comment) What with Seems like the move here is to get the new git image into 2.0.0 RC for |
Just for my reference later, some dates from https://docs.aws.amazon.com/lambda/latest/dg/runtime-support-policy.html:
All sounds good - the hard deprecation here makes a convincing case to me too for just focusing on Node 10 as the default asap, along with a simultaneous bump to v1.0.0. Definitely keeps things simpler too, works for me 👍 |
Right on. Will get a PR cooking for this this week! |
Ok! Got a PR going for Unfortunately it's not good news. I probably should have tested So, a quick bit of background: the When AWS released This is (in theory) a major boon to cold start times and other operations, but unfortunately it also meant that any custom binaries could no longer rely on standard system libraries. No bigs, being the mensch that @mhart is, he built a lot of great tooling (like docker-lambda and more recently yumda) to make it easier to compile binaries for Lambda targets. However, the assumptions of extracting binaries to the filesystem via userland / Node modules vs via Lambda layers are different. Runtimes do their userland work in Lambda within Looking into some of the binaries, it appears they may be calling libs from an absolute path that assumed a layer ( This wasn't an issue before because all the common libs needed to run these binaries existed on the filesystem in Just for completeness, I was curious to see if we could extract to
Unless anyone can think of other approaches, it seems like that means we'd need to take on compiling git just for this module in order to make it work. In terms of level of effort vs. wheel reinvention vs. other subject considerations (related to my own use cases), I don't think I'd recommend that, and don't personally want to take on that workload. I'm a bit bummed out, really thought I could make this happen while still drafting on the good work of the @pimterry wdyt? |
Interesting! Yeah, that sounds like a pain. Can you paste the errors you're seeing here, and the output of
I think absolute paths are common, but by no means required. You can have relative paths (although they're relative to your working directory, not the binary) or bare names (which will be looked up using
You are right: the 'correct' solution is probably to set up our own pipeline to compile Git for Lambda, for userland instead of layerland, but I agree that's a hassle. I think there are other options though. For example, a quick google turns up this fun SO question: https://unix.stackexchange.com/questions/448789/fix-hardcoded-dynamic-linking-for-executable. They're resolving a very similar issue using patchelf, which lets you to rewrite the paths in the binary directly. I think this should look something like:
In theory we could do that fairly easily, although it might just expose a new problem. I don't really have time to dig into this myself right now, but if you've got a minute, do you want to give it a go? |
You guys got this! 👀 this thread 👍 |
Just a reminder for anyone lurking here that doesn't know – you can get If that's not an option for you, then I'd understand why you'd want to continue using this module, but just figured I'd chime in to make sure ppl know. |
Thanks for that @mhart - I will check it out. The layer is new right? (~17 days ago the support was added). I think that is why I used this one a while back. We don't have any restrictions for adding the layer in on our side (just need to spend a few minutes to update the cloudformation). May be a good idea to add that to the README for folks on that repo. |
@mhart for sure! At the time I bugged @pimterry to undeprecate this package we couldn’t yet make use of layers. @pimterry re patching the elf and repackaging the binaries, sounds p straightforward and easy to automate (assuming it works), but I’m also tapped out on time right now. Not sure when I’ll be able to get to it, so if someone wants to pick up where I left off on the 2.0 branch (or if you opt to re-deprecate this package) either is fine imo! |
@dorian-coygo the layer that supports git on all runtimes except |
@mhart - I went down the rabbit hole this morning. @ryanblock is right about how slim AWS Linux 2 is. It doesn't have I may just wait to see if this package has more success or just write my lambda in a different language that still uses AWS Linux image. As for the README, you explain how to use the AWS Layer via the UI. You could add a snippet about how to add it to the CloudFormation such as
|
@dorian-coygo if you want any of those binaries (curl, tar, etc), you can use https://github.com/lambci/yumda Are you having issues with the |
Btw, in terms of explaining how to use it in the UI, I have exactly an example of that in the README here: https://github.com/lambci/git-lambda-layer#getting-started |
Just wanted to give an update that I also moved to layers solution and used the git-lambda-layer as a guide (since it didn't have all the dependencies I needed). Since AWS slimmed down AWS Linux 2, I don't think the lambda-git would be good enough for most people since you will probably have to build a layer of dependencies anyways. Steps for others:
|
FWIW: I was referring to adding a CloudFormation snippet in the readme (in case someone didn't want to do it manually in the UI). |
See also: lambci/git-lambda-layer#13
Changes in Lambda nodejs10.x appear to break this library; specifically, its build of git, which is based on
lambci/git-lambda-layer
's build (hence the issue above).I'll continue to monitor progress on the next git distribution for the AWS Linux 2 image that Lambda nodejs10.x uses.
Related, I'm thinking said fix (whether it originates from
lambci/git-lambda-layer
, or here) may be occasion for a1.0
bump – open to thoughts on that!Edit: misunderstood rollout plan/schedule of AWS Linux 2 – while it's a breaking change for this library in Lambda nodejs10.x, it's not going to be forced on non-nodejs10.x users (yet, anyway!).
The text was updated successfully, but these errors were encountered: