sfirke commented on code in PR #44243: URL: https://github.com/apache/superset/pull/44243#discussion_r4017701447
########## docs/admin_docs/configuration/alerts-reports.mdx: ########## @@ -50,13 +50,10 @@ Screenshots will be taken but no messages actually sent as long as `ALERT_REPORT #### In your `Dockerfile` -You'll need to extend the Superset image to include a headless browser. Your options include: +As of 7.0.0, Superset takes screenshots only with [Playwright](https://playwright.dev/python/) driving a headless Chromium browser. Selenium, Firefox, geckodriver and the `WEBDRIVER_TYPE` setting are not supported, and no feature flag is needed to use Playwright. Prior to 7.0.0, users were responisble for installing their own headless browser, and could use Selenium if desired. -- Use Playwright with Chromium: this is the recommended approach as of version 4.1.x or greater. Playwright always uses Chromium — the `WEBDRIVER_TYPE` config setting has no effect when Playwright is active. A working example of a Dockerfile that installs these tools is provided under "Building your own production Docker image" on the [Docker Builds](/admin-docs/installation/docker-builds#building-your-own-production-docker-image) page. Enable the `PLAYWRIGHT_REPORTS_AND_THUMBNAILS` feature flag in your config to activate it. -- Use Firefox (Selenium): you'll need to install geckodriver and Firefox. Set `WEBDRIVER_TYPE` to `"firefox"` in your `superset_config.py`. -- Use Chrome (Selenium): you'll need to install Chrome. Set `WEBDRIVER_TYPE` to `"chrome"` in your `superset_config.py`. - -In Superset versions <=4.0x, users installed Firefox or Chrome and that was documented here. +- The default Superset image (for example the `latest` and `<version>` tags) includes Playwright and Chromium. +- The `lean` image and custom images need them installed. A working example of a Dockerfile that installs these tools is provided under "Building your own production Docker image" on the [Docker Builds](/admin-docs/installation/docker-builds#building-your-own-production-docker-image) page. Review Comment: Good catch, thanks. You're right that the published `-dev` image has no browser: `scripts/docker-build-extra-flags.sh` passes `INCLUDE_CHROMIUM=false` for every preset, and the `dev` stage builds from `python-common` rather than the `superset` stage that bundles Chromium. I've updated this section to cover `-lean` and `-dev` separately, including how to build `dev` with `INCLUDE_CHROMIUM=true`. The linked Docker Builds page is fixed in #44240, which I kept separate to keep this diff focused. That PR says `-dev` has no headless browser, drops `PLAYWRIGHT_REPORTS_AND_THUMBNAILS` and the Selenium note from the example Dockerfile, and (in a new commit) removes the leftover sentence about enabling a feature flag. The two PRs should ideally merge together. --- 🤖 _Drafted by Claude Code, co-signed by @sfirke._ ########## docs/admin_docs/configuration/alerts-reports.mdx: ########## @@ -388,20 +385,13 @@ SMTP_PASSWORD = "your_password" # use the empty string "" if using an unauthenti SMTP_MAIL_FROM = "[email protected]" EMAIL_REPORTS_SUBJECT_PREFIX = "[Superset] " # optional - overwrites default value in config.py of "[Report] " -# WebDriver configuration -# If you use Firefox or Playwright with Chrome, you can stick with default values -# If you use Chrome and are *not* using Playwright, then add the following WEBDRIVER_TYPE and WEBDRIVER_OPTION_ARGS -WEBDRIVER_TYPE = "chrome" -WEBDRIVER_OPTION_ARGS = [ - "--force-device-scale-factor=2.0", - "--high-dpi-support=2.0", - "--headless", - "--disable-gpu", - "--disable-dev-shm-usage", - "--no-sandbox", - "--disable-setuid-sandbox", - "--disable-extensions", -] +# Screenshot browser configuration +# Playwright always launches Chromium, so there is no browser type to set, and the +# defaults work for most deployments. To render sharper screenshots, raise +# pixel_density in WEBDRIVER_WINDOW (the sizes shown are the defaults). Extra +# Chromium launch arguments can be passed with WEBDRIVER_OPTION_ARGS. +# WEBDRIVER_WINDOW = {"dashboard": (1600, 2000), "slice": (3000, 1200), "pixel_density": 2} Review Comment: Agreed, thanks. The default in `superset/config.py` is `1`, and uncommenting a line labeled as defaults shouldn't quadruple screenshot size. The sample now shows the real defaults, including `pixel_density: 1`. --- 🤖 _Drafted by Claude Code, co-signed by @sfirke._ -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
