From 9b62a9c23880a409f82f673e0b63b141c9761ced Mon Sep 17 00:00:00 2001 From: Harmen Stoppels Date: Thu, 2 May 2024 12:06:30 +0200 Subject: [PATCH] gitlab ci: cache user cache (#43952) --- share/spack/gitlab/cloud_pipelines/.gitlab-ci.yml | 1 + share/spack/gitlab/cloud_pipelines/configs/ci.yaml | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/share/spack/gitlab/cloud_pipelines/.gitlab-ci.yml b/share/spack/gitlab/cloud_pipelines/.gitlab-ci.yml index 4256a3e2fd2..9bc238ff6e0 100644 --- a/share/spack/gitlab/cloud_pipelines/.gitlab-ci.yml +++ b/share/spack/gitlab/cloud_pipelines/.gitlab-ci.yml @@ -170,6 +170,7 @@ default: artifacts: paths: - "${CI_PROJECT_DIR}/jobs_scratch_dir" + - "${CI_PROJECT_DIR}/tmp/_user_cache/cache" variables: KUBERNETES_CPU_REQUEST: 4000m KUBERNETES_MEMORY_REQUEST: 16G diff --git a/share/spack/gitlab/cloud_pipelines/configs/ci.yaml b/share/spack/gitlab/cloud_pipelines/configs/ci.yaml index 3b9736e10bc..5f34beb2c58 100644 --- a/share/spack/gitlab/cloud_pipelines/configs/ci.yaml +++ b/share/spack/gitlab/cloud_pipelines/configs/ci.yaml @@ -13,7 +13,7 @@ ci: before_script-: - - cat /proc/loadavg || true - cat /proc/meminfo | grep 'MemTotal\|MemFree' || true - - - spack list --count # ensure that spack's cache is populated + - - touch ${SPACK_USER_CACHE_PATH}/cache/*/* # bump mtime of cache so it is not invalidated - - spack env activate --without-view ${SPACK_CONCRETE_ENV_DIR} - spack compiler list - if [ -n "$SPACK_BUILD_JOBS" ]; then spack config add "config:build_jobs:$SPACK_BUILD_JOBS"; fi @@ -119,7 +119,7 @@ ci: # Disable local configs to avoid issues on shell runners SPACK_DISABLE_LOCAL_CONFIG: "1" before_script: - - - export SPACK_USER_CACHE_PATH="${CI_PROJECT_DIR}/_user_cache/" + - - export SPACK_USER_CACHE_PATH="${CI_PROJECT_DIR}/tmp/_user_cache/" - - uname -a || true - grep -E "vendor|model name" /proc/cpuinfo 2>/dev/null | sort -u || head -n10 /proc/cpuinfo 2>/dev/null || true - nproc || true