ci: Update cache on schedules and don't cache go/build
What does this merge request do and why?
We only pull the cache in MRs, and we only update the cache in scheduled pipelines (every 6 hours). This is the strategy we use for https://gitlab.com/gitlab-org/gitlab and it works well.
Also, we stop caching go/build
since only go/mod
is useful (see https://evilmartians.com/chronicles/speeding-up-go-modules-for-docker-and-ci).
Note that I had to disable the "different cache for protected branches" since the cache is updated in main
(which is protected) but used in MRs (where branches aren't protected).
Improvements
The context being loaded during build is now 3.5GB instead of 8.1GB previously:
- Before: #6 transferring context: 8.16GB 482.8s done
- After: #6 transferring context: 3.53GB 962.0s done
The copying of .gitlab-ci-cache/
is also faster:
- Before (https://gitlab.com/gitlab-org/gitlab-development-kit/-/jobs/4633223422#L1540):
#10 [ 5/11] COPY --chown=gdk .gitlab-ci-cache/ .gitlab-ci-cache/ #10 DONE 1552.3s
- After (https://gitlab.com/gitlab-org/gitlab-development-kit/-/jobs/4649657330#L1787):
#11 [ 6/12] COPY --chown=gdk .gitlab-ci-cache/ .gitlab-ci-cache/ #11 DONE 719.7s
Before | After |
---|---|
P50: 179m | TBD |
Impacted categories
The following categories relate to this merge request:
-
gdk-reliability - e.g. When a GDK action fails to complete. -
gdk-usability - e.g. Improvements or suggestions around how the GDK functions. -
gdk-performance - e.g. When a GDK action is slow or times out.
Merge request checklist
-
This change is backward compatible. If not, please include steps to communicate to our users. -
Tests added for new functionality. If not, please raise an issue to follow-up. -
Documentation added/updated, if needed. -
Announcement added, if change is notable. -
gdk doctor
test added, if needed. -
Add the ~highlight
label if this MR should be included in theCHANGELOG.md
.
Edited by Rémy Coutable