Skip to content
Snippets Groups Projects

CI spack config fixes

Merged Eleni Mathioulaki requested to merge ci-fixes into spack_v0.23.0
1 file
+ 8
14
Compare changes
  • Side-by-side
  • Inline
+ 8
14
@@ -21,10 +21,9 @@ export OCI_CACHE_PREFIX=$7
@@ -21,10 +21,9 @@ export OCI_CACHE_PREFIX=$7
# make sure spack uses the symlinked folder as path
# make sure spack uses the symlinked folder as path
export CI_SPACK_ROOT=${INSTALLATION_ROOT}/spack
export CI_SPACK_ROOT=${INSTALLATION_ROOT}/spack
# specify location of .spack dir (by default in ~)
# disable local configuration and cache directories
# this is where cache and configuration settings are stored
export SPACK_DISABLE_LOCAL_CONFIG=true
export SPACK_USER_CACHE_PATH=${CI_SPACK_ROOT}/.spack
export SPACK_USER_CACHE_PATH=/tmp/spack
export SPACK_USER_CONFIG_PATH=${CI_SPACK_ROOT}/.spack
# define SYSTEMNAME variable in sites where it's not already defined
# define SYSTEMNAME variable in sites where it's not already defined
export SYSTEMNAME=${SYSTEMNAME:-${HPC_SYSTEM:-$BSC_MACHINE}}
export SYSTEMNAME=${SYSTEMNAME:-${HPC_SYSTEM:-$BSC_MACHINE}}
@@ -46,19 +45,14 @@ if [ ! -d ${CI_SPACK_ROOT} ]; then
@@ -46,19 +45,14 @@ if [ ! -d ${CI_SPACK_ROOT} ]; then
SPACK_ROOT_EXISTED=0
SPACK_ROOT_EXISTED=0
fi
fi
if [[ $UPSTREAM_INSTANCE ]]
then
UPSTREAM_PREFIX=$(find $UPSTREAM_INSTANCE/spack/opt/spack/ -type d -name ".spack-db" 2>/dev/null | xargs -I {} dirname {})
cat <<EOF > ${CI_SPACK_ROOT}/etc/spack/defaults/upstreams.yaml
upstreams:
upstream-spack-instance:
install_tree: $UPSTREAM_PREFIX
EOF
fi
# activate Spack
# activate Spack
source ${CI_SPACK_ROOT}/share/spack/setup-env.sh
source ${CI_SPACK_ROOT}/share/spack/setup-env.sh
 
if [[ $UPSTREAM_INSTANCE ]]; then
 
UPSTREAM_PREFIX=$(find $UPSTREAM_INSTANCE/spack/opt/spack/ -type d -name ".spack-db" 2>/dev/null | xargs -I {} dirname {})
 
spack config add upstreams:upstream-spack-instance:install_tree:$UPSTREAM_PREFIX
 
fi
 
if [ "${SPACK_ROOT_EXISTED}" -eq 0 ]; then
if [ "${SPACK_ROOT_EXISTED}" -eq 0 ]; then
# for caching purposes it's nice if we can relocate into long paths, but we
# for caching purposes it's nice if we can relocate into long paths, but we
# can't do that for existing installations -> else path
# can't do that for existing installations -> else path