Mesa (master): gitlab-ci: Use per-job ccache

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Thu Oct 3 07:45:08 UTC 2019


Module: Mesa
Branch: master
Commit: 4712fdf7ae97e8e81a7a9c6bbcfbed4c4e493123
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=4712fdf7ae97e8e81a7a9c6bbcfbed4c4e493123

Author: Michel Dänzer <mdaenzer at redhat.com>
Date:   Tue Oct  1 16:00:16 2019 +0200

gitlab-ci: Use per-job ccache

Instead of a single cache shared between all jobs, but reduce the
maximum cache size to 1.5G (from 5G).

Rationale for smaller cache:

Pulling & pushing a 5G cache could take a long time. Consider
https://gitlab.freedesktop.org/mesa/mesa/-/jobs/684010 (click the "Show
complete raw" button to see timestamps): Pulling the cache took
1569927241-1569927194 = 47 seconds, pushing it 1569927671-1569927519
= 152, for a total of 199 seconds. The actual build took comparable
1569927518-1569927243 = 275 seconds, despite no cache hits from ccache.
In other words, the cache transfers almost doubled the job duration,
and they would have negated any build time benefits from ccache even
with a high cache hit rate.

Also, the smaller caches avoid blowing up storage requirements for them
too much.

Rationale for per-job caches:

Making a single cache significantly smaller might result in cached
build products from one job getting evicted by another job, reducing
the likelihood of cache hits from previous pipelines.

v2:
* Move up "ccache --max-size=1500M" call (Eric Engestrom)

Reviewed-by: Eric Engestrom <eric.engestrom at intel.com>

---

 .gitlab-ci.yml | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index c9c7af53f42..dc2b1177457 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -98,6 +98,7 @@ test-container:arm64:
     - debian-10
   stage: build
   cache:
+    key: ${CI_JOB_NAME}
     paths:
       - ccache
   artifacts:
@@ -114,6 +115,7 @@ test-container:arm64:
     - export PATH="/usr/lib/ccache:$PATH"
     - export CCACHE_BASEDIR="$PWD"
     - export CCACHE_DIR="$PWD/ccache"
+    - ccache --max-size=1500M
     - ccache --zero-stats || true
     - ccache --show-stats || true
   after_script:




More information about the mesa-commit mailing list