Update spack-stack-dev from spack develop as of 2024/10/31 #1350
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: macos-ci-aarch64-build | |
on: | |
pull_request: | |
workflow_dispatch: | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} | |
cancel-in-progress: true | |
defaults: | |
run: | |
shell: bash | |
jobs: | |
macos-ci-aarch64-build: | |
runs-on: [macos-ci-aarch64] | |
steps: | |
- name: cleanup | |
run: | | |
pwd | |
ls -lart | |
set +e | |
find ./* -type d -exec chmod u+xw {} \; | |
set -e | |
rm -fr * | |
- name: checkout | |
uses: actions/checkout@v4 | |
with: | |
submodules: true | |
- name: prepare-directories | |
run: | | |
mkdir -p /Users/ec2-user/spack-stack/build-cache | |
mkdir -p /Users/ec2-user/spack-stack/source-cache | |
- name: create-buildcache | |
run: | | |
# Get day of week to decide whether to use build caches or not | |
DOW=$(date +%u) | |
# Monday is 1 ... Sunday is 7 | |
if [[ $DOW == 7 ]]; then | |
export USE_BINARY_CACHE=false | |
echo "Ignore existing binary cache for creating buildcache environment" | |
else | |
export USE_BINARY_CACHE=true | |
echo "Use existing binary cache for creating buildcache environment" | |
fi | |
# Set up homebrew and lmod support | |
eval "$(/opt/homebrew/bin/brew shellenv)" | |
source /opt/homebrew/opt/lmod/init/profile | |
# Set up spack-stack | |
source ./setup.sh | |
# Important! | |
export SPACK_PYTHON=/usr/bin/python3 | |
spack clean -ab | |
spack bootstrap now | |
# | |
export ENVNAME=ue-apple-clang-14.0.3-buildcache | |
export ENVDIR=$PWD/envs/${ENVNAME} | |
spack stack create env --site macos.default --template unified-dev --name ${ENVNAME} --compiler apple-clang | |
spack env activate ${ENVDIR} | |
export SPACK_SYSTEM_CONFIG_PATH="${ENVDIR}/site" | |
# Find external packages | |
spack external find --scope system \ | |
--exclude bison --exclude openssl \ | |
--exclude curl --exclude python | |
spack external find --scope system perl | |
spack external find --scope system libiconv | |
spack external find --scope system wget | |
PATH="/opt/homebrew/opt/curl/bin:$PATH" \ | |
spack external find --scope system curl | |
PATH="/opt/homebrew/opt/qt5/bin:$PATH" \ | |
spack external find --scope system qt | |
spack external find --scope system texlive | |
spack external find --scope system mysql | |
# Find compilers | |
spack compiler find --scope system | |
export -n SPACK_SYSTEM_CONFIG_PATH | |
# For buildcaches | |
spack config add config:install_tree:padded_length:200 | |
# Set compiler and MPI specs | |
spack config add "packages:all:providers:mpi:[openmpi@5.0.5]" | |
spack config add "packages:all:compiler:[apple-clang@14.0.3]" | |
# Add additional variants for MET packages, different from config/common/packages.yaml | |
# DH* 20240513 - avoid hdf-eos2 until https://github.com/spack/spack/issues/44168 is resolved | |
#spack config add "packages:met:variants:+python +grib2 +graphics +lidar2nc +modis" | |
spack config add "packages:met:variants:+python +grib2 +graphics" | |
# *DH | |
# Concretize and check for duplicates | |
spack concretize 2>&1 | tee log.concretize.apple-clang-14.0.3-buildcache | |
${SPACK_STACK_DIR}/util/show_duplicate_packages.py -d log.concretize.apple-clang-14.0.3-buildcache -i fms -i crtm -i esmf -i mapl | |
# Add and update source cache | |
spack mirror add local-source file:///Users/ec2-user/spack-stack/source-cache/ | |
spack mirror create -a -d /Users/ec2-user/spack-stack/source-cache/ | |
# Add binary cache if requested | |
if [ "$USE_BINARY_CACHE" = true ] ; then | |
set +e | |
spack mirror add local-binary file:///Users/ec2-user/spack-stack/build-cache/ | |
spack buildcache update-index local-binary || (echo "No valid binary cache found, proceed without" && spack mirror rm local-binary) | |
set +e | |
echo "Packages in spack binary cache:" | |
spack buildcache list | |
fi | |
# Break installation up in pieces and create build caches in between | |
# This allows us to "spin up" builds that altogether take longer than | |
# six hours, and/or fail later in the build process. | |
# base-env | |
echo "base-env ..." | |
spack install --fail-fast --source --no-check-signature base-env 2>&1 | tee log.install.apple-clang-14.0.3.base-env | |
spack buildcache create -a -u /Users/ec2-user/spack-stack/build-cache/ base-env | |
# jedi-base-env | |
echo "jedi-base-env ..." | |
spack install --fail-fast --source --no-check-signature jedi-base-env 2>&1 | tee log.install.apple-clang-14.0.3.jedi-base-env | |
spack buildcache create -a -u /Users/ec2-user/spack-stack/build-cache/ jedi-base-env | |
# jedi-ufs-env | |
echo "jedi-ufs-env ..." | |
spack install --fail-fast --source --no-check-signature jedi-ufs-env 2>&1 | tee log.install.apple-clang-14.0.3.jedi-ufs-env | |
spack buildcache create -a -u /Users/ec2-user/spack-stack/build-cache/ jedi-ufs-env | |
# the rest | |
echo "unified-env ..." | |
spack install --fail-fast --source --no-check-signature 2>&1 | tee log.install.apple-clang-14.0.3.unified-env | |
spack buildcache create -a -u /Users/ec2-user/spack-stack/build-cache/ | |
# Remove binary cache for next round of concretization | |
if [ "$USE_BINARY_CACHE" = true ] ; then | |
spack mirror rm local-binary | |
fi | |
# Remove buildcache config settings | |
spack config remove config:install_tree:padded_length | |
# Next steps: synchronize source and build cache to a central/combined mirror? | |
# Cleanup | |
spack clean -a | |
spack env deactivate | |
- name: create-env | |
run: | | |
# Set up spack-stack | |
source ./setup.sh | |
# Important! | |
export SPACK_PYTHON=/usr/bin/python3 | |
export BUILDCACHE_ENVNAME=ue-apple-clang-14.0.3-builddcache | |
export BUILDCACHE_ENVDIR=$PWD/envs/${BUILDCACHE_ENVNAME} | |
export ENVNAME=ue-apple-clang-14.0.3 | |
export ENVDIR=$PWD/envs/${ENVNAME} | |
rsync -av --exclude='install' --exclude='spack.lock' --exclude='.spack_db' ${BUILDCACHE_ENVDIR}/ ${ENVDIR}/ | |
spack env activate ${ENVDIR} | |
# Concretize and check for duplicates | |
spack concretize --force 2>&1 | tee log.concretize.apple-clang-14.0.3 | |
${SPACK_STACK_DIR}/util/show_duplicate_packages.py -d log.concretize.apple-clang-14.0.3 -i fms -i crtm -i esmf -i mapl | |
# Add binary cache back in | |
spack mirror add local-binary file:///Users/ec2-user/spack-stack/build-cache/ | |
echo "Packages in combined spack build caches:" | |
spack buildcache list | |
# Install from cache | |
spack install --fail-fast --source --no-check-signature 2>&1 | tee log.install.apple-clang-14.0.3.unified-env | |
# Create modules | |
spack clean -a | |
spack module lmod refresh -y | |
spack stack setup-meta-modules | |
spack env deactivate | |
# Test environment chaining | |
echo "Test environment chaining" | |
spack stack create env --name chaintest --template empty --site macos.default --upstream ${ENVDIR}/install --compiler apple-clang | |
# Retain config from upstream so we don't have to rebuild: | |
cp -r ${ENVDIR}/{site,common} $PWD/envs/chaintest/. | |
spack env activate ${PWD}/envs/chaintest | |
spack add nccmp@1.9.0.1%apple-clang | |
spack concretize | tee envs/chaintest/log.concretize | |
unwanted_duplicates=$(( cat envs/chaintest/log.concretize | grep -E '^ - ' | grep -Fv 'nccmp@1.9.0.1' || true ) | wc -l) | |
if [ ${unwanted_duplicates} -gt 0 ]; then echo "Environment chaining test failed"; exit 1; fi | |
spack env deactivate | |
- name: test-env | |
run: | | |
eval "$(/opt/homebrew/bin/brew shellenv)" | |
source /opt/homebrew/opt/lmod/init/profile | |
export ENVNAME=ue-apple-clang-14.0.3 | |
export ENVDIR=$PWD/envs/${ENVNAME} | |
ls -l ${ENVDIR}/install/modulefiles/Core | |
module use ${ENVDIR}/install/modulefiles/Core | |
module load stack-apple-clang/14.0.3 | |
module load stack-openmpi/5.0.5 | |
module load stack-python/3.11.7 | |
module available | |
module load jedi-ufs-env | |
module load ewok-env | |
module load soca-env | |
module list |