editly icon indicating copy to clipboard operation
editly copied to clipboard

Run editly in AWS lambda

Open asharafshahi opened this issue 5 years ago • 10 comments

Has anyone attempted to run a Nodejs project with editly in AWS lambda? Seems every request to the lambda fails with:

{ "errorType": "Runtime.ImportModuleError", "errorMessage": "Error: Cannot find module '../build/Release/canvas.node'\nRequire stack:\n- /var/task/node_modules/canvas/lib/bindings.js\n- /var/task/node_modules/canvas/lib/canvas.js\n- /var/task/node_modules/canvas/index.js\n- /var/task/node_modules/jsdom/lib/jsdom/utils.js\n- /var/task/node_modules/jsdom/lib/jsdom/browser/Window.js\n- /var/task/node_modules/jsdom/lib/api.js\n- /var/task/node_modules/fabric/dist/fabric.js\n- /var/task/node_modules/editly/sources/fabricFrameSource.js\n- /var/task/node_modules/editly/index.js\n- /var/task/handler.js\n- /var/runtime/UserFunction.js\n- /var/runtime/index.js", "stack": [ "Runtime.ImportModuleError: Error: Cannot find module '../build/Release/canvas.node'", "Require stack:", "- /var/task/node_modules/canvas/lib/bindings.js", "- /var/task/node_modules/canvas/lib/canvas.js", "- /var/task/node_modules/canvas/index.js", "- /var/task/node_modules/jsdom/lib/jsdom/utils.js", "- /var/task/node_modules/jsdom/lib/jsdom/browser/Window.js", "- /var/task/node_modules/jsdom/lib/api.js", "- /var/task/node_modules/fabric/dist/fabric.js", "- /var/task/node_modules/editly/sources/fabricFrameSource.js", "- /var/task/node_modules/editly/index.js", "- /var/task/handler.js", "- /var/runtime/UserFunction.js", "- /var/runtime/index.js", " at _loadUserApp (/var/runtime/UserFunction.js:100:13)", " at Object.module.exports.load (/var/runtime/UserFunction.js:140:17)", " at Object. (/var/runtime/index.js:43:30)", " at Module._compile (internal/modules/cjs/loader.js:1138:30)", " at Object.Module._extensions..js (internal/modules/cjs/loader.js:1158:10)", " at Module.load (internal/modules/cjs/loader.js:986:32)", " at Function.Module._load (internal/modules/cjs/loader.js:879:14)", " at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:71:12)", " at internal/main/run_main_module.js:17:47" ] }

The lambda was deployed with serverless and npm packages were installed on a Amazon Linux 2 AMI.

asharafshahi avatar Aug 29 '20 13:08 asharafshahi

Does this help? https://github.com/Automattic/node-canvas/wiki/Installation:-AWS-Lambda

mifi avatar Sep 23 '20 12:09 mifi

If anyone created a working AWS lambda with editly I would like to try it out, willing to pay for it as well.

ariel-frischer avatar Oct 28 '20 02:10 ariel-frischer

Wth the new docker file it may be easier to get it working now

mifi avatar Dec 08 '20 12:12 mifi

@ariel-frischer any updates, I am willing to pay for it as well

tsejerome avatar Aug 31 '21 11:08 tsejerome

@tsejerome Sorry no updates for this, we are working on deployment using EKS clusters instead atm.

ariel-frischer avatar Aug 31 '21 11:08 ariel-frischer

Glad to see such support. Feel free to join @mifi's sponsors too: https://mifi.no/thanks/

aloisdg avatar Nov 15 '21 15:11 aloisdg

Wth the new docker file it may be easier to get it working now

is there any step by step tutorial for deploying this please

mindbugg avatar Jan 13 '22 08:01 mindbugg

No, but feel free to make one!

mifi avatar Jan 13 '22 10:01 mifi

Found that editly uses "xvfb-run" to create a virtual screen and get the frames from that. It is a software that needs to run in the background continuously So, running it would not be possible in AWS Lambda

mindbugg avatar Jan 13 '22 18:01 mindbugg

Can't the code that runs editly also use child_process to start xvfb-run in the backgroiund?

mifi avatar Jan 14 '22 05:01 mifi