Could I use an action to generate a pdf
Could I use an action to generate a pdf file with puppeteer and store it in convex?
15 Replies
Sup! I believe you can. We just had a pretty similar example drop on stack today! https://stack.convex.dev/using-dall-e-from-convex
Using Dall-E from Convex
Use Convex to fetch an image from OpenAI’s image generation service based on a user-provided prompt.
I haven't tried using puppeteer - but I think it should work. Let us know if you run into any issues.
The dall-e post should give examples on how to access file storage from actions.
In Vercel serverless functions there is a limit of 50MB i think it is imposed by AWS
That has been giving me trouble with puppeteer since it needs a headless chromium and that bloat exceeds the limit
So I’ve had to run a very old version of chromium and puppeteer with nodejs 14 since that is still fits in the memory limit
Curious if convex has a similar limit
What limit are you referencing? File Size limit? Memory usage in the process?
The main limit we have in actions is a 30 second execution limit.
I believe we deploy actions code through S3, which should bypass the 50mb limit on direct code uploads to AWS lambda. But I may be wrong, the best way to tell is to try it 🙂
Let us know if you hit a code size limit and we can look into it!
50MB function size limit
maximum allowed serverless function size limit of 50MB on Vercel (transitively, AWS).
This is the recipe i followed https://gist.github.com/kettanaito/56861aff96e6debc575d522dd03e5725
Gist
Chromium on Vercel (serveless)
Chromium on Vercel (serveless). GitHub Gist: instantly share code, notes, and snippets.
I’ll try it with convex
If you get it working and want to write a walkthrough for Stack, lmk! I'd love to see how it works
yeah that would be helpful for others
Hey @Gorka Cesium - did you end up trying this? How did it go?
Not yet. First i need to figure out hire to migrate from fauna
Sounds way more important! I'll see if I can check it out for you
(the code size limit thing)
thanks!