Skip to content
Snippets Groups Projects
Commit f41d0214 authored by Eleni Mathioulaki's avatar Eleni Mathioulaki
Browse files

rm spack.lock before env activation (to avoid errors with missing packages)

parent 0be561fa
No related branches found
No related tags found
No related merge requests found
Pipeline #24245 passed with stage
in 30 minutes and 22 seconds
...@@ -269,17 +269,18 @@ sync-gitlab-spack-instance: ...@@ -269,17 +269,18 @@ sync-gitlab-spack-instance:
- spack load $EBRAINS_SPACK_COMPILER - spack load $EBRAINS_SPACK_COMPILER
- spack compiler find - spack compiler find
- spack compiler list - spack compiler list
# activate environment (and create it, if it doesn't exist) # create environment, if it doesn't exist
- spack env list | grep -q $SPACK_NFS_ENV && echo "Environment created already" || spack env create $SPACK_NFS_ENV - spack env list | grep -q $SPACK_NFS_ENV && echo "Environment created already" || spack env create $SPACK_NFS_ENV
- spack env activate $SPACK_NFS_ENV
# update environment site-configs # update environment site-configs
- rm -rf $SPACK_ENV/site-config && cp -r site-config $SPACK_ENV - rm -rf $SPACK_ROOT/var/spack/environments/$SPACK_NFS_ENV/site-config && cp -r site-config $SPACK_ROOT/var/spack/environments/$SPACK_NFS_ENV
# update spack.yaml: merge top-level and site-specific spack.yaml files # update spack.yaml: merge top-level and site-specific spack.yaml files
- spack-python site-config/ymerge.py spack.yaml site-config/$SYSTEMNAME/spack.yaml > /tmp/spack.yaml - spack-python site-config/ymerge.py spack.yaml site-config/$SYSTEMNAME/spack.yaml > /tmp/spack.yaml
- cp /tmp/spack.yaml $SPACK_ENV/ - cp /tmp/spack.yaml $SPACK_ROOT/var/spack/environments/$SPACK_NFS_ENV
# There is a known spack bug (https://github.com/spack/spack/issues/29447) in installing test dependencies for installation tests. The workaround suggested # There is a known spack bug (https://github.com/spack/spack/issues/29447) in installing test dependencies for installation tests. The workaround suggested
# in the issue is to NOT concretize separately, but simply remove the .lock file and let the enironment be concretized by the spack install command: # in the issue is to NOT concretize separately, but simply remove the .lock file and let the enironment be concretized by the spack install command:
- rm $SPACK_ROOT/var/spack/environments/$SPACK_NFS_ENV/spack.lock || echo "No spack.lock file" - rm $SPACK_ROOT/var/spack/environments/$SPACK_NFS_ENV/spack.lock || echo "No spack.lock file"
# then activate environment
- spack env activate $SPACK_NFS_ENV
- spack install -y -j2 --fresh --test root - spack install -y -j2 --fresh --test root
- spack reindex - spack reindex
after_script: after_script:
......
...@@ -55,18 +55,19 @@ then ...@@ -55,18 +55,19 @@ then
spack env create $EBRAINS_SPACK_ENV spack env create $EBRAINS_SPACK_ENV
fi fi
# activate environment
spack env activate $EBRAINS_SPACK_ENV
# update environment site-configs # update environment site-configs
rm -rf $SPACK_ENV/site-config && cp -r $EBRAINS_REPO/site-config $SPACK_ENV rm -rf $SPACK_ROOT/var/spack/environments/$EBRAINS_SPACK_ENV/site-config && cp -r $EBRAINS_REPO/site-config $SPACK_ROOT/var/spack/environments/$EBRAINS_SPACK_ENV
# update spack.yaml: merge top-level and site-specific spack.yaml files # update spack.yaml: merge top-level and site-specific spack.yaml files
spack-python $EBRAINS_REPO/site-config/ymerge.py $EBRAINS_REPO/spack.yaml $EBRAINS_REPO/site-config/$SYSTEMNAME/spack.yaml > /tmp/spack.yaml spack-python $EBRAINS_REPO/site-config/ymerge.py $EBRAINS_REPO/spack.yaml $EBRAINS_REPO/site-config/$SYSTEMNAME/spack.yaml > /tmp/spack.yaml
cp /tmp/spack.yaml $SPACK_ENV/ cp /tmp/spack.yaml $SPACK_ROOT/var/spack/environments/$EBRAINS_SPACK_ENV/
# There is a known spack bug (https://github.com/spack/spack/issues/29447) in installing test dependencies # There is a known spack bug (https://github.com/spack/spack/issues/29447) in installing test dependencies
# for installation tests. The workaround suggested in the issue is to NOT concretize separately, but simply # for installation tests. The workaround suggested in the issue is to NOT concretize separately, but simply
# remove the .lock file and let the environment be concretized by the spack install command: # remove the .lock file and let the environment be concretized by the spack install command:
rm $SPACK_ROOT/var/spack/environments/$EBRAINS_SPACK_ENV/spack.lock || echo "No spack.lock file" rm $SPACK_ROOT/var/spack/environments/$EBRAINS_SPACK_ENV/spack.lock || echo "No spack.lock file"
# activate environment
spack env activate $EBRAINS_SPACK_ENV
# install the environment, use 2 jobs to reduce the amount of required RAM # install the environment, use 2 jobs to reduce the amount of required RAM
spack install -y -j2 --fresh --test root spack install -y -j2 --fresh --test root
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment