octaltree / playwright-rust

Playwright port to Rust
316 stars 36 forks source link

Running on Lambda Function #16

Open aydrian opened 3 years ago

aydrian commented 3 years ago

Was wondering if anyone has tried getting the to run on a Rust AWS Lambda function? The Node.js side has playwright-aws-lambda to assist. It's currently failing for me because Playwright::initialize() attempts to download the driver to the read-only file system. Wondering if it'd be possible to use Playwright::with_driver(driver) with a driver packaged with the function.

Thank you

d4h0 commented 2 years ago

Have you seen Playwright::with_driver?

You can install browsers yourself, and then point Playwright to their location.

Looks like, that's what playwright-aws-lambda does.

physics515 commented 2 years ago

Have you seen Playwright::with_driver?

You can install browsers yourself, and then point Playwright to their location.

Any examples of how this would look in practice? I'm fairly new to Rust and I'm trying to get this working with Docker. I have it working but the browsers are not persistent between container spin-ups. I have mounted a persistent storage to the container, but I need to figure out how to specify the download location.

jtomek commented 2 years ago

Would somebody like to team up and develop a Dockerfile and SAM configuration that would "just run" on AWS Lambda? I have been looking into this for weeks, developed half-done solutions for what looks like all Linux distributions, but cannot manage to finalise it:

Key challenges (no particular order) I have faced:

I would love to team up with somebody and share the Dockerfiles and SAM configuration so we can provide a solution to the community.