Reviewed & tested by the community
Project:
Drupal.org infrastructure
Component:
GitLab
Priority:
Major
Category:
Task
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
13 Sep 2023 at 17:06 UTC
Updated:
24 Oct 2025 at 08:36 UTC
Jump to comment: Most recent
Comments
Comment #2
fjgarlin commentedI've put together an internal MR to enable this. It's based on the setup suggested here https://docs.gitlab.com/runner/configuration/advanced-configuration.html... and using "iam" authentication.
Comment #3
wim leersRan into this too: https://drupal.slack.com/archives/CGKLP028K/p1695219548515259
This can deliver a nice boost in some scenarios! 😊
Comment #4
wim leersBump — this has the potential to help with
— https://drupal.slack.com/archives/CGKLP028K/p1698398728821119
Comment #5
andypostI bet even start using local runner's cache can speed-up pipelines
Simplest approach is just add fallback cache https://docs.gitlab.com/ee/ci/caching/#per-cache-fallback-keys
Then tune-up push/pull policy https://docs.gitlab.com/ee/ci/caching/#use-a-variable-to-control-a-jobs-...
Alternatively, cspell for example (7.5MB) can use artifacts via https://docs.gitlab.com/ee/ci/jobs/job_artifacts.html#with-a-cicd-job-token
Comment #6
andypostFiled new issue as it's the blocker for new infra #3449463: Update DB images to prevent server restart
Comment #7
wim leersDo we have an ETA for this? 🤞
This could AFAICT massively speed up CI runs, and reduce infrastructure costs!
Comment #8
cmlaraIf we don’t implement #3445532: Random HTTP timeouts for GitLab CI jobs this issue would be helpful to avoid failing jobs (at an expense of increase in S3 storage usage)
Cache is not a replacement for artifacts, this won’t fix the storage issue mentioned above but can help decrease runtimes by copying some temporary cache files (like phpstan analysis cache) though that will not help
issue forks (cache is per project)
Comment #9
catchIf this doesn't help issue forks, do we want to look at moving phpstan analysis caches (and similar) into artifacts somehow? afaik that wouldn't be blocked on infrastructure changes too, so we could find out whether it helps or not fairly quickly.
edit: opened #3462763: Use artifacts to share the phpstan result and cspell caches from core to MRs
Comment #10
murzCaching of Composer and NPM dependencies can significantly reduce the pipeline execution time and resources usage, including bandwidth, because now we download packages again from scratch in every pipeline.
Also, it should reduce the load and bandwidth on the Composer repo servers too.
I tried to enable caching in the issue #3513729: Implement caching of the Composer packages in GitLab CI pipeline jobs and in a contrib module, but faced this issue that the GitLab cache URL is not configured, here is an example: https://git.drupalcode.org/project/commercetools/-/jobs/4701921
But, surprisingly, it can be uploaded well:
So, maybe we just miss some easy thing to make it work?
Comment #11
fjgarlin commentedAs mentioned in #2, there is an MR in the private repo where the gitlab runner is managed to add caching to s3.
The patch is this (a bit trimmed down):
It needs infra to set "iam" per https://docs.gitlab.com/runner/configuration/advanced-configuration.html... first.
Comment #12
cmlaraConsidering the propose config change has been waiting since September of 2023:
What is infras opinion on this? Is this something they actually plan to enable or not given its known positives and negatives?
Comment #13
drummSince the new cluster has been stable, we can move ahead with this.
Caching looks like its opt-in via editing
.gitlab-ci.yml, so it's not too much risk destabilizing tests, until we get something using this into the main templates.I’m not seeing any explicit notes about cached items expiring and being cleaned up, we will want to make sure it's not a runaway cost.
Comment #14
cmlaraIIRC Gitlab currently expects that the storage layer will handle this (add lifecycle rules in S3).
Comment #15
fjgarlin commentedInternal MR rebased (still the same as #11).
Will create an MR here that tests the cache so we can see it in this fork/MR.
Comment #17
fjgarlin commentedInternal MR: https://gitlab.com/drupal-infrastructure/gitlab-runner-infra/-/merge_req...
--
Issue created: #3553846: Test that caching works
MR: https://git.drupalcode.org/project/gitlab_templates/-/merge_requests/417
See pipeline: https://git.drupalcode.org/project/gitlab_templates_downstream/-/pipelin...
It's trying to set the cache in one job and then retrieve it in another but it fails to do so.
Comment #18
fjgarlin commentedThe internal MR was merged.
I did a POC to test that caching works and it did. See this comment.
I don't think that we need to change or document anything anywhere, as GitLab has good documentation about this. Core or contrib can start using this feature and report here if there are any issues.
RTBC (I guess it could be "Fixed" as well, but I'll wait until we have some more tests confirming it).
Comment #19
mondrakeNewbie here, excuse my ignorance
Could this help with #3549110: [CI] Performance pipeline execution drops warmed caches?