From e533e2891570ea13b230f8f348de5220f1c60e6f Mon Sep 17 00:00:00 2001 From: Nicolas Richart <nicolas.richart@epfl.ch> Date: Wed, 7 Feb 2024 13:20:57 +0100 Subject: [PATCH] Setting stack install location --- .gitlab-ci.yml | 4 +--- ci/setup_spack.sh | 18 ++++++++++-------- config.json | 1 + 3 files changed, 12 insertions(+), 11 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 7670925..d976a93 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -35,13 +35,11 @@ variables: - stack variables: COMMAND_OPTIONS_SBATCH: ${slurm_options} - APPTAINER_EXEC_OPTIONS: ${apptainer_options} --bind ${BUILDCACHE}:/buildcache:rw --bind ${STACK_PATH}:/stack:rw --writable-tmpfs + APPTAINER_EXEC_OPTIONS: ${apptainer_options} --bind ${BUILDCACHE}:/buildcache:rw SPACK_USER_CACHE_PATH: "/tmp/spack_cache_${CI_JOB_ID}" SPACK_USER_CONFIG_PATH: "/tmp/spack_user_${CI_JOB_ID}" SPACK_SYSTEM_CONFIG_PATH: "/stack/spack/etc" BUILDCACHE: "/work/scitas-ge/richart/ci/buildcache" - STACK_PATH: "/work/scitas-ge/richart/ci/${environment}/stack" - .spack_cache: cache: diff --git a/ci/setup_spack.sh b/ci/setup_spack.sh index f00fc4e..b264a39 100755 --- a/ci/setup_spack.sh +++ b/ci/setup_spack.sh @@ -2,6 +2,8 @@ SPACK_VERSION=$(jq -r .spack.version config.json) +STACK_LOCATION=$(jq -r .stack.mount_point config.json) + echo "Setting up spack" if [ ! -d spack/.git ]; then git clone https://github.com/spack/spack.git -b $SPACK_VERSION spack @@ -14,7 +16,7 @@ fi cat > spack/etc/spack/config.yaml << EOF config: install_tree: - root: /stack/spack/opt/spack + root: ${STACK_LOCATION}/spack/opt/spack EOF @@ -32,7 +34,7 @@ done echo "Setting up extra repos" -spack_external_repos=/stack/external_repos +spack_external_repos=${STACK_LOCATION}/external_repos mkdir -p ${spack_external_repos} if [ ! -e ${SPACK_SYSTEM_CONFIG_PATH}/repos.yaml ]; then @@ -62,18 +64,18 @@ echo "Setting up buildcache" spack/bin/spack gpg trust \ $GPG_PRIVATE_KEY -spack/bin/spack mirror add \ - --type binary \ - --scope system \ - buildcache file:///buildcache - if [ ! -d /buildcache/build_cache ]; then spack/bin/spack gpg publish \ -d /buildcache fi +spack/bin/spack mirror add \ + --type binary \ + --scope system \ + buildcache file:///buildcache + spack/bin/spack buildcache keys \ --install \ --trust -spack/bin/spack buildcache update-index /buildcache +#spack/bin/spack buildcache update-index /buildcache diff --git a/config.json b/config.json index 0a3fe77..cbc0637 100644 --- a/config.json +++ b/config.json @@ -13,6 +13,7 @@ } }, "stack": { + "mount_point": "/stack", "core_compiler": "gcc@11.4.1 arch=linux-rhel9-x86_64_v2", "compilers": { "gcc": { "spec": "gcc", "version": "12.2.0" }, -- GitLab