-
Notifications
You must be signed in to change notification settings - Fork 5.7k
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
How to include binaries within generated function zip? #956
Comments
could you deploy your function again with |
My bad something like this works:
Other than that it would be awesome if https://github.com/serverless/serverless-optimizer-plugin could support something like the example below and put those files to the root of the zip:
|
oh yeah I was just gonna ask you about the optimize plugin! 😄 Please let me know if there's anything else I can help you with 😊 |
Haha thanks man! How would you feel about something like?
|
hmmmm I'm not sure I completely understand what you mean by "put those files in the root of the zip", but generally we really hate changing the directory/file structure of our users projects (they may have this structure for a strict reason). So I'm not sure if moving files around to the root of the zip would be a great idea. |
That's completely understandable. The binary is now part of the zip, next problem is permissions.
If I zip the dir myself Lambda triggers the function without any problems. Could it be that the optimize plugin is not respecting original file permissions? EDIT EDIT EDIT |
@eahefnawy Fixed the permissions issue in #960 |
@nicka thanks for keeping us updated! Is everything working for u now? :) |
@eahefnawy No problem! Only thing left is for serverless to retain original file permissions while generating the zip. But that should be fixed once #960 is approved 😄 |
wow thanks a lot for the PR! 😊 |
Is there an update for this for serverless.yml? Using serverless webpack I;m not sure how to include binaries. |
@peterschwarz21 that should be possible with The usage of globs can help here! How does your |
I must be missing something really easy lol. Here is my dir structure:
Now when I deploy it to AWS (or run serverless deploy -t), the /bin dir is not included. i just need to include that directory in the zip file before it gets uploaded to AWS. I feel like this should be easy, but it isn't. The serverless.yml file is like this:
.... etc |
Success! Using the copy-webpack-plugin I was able to upload a static file to AWS. |
@peterschwarz21 awesome! Thanks for keeping us posted on this one! Glad to hear that it has been resolved 👍 |
@peterschwarz21 you might face permission issues if you use copy-webpack-plugin with binaries that you need to execute in lambda environment. I had to use serverless-plugin-optimize to get ffmpeg working in my project. |
@laardee Can you elaborate? I'm currently facing permission issues with ffmpeg in lambda using the copy-webpack-plugin. EDIT
|
@boazdejong nice, I need to check out that plugin also. |
@boazdejong @laardee With the upcoming V3 version of the webpack plugin copying the file right into the |
@HyperBrain That would be a great feature! I just added the request. Thank you. |
I can't figure out how to store binaries within the generated function zip.
For example:
Only thing present on AWS is the
_serverless_handler.js
file.The text was updated successfully, but these errors were encountered: