fix(ci): give gitlab perf job a discoverable chromium (ADR-0028) #243

Merged
julien merged 1 commits from fix/gitlab-perf-chrome into main 2026-05-28 10:12:07 +02:00
Owner

Summary

Fix the GitLab perf job, which failed at the Lighthouse CI healthcheck with Chrome installation not found. Follow-up on ADR-0028 Phase 2 (.gitlab-ci.yml landed in #241).

Root cause

The perf job ran on mcr.microsoft.com/playwright:v1.55.0-jammy. That image does ship Chromium, but under /ms-playwright/chromium-<rev>/chrome-linux/chrome — a non-standard path/name. Lighthouse CI uses chrome-launcher, which discovers Chrome by probing the PATH (google-chrome, chromium, chromium-browser) or the CHROME_PATH env var. It cannot find Playwright's bundled Chromium, so the healthcheck fails before any run starts.

The same class of failure ("absence de Chrome pour Lighthouse") was hit and solved on the Gitea side — there the catthehacker/ubuntu:full-22.04 image happened to carry Chrome at a standard location.

Fix

Decouple the two browser-driving tools instead of forcing one image to serve both:

Aspect Before After
image mcr.microsoft.com/playwright:v1.55.0-jammy node:24-bookworm (same as the .node-job base)
Chrome bundled, undiscoverable apt-get install --no-install-recommends chromium/usr/bin/chromium
CHROME_PATH unset /usr/bin/chromium (explicit, removes any PATH ambiguity)
before_script inherited !reference [.node-job, before_script] + the apt install

Rationale for not pinning Playwright's Chromium via CHROME_PATH instead: that couples the perf job to an exact match between the npm @playwright/test version and the Docker image tag. A Renovate bump of @playwright/test while the image stays at v1.55.0 would silently break executablePath(). The apt-installed Debian chromium has no such coupling.

The future ADR-0016 axe-core e2e job — which drives Playwright directly — will use the Playwright image. Lighthouse wants a standard Chrome; Playwright wants its own browsers. Different tools, different images.

lighthouserc.js already passes --no-sandbox (containerised-CI requirement), so no change needed there — that flag's rationale applies identically on GitLab Runner.

Trade-off noted

The apt-get install chromium re-downloads ~100 MB per perf run (the package lands in the job container's ephemeral writable layer, not a cached image layer). Acceptable for now. If perf-job duration or vm-gitlab bandwidth becomes a pain, the clean optimisation is a small custom image with Chromium pre-installed, pushed to GitLab's Container Registry — out of scope here, flagged for later.

Test plan

  • GitLab perf job reaches the Lighthouse run (no more Chrome installation not found) and the ADR-0017 assertions evaluate.
  • chromium apt install completes on node:24-bookworm (Debian bookworm main carries the package).
  • .gitlab-ci.yml passes GitLab CI Lint (Project → Build → Pipeline Editor → Validate) — confirms the !reference + added keys parse.
  • Other jobs (check, audit, commits, a11y, sast, secret_detection) unaffected.

Related

  • ADR-0028 Phase 2 — .gitlab-ci.yml (#241).
  • ADR-0017 — Lighthouse CI perf budgets.
  • ADR-0016 — future axe-core e2e (will own the Playwright image).
## Summary Fix the GitLab `perf` job, which failed at the Lighthouse CI healthcheck with `Chrome installation not found`. Follow-up on [ADR-0028](../docs/decisions/0028-migrate-cicd-and-git-hosting-to-gitlab.md) Phase 2 (`.gitlab-ci.yml` landed in #241). ## Root cause The `perf` job ran on `mcr.microsoft.com/playwright:v1.55.0-jammy`. That image **does** ship Chromium, but under `/ms-playwright/chromium-<rev>/chrome-linux/chrome` — a non-standard path/name. Lighthouse CI uses `chrome-launcher`, which discovers Chrome by probing the `PATH` (`google-chrome`, `chromium`, `chromium-browser`) or the `CHROME_PATH` env var. It cannot find Playwright's bundled Chromium, so the healthcheck fails before any run starts. The same class of failure ("absence de Chrome pour Lighthouse") was hit and solved on the Gitea side — there the `catthehacker/ubuntu:full-22.04` image happened to carry Chrome at a standard location. ## Fix Decouple the two browser-driving tools instead of forcing one image to serve both: | Aspect | Before | After | | --- | --- | --- | | `image` | `mcr.microsoft.com/playwright:v1.55.0-jammy` | `node:24-bookworm` (same as the `.node-job` base) | | Chrome | bundled, undiscoverable | `apt-get install --no-install-recommends chromium` → `/usr/bin/chromium` | | `CHROME_PATH` | unset | `/usr/bin/chromium` (explicit, removes any PATH ambiguity) | | `before_script` | inherited | `!reference [.node-job, before_script]` + the apt install | Rationale for not pinning Playwright's Chromium via `CHROME_PATH` instead: that couples the perf job to an exact match between the npm `@playwright/test` version and the Docker image tag. A Renovate bump of `@playwright/test` while the image stays at `v1.55.0` would silently break `executablePath()`. The apt-installed Debian `chromium` has no such coupling. The future ADR-0016 axe-core e2e job — which drives **Playwright** directly — will use the Playwright image. Lighthouse wants a standard Chrome; Playwright wants its own browsers. Different tools, different images. `lighthouserc.js` already passes `--no-sandbox` (containerised-CI requirement), so no change needed there — that flag's rationale applies identically on GitLab Runner. ## Trade-off noted The `apt-get install chromium` re-downloads ~100 MB per perf run (the package lands in the job container's ephemeral writable layer, not a cached image layer). Acceptable for now. If perf-job duration or `vm-gitlab` bandwidth becomes a pain, the clean optimisation is a small custom image with Chromium pre-installed, pushed to GitLab's Container Registry — out of scope here, flagged for later. ## Test plan - [ ] GitLab `perf` job reaches the Lighthouse run (no more `Chrome installation not found`) and the ADR-0017 assertions evaluate. - [ ] `chromium` apt install completes on `node:24-bookworm` (Debian bookworm `main` carries the package). - [ ] `.gitlab-ci.yml` passes GitLab CI Lint (Project → Build → Pipeline Editor → Validate) — confirms the `!reference` + added keys parse. - [ ] Other jobs (`check`, `audit`, `commits`, `a11y`, `sast`, `secret_detection`) unaffected. ## Related - [ADR-0028](../docs/decisions/0028-migrate-cicd-and-git-hosting-to-gitlab.md) Phase 2 — `.gitlab-ci.yml` (#241). - [ADR-0017](../docs/decisions/0017-performance-budgets-lighthouse-ci.md) — Lighthouse CI perf budgets. - [ADR-0016](../docs/decisions/0016-accessibility-baseline-wcag-aa-targeted-aaa.md) — future axe-core e2e (will own the Playwright image).
julien added 1 commit 2026-05-28 10:08:41 +02:00
fix(ci): give gitlab perf job a discoverable chromium (ADR-0028)
CI / scan (pull_request) Successful in 2m48s
CI / commits (pull_request) Successful in 2m59s
CI / check (pull_request) Successful in 3m13s
CI / a11y (pull_request) Successful in 1m34s
CI / perf (pull_request) Successful in 6m22s
441b9297ce
The perf job ran on the Playwright image, which bundles Chromium at
a non-standard path that Lighthouse's chrome-launcher cannot find —
the job failed at the healthcheck with 'Chrome installation not
found'.

Switch perf to node:24-bookworm and apt-install Debian's chromium
(/usr/bin/chromium), pointing CHROME_PATH at it. Preferred over
wiring CHROME_PATH to Playwright's bundled Chromium because the
latter couples the job to an exact @playwright/test-version vs
image-tag match that a Renovate bump would silently break.

The future ADR-0016 axe-core e2e job will use the Playwright image;
Lighthouse and Playwright want different things, so they get
different images rather than one that serves both poorly.
julien merged commit e88263a985 into main 2026-05-28 10:12:07 +02:00
julien deleted branch fix/gitlab-perf-chrome 2026-05-28 10:12:08 +02:00
Sign in to join this conversation.
No Reviewers
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: julien/apf_portal#243