-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #110 from lanl/rberger/ci_updates
CI Updates
- Loading branch information
Showing
4 changed files
with
59 additions
and
19 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,6 +15,8 @@ SUBMIT_TO_CDASH=${SUBMIT_TO_CDASH:-false} | |
BUILD_WITH_CTEST=${BUILD_WITH_CTEST:-${SUBMIT_TO_CDASH}} | ||
SUBMIT_ON_ERROR=${SUBMIT_ON_ERROR:-${SUBMIT_TO_CDASH}} | ||
SHOW_HELP_MESSAGE=${SHOW_HELP_MESSAGE:-true} | ||
DEFAULT_TEST_TIMEOUT=${DEFAULT_TEST_TIMEOUT:-600} | ||
AVAILABLE_CLUSTERS=darwin,rocinante,venado,chicoma,rzvernal,rzadams | ||
|
||
if ${SUBMIT_TO_CDASH}; then | ||
UNTIL=${UNTIL:-submit} | ||
|
@@ -44,12 +46,16 @@ section() { | |
} | ||
|
||
print_usage() { | ||
echo "usage: build_and_test [-h] [-u {spack,env,cmake,build,test,install}] system environment" | ||
echo "usage: build_and_test [-h] [-u {spack,env,cmake,build,test,install}] [system] [environment]" | ||
echo | ||
echo "This script allows you to active a Spack environment on a given system," | ||
echo "This script allows you to activate a Spack environment on a given system," | ||
echo "configure your project's CMake based on its Spack variants, and then build, test and" | ||
echo "install it. Use the -u/--until option to stop the script early at a given phase." | ||
echo | ||
echo "Not specifying an environment will list all available configurations for the given system." | ||
echo | ||
echo "Not specifying a system or environment will list all available systems." | ||
echo | ||
echo "After the 'env' phase has run, you will be in an active Spack environment." | ||
echo "You can then use the 'activate_build_env' command to enter a sub-shell" | ||
echo "with the Spack build environment for your project." | ||
|
@@ -63,6 +69,12 @@ print_usage() { | |
echo " - cmake_test [EXTRA_CTEST_ARGS]" | ||
echo " - cmake_install" | ||
echo | ||
echo "To enable CDash submission, set environment variable SUBMIT_TO_CDASH=true" | ||
echo | ||
echo "Use the environment variable PROJECT_SPACK_ENV to select a different" | ||
echo "upstream. If CI_SPACK_ENV is set to the same location as PROJECT_SPACK_ENV," | ||
echo "that spack deployment will be used directly and not replicated." | ||
echo | ||
echo "positional arguments:" | ||
echo " system name of the system" | ||
echo " environment name of the Spack environment" | ||
|
@@ -74,6 +86,7 @@ print_usage() { | |
} | ||
|
||
VALID_CMD=false | ||
SHOW_AVAILABLE=false | ||
if [ $# -eq 2 ] && [[ ! "$1" =~ ^-.* ]] && [[ ! "$2" =~ ^-.* ]]; then | ||
VALID_CMD=true | ||
elif [ $# -eq 4 ]; then | ||
|
@@ -84,6 +97,12 @@ elif [ $# -eq 4 ]; then | |
shift 2 | ||
fi | ||
fi | ||
elif [ $# -eq 1 ] && [[ "$AVAILABLE_CLUSTERS" =~ "$1" ]]; then | ||
VALID_CMD=true | ||
SHOW_AVAILABLE=true | ||
elif [ $# -eq 0 ]; then | ||
VALID_CMD=true | ||
SHOW_AVAILABLE=true | ||
fi | ||
|
||
if ! $VALID_CMD; then | ||
|
@@ -95,16 +114,37 @@ fi | |
export SYSTEM_NAME=$1 | ||
export SPACK_ENV_NAME=$2 | ||
|
||
if [[ "$SYSTEM_NAME" == "darwin" || "$SYSTEM_NAME" == "rocinante" || "$SYSTEM_NAME" == "venado" ]]; then | ||
if [[ "$SYSTEM_NAME" == "darwin" || "$SYSTEM_NAME" == "rocinante" || "$SYSTEM_NAME" == "venado" || "${SYSTEM_NAME}" == "chicoma" ]]; then | ||
PROJECT_SPACK_ENV=${PROJECT_SPACK_ENV:-/usr/projects/xcap/spack-env/${PROJECT_TYPE}/${PROJECT_SPACK_ENV_VERSION}} | ||
elif [[ "$SYSTEM_NAME" == "rzadams" || "${SYSTEM_NAME}" == "rzansel" || "$SYSTEM_NAME" == "rzvernal" ]]; then | ||
elif [[ "$SYSTEM_NAME" == "rzadams" || "${SYSTEM_NAME}" == "rzansel" || "$SYSTEM_NAME" == "rzvernal" || "$SYSTEM_NAME" == "elcapitan" ]]; then | ||
PROJECT_SPACK_ENV=${PROJECT_SPACK_ENV:-/usr/workspace/xcap/spack-env/${PROJECT_TYPE}/${PROJECT_SPACK_ENV_VERSION}} | ||
elif $SHOW_AVAILABLE; then | ||
echo "Available systems:" | ||
echo | ||
for c in ${AVAILABLE_CLUSTERS//,/ } | ||
do | ||
echo "${c}" | ||
done | ||
true | ||
return | ||
else | ||
echo "Unkown system '${SYSTEM_NAME}'" | ||
echo "ERROR: Unkown system '${SYSTEM_NAME}'" | ||
false | ||
return | ||
fi | ||
|
||
if $SHOW_AVAILABLE; then | ||
shift 1 | ||
if [ -f $PROJECT_SPACK_ENV/systems/$SYSTEM_NAME/activate.sh ]; then | ||
source $PROJECT_SPACK_ENV/systems/$SYSTEM_NAME/activate.sh | ||
true | ||
else | ||
echo "ERROR: command can only be executed on ${SYSTEM_NAME}" | ||
false | ||
fi | ||
return | ||
fi | ||
|
||
if [[ "${SPACK_ENV_NAME}" == "custom-spec" ]] && [[ -z "${SPACK_ENV_SPEC}" ]]; then | ||
echo "Spack environment 'custom-spec' requires SPACK_ENV_SPEC environment variable to be set!" | ||
false | ||
|
@@ -127,8 +167,10 @@ fi | |
prepare_spack() { | ||
section start "prepare_spack[collapsed=true]" "Prepare Spack" | ||
umask 0007 | ||
mkdir -p $TMPDIR | ||
source $PROJECT_SPACK_ENV/replicate.sh $CI_SPACK_ENV | ||
if [[ "$PROJECT_SPACK_ENV" != "$CI_SPACK_ENV" ]]; then | ||
mkdir -p $TMPDIR | ||
source $PROJECT_SPACK_ENV/replicate.sh $CI_SPACK_ENV | ||
fi | ||
section end "prepare_spack" | ||
} | ||
|
||
|
@@ -206,7 +248,7 @@ cmake_test() { | |
if ${BUILD_WITH_CTEST}; then | ||
ctest -V -S .gitlab/build_and_test.cmake,Test,$REPORT_ERRORS | ||
else | ||
ctest --test-dir ${BUILD_DIR} --output-junit tests.xml $@ | ||
ctest --timeout ${DEFAULT_TEST_TIMEOUT} --test-dir ${BUILD_DIR} --output-junit tests.xml | ||
fi | ||
) | ||
section end "testing" | ||
|
@@ -248,7 +290,7 @@ activate_build_env() { | |
############################################################################### | ||
if ${SHOW_HELP_MESSAGE}; then | ||
echo "Running on $(hostname)" | ||
|
||
if [ ${CI} ]; then | ||
echo " " | ||
echo -e "${COLOR_BLUE}######################################################################${COLOR_PLAIN}" | ||
|
@@ -258,6 +300,7 @@ if ${SHOW_HELP_MESSAGE}; then | |
echo -e "${COLOR_BLUE}ssh ${CLUSTER}${COLOR_PLAIN}" | ||
echo -e "${COLOR_BLUE}cd /your/${PROJECT_NAME}/checkout${COLOR_PLAIN}" | ||
if [ -d ${SOURCE_DIR}/extern/ports-of-call.git ]; then | ||
echo -e "${COLOR_BLUE}mkdir extern${COLOR_PLAIN}" | ||
echo -e "${COLOR_BLUE}git clone --bare ssh://[email protected]:10022/xcap/oss/ports-of-call.git extern/ports-of-call.git${COLOR_PLAIN}" | ||
fi | ||
if [[ ! -z "${LLNL_FLUX_SCHEDULER_PARAMETERS}" ]]; then | ||
|
@@ -267,6 +310,9 @@ if ${SHOW_HELP_MESSAGE}; then | |
else | ||
echo -e "${COLOR_BLUE}salloc ${SCHEDULER_PARAMETERS}${COLOR_PLAIN}" | ||
fi | ||
if [[ "${PROJECT_SPACK_ENV_VERSION}" != "current" ]]; then | ||
echo -e "${COLOR_BLUE}export PROJECT_SPACK_ENV_VERSION=${PROJECT_SPACK_ENV_VERSION}${COLOR_PLAIN}" | ||
fi | ||
if [[ ! -z "${SPACK_ENV_SPEC}" ]]; then | ||
echo -e "${COLOR_BLUE}export SPACK_ENV_SPEC='${SPACK_ENV_SPEC}'${COLOR_PLAIN}" | ||
fi | ||
|
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,4 @@ | ||
# Copyright 2013-2023 Lawrence Livermore National Security, LLC and other | ||
# Spack Project Developers. See the top-level COPYRIGHT file for details. | ||
# Copyright Spack Project Developers. See COPYRIGHT file for details. | ||
# | ||
# SPDX-License-Identifier: (Apache-2.0 OR MIT) | ||
|
||
|
@@ -64,8 +63,8 @@ class Spiner(CMakePackage): | |
depends_on("ports-of-call portability_strategy=Kokkos", when="@:1.5.1 +kokkos") | ||
depends_on("ports-of-call portability_strategy=None", when="@:1.5.1 ~kokkos") | ||
depends_on("[email protected]:", when="+kokkos") | ||
depends_on( | ||
"kokkos ~shared+cuda_lambda+cuda_constexpr", | ||
requires( | ||
"^kokkos ~shared+cuda_lambda+cuda_constexpr", | ||
when="+kokkos ^kokkos+cuda", | ||
) | ||
|
||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,2 @@ | ||
# ### | ||
# repository information | ||
# ### | ||
|
||
repo: | ||
namespace: spiner |