This thread is trying to answer question "Has anyone been able to build a docker image containing playwright to use as an AWS lambda function with Python?"
Hi, those people might be hard to find, since running in AWS Lambda is uncommon and then combining that with Python makes it even less common. So despite not having experience with this, I thought I'd try to be helpful (maybe just being the 'rubber duck').
What issues are you running into?
And have you had a look at these articles? Especially on stackoverflow there seems to be some information on similar efforts by other people: https://www.google.com/search?q=playwright+aws+lambda+python
And there seems to be a Japanese article from someone who has succeeded at it. Linking to the Google translation of it: https://tech-smartshopping-co-jp.translate.goog/lambda-container-playwright?_x_tr_sl=auto&_x_tr_tl=en&_x_tr_hl=en&_x_tr_pto=wapp
Hi! I've been through that, only node.js, not Python but I managed to run Playwright inside docker in AWS Lambda and it's running on production already for couple of weeks 🙂 It did require a bit of research as it's not officially supported but it's there. AMA - I might be able to help if I ran into the same issues as you're having with Python.
BTW I'm using a custom docker image based on Ubuntu, couldn't make it work on images provided by AWS so I went the other way. I made my Ubuntu image compatible with AWS Lambda which is quite easy and all documented on AWS.
I had to use --single-process
to run inside Lambda. Otherwise I was getting some weird errors which I can't remember now but it was something with DBus which is a Linux IPC which Chrome probably uses to communicate between child processes. For some reason it wasn't working properly even though my base image was a regular Ubuntu which should support that.
I couldn't find any workaround for that though so ended up with this single process flag. However I don't see any downsides. It's already running for more than half year (e2e tests every day) and so far so good.
Rayrun is a community for QA engineers. I am constantly looking for new ways to add value to people learning Playwright and other browser automation frameworks. If you have feedback, email [email protected].