From 3567abfc71058a1798d72b2a6e0802bac061e1c7 Mon Sep 17 00:00:00 2001 From: Alex Richert Date: Tue, 30 Jul 2024 08:11:13 -0700 Subject: [PATCH] draft weekly build/test scripts --- util/weekly_build/1_DirectorySetup.sh | 5 +++++ util/weekly_build/2_GetSpackStackDevelop.sh | 6 ++++++ util/weekly_build/3_SetupUnifiedEnv.sh | 17 +++++++++++++++++ util/weekly_build/4_SpackInstall.sh | 18 ++++++++++++++++++ util/weekly_build/5_BuildCache.sh | 0 util/weekly_build/6_Cleanup.sh | 0 util/weekly_build/README | 1 + util/weekly_build/ShellSetup.sh | 16 ++++++++++++++++ .../SpackStackBuildCache_AllSteps.sh | 9 +++++++++ 9 files changed, 72 insertions(+) create mode 100644 util/weekly_build/1_DirectorySetup.sh create mode 100644 util/weekly_build/2_GetSpackStackDevelop.sh create mode 100644 util/weekly_build/3_SetupUnifiedEnv.sh create mode 100644 util/weekly_build/4_SpackInstall.sh create mode 100644 util/weekly_build/5_BuildCache.sh create mode 100644 util/weekly_build/6_Cleanup.sh create mode 100644 util/weekly_build/README create mode 100644 util/weekly_build/ShellSetup.sh create mode 100644 util/weekly_build/SpackStackBuildCache_AllSteps.sh diff --git a/util/weekly_build/1_DirectorySetup.sh b/util/weekly_build/1_DirectorySetup.sh new file mode 100644 index 000000000..a73c9584f --- /dev/null +++ b/util/weekly_build/1_DirectorySetup.sh @@ -0,0 +1,5 @@ +#!/bin/bash + +echo Base directory: ${2?"Second arg: base directory for build"} + +mkdir -p $2 diff --git a/util/weekly_build/2_GetSpackStackDevelop.sh b/util/weekly_build/2_GetSpackStackDevelop.sh new file mode 100644 index 000000000..f92e83ed7 --- /dev/null +++ b/util/weekly_build/2_GetSpackStackDevelop.sh @@ -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} diff --git a/util/weekly_build/3_SetupUnifiedEnv.sh b/util/weekly_build/3_SetupUnifiedEnv.sh new file mode 100644 index 000000000..98830ec9d --- /dev/null +++ b/util/weekly_build/3_SetupUnifiedEnv.sh @@ -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 diff --git a/util/weekly_build/4_SpackInstall.sh b/util/weekly_build/4_SpackInstall.sh new file mode 100644 index 000000000..36f49e6e7 --- /dev/null +++ b/util/weekly_build/4_SpackInstall.sh @@ -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 diff --git a/util/weekly_build/5_BuildCache.sh b/util/weekly_build/5_BuildCache.sh new file mode 100644 index 000000000..e69de29bb diff --git a/util/weekly_build/6_Cleanup.sh b/util/weekly_build/6_Cleanup.sh new file mode 100644 index 000000000..e69de29bb diff --git a/util/weekly_build/README b/util/weekly_build/README new file mode 100644 index 000000000..31232331b --- /dev/null +++ b/util/weekly_build/README @@ -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. diff --git a/util/weekly_build/ShellSetup.sh b/util/weekly_build/ShellSetup.sh new file mode 100644 index 000000000..5cfcb5f58 --- /dev/null +++ b/util/weekly_build/ShellSetup.sh @@ -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" diff --git a/util/weekly_build/SpackStackBuildCache_AllSteps.sh b/util/weekly_build/SpackStackBuildCache_AllSteps.sh new file mode 100644 index 000000000..3b666de5c --- /dev/null +++ b/util/weekly_build/SpackStackBuildCache_AllSteps.sh @@ -0,0 +1,9 @@ +#!/bin/bash + +set -e + +. ShellSetup.sh $* + +export SETUPDONE=YES + +