[CNG] Cache base images digest to hasten `gitlab-org/gitlab` triggered pipelines
Summary
As suggested in gitlab-org/gitlab#208389 (comment 1084275711), we could probably speed gitlab-org/gitlab
triggered pipelines (i.e. the ones in gitlab/org/build/CNG-mirror
) by avoiding the pulling of base images in the phase-zero
stage (the jobs that only do record_stable_image ...
.
For instance alpine-stable
only pulls alpine:3.15
and record its digest in an artifacts/container_versions/alpine.txt
file. I think we could cache this file, and retrieve the cache for triggered pipelines (maybe not for master
ones as we may want to ensure we're always using the latest image in those cases), so that we can avoid the alpine-stable
job entirely somehow. I'll search or create an issue for this.
Moreover, we could also optimize the phase-one
, phase-two
, and phase-three
jobs since gitlab-org/gitlab
triggered pipelines shouldn't have any impact on those.
We should be able to save around 3 minutes for gitlab-org/gitlab
triggered pipelines.