Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for Spack 0.22+ #15

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 24 additions & 2 deletions bin/spack-install-helper-40-concretize-install
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,23 @@ do
spack repo add "${repo}"
done

spack -e . gpg trust /tmp/spack_sign_key.gpg || echo 'Warning: Could not add spack sign key, i.e. your packages cannot be added to the buildcache'
# TODO: Remove the Spack version check when we decide to dicsontinue support for older versions
SPACK_VER=`spack --version`
IFS="." read SPACK_MAJOR SPACK_MINOR SPACK_PATCH <<< $SPACK_VER

# GPG key is available (we are running in the CI pipeline) => we can push into the buildcache
if [ -f /tmp/spack_sign_key.gpg ];
then
spack -e . gpg trust /tmp/spack_sign_key.gpg

# Spack 0.22+ has autopush mirrors
if [ $SPACK_MINOR -ge 22 ]
then
spack mirror set --autopush s3_cscs_buildcache
fi
else
echo 'Warning: Could not add spack sign key, i.e. your packages cannot be added to the buildcache'
fi

spack -e . concretize

Expand All @@ -24,7 +40,13 @@ if [ ${#SPECS_ONLY_DEPENDENCIES[@]} -ne 0 ]; then
printf '%s\n' "${SPECS_ONLY_DEPENDENCIES[@]}" | jq --raw-input . | jq --slurp --compact-output . > only-dependencies.json
fi

spack -e . env depfile | spack-modify-makefile-push-buildcache > Makefile
# Spack 0.22+ has autopush mirrors, no modification of Makefile is needed
if [ $SPACK_MINOR -ge 22 ]
then
spack -e . env depfile > Makefile
else
spack -e . env depfile | spack-modify-makefile-push-buildcache > Makefile
fi
make -j$NUM_PROCS SPACK_COLOR=always --output-sync=recurse

# Do garbage collection only when there are no packages with --only-dependencies
Expand Down
2 changes: 1 addition & 1 deletion ci/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ os:
# - "39"
# - "40"
spackver:
#- "0.20.3"
- "0.21.0"
- "0.22.0"
cudaver:
#- "11.7.1"
- "12.4.1"
Expand Down