De-duplicate cache updating jobs in omnibus-gitlab-mirror
As part of fixing #3988 (closed), the main change we made was
- Builds triggered from
gitlab-org/gitlabMRs will useGITLABidentifier in the cache key- Cache used by these builds will be updated by
update-trigger-package-cachejob in the pipeline caused by the 2-hourly schedule ingitlab-org/gitlab(named[2-hourly] Repo caching, Review Apps cleanup, Caches update)
- Cache used by these builds will be updated by
- Builds triggered from
omnibus-gitlabMRs and nightly pipelines will do the following- If EE builds, use
EEidentifier in cache key - If CE builds, use
CEidentifier in cache key - Cache used by these builds will be updated by
update-trigger-package-cachejob in the nightly pipelines - one for CE and one for EE.
- If EE builds, use
The problem is that, the pipeline caused downstream in omnibus-gitlab-mirror by that 2-hourly schedule in gitlab-org/gitlab looks like this
The update-trigger-package-cache job and Trigger:package job is doing very similar action - building a GitLab package. What differs is that, update-trigger-package-cache won't use any cache, but pushes the build result to cache while Trigger:package pulls the cache but won't push it back. This is wastage of resources. The former also doesn't do other actions like renaming the package file or exposing artifacts that could be used by Docker builds or anything (so that we could replace the Trigger:package job in that pipeline with it)
Proposal 1
- Make
update-trigger-package-cachedo everythingTrigger:packagedoes, with the exception of whether it pulls or pushes cache. - Make other
Trigger:*declare an optional need onupdate-trigger-package-cacheso that we can have only it in the 2-hourly pipeline
The problems with this approach are
-
The pipeline looks ugly. It will be
(fetch-assets | generate-facts | update-trigger-cache) ====> (Trigger:docker) ====> (Trigger:gitlab-docker | Trigger:RAT | Trigger:package_size_check) ====> (Trigger:letsencrypt-test | Trigger:qa-test)Here,
update-trigger-cachewill do the job ofTrigger:package, but it is definitely not intuitive to someone who doesn't know why. -
If Engineering Productivity or Quality teams are measuring the pipeline duration of this (the 2-hourly one) scheduled pipeline, they will notice that it has now suddenly gone up.
Proposal 2
- Have another scheduled pipeline in
gitlab-org/gitlabthat is dedicated just to updateomnibus-gitlabcache used bygitlab-org/gitlabMRs. (This has to be initiated from agitlab-org/gitlabschedule because if it is started fromomnibus-gitlab, the cache will have wrong versions of GitLab components because the difference in*_VERSIONfiles betweengitlab-org/gitlabandomnibus-gitlab.)
Personally, I prefer Proposal 2. Have a new schedule, maybe twice a day whose only job is to tell omnibus-gitlab-mirror to update the GITLAB cache.
