sfirke commented on code in PR #44245: URL: https://github.com/apache/superset/pull/44245#discussion_r4018302655
########## 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, for example with `pip install playwright && playwright install-deps && playwright install chromium`. 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: Thanks. That command was removed in 9421ce46, after the commit you reviewed. The section no longer gives an inline install. For `-lean`-based images it links to the example Dockerfile on the Docker Builds page. That example is updated in #44240: it switches to `root`, installs `playwright` into `/app/.venv` with `uv pip`, then runs `playwright install-deps` and `playwright install chromium` before switching back to `superset`. --- 🤖 _Drafted by Claude Code, co-signed by @sfirke._ ########## docs/admin_docs/configuration/cache.mdx: ########## @@ -311,21 +311,27 @@ CACHE_WARMUP_EXECUTORS = [FixedExecutor("admin")] Use a dedicated read-only service account here rather than a personal admin account, so that thumbnail rendering and cache warmup tasks don't fail if a specific user's credentials change. -Additional Selenium WebDriver configuration can be set using `WEBDRIVER_CONFIGURATION`. You can -implement a custom function to authenticate Selenium. The default function uses the `flask-login` -session cookie. Here's an example of a custom function signature: +Thumbnails are rendered with Playwright and a headless Chromium browser. Extra Chromium launch +arguments can be set using `WEBDRIVER_OPTION_ARGS`. You can implement a custom function to +authenticate the Playwright browser context. The default function uses the `flask-login` session +cookie. Here's an example of a custom function signature: ```python -def auth_driver(driver: WebDriver, user: "User") -> WebDriver: +from playwright.sync_api import BrowserContext Review Comment: Good catch, thanks. `superset_config.py` is loaded by the webserver, beat and workers alike, so a top-level Playwright import breaks every service that doesn't have the browser. I checked it: with Playwright missing, the old example fails with `ModuleNotFoundError` and the new one imports cleanly. The example now imports `BrowserContext` (and `User`, which it used without importing) under `TYPE_CHECKING`, the same pattern `superset/utils/machine_auth.py` uses. It also returns the context instead of `pass`, to match the signature `MachineAuthProvider` expects. The fix is in #44243 (abb6524d52) and merged into this branch. --- 🤖 _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]
