Time out when waiting for the assets image in fetch_assets

What does this MR do?

Adds a timeout to fetch_assets, so gitlab-rails-* stops waiting for an assets image that will never arrive. Part of #2441.

gitlab-org/gitlab!263017 (merged) triggers CNG as soon as the assets hash is known, instead of after build-assets-image. fetch_assets already waits until the assets image exists, but with no limit. If the frontend compile or build-assets-image fails upstream, the rails jobs would then wait until the job timeout.

  • fetch_assets fails after ASSETS_IMAGE_WAIT_TIMEOUT_SECONDS. The default is 2700 (45 min); a cold compile takes about 17 min. The error names the image.
  • The variable is documented in docs/ci-variables.md, together with cancelling the CNG pipeline from GitLab as an alternative.

There's no other change in behaviour: the check is still "the image exists", and the early returns are unchanged.

How was it tested?

  • A mocked skopeo run in the CI tools image (distribution_ci_tools:5.8.0, the version the jobs run) covers these cases:
    • existing image
    • missing image, then present
    • timeout with a custom value and with the default 2700s
    • early returns for empty ASSETS_IMAGE, COMPILE_ASSETS and needs_build
  • In that image, I ran the real skopeo inspect (skopeo 1.2.2) against gitlab-assets-ee:master (it succeeds) and against a missing tag (non-zero exit, empty output).
Edited by Heinrich Lee Yu

Merge request reports

Loading
Loading