-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Add lambda layers to releases #1772
Comments
Hello, I'm happy for the docs to link to public, third-party, well-maintained Lambda Layer(s) in the same way there are links to Docker images of a likewise nature. I'm sure it won't be long before AWS provides a Lambda Layer Marketplace, at which point I might consider providing "official" layers at a small cost. I regularly take on paid consulting should anyone wish me to create and maintain either private or public Lambda Layers custom to their needs - please feel free to send an email if this would be of interest to you or anyone else reading this. |
@Exonis any interest in publishing your third-party Lambda Layer? 🙏 I’m just a student so I can’t afford consulting services yet 😅 Otherwise, I’ll probably just use the prebuilt tarballs or use a similar build step. |
@jlarmstrongiv There are several solutions on github that generate a layer zip-file with sharp. I also recently created one with the (currently) latest version - https://github.com/Umkus/lambda-layer-sharp. |
AWS now provides the "Lambda Layer Marketplace" @lovell: https://serverlessrepo.aws.amazon.com/applications E.g. imagemagick is on here at https://serverlessrepo.aws.amazon.com/applications/arn:aws:serverlessrepo:us-east-1:145266761615:applications~image-magick-lambda-layer Using it in a serverless function with the serverless framework is as simple as:
Would be great if we can have the same plug-and-play solution with Sharp |
I'm looking for a (zip) layer with gif support. I couldn't do it myself I run into multiple issues with Docker. help appreciated ❤️ |
For anyone coming here looking for a lambda layer: I've created one that includes sharp with HEIC/HEIF support: https://github.com/zoellner/sharp-heic-lambda-layer |
@zoellner this is awesome, any chance you can submit it to the AWS serverless application repository? |
@tommedema added it to the repository and added some more details to the readme: https://serverlessrepo.aws.amazon.com/applications/us-east-1/776954778331/sharp-heic |
awesome, thanks! |
@zoellner It looks like you have published binary files (not source code) to AWS containing patent-encumbered HEVC logic. If so, please be aware this will expose you or your employer to potential royalty payments to patent pools/holders for every copy "downloaded". This might be construed under law to mean every time anyone deploys a Lambda function that uses it. |
Thanks for the note. In order to stay on the safe side, I modified the repo to make it more suitable for self hosting and removed the application from the serverless application repository |
Would be great to get a non-hevc version of sharp published on the application repository. This makes it super easy to use sharp with lambda |
I automated the zip-building with Github Actions and Dependabot here: bubblydoo/lambda-layer-sharp. |
I'll close this issue as, from the comments, it looks like there are now some good solutions to this. Many thanks to those who've created and maintain these layers. |
What are you trying to achieve?
AWS released Lambda Layers to facilitate sharing libraries and binaries across lambda functions.
With Lambda Layers, adopting Sharp.js into any AWS Lambda Node.js project will be a breeze. Plus, there will be less setup, confusion, and errors surrounding compiling for the lambda execution environment.
I appreciate the existing installation instructions for AWS Lambda, and I think Lambda Layers could augment them.
What would you expect the API to look like?
With the releases, also publish the arn of the Lambda Layer for that particular version. This step could be automated into the build process. The docs for installation will need to be updated accordingly.
What alternatives have you considered?
Setting up my own Lambda Layer. Will often be out of date and more error prone.
Building and packaging Sharp.js each time. Build and upload speed will be slower and maintaining versions and consistency across multiple lambda functions will be difficult.
Is there a sample image that helps explain?
N/A. Here are more links about lambda layers:
There are other tutorials for creating a Lambda Layer online.
Loving Sharp.js! Just hoping to use it in more places 😄
The text was updated successfully, but these errors were encountered: