Pre-bake ProtoFleet E2E runner dependencies - #985
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 9dbac9369e
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| name: Build runner image | ||
| if: >- | ||
| vars.PROTOFLEET_E2E_IMAGE_BUILDER_RUNNER != '' && | ||
| github.ref_name == github.event.repository.default_branch |
There was a problem hiding this comment.
Require the default branch ref before snapshotting
For workflow_dispatch, the selected ref may be a tag, and github.ref_name strips the refs/tags/ prefix. A writable tag named like the default branch therefore satisfies this condition, after which checkout and the preparation script bake that tag's dependencies and Docker images into the shared E2E runner image. This can persist unreviewed code in later CI runs; compare the full github.ref against refs/heads/<default_branch> instead.
Useful? React with 👍 / 👎.
🔐 Codex Security Review
Review SummaryOverall Risk: HIGH Findings[HIGH] Automated review incomplete
NotesHuman review is required because the bounded automated review was incomplete. Generated by Codex Security Review | |
ankitgoswami
left a comment
There was a problem hiding this comment.
seems like a good idea if we can get a custom runner
Reviewable diff: +1552/-12 across 8 files (excludes generated, test, and story files).
Summary
ProtoFleet E2E can now run on an opt-in GitHub-hosted custom VM image that preloads the exact client dependency tree, matching Playwright browser, and Docker Compose images. Hash and presence checks keep stale image components from being used, while the existing
ubuntu-latest, Actions cache, and Docker artifact paths remain the default and fallback. This also checks in the timing analyzer and baseline used to measure whether the runner reduces overhead or causes regressions.How it works
A trusted weekly or manual workflow on the default branch prepares a Linux x64 image-generation runner, writes a manifest containing the source SHA plus
hashFilesdigests, and snapshots it asprotofleet-e2e. Once an administrator provisions a runtime larger runner and setsPROTOFLEET_E2E_RUNNER, the E2E build, 32 functional shards, and two visual jobs land on that image.After checkout, a local action compares the current server and lockfile hashes with the manifest. Matching client dependencies are copied into the workspace, Playwright is pointed at the baked Chromium tree, and Docker images are accepted only if every recorded image is still present in the host daemon. Each component falls back independently; scheduled E2E runs always rebuild Docker images against fresh upstream bases, and the build job still publishes an image artifact so older runner instances can fall back safely during image rollouts.
The timing analyzer reads completed PR Gate runs and latest-attempt job data from GitHub, groups the newest successful runs per PR, classifies step time as test, validation/build, or overhead, and emits Markdown/JSON plus a regression comparison against the checked-in baseline.
Diagrams
flowchart LR A["Trusted default-branch image workflow"] --> B["Image-generation larger runner"] B --> C["Install Node dependencies and Chromium"] B --> D["Pull and build Compose images"] C --> E["Write hash manifest"] D --> E E --> F["Snapshot protofleet-e2e"] F --> G["Runtime larger runner"] H["PR E2E job"] --> I["Hash-aware restore action"] G --> I I --> J{"Component matches and exists?"} J -->|"Yes"| K["Use pre-baked component"] J -->|"No"| L["Use existing cache or artifact path"] K --> M["Build, functional shards, and visual tests"] L --> MsequenceDiagram participant Admin as "CI administrator" participant Builder as "Image workflow" participant GitHub as "Custom image store" participant E2E as "PR E2E job" Admin->>Builder: "Configure builder variable and run on main" Builder->>GitHub: "Snapshot tools, dependencies, Docker images, and manifest" Admin->>E2E: "Configure runtime runner variable" E2E->>E2E: "Compare current hashes and inspect Docker images" alt "Valid pre-baked component" E2E->>E2E: "Restore or reuse local component" else "Missing or stale component" E2E->>E2E: "Restore Actions cache/artifact or rebuild" endAreas of the code involved
.github/workflows/protofleet-e2e-runner-image.ymlsnapshot.github/actions/protofleet-e2e-runner/.github/scripts/prepare_protofleet_e2e_runner.sh.github/scripts/restore_protofleet_e2e_runner.sh.github/workflows/protofleet-e2e-tests.yml.github/scripts/analyze_ci_timings.pyand baselinedocs/plans/2026-08-31-protofleet-e2e-prebaked-runner-plan.mdKey technical decisions & trade-offs
ubuntu-latestas the variable fallback rather than requiring organization infrastructure at merge time; activation and rollback are configuration-only.Testing & validation
server/sdk/v1/python/.venv/bin/python -B .github/scripts/protofleet_e2e_runner_test.py— 5 tests passed.server/sdk/v1/python/.venv/bin/python -B .github/scripts/analyze_ci_timings_test.py— 7 tests passed.server/sdk/v1/python/.venv/bin/python -B .github/scripts/evaluate_review_policy_test.py— 72 tests passed.git diff --checkpassed.