Repository navigation
fix(ci): retry buildx create in builder setup; harden clean_builder - #504
Merged
Merged
Conversation
Concurrent jobs of a pipeline (e.g. base and base-cuda) share one BuildKit
builder. If one job has just started the buildx_buildkit_* container and
buildkitd is not yet listening, `docker buildx create` in the other job
fails ("listing workers: ... buildkitd.sock: no such file or directory")
and drops the builder from that job's buildx config, so the
`|| docker buildx use` fallback also fails and the job exits before the
bootstrap retries (eicweb job 8767659). Retry create/use together with
the bootstrap.
In clean_builder, a slow or non-JSON pipelines API response made jq fail
and aborted the job (eicweb job 8746912). Bound curl with --fail and
--max-time and treat an unparseable response as unknown status (builder
kept).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019qEz4uqoKa2R5BVLBKSyhx
Contributor
There was a problem hiding this comment.
Note
Copilot was unable to complete this review at the selected tier due to model policy or plan restrictions.
🔵 Needs a closer look
The change alters GitLab CI builder creation/cleanup on shared runners and, because its correctness depends on real GitLab runner concurrency and Docker Buildx/BuildKit timing/API behavior, it should be validated by an actual pipeline run before proceeding.
No open issues 🎉
What changed in this PR
Improves GitLab CI robustness for per-pipeline BuildKit builders by mitigating a buildx startup race and making stale-builder cleanup resilient to flaky GitLab API responses.
Changes:
- Retry
docker buildx create || docker buildx usetogether withdocker buildx inspect --bootstrapto handle transient builder readiness/concurrency races. - Harden
clean_builderby bounding/failingcurlsafely and tolerating non-JSON/failed API responses so the cleanup loop continues.
| File | Description |
|---|---|
| .gitlab-ci.yml | Adds retry logic around Buildx builder selection/bootstrapping and hardens the stale builder cleanup loop against slow/failed/non-JSON GitLab API responses. |
Review effort: Balanced
wdconinc
temporarily deployed
to
github-pages
November 13, 2026 08:14 — with
GitHub Actions
Inactive
Contributor
veprbl
approved these changes
Nov 13, 2026
This branch was previously deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Briefly, what does this PR introduce?
Two GitLab CI robustness fixes around the per-pipeline BuildKit builder (
BUILDER_NAME).1. Race on
docker buildx create(eicweb job 8767659)Two jobs of pipeline 152034 started at the same moment on eic-n0 (
base-cuda: [cuda_runtime]andbase: [debian_stable_base]):buildx createconnects to a running builder container to list workers, so the race shows up there, not at bootstrap as the comment assumed.|| docker buildx usefallback can't recover, and the job exits before the bootstrap retry loop runs.baseandbase-cudajobs start together.Fix: retry
create || usetogether withinspect --bootstrap(5 attempts, 10 s apart). After a successfulcreate, a later attempt fails on the existing name anduseselects it. I also updated the comment.2.
clean_builderaborted by a bad API response (eicweb job 8746912)One pipelines-API
curltook 5 min and returned non-JSON.jqthen failed ("Invalid numeric literal") and the job exited (code 5), so it skipped the remaining stale builders. Nowcurl --fail --max-time 30is used, and a failed or unparseable response leaves the status empty, so that builder is kept and the loop continues.Testing
before_scriptline is valid bash.bash -eo pipefailwith a stubbeddocker:createfails once, then succeeds: recovers, exit 0.createalways fails: 5 attempts, exit 1.jqline with a non-JSON input gives an empty status and doesn't exit.What kind of change does this PR introduce?
Generated by Claude Code