ci: pre-pull and cache heavy e2e images via GitHub Actions cache - #14080
ci: pre-pull and cache heavy e2e images via GitHub Actions cache#14080glours wants to merge 3 commits into
Conversation
d3335a2 to
f878666
Compare
docker-agent
left a comment
There was a problem hiding this comment.
🟢 No issues found — LGTM! View logs.
f878666 to
c0b8477
Compare
…igurable Several e2e tests used fixed host ports (8070, 8080, 8090, etc.), global buildx builders registered with --use, and a hardcoded IPC container name. Under parallel execution these shared daemon-level resources caused port conflicts, buildkitd container-name collisions, and intermittent failures. Separately, the standalone make target hardcoded -parallel=1, forcing the entire standalone suite to run serially even though the same tests run in parallel in plugin mode. Changes: - Convert fixed host ports in four fixtures (network-test, sentences, build-test, volume-test) to ephemeral bindings; add ServicePublishedPort helper to framework.go to resolve the actual mapped port at runtime. - Give each buildx-builder test a unique daemon-scoped name via BuilderName helper, preventing container-name collisions between parallel goroutines. Applies to TestBuildPlatformsWithCorrectBuildxConfig, TestBuildPrivileged, TestBuildBuilder, TestBuildEntitlements, TestBuildTLS. - Rename the fixed ipc_mode_container to a project-scoped name (ipc_e2e-src) and update the ipc-test fixture accordingly. - Replace the hardcoded -parallel=1 in make e2e-compose-standalone with E2E_PARALLEL_PLUGIN?=4 and E2E_STANDALONE_PARALLEL?=4, aligning both modes with the effective GOMAXPROCS on 4-core GitHub Actions runners. Both variables are overridable (E2E_STANDALONE_PARALLEL=1 restores serial local debugging). - Raise the poll delay in watch_test.go long-running polls (90s/120s timeout) from the default 100ms to 1s; bump cascade_test.go and publish_test.go from 100ms to 500ms. Reduces CPU pressure without affecting effective test duration. The logging-driver fixture retains its fixed port 24224: the Docker fluentd log driver encodes fluentd-address at service-start time, making ephemeral resolution non-trivial. TestLoggingDriver is serial so there is no collision risk in practice. Signed-off-by: Guillaume Lours <glours@users.noreply.github.com>
c0b8477 to
8e52599
Compare
docker-agent
left a comment
There was a problem hiding this comment.
Assessment: 🟡 NEEDS ATTENTION
Two findings in the newly added code — one in pkg/e2e/framework.go and one in the Makefile — affect correctness of local developer runs and the new test helper.
| TEST_FLAGS?= | ||
| E2E_TEST?= | ||
| E2E_PARALLEL_PLUGIN?=4 | ||
| E2E_STANDALONE_PARALLEL?=4 |
There was a problem hiding this comment.
[medium] E2E_STANDALONE_PARALLEL defaults to 4, silently removing the serial guarantee for local make e2e-compose-standalone runs
The previous command hardcoded -parallel=1; standalone tests have always been run serially. This PR changes the default to 4, meaning any developer who runs make e2e-compose-standalone without explicitly setting E2E_STANDALONE_PARALLEL=1 will now get 4 parallel workers.
The PR description says "make e2e-compose-standalone unchanged for local runs", but this is a behaviour change. Standalone tests that rely on unique ports, container names, or Docker-daemon-global state (e.g., build caches, named builders) can fail intermittently when run 4-way in parallel. The recent history of this file also shows the standalone runner was previously kept serial for stability.
If the intent is to let CI run at higher parallelism while keeping local runs safe, the default should stay at 1 and only CI should override via the environment:
| E2E_STANDALONE_PARALLEL?=4 | |
| E2E_STANDALONE_PARALLEL?=1 |
| Confidence | Score |
|---|---|
| 🟡 moderate | 67/100 |
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
Add a GHA cache layer for the passive Docker images used by the e2e suite.
Before each test run the workflow attempts to restore a pre-built tar
from the cache (key = Docker engine version + sha256 of the image list).
On a cache hit the images are loaded with 'docker load'; on a miss they
are pulled in parallel ('xargs -P 4 -n 1') and saved for the next run.
A new allowlist .github/e2e-images.txt controls which images are cached.
It includes the infrastructure images that every test cell downloads:
docker:dind, mariadb, golang:alpine, fluent/fluent-bit:3.1.7-debug,
registry:3, and the sentences/nginx helper images. Images used by
pull-policy and image-identity assertions (alpine:* and several fixture-
specific tags) are intentionally absent so those tests remain unaffected.
The ci.yml changes are provided as .github/ci-workflow-cache-only.patch
because the sandbox environment lacks the GitHub 'workflow' OAuth scope.
Apply with:
git apply .github/ci-workflow-cache-only.patch
git rm .github/ci-workflow-cache-only.patch
git commit --amend --no-edit --signoff
Also fix ServicePublishedPort helper to take only the first line of
'compose port' output (SplitN), making it robust when a service is scaled.
Signed-off-by: Guillaume Lours <glours@users.noreply.github.com>
9045bd4 to
0f2a67f
Compare
The previous patch was generated with Python difflib which omits the required leading space on blank context lines, producing a 'corrupt patch' error when applied with git apply. Regenerated with git diff --cached to get proper unified diff format. Signed-off-by: Guillaume Lours <glours@users.noreply.github.com>
077f716 to
6602303
Compare
|
The measurements didn’t show any meaningful benefit from introducing the cache, so I’m closing the PR. |
What I did
Added a GHA cache layer for the passive Docker images used by the e2e suite.
A new allowlist
.github/e2e-images.txtlists the infrastructure images that every test cell downloads:docker:dind,mariadb,golang:alpine,fluent/fluent-bit:3.1.7-debug,registry:3, and thegtardif/sentences-*/nginx:alpinehelper images.Before each test run the workflow restores a pre-built tar from the GHA cache (key = Docker engine version + hash of the image list). On a cache hit the images are loaded instantly with
docker load; on a miss they are pulled in parallel (xargs -P 4 -n 1 docker pull) and saved for the next run. Any change to.github/e2e-images.txtautomatically invalidates the cache.Images used by pull-policy and image-identity assertions (
alpine:*and several fixture-specific tags) are intentionally absent from the list so those tests remain unaffected. No change to localmake e2e-composeormake e2e-compose-standaloneruns.Related issue
No related issue — this is a CI infrastructure improvement.
(not mandatory) A picture of a cute animal, if possible in relation to what you did
A panda that found its bamboo already pre-stocked instead of having to go fetch it 🐼