Skip to content

Build chromium images on the shared buildx builder - #358

Merged
Sayan- merged 2 commits into
mainfrom
hypeship/chromium-builds-shared-buildx
Aug 28, 2026
Merged

Build chromium images on the shared buildx builder#358
Sayan- merged 2 commits into
mainfrom
hypeship/chromium-builds-shared-buildx

Conversation

@Sayan-

@Sayan- Sayan- commented Aug 28, 2026

Copy link
Copy Markdown
Contributor

Moves the headful and headless image builds from 2-core hosted runners to the self-hosted pool, attached to the persistent deft-shared buildx builder (same setup as kernel/kernel's image builds). The builder's local layer store replaces type=gha caching, which was churning against the repo's 10GB Actions cache quota and making build times a lottery (79-700s). Docker Hub push, tags, and the e2e flow are unchanged.

Measured on this PR's own CI (run 33197223789):

build before (hosted) cold warm
chromium-headless 79-700s 242s 6s
chromium-headful 79-700s 375s 7s

The pristine-context reset and isolated Docker config are ported from kernel/kernel's auth-flow-simulator workflow; .github/buildkitd.toml is the recreate-fallback config.


Note

Medium Risk
Changes CI infrastructure (self-hosted runners, shared builder, fork skip) and image build caching; runtime images and push tags are unchanged but fork PRs no longer run these image/e2e jobs.

Overview
Moves chromium-headful and chromium-headless Docker builds from GitHub-hosted runners to self-hosted runners using the persistent deft-shared Buildx builder, matching the pattern used elsewhere in the org.

Caching and config: Drops type=gha cache import/export in favor of the builder’s local layer store. Adds .github/buildkitd.toml as a recreate fallback (longer retention for cache mounts/local context, 150GB storage cap with 100GB free-space floor). Buildx setup pins deft-shared, cleanup: false, and that config file.

Runner hygiene: Before build, jobs reset the checkout to a pristine context (clean + normalized file modes) so COPY cache keys stay stable on persistent workspaces. They also use a temp DOCKER_CONFIG while pointing BUILDX_CONFIG at ~/.docker/buildx-ci so registry login stays isolated without losing the shared builder.

Fork PRs: The docker job is skipped when the PR head is from a fork (no secrets and no self-hosted pool), which propagates to dependent e2e via needs instead of failing at Docker Hub login.

Reviewed by Cursor Bugbot for commit 5d3eb63. Bugbot is set up for automated code reviews on this repo. Configure here.

Both image jobs ran on 2-core hosted runners with type=gha layer caching.
Chromium layers are large, so mode=max churned against the repo's 10GB
Actions cache quota and builds swung 79s to 700s depending on eviction
luck. Move the jobs to the self-hosted pool and attach to the persistent
deft-shared builder, whose local layer store replaces the gha cache
entirely. Docker Hub push behavior and tags are unchanged; the e2e job
pulls the same images as before.

The pristine-context reset and isolated Docker config mirror
kernel/kernel's auth-flow-simulator workflow, which pioneered this setup:
persistent runner workdirs carry file modes that bust COPY cache keys,
and the shared BUILDX_CONFIG path is the one root-run CI from other
repos cannot clobber.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@Sayan-
Sayan- marked this pull request as ready for review August 28, 2026 19:18

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit e7248be. Configure here.

Comment thread .github/workflows/chromium-headful-image.yaml
The docker jobs now run on the persistent self-hosted pool, and this is
a public repo: a fork PR must not execute on those runners. Fork PRs
previously failed at Docker Hub login (forks get no secrets); with the
guard they and the dependent e2e job skip instead.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

@tnsardesai tnsardesai left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

agent review flagged this blocker! I haven't checked if its possible yet but comment seems valid

  • .github/workflows/chromium-headful-image.yaml:8-12 and .github/workflows/chromium-headless-image.yaml:8-12 — the new if guard is part of the PR-controlled workflow, so a fork can remove it in the same change and request the self-hosted label directly. Approval gates reduce exposure but do not make the persistent runner safe after approval. This needs enforcement outside PR-controlled code—such as runner-group access restricted to a trusted default-branch workflow—or fork PRs must have no access to this self-hosted runner pool.

@sjmiller609
sjmiller609 removed their request for review August 28, 2026 19:49
@Sayan-

Sayan- commented Aug 28, 2026

Copy link
Copy Markdown
Contributor Author

Addressing the blocker with a control outside PR-controlled code, now in place:

The org Actions policy is set to require approval for workflow runs from all external contributors. That lives in org settings, a fork cannot edit it, and it means fork code has no execution path on any runner (deft included) unless a maintainer explicitly approves that specific run. Combined with the job-level guard (which covers the approved-but-unmodified case), fork PRs get: no auto-execution, and skipped builds even when approved.

SCR-20260828-numr

On the suggested runner-group workflow restriction: we looked at it, and it cannot serve this use case. Pinning the group to refs/heads/main also rejects same-repo pull_request jobs, because PR runs execute from merge refs, which would kill the PR build path this PR exists to speed up. Wildcard refs only block net-new workflow files, not edits to the listed ones.

Remaining residual: a maintainer approving a run from a fork that edited the workflows. Two things bound it: this repo has never merged a fork PR (0 of the last 29), and the working norm is that fork runs do not get approved. If we want that mechanized, a small pull_request_target auto-closer (executes the base repo's copy, forks cannot modify it, runs on hosted only) would close fork PRs before an approval is ever possible. Happy to ship that as a follow-up; it does not need to gate this PR.

Does that clear the blocker?

@Sayan-
Sayan- requested a review from tnsardesai August 28, 2026 22:37
@Sayan-
Sayan- merged commit edaff49 into main Aug 28, 2026
14 of 15 checks passed
@Sayan-
Sayan- deleted the hypeship/chromium-builds-shared-buildx branch August 28, 2026 23:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants