-
Notifications
You must be signed in to change notification settings - Fork 72
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
Package size exceeds AWS Lambda max. deploy size (250MB) #44
Comments
Hi @andreastepel, thanks for this question! It's good to know about the different use cases. As you pointed out, timecut installs timesnap, which installs puppeteer, which installs Chromium, and that takes up a significant amount of space. I don't know if there's a super simple solution for now, though there might be in the future. In the Future:The particular case of wanting to use a specific version of puppeteer (in this case one that uses This issue also makes me think it might be useful to have something like For Now: ForkingFor the time being, you may have some luck forking timesnap and removing puppeteer altogether by changing the lines in index.js/
Alternatively: Possibly Overriding DependenciesIf you don't want to fork so many things, you might have some luck checking out the answers to this question for overriding dependencies and combining it with aliasing. You might be able to use a custom version of puppeteer via something like You would either need to find or make a package that mimics the puppeteer API for I haven't tried any of this stuff, so I have no idea if it works, particularly if npm/yarn can alias packages that way. |
Hey @tungs! Thanks for your detailed answer. The idea of making a I will try the approaches you have suggested and will let you know which one worked for me. To find a solution for using timecut on a AWS Lambda function will be a great step to integrate video rendering (e.g. for user-generated content) into many applications on a scalable and affordable basis. |
Hi @andreastepel, as previously discussed, I just published You can use it by via:
And then in your program, the implementation would look something like this:
Thanks for your interest in this! Let me know if it works or if you run into any problems. |
Hey @tungs! Thank you for the nice solution! I have tried it and it works very well 🎉 It has become very easy now to render Web Animations on a scalable infrastructure. Some hints for everybody who wants to try this:
I have made some performance tests as well for everybody who is interested:
Hope that helps anybody who is running into the same question. |
Thanks for those performance tests, very useful!
…On Wed, 27 Jan 2021 at 15:14, Andreas Tepel ***@***.***> wrote:
Hey @tungs <https://github.com/tungs>!
Thank you for the nice solution! I have tried it and it works very well 🎉
It has become very easy now to render Web Animations on a scalable
infrastructure.
Some hints for everybody who wants to try this:
- you have to set frameCache: '/tmp' and output: '/tmp' because AWS
Lambda only allows you to write inside the /tmp directory
- to get FFMPEG running you have to add a custom layer which installs
FFMPEG for your Lambda function (some hints how this works can be found in
this post
<https://aws.amazon.com/de/blogs/media/processing-user-generated-content-using-aws-lambda-and-ffmpeg/>
in section 2
I have made some performance tests as well for everybody who is interested:
- Animation was 15sec with 1920x1080px resolution and 24fps framerate
- screenshotType: 'jpeg' was used to speed up performance
- 1024MB RAM -> 1min 34sec
- 2048MB RAM -> 56sec
- 4096MB RAM -> 47sec
- 8192MB RAM -> 35sec
Hope that helps anybody who is running into the same question.
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#44 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAN46QNRGGDNK3JKSXFL4CTS4AUWHANCNFSM4WIOE2RQ>
.
--
[email protected]
Senior Software Engineer
Office: +44 1923 261166
--
--
* <http://www.clock.co.uk/>
*
<https://www.clock.co.uk/insight/clock-launches-two-new-sites-for-BBFC>
_
_
The Old School House
Bridge Road, Hunton Bridge,
Kings Langley, WD4 8RQ
Switchboard: +44 1923 261166
www.clock.co.uk <http://www.clock.co.uk/>
*
*
* <http://twitter.com/clock> <https://github.com/clocklimited>
<http://www.linkedin.com/company/clock-limited>
*
*
*
www.clock.co.uk/email-disclaimer <http://www.clock.co.uk/email-disclaimer>
clock.® is a Registered Trademark of Clock Limited in the European
Community and other territories
|
@andreastepel I'm two years later and I'm getting much lower speeds on AWS Lambda (1024 MB), using a newer version of puppeteer and chrome, with screenshotType = "jpeg" and mode canvas.. for 1920x1080 px resolution, it takes forever: like 1 min for 1 second of animation at 30 fps.. the screenshot speed is something like 1 per second... Any tips ? I will maybe try to downgrade node / chromium / puppeteer |
downgrading to node v12 and "chrome-aws-lambda": "^5.5.0" "puppeteer-core": "^5.5.0" gives a bit better results: for a 5s animation 30 FPS 1920x1080 (150 frames) jpeg mode
Still like 3 times slower than @andreastepel though |
Thanks for the tests @andreastepel and @tdurand ! Do you also have price estimates handy by any chance? |
Hey there!
I have tried to run the timecut package on AWS Lambda but unfortunately if timecut is installed via npm all dependencies combined result in a deploy package over 300MB, AWS Lambda currently allows only unzipped deploy packages below 250MB. The biggest issue is the Chrome package that is installed by default.
Is there kind of a workaround to maybe cut off some dependencies that are not needed for the core functionalities of timecut? Or has anyone experiences with using timecut on AWS Lambda and has managed to use a package like https://github.com/alixaxel/chrome-aws-lambda ?
Hope that someone has a smart solution for this.
Best Andreas
The text was updated successfully, but these errors were encountered: