Skip to content

[CI] Harden Dockerfile wget calls with retry logic#7011

Closed
tenpercent wants to merge 5 commits into
developfrom
users/tenpercent/ck/harden-dockerfile-wget-retries
Closed

[CI] Harden Dockerfile wget calls with retry logic#7011
tenpercent wants to merge 5 commits into
developfrom
users/tenpercent/ck/harden-dockerfile-wget-retries

Conversation

@tenpercent

@tenpercent tenpercent commented May 2, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Add --tries=3 --retry-connrefused --waitretry=5 to all 4 GitHub-facing wget calls in the Dockerfile to handle transient network failures
  • Fix ninja download to use unzip instead of gunzipninja-linux.zip is a zip archive, not gzip
  • Quote all GitHub URLs consistently
  • Use /tmp for intermediate downloads and clean up temp files
  • Add optional: true to copyArtifacts in generateAndArchiveBuildTraceVisualization so the post-stage doesn't fail when no build trace JSON was produced (e.g. NINJA_BUILD_TRACE=false or gfx950 stage skipped)
  • Set gc.autoDetach=true on the ref repo so git gc runs in the background during git remote update and cannot block or fail the checkout. Clean up stale gc.log files older than 2 hours to prevent agents from permanently skipping gc after a killed pack-objects

Motivation

CI build develop #864 failed because wget got exit code 8 (server error) downloading sccache from GitHub releases during Docker image build. No retry logic existed on any of the external downloads.

Every branch build was hitting "Copied 0 artifacts" failures in the post-stage because copyArtifacts (without optional: true) throws when the filter matches nothing, and ck_build_trace_*.json is only produced when NINJA_BUILD_TRACE=true.

Recurring git_pack_objects_killed failures on ctr2-mlse-smc-alola-s98-* and jenkins-trex-vg-21 agents caused by git gc running in the foreground during ref repo update, getting killed by SIGTERM (timeout/resource limit), and cascading to 26-28 stage failures.

Test plan

  • Docker image builds successfully with --build-arg compiler_version=therock
  • sccache, ninja, dumb-init all installed correctly in the resulting image
  • Post-stage artifact copy no longer fails when NINJA_BUILD_TRACE=false
  • Ref repo update succeeds on agents that previously hit git gc failures

🤖 Generated with Claude Code

Add --tries=3 --retry-connrefused --waitretry=5 to all GitHub-facing
wget calls to handle transient network failures that were causing
Docker build failures (e.g. develop #864, wget exit code 8).

Also fixes ninja download to use unzip instead of gunzip, since
ninja-linux.zip is a zip archive, not gzip.

Generated-by: Claude Code (Claude-Opus-4.6)
tenpercent added 3 commits May 1, 2026 21:52
- Add --retry-on-http-error=502,503,504 to all 4 wget calls to
  handle transient GitHub HTTP errors (not just connection-refused)
- Move dumb-init download to /tmp/ for consistency with other downloads

Generated-by: Claude Code (Claude-Opus-4.6)
Add `optional: true` to the copyArtifacts call in
generateAndArchiveBuildTraceVisualization so it silently succeeds
when no trace file was produced (e.g. NINJA_BUILD_TRACE=false or
gfx950 stage skipped). Previously the missing-artifact error was
caught but copyArtifacts without optional: true throws before the
catch can intercept it on some plugin versions, causing post-stage
failures on every gfx950 branch build.

Generated-by: Claude Code (claude-sonnet-4-6)
Set gc.autoDetach=true on the ref repo so git gc forks to background
during remote update and cannot block or fail the checkout. Also clean
up stale gc.log files older than 2 hours left by previously killed gc
processes, so agents don't permanently stop repacking.

Addresses recurring git_pack_objects_killed failures on
ctr2-mlse-smc-alola-s98-* and jenkins-trex-vg-21 agents.

Generated-by: Claude Code (claude-sonnet-4-6)
@github-actions

Copy link
Copy Markdown
Contributor

This pull request has been inactive for 25 days and will be marked as stale.

If you would like to keep this PR open, please:

  • Add new commits
  • Add a comment explaining why it should remain open

This PR will be automatically closed in 5 days if no further activity occurs.

@github-actions github-actions Bot added the Stale PR has no activity for 25+ days label May 30, 2026
@tenpercent tenpercent removed the Stale PR has no activity for 25+ days label May 30, 2026
@github-actions

Copy link
Copy Markdown
Contributor

This pull request has been inactive for 25 days and will be marked as stale.

If you would like to keep this PR open, please:

  • Add new commits
  • Add a comment explaining why it should remain open

This PR will be automatically closed in 5 days if no further activity occurs.

@github-actions github-actions Bot added the Stale PR has no activity for 25+ days label Jun 25, 2026
@github-actions

Copy link
Copy Markdown
Contributor

This pull request has been automatically closed due to inactivity (30 days with no updates).

If you'd like to continue working on this, feel free to reopen the PR or create a new one.

@github-actions github-actions Bot closed this Jun 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants