Skip to content

ci: Update cache on schedules and don't cache go/build

Rémy Coutable requested to merge dont-cache-go-build-folder-2 into main

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:

The copying of .gitlab-ci-cache/ is also faster:

Before After
P50: 179m TBD

Impacted categories

The following categories relate to this merge request:

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 the CHANGELOG.md.
Edited by Rémy Coutable

Merge request reports

Loading