refactors GitLab CI dependency setup to use a persistent filesystem Spack cache - #1091
refactors GitLab CI dependency setup to use a persistent filesystem Spack cache#1091adrienbernede wants to merge 21 commits into
Conversation
There was a problem hiding this comment.
Pull request overview
Note
Copilot couldn't run its full agentic review because it didn't start before the timeout. Make sure your repository has a runner available, or add a copilot-code-review.yml file specifying one with the runs-on attribute. See the docs for more details.
Refactors GitLab CI dependency setup to leverage a persistent filesystem-backed Spack cache with branch-aware reuse (including optional upstream reuse), and simplifies the orchestration by extracting the cache-miss build/publish path into a dedicated script.
Changes:
- Added Spack config fragments for filesystem install/buildcache and upstream reuse.
- Added shared GitLab log/section helpers and updated build orchestration to use deterministic cache keys + host-config paths.
- Added a dedicated cache-miss dependency build/publish script and wired it into
build_and_test.sh.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 8 comments.
Show a summary per file
| File | Description |
|---|---|
scripts/gitlab/umpire-ci-cache-upstream.yaml |
Adds Spack upstream install tree configuration driven by CI env. |
scripts/gitlab/umpire-ci-cache-common.yaml |
Defines filesystem install tree + mirror and package permission defaults. |
scripts/gitlab/gitlab_logs_helpers.bash |
Centralizes GitLab section logging with nesting and timing. |
scripts/gitlab/build_deps_on_cache_miss.sh |
Implements the cache-miss path: Spack setup/build, buildcache push, and host-config publish. |
scripts/gitlab/build_and_test.sh |
Simplifies orchestration: cache key/target resolution, cache hit reuse, and cache-miss delegation. |
.gitlab/custom-variables.yml |
Introduces CI variables controlling persistent storage, permissions, and upstream behavior. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| find_project_hostconfig () | ||
| { | ||
| local hostconfigs=() | ||
| shopt -s nullglob | ||
| hostconfigs=( "${project_dir}"/*.cmake ) | ||
| shopt -u nullglob | ||
|
|
||
| if [[ ${#hostconfigs[@]} == 1 ]] | ||
| then | ||
| printf '%s\n' "${hostconfigs[0]}" | ||
| elif [[ ${#hostconfigs[@]} == 0 ]] | ||
| then | ||
| print_error "No result for: ${project_dir}/*.cmake" | ||
| print_error "Spack generated host-config not found." | ||
| return 1 | ||
| else | ||
| print_error "More than one result for: ${project_dir}/*.cmake" | ||
| print_error "${hostconfigs[@]}" | ||
| print_error "Expected a single generated host-config." | ||
| return 1 | ||
| fi | ||
| } |
There was a problem hiding this comment.
I need to fix this.
… document PUSH_TO_REGISTRY default
…st-config, simplify hostconfig lookup - Add clean_hostconfig() to remove stale .cmake files before spack_build - Simplify find_project_hostconfig() to a single -ne 1 check, always search prefix - Validate prefix exists as a directory before proceeding - Remove main() wrapper, inline script core, remove script-scope local declarations - Pass --prefix explicitly to run_uberenv instead of positional argument - Move find_project_hostconfig call before filesystem buildcache push
Summary
This PR refactors GitLab CI dependency setup to use a persistent filesystem Spack cache with branch-aware behavior, while simplifying the main orchestration flow.
What changed
Persistent Spack cache configuration
.gitlab/custom-variables.yml:UMPIRE_CI_STORAGE_ROOTUMPIRE_CI_STORAGE_GROUPUMPIRE_CI_STORAGE_UMASKUMPIRE_CI_FORCE_SPACKUMPIRE_CI_UPSTREAM_TARGET(develop)scripts/gitlab/umpire-ci-cache-common.yaml(install tree + filesystem mirror + permissions)scripts/gitlab/umpire-ci-cache-upstream.yaml(upstream install tree include)build_and_test.shsimplificationdevelop) cacheHOST_CONFIGis provided.Extracted cache-miss dependency path
scripts/gitlab/build_deps_on_cache_miss.shto handle:umaskbefore artifact creation.HOST_CONFIGbranching from this script (it only runs on miss path).Shared GitLab logging helpers
scripts/gitlab/gitlab_logs_helpers.bash.print_*, section rendering, andrun_sectionhelpers.build_and_test.shandbuild_deps_on_cache_miss.shnow source this file.Behavior notes
developinstall tree as Spack upstream when available.HOST_CONFIGpath is treated as authoritative and bypasses dependency build/install.TODOs:
@developfor dependencies, or add a mechanism to catch those situations and for using Spack to potentially rebuild the dep.