Skip to content
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

Layer with Python runtime support #63

Open
justincandoit opened this issue Dec 1, 2023 · 5 comments
Open

Layer with Python runtime support #63

justincandoit opened this issue Dec 1, 2023 · 5 comments

Comments

@justincandoit
Copy link

Would it be possible to create a similar Chrome AWS Lambda layer that is compatible with Python Lambda functions?

@vladholubiev
Copy link
Member

It is supported; we publish the layer without restricting the runtime.

@justincandoit
Copy link
Author

Do you know what the import statement would be?

@vladholubiev
Copy link
Member

The layer contains a pre-compiled Chromium binary, which you can run just like any other executable in Python. It's probably located at /var/task/bin/chromium, but to confirm, you might want to download the Lambda Layer ZIP from AWS and check for yourself.

@hexi-verifiet
Copy link

Hey @vladholubiev, I had a similar use case of trying to launch Playwright-Python (Pyppeteer package recommended Playwright) browser on a lambda function using the layer here. I ran into two issues:

  1. The path for my lambda layer has been '/opt/nodejs/node_modules/@sparticuz/chromium/bin'. I've gotten this path to work well with Nodejs puppeteer. This invocation is returning BrowserType.launch: Failed to launch:Error: spawn /opt/nodejs/node_modules/@sparticuz/chromium/bin EACCES and I'm unable to debug from here. Is this bin the correct binary to invoke?
  2. Seems like the architecture of x86_64 is not compatible with ARM_64. The reason I used ARM was to use PIP for code bundling. Looks like this request should address this incompatibility: [REQUEST] arm64 support Sparticuz/chromium#186

@Sechorda
Copy link

Hey @vladholubiev, I had a similar use case of trying to launch Playwright-Python (Pyppeteer package recommended Playwright) browser on a lambda function using the layer here. I ran into two issues:

  1. The path for my lambda layer has been '/opt/nodejs/node_modules/@sparticuz/chromium/bin'. I've gotten this path to work well with Nodejs puppeteer. This invocation is returning BrowserType.launch: Failed to launch:Error: spawn /opt/nodejs/node_modules/@sparticuz/chromium/bin EACCES and I'm unable to debug from here. Is this bin the correct binary to invoke?
  2. Seems like the architecture of x86_64 is not compatible with ARM_64. The reason I used ARM was to use PIP for code bundling. Looks like this request should address this incompatibility: [REQUEST] arm64 support Sparticuz/chromium#186

Can you please share more info?

When I download the .zip layer I only see nodejs/node_modules. How do I use this within python runtime?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

4 participants