Slim CI image: drop unused firefox/webkit/chrome#2
Conversation
The CI E2E job's "Initialize containers" step spends ~10 min pulling this image (pixiebrix-source#9209) — the whole overrun, and far longer than the tests themselves. The batteries-included mcr.microsoft.com/playwright base bakes firefox + webkit into its layers, so they're pulled on every shard even though neither E2E suite uses them: - webext-e2e launches the `chromium` and `msedge` channels - web-app-e2e uses bundled `chromium` - the `chrome` channel is disabled (pixiebrix-source#2797) Build on the official Node base (pinned to the monorepo's Node) and install only chromium + msedge + msedge-beta with --with-deps. Set PLAYWRIGHT_BROWSERS_PATH=/ms-playwright and recreate uid-1001 pwuser to match the official image layout so the browsers resolve at runtime (no re-download) and `--user 1001` keeps working. Update release.yml to derive the image tag from the @playwright/test pin instead of the (now removed) mcr FROM line. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
1 issue found.
About Unblocked
Unblocked has been set up to automatically review your team's pull requests to identify genuine bugs and issues.
📖 Documentation — Learn more in our docs.
💬 Ask questions — Mention @unblocked to request a review or summary, or ask follow-up questions.
👍 Give feedback — React to comments with 👍 or 👎 to help us improve.
⚙️ Customize — Adjust settings in your preferences.
| RUN npx --yes @playwright/test@1.57.0 install --with-deps chromium msedge msedge-beta && \ | ||
| chmod -R a+rX /ms-playwright && \ | ||
| rm -rf /var/lib/apt/lists/* |
There was a problem hiding this comment.
npx --yes @playwright/test@1.57.0 downloads the package into npm's cache (/root/.npm) and npx's staging area before running the install sub-command. These artefacts are never cleaned up, so they remain in this layer permanently. Given the PR's goal is to shrink pull time, it's worth purging them in the same RUN:
| RUN npx --yes @playwright/test@1.57.0 install --with-deps chromium msedge msedge-beta && \ | |
| chmod -R a+rX /ms-playwright && \ | |
| rm -rf /var/lib/apt/lists/* | |
| RUN npx --yes @playwright/test@1.57.0 install --with-deps chromium msedge msedge-beta && \ | |
| chmod -R a+rX /ms-playwright && \ | |
| rm -rf /var/lib/apt/lists/* /root/.npm /tmp/* |
Why
On the monorepo E2E job, the built-in "Initialize containers" step takes ~10 min, essentially all of it a single
docker pullof this image — longer than the tests themselves (pixiebrix/pixiebrix-source#9209). By contrast the Docker Hub service images (postgres,redis) pull in ~2s because Blacksmith mirrors docker.io; this GHCR image is pulled uncached. It's paid on every shard (chromium×4 + msedge×4, more with foundever).The batteries-included
mcr.microsoft.com/playwrightbase bakes firefox + webkit into its base layers, so they're pulled on every job even though neither E2E suite uses them:chromiumandmsedgechannelschromium(devices["Desktop Chrome"]is a viewport/UA descriptor, not thechromechannel)chromechannel is disabled (pixiebrix/pixiebrix-source#2797)What
node:24.18.0-bookworm, pinned to the monorepo's Node — Node publishes no Ubuntu-nobleimage; Playwright supports Debian 12) and install onlychromium+msedge+msedge-betawith--with-deps.PLAYWRIGHT_BROWSERS_PATH=/ms-playwrightand recreate the uid-1001pwuser, mirroring the official image layout, so browsers resolve at runtime without re-downloading and--user 1001keeps working. (This preserves the pull-vs-post-pull-install balance: browsers are baked at image-build time, not installed during monorepo CI.)release.ymlto derive the image tag from the@playwright/test@<version>pin, since theFROM mcr.microsoft.com/playwright:vX.Y.Zline it previously grepped is gone.Rollout / risk
The tag is version-derived, so the Playwright pin is unchanged (
1.57.0) → this republishes1.57.0(andlatest) in place, same as the existing 3-day auto-rebuild. The monorepo already references1.57.0, so it picks up the slimmed image on the next pull with no monorepo change.Because I can't build/run the image locally, please validate before relying on it — e.g. build to a scratch tag and run a monorepo E2E pass, or merge during a quiet window with a revert ready. Two things to confirm on the new base:
playwright install --with-deps msedge msedge-betaresolves the Edge channels on Debian bookworm./ms-playwright(permsa+rX) are readable/executable by uid 1001 at runtime with no re-download.Refs pixiebrix/pixiebrix-source#9209