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

[Feature] Support for AWS Lambda / Serverless environments #2404

Closed
mxschmitt opened this issue May 29, 2020 · 14 comments
Closed

[Feature] Support for AWS Lambda / Serverless environments #2404

mxschmitt opened this issue May 29, 2020 · 14 comments

Comments

@mxschmitt
Copy link
Member

mxschmitt commented May 29, 2020

A lot of users try to use Puppeteer and Playwright in special environments like on Vercel (formerly ZEIT) which is based on Amazon Linux 2 / Lamda or directly on AWS Lamda. Also there are quite a few interesting use cases for Google Cloud Functions / Azure Functions.

Would be good to investigate into them, if separate browser binaries can be provided for that or an official buildpack for Heroku.

Probably it does not make sense to support all the browsers there, only Chromium would be already a big win.

(also userspace is possible)

Ref:

For AWS Lambda / Google Cloud / Vercel functions this works currently: https://github.com/alixaxel/chrome-aws-lambda#usage-with-playwright

@zedd3v
Copy link

zedd3v commented Jun 19, 2020

+1

@osmenia
Copy link

osmenia commented Jun 24, 2020

any news?

@mxschmitt
Copy link
Member Author

mxschmitt commented Jul 3, 2020

Closed, since for AWS Lambda based systems this can be used and for Heroku https://github.com/mxschmitt/heroku-playwright-buildpack buildpack should now work too.

@jan-osch
Copy link

jan-osch commented Jul 3, 2020

Hi @mxschmitt -first of all, thanks for the awesome library! 😄

The current support for AWS Lambda is partial (only chromium works). As far as I know, porting Firefox and Webkit to Lambda would require static compiling all the missing libraries + applying the playwright patches.

Since the playwright team is already preparing other browser images, could you also prepare Lambda compatible binaries for Webkit and FF? That would be enormously helpful. Even some suggestions on how to tackle this problem would be great. The playwright-aws-lambda project does not seem very active.

@mxschmitt mxschmitt reopened this Jul 3, 2020
@mxschmitt mxschmitt changed the title [Investigate] Support for AWS Lambda / Serverless / Heroku [Investigate] Support for AWS Lambda / Serverless environments Jul 3, 2020
@mxschmitt
Copy link
Member Author

@jan-osch I full agree. I reopened it to keep track on solutions to run Firefox and WebKit in serverless functions. Having this out of the box would be great.

@CyberV
Copy link

CyberV commented Jul 5, 2020

Closed, since for AWS Lambda based systems this can be used and for Heroku https://github.com/mxschmitt/heroku-playwright-buildpack buildpack should now work too.

What about Azure support? I'm currently running into the same 'failed to launch browser' error while trying to launch browser from an Azure App Service. Same for an Azure Function with dockerized container.

And Thanks a TON for the heroku build pack. You just saved more than just my day.

@mxschmitt
Copy link
Member Author

@CyberV for Azure Functions, you can follow this example by @arjun27: https://github.com/arjun27/playwright-azure-functions

@arjunattam
Copy link
Contributor

@CyberV, thanks for the comment. This is the current state of running Playwright on Azure Functions:

  • Azure Functions Linux: Chromium can run on the Linux consumption (basic) plan, without any additional dependencies. Firefox and WebKit require the Linux premium plan, with a custom docker setup. @mxschmitt has shared an example above.
  • Azure Functions Windows: running headless browsers is not supported, due to missing Windows libs.

Are you running on Windows?

@dgozman dgozman changed the title [Investigate] Support for AWS Lambda / Serverless environments [Feature] Support for AWS Lambda / Serverless environments Nov 24, 2020
@paya-cz
Copy link

paya-cz commented Apr 15, 2021

The playwright-aws-lambda package mentioned earlier as a solution for AWS Lambda users seems to be abandoned. Last release 8 months ago. Bundled Chromium was last updated 11 months ago.

It would be great to have officially supported playwright package for AWS Lambda and updated with the same cadence as other playwright packages.

@mxschmitt
Copy link
Member Author

The original project has now also added some documentation to its project how to use Playwright with it. This project has quite recent builds: https://github.com/alixaxel/chrome-aws-lambda#usage-with-playwright

@ycjcl868
Copy link

+1

@pavelfeldman
Copy link
Member

This is not something Playwright team is actively looking at, so closing it to manage the expectations.

@mdw123
Copy link

mdw123 commented May 27, 2022

FWIW, chrome-aws-lambda now appears to be abandoned.

@b5414
Copy link

b5414 commented Jun 9, 2022

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

No branches or pull requests