Skip to content
Merged
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
22 changes: 0 additions & 22 deletions .github/CI/github_runner.yaml

This file was deleted.

80 changes: 2 additions & 78 deletions .github/CI/spack_setup.sh
Original file line number Diff line number Diff line change
@@ -1,83 +1,7 @@
# This file should be "sourced" into your environment
# to set up the spack repository

SPACK_DIR=${HOME}/spack

sload () {
# Installs a software package and loads it into the environment
spack install --reuse --fail-fast $@
spack load --first $@
}

slocation () {
# Returns the installation directory of a given software package
HASH=`spack find --no-groups --loaded -l $@ | head -1 | awk '{print $1}'`
spack location -i /$HASH
}

# Only do the heavy lifting once per github_action invocation
if [ ${GITHUB_ACTION} != "setup" ]; then
echo "::group::Loading spack ${RUNNER_ENV} env"
source $SPACK_DIR/share/spack/setup-env.sh
spack env activate ${RUNNER_ENV}
echo "::endgroup::"
return
fi

save_dir=`pwd`
#
# Only update the spack clone once a day
#
echo "::group::Spack environment setup"
if [ -r ${SPACK_DIR}/.git/FETCH_HEAD ]; then
# We should never allow spack to update it's packages, it increases the
# opportunity for mishandling of the runner environment. Instead, when
# there is a need for update, the entire runner should be flushed, such
# that a fresh spack install is created.
last_update=`stat -c %Y ${SPACK_DIR}/.git/FETCH_HEAD`
current=`date -d now "+%s"`
echo "spack is $(((current - last_update) / 86400)) days old"
# if [ $(((current - last_update) / 86400)) -gt 1 ]; then
# echo "Last update ${last_update}, current ${current}: Do git pull spack"
# cd $SPACK_DIR && git pull
# else
# echo "git pull was less than one day ago"
# fi
else
echo "git clone spack"
git clone https://github.com/spack/spack $SPACK_DIR || true
# We do a git pull to create the .git/FETCH_HEAD for the check
# next time the script is executed.
cd $SPACK_DIR && git pull && git status
fi

rm -rf ${HOME}/.spack

echo "Load spack environment"
source $SPACK_DIR/share/spack/setup-env.sh

spack compiler find

# Start with a fresh env every time
spack env remove -y ${RUNNER_ENV} || true

cd ${save_dir}
mkdir ${RUNNER_ENV} || true

# Show the known envs
if spack env activate "${RUNNER_ENV}"; then
if diff ${GITHUB_WORKSPACE}/.github/CI/${RUNNER_ENV}.yaml ${SPACK_DIR}/var/spack/environments/${RUNNER_ENV}/spack.yaml > /dev/null; then
echo "Update spack env ${RUNNER_ENV}"
cp ${GITHUB_WORKSPACE}/.github/CI/${RUNNER_ENV}.yaml ${SPACK_DIR}/var/spack/environments/${RUNNER_ENV}/spack.yaml
fi
spack env update ${RUNNER_ENV}
else
echo "Create spack env ${RUNNER_ENV}"
spack env create ${RUNNER_ENV} ${GITHUB_WORKSPACE}/.github/CI/${RUNNER_ENV}.yaml
fi
spack env activate ${RUNNER_ENV}
spack concretize --force
spack install --reuse

echo "::endgroup::"
source $SPACK_SETUP
spack env activate dplasma