diff --git a/.github/workflows/ubuntu-ci-containers-x86_64.yaml b/.github/parkinglot/ubuntu-ci-containers-x86_64.yaml similarity index 100% rename from .github/workflows/ubuntu-ci-containers-x86_64.yaml rename to .github/parkinglot/ubuntu-ci-containers-x86_64.yaml diff --git a/.github/workflows/ubuntu-ci-x86_64-gnu.yaml b/.github/parkinglot/ubuntu-ci-x86_64-gnu.yaml similarity index 99% rename from .github/workflows/ubuntu-ci-x86_64-gnu.yaml rename to .github/parkinglot/ubuntu-ci-x86_64-gnu.yaml index d854fb91c..859ddd632 100644 --- a/.github/workflows/ubuntu-ci-x86_64-gnu.yaml +++ b/.github/parkinglot/ubuntu-ci-x86_64-gnu.yaml @@ -28,7 +28,7 @@ jobs: rm -fr * - name: checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: submodules: true @@ -45,7 +45,7 @@ jobs: echo "Use existing binary cache for creating buildcache environment" fi - # spack-stack setup + # Set up spack-stack source ./setup.sh export ENVNAME=ue-gcc-11.4.0-buildcache export ENVDIR=$PWD/envs/${ENVNAME} diff --git a/.github/workflows/ubuntu-ci-x86_64-intel.yaml b/.github/parkinglot/ubuntu-ci-x86_64-intel.yaml similarity index 100% rename from .github/workflows/ubuntu-ci-x86_64-intel.yaml rename to .github/parkinglot/ubuntu-ci-x86_64-intel.yaml diff --git a/.github/workflows/macos-ci-aarch64.yaml b/.github/workflows/macos-ci-aarch64.yaml index 6db11b222..7325e9a5f 100644 --- a/.github/workflows/macos-ci-aarch64.yaml +++ b/.github/workflows/macos-ci-aarch64.yaml @@ -28,12 +28,23 @@ jobs: rm -fr * - name: checkout - uses: actions/checkout@v2 + uses: actions/checkout@v4 with: submodules: true - - name: create-env + - 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 @@ -42,15 +53,9 @@ jobs: source ./setup.sh # Important! export SPACK_PYTHON=/usr/bin/python3 - - # DH* 20230302 - to avoid using padded_length for build caches, - # always build in the same environment so that the length of the - # path doesn't change - see also other 'DH* 20230302' changes below - #export ENVNAME=${{ inputs.template || 'unified-dev' }}.macos-ci-aarch64 - export ENVNAME=ci-env.macos-ci-aarch64 - # *DH + export ENVNAME=ue-apple-clang-14.0.3-buildcache export ENVDIR=$PWD/envs/${ENVNAME} - spack stack create env --site macos.default --template ${{ inputs.template || 'unified-dev' }} --name ${ENVNAME} + spack stack create env --site macos.default --template unified-dev --name ${ENVNAME} spack env activate ${ENVDIR} spack add ${{ inputs.specs || '' }} export SPACK_SYSTEM_CONFIG_PATH="${ENVDIR}/site" @@ -58,7 +63,7 @@ jobs: # Find external packages spack external find --scope system \ --exclude bison --exclude openssl \ - --exclude python + --exclude curl --exclude python spack external find --scope system perl spack external find --scope system libiconv spack external find --scope system wget @@ -74,10 +79,8 @@ jobs: export -n SPACK_SYSTEM_CONFIG_PATH - # DH* 20230302 - Don't use yet, too many problems - ## For buildcaches - #spack config add config:install_tree:padded_length:true - # *DH + # For buildcaches + spack config add config:install_tree:padded_length:200 # Set compiler and MPI spack config add "packages:all:providers:mpi:[openmpi@5.0.3]" @@ -98,11 +101,13 @@ jobs: 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 and reindex it - spack mirror add local-binary file:///Users/ec2-user/spack-stack/build-cache/ - spack buildcache update-index local-binary - echo "Packages in combined spack build caches:" - spack buildcache list + # Add binary cache if requested + if [ "$USE_BINARY_CACHE" = true ] ; then + spack mirror add local-binary file:///Users/ec2-user/spack-stack/build-cache/ + spack buildcache update-index local-binary + 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 @@ -110,33 +115,85 @@ jobs: # 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 install --fail-fast --source --no-check-signature base-env 2>&1 | tee log.install.apple-clang-14.0.3-buildcache.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-buildcache.jedi-base-env + spack buildcache create -a -u /Users/ec2-user/spack-stack/build-cache/ jedi-base-env + # the rest - echo "${{ inputs.template || 'unified-dev' }} ..." - spack install --fail-fast --source --no-check-signature 2>&1 | tee log.install.apple-clang-14.0.3.${{ inputs.template || 'unified-dev' }} + echo "unified-env ..." + spack install --fail-fast --source --no-check-signature 2>&1 | tee log.install.apple-clang-14.0.3-buildcache.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? - echo "Next steps ..." + + # Cleanup + spack clean -a + spack env deactivate + + - name: create-env + run: | + # Set up homebrew and lmod support + eval "$(/opt/homebrew/bin/brew shellenv)" + source /opt/homebrew/opt/lmod/init/profile + + source ./setup.sh + export BUILDCACHE_ENVNAME=ue-apple-clang-14.0.3-buildcache + 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 + 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 and reindex it + spack mirror add local-binary file:///Users/ec2-user/spack-stack/build-cache/ + echo "Packages in combined spack build caches:" + spack buildcache list + + # base-env + echo "base-env ..." + spack install --fail-fast --source --no-check-signature 2>&1 | tee log.install.apple-clang-14.0.3.unified-env + + ${SPACK_STACK_DIR}/util/ldd_check.py $SPACK_ENV 2>&1 | tee log.ldd_check 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 $(realpath envs/${ENVNAME}/install) + # Retain config from upstream so we don't have to rebuild: + cp -r $PWD/envs/${ENVNAME}/{site,common} $PWD/envs/chaintest/. + spack env activate ${PWD}/envs/chaintest + spack add nccmp@1.8.9.0%gcc + spack concretize | tee envs/chaintest/log.concretize + unwanted_duplicates=$(( cat envs/chaintest/log.concretize | grep -E '^ - ' | grep -Fv 'nccmp@1.8.9.0' || true ) | wc -l) + if [ ${unwanted_duplicates} -gt 0 ]; then echo "Environment chaining test failed"; exit 1; fi + spack env deactivate + - name: test-env run: | # Set up homebrew and lmod support eval "$(/opt/homebrew/bin/brew shellenv)" source /opt/homebrew/opt/lmod/init/profile - # DH* 20230302 - to avoid using padded_length for build caches, - # always build in the same environment so that the length of the - # path doesn't change - see also other 'DH* 20230302' changes below - #export ENVNAME=${{ inputs.template || 'unified-dev' }}.macos-ci-aarch64 - export ENVNAME=ci-env.macos-ci-aarch64 - # *DH + export ENVNAME=ue-apple-clang-14.0.3 export ENVDIR=$PWD/envs/${ENVNAME} ls -l ${ENVDIR}/install/modulefiles/Core @@ -146,7 +203,7 @@ jobs: module load stack-python/3.10.13 module available - module load jedi-ufs-env/1.0.0 - module load ewok-env/1.0.0 - module load soca-env/1.0.0 + module load jedi-ufs-env + module load ewok-env + module load soca-env module list