Gorka Cesium
Gorka Cesium3y ago

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
nipunn
nipunn3y ago
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.
nipunn
nipunn3y ago
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.
Gorka Cesium
Gorka CesiumOP3y ago
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
nipunn
nipunn3y ago
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.
lee
lee3y ago
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 🙂
nipunn
nipunn3y ago
Let us know if you hit a code size limit and we can look into it!
Gorka Cesium
Gorka CesiumOP3y ago
50MB function size limit maximum allowed serverless function size limit of 50MB on Vercel (transitively, AWS).
Gorka Cesium
Gorka CesiumOP3y ago
Gist
Chromium on Vercel (serveless)
Chromium on Vercel (serveless). GitHub Gist: instantly share code, notes, and snippets.
Gorka Cesium
Gorka CesiumOP3y ago
I’ll try it with convex
ian
ian3y ago
If you get it working and want to write a walkthrough for Stack, lmk! I'd love to see how it works
Gorka Cesium
Gorka CesiumOP3y ago
yeah that would be helpful for others
nipunn
nipunn3y ago
Hey @Gorka Cesium - did you end up trying this? How did it go?
Gorka Cesium
Gorka CesiumOP3y ago
Not yet. First i need to figure out hire to migrate from fauna
nipunn
nipunn3y ago
Sounds way more important! I'll see if I can check it out for you (the code size limit thing)
Gorka Cesium
Gorka CesiumOP3y ago
thanks!

Did you find this page helpful?