Skip to content

Commit

Permalink
draft weekly build/test scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexanderRichert-NOAA committed Jul 30, 2024
1 parent 2c9cb91 commit 3567abf
Show file tree
Hide file tree
Showing 9 changed files with 72 additions and 0 deletions.
5 changes: 5 additions & 0 deletions util/weekly_build/1_DirectorySetup.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/bin/bash

echo Base directory: ${2?"Second arg: base directory for build"}

mkdir -p $2
6 changes: 6 additions & 0 deletions util/weekly_build/2_GetSpackStackDevelop.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/bin/bash

if [ -z $SETUPDONE ]; then . ShellSetup.sh $* ; fi

cd $RUNDIR
git clone https://github.com/JCSDA/spack-stack -b develop spack-stack-build-cache-${RUNID}
17 changes: 17 additions & 0 deletions util/weekly_build/3_SetupUnifiedEnv.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#!/bin/bash

if [ -z $SETUPDONE ]; then . ShellSetup.sh $* ; fi

cd $RUNDIR/spack-stack-build-cache-$RUNID

. setup.sh

for compiler in $COMPILERS; do
spack stack create env --name build-$compiler --template unified-dev --platform $PLATFORM
cd envs/build-$compiler
sed -i "s|- compilers: \['%.*|- compilers: ['%$compiler']|" spack.yaml
# Check for duplicates and fail before doing the "real" concretization with test deps:
spack concretize --fresh 2>&1 | tee log.concretize
${SPACK_STACK_DIR:?}/utils/show_duplicate_packages.py -d -i crtm log.concretize
spack concretize --force --fresh --test all 2>&1 | tee log.concretize_test
done
18 changes: 18 additions & 0 deletions util/weekly_build/4_SpackInstall.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#!/bin/bash

if [ -z $SETUPDONE ]; then . ShellSetup.sh $* ; fi

cd $RUNDIR/spack-stack-build-cache-${RUNID}

. setup.sh

installopts="--show-log-on-error"

for compiler in $COMPILERS; do
cd envs/build-$compiler
spack env activate .
# Just install the packages we're testing (+dependencies):
spack install $installopts --test root $PACKAGESTOTEST 2>&1 | tee log.install_withtesting
# Install the rest of the stack as usual:
spack install $installopts 2>&1 | tee log.install
done
Empty file.
Empty file added util/weekly_build/6_Cleanup.sh
Empty file.
1 change: 1 addition & 0 deletions util/weekly_build/README
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Concretization for deployments should be done with `spack concretize --fresh` so as to ensure that the stack would concretize the same way if the build cache weren't there.
16 changes: 16 additions & 0 deletions util/weekly_build/ShellSetup.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
echo Run ID: ${1?"First arg: Unique run ID"}
echo Base directory: ${2?"Second arg: base directory for build"}
echo Platform name: ${3?"Third arg: platform name ('hera', 'hercules', etc.)"}

export RUNID=$1
export BASEDIR=$2
export PLATFORM=$3

if [ ${BASEDIR::1} != "/" ]; then
echo "FATAL ERROR: Directory should be an absolute path!"
exit 1
fi

export COMPILERS=intel

export PACKAGESTOTEST="libpng libaec jasper scotch w3emc bacio g2 g2c"
9 changes: 9 additions & 0 deletions util/weekly_build/SpackStackBuildCache_AllSteps.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/bin/bash

set -e

. ShellSetup.sh $*

export SETUPDONE=YES


0 comments on commit 3567abf

Please sign in to comment.