Reuse wait_for_assets in fetch_assets
What does this MR do?
Makes fetch_assets in the gitlab-rails-* jobs use wait_for_assets, the same wait the wait-for-assets-* gate runs. This is the follow-up to !3179 (comment 4041741521).
Today fetch_assets treats every skopeo failure as "not available yet" and keeps polling until its 45 min timeout. Auth, registry and usage errors can't clear up during the job, so the polling only hides them. That's how an unsupported --no-tags flag went unnoticed for the whole timeout in !3179 (merged)'s first pipeline.
fetch_assets still matters after !3173 (merged). The gate is skipped when RAILS_SPLIT_ASSETS_BUILD=true, which E2E on CNG sets, so there the rails job does the waiting itself.
fetch_assetskeeps its early returns (noASSETS_IMAGE,COMPILE_ASSETS,needs_buildfalse). It then runswait_for_assetswithASSETS_WAIT_TIMEOUTset toASSETS_IMAGE_WAIT_TIMEOUT_SECONDS(default still 2700). So the rails jobs now also:- wait only for a missing manifest,
- retry transient registry errors with backoff,
- fail at once on any other error, with skopeo's message and exit status,
- fail before polling when the repository path is wrong.
- On a timeout,
fetch_assetsnow exits with 75 instead of 1. Nothing in the rails jobs depends on the exit code, and.job-base'sretry: 1covers both. - The last line of
wait_for_assets's timeout message no longer says "the gitlab-rails-* jobs start once it passes", because it now runs inside those jobs too.
How was it tested?
-
Three new tests in
build-scripts/tests/wait_for_assets.batscover whatfetch_assetsadds on top ofwait_for_assets: theneeds_buildskip, the default 2700s timeout, and thatASSETS_IMAGE_WAIT_TIMEOUT_SECONDSoverrides the gate'sASSETS_WAIT_TIMEOUTonly for the call. The rest of the wait is already covered by that file. The full suite passes: 110 tests. -
With the real skopeo 1.2.2, curl and jq in
distribution_ci_tools:5.8.0, the image the rails jobs run:Case Result gitlab-assets-ee:masteravailable on the first poll missing tag, timeout 0 exit 75 with the full explanation no access (403) fails on the first poll with skopeo's message skopeo rejects its arguments fails on the first poll with skopeo's message
Related
- !3173 (merged) (merged): the
wait-for-assets-*gate andwait_for_assets - !3179 (merged) (merged): the
fetch_assetstimeout - #2441