Mesa (master): gitlab-ci: Directly use host-mapped directory for ccache

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Thu Nov 21 09:54:21 UTC 2019


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

Author: Michel Dänzer <mdaenzer at redhat.com>
Date:   Wed Nov 20 09:11:35 2019 +0100

gitlab-ci: Directly use host-mapped directory for ccache

Use hardcoded /cache/mesa/ccache for the cache, so it will be shared by
all jobs of all Mesa projects running on the same runner host. This
should increase the hit rate and decrease the worst case storage used.

Further benefits of directly using a host-mapped directory:

* Saves up to ~1 minute per job for restoring and saving the cache
  contents via the GitLab CI cache mechanism
* Cache contents generated by failed jobs are no longer lost
* Jobs running in parallel on the same runner host can get hits from
  each other

Also enable compression, so the default maximum cache size of 5G might
be sufficient.

v2:
* Move CCACHE_DIR variable to the .build-linux template

Suggested-by: Eric Anholt <eric at anholt.net>
Reviewed-by: Eric Anholt <eric at anholt.net> # v1

---

 .gitlab-ci.yml | 12 +++---------
 1 file changed, 3 insertions(+), 9 deletions(-)

diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 012a6d79f25..849331ced1e 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -166,22 +166,16 @@ arm_test:
 # Just Linux
 .build-linux:
   extends: .build-common
-  cache:
-    key: ${CI_JOB_NAME}
-    paths:
-      - ccache
   variables:
     CCACHE_COMPILERCHECK: "content"
+    CCACHE_COMPRESS: "true"
+    CCACHE_DIR: /cache/mesa/ccache
   # Use ccache transparently, and print stats before/after
   before_script:
     - 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
+    - ccache --show-stats
   after_script:
-    - export CCACHE_DIR="$PWD/ccache"
     - ccache --show-stats
 
 .build-windows:




More information about the mesa-commit mailing list