ddev / ddev-contrib

Contrib space for DDEV services, tools, snippets, and approaches.
Apache License 2.0
162 stars 162 forks source link

Update Puppeteer Chrome recipe to support latest ddev web image version and workaround for Apple M1 arch #196

Open juban opened 2 years ago

juban commented 2 years ago

The New Solution:

This PR provides a reliable way to make Puppeteer run inside the ddev web container (replacing the current "Puppeteer Headless Chrome support" recipe).

How this PR Solves The Problem:

The previous recipe was not working anymore on latest ddev web container images (> 1.16) because of outdated packages. Also, the current chromium bundled version in Puppeteer is not working on Apple Silicon M1 architecture. This update provides a workaround by overriding the webimage_extra_packages configuration to install a native chromium package which puppeteer will use instead of the bundled one.

Manual Testing Instructions:

Follow instructions provided in the recipe recipes/puppeteer-chromium-support/README.md file.

Related Issue Link(s):

https://github.com/drud/ddev-contrib/issues/192 (Not directly related as the "Headless Chrome for Behat Testing" service seams to work fine on M1)

rfay commented 2 years ago

Please reach out for some other puppeteer users to review this, thanks!

juban commented 2 years ago

@rfay Will do. Do you have anyone in mind I could reach out in the ddev community? @isholgueras or @jonaseberle maybe?

jonaseberle commented 2 years ago

Installing headless browsers into the web container is not for me. I also don't use Puppeteer but selenium hub with chrome and firefox.

rfay commented 2 years ago

Current ddev stable is v1.18, not sure why this is trying to support v1.16 and higher?

juban commented 2 years ago

@rfay In fact, the previous recipe stopped working starting ddev 1.16, in other words, the updated recipe will work on ddev 1.16 and upper. Sorry for not being clear.

rfay commented 2 years ago

Thanks for the explanation. I'm not sure the difference is worth explaining, or that it's worth encouraging people to use ddev v1.16 :)

juban commented 2 years ago

Yes, maybe a simple "latest ddev version" would be better, I agree. I wanted to stick to the contribution guidelines which state that the goal of the update should be specified clearly. I'll simplified that.

juban commented 2 years ago

I fixed the README file accordingly.

rfay commented 2 years ago

Could you please rebase this and test with ddev v1.19.0?

Thanks!

rfay commented 1 year ago

The best place for ongoing work is https://github.com/drud/ddev-selenium-standalone-chrome