diff --git a/bot/test.sh b/bot/test.sh index 4205ea8564..464c4817a9 100755 --- a/bot/test.sh +++ b/bot/test.sh @@ -172,6 +172,10 @@ EESSI_SOFTWARE_SUBDIR_OVERRIDE=${EESSI_SOFTWARE_SUBDIR_OVERRIDE:-${CPU_TARGET}} export EESSI_SOFTWARE_SUBDIR_OVERRIDE echo "bot/test.sh: EESSI_SOFTWARE_SUBDIR_OVERRIDE='${EESSI_SOFTWARE_SUBDIR_OVERRIDE}'" +# determine accelerator target (if any) from .architecture in ${JOB_CFG_FILE} +export EESSI_ACCELERATOR_TARGET=$(cfg_get_value "architecture" "accelerator") +echo "bot/test.sh: EESSI_ACCELERATOR_TARGET='${EESSI_ACCELERATOR_TARGET}'" + # get EESSI_OS_TYPE from .architecture.os_type in ${JOB_CFG_FILE} (default: linux) EESSI_OS_TYPE=$(cfg_get_value "architecture" "os_type") export EESSI_OS_TYPE=${EESSI_OS_TYPE:-linux} @@ -219,6 +223,9 @@ declare -a TEST_SUITE_ARGS=() if [[ ${EESSI_SOFTWARE_SUBDIR_OVERRIDE} =~ .*/generic$ ]]; then TEST_SUITE_ARGS+=("--generic") fi +if [[ ${SHARED_FS_PATH} ]]; then + TEST_SUITE_ARGS+=("--shared-fs-path" "${SHARED_FS_PATH}") +fi # [[ ! -z ${BUILD_LOGS_DIR} ]] && TEST_SUITE_ARGS+=("--build-logs-dir" "${BUILD_LOGS_DIR}") # [[ ! -z ${SHARED_FS_PATH} ]] && TEST_SUITE_ARGS+=("--shared-fs-path" "${SHARED_FS_PATH}") diff --git a/reframe_config_bot.py.tmpl b/reframe_config_bot.py.tmpl deleted file mode 100644 index 323aafd5ec..0000000000 --- a/reframe_config_bot.py.tmpl +++ /dev/null @@ -1,57 +0,0 @@ -# WARNING: this file is intended as template and the __X__ template variables need to be replaced -# before it can act as a configuration file -# Once replaced, this is a config file for running tests after the build phase, by the bot - -from eessi.testsuite.common_config import common_logging_config -from eessi.testsuite.constants import * # noqa: F403 - - -site_configuration = { - 'systems': [ - { - 'name': 'BotBuildTests', - 'descr': 'Software-layer bot', - 'hostnames': ['.*'], - 'modules_system': 'lmod', - 'partitions': [ - { - 'name': '__RFM_PARTITION__', - 'scheduler': 'local', - 'launcher': 'mpirun', - 'environs': ['default'], - 'features': [ - FEATURES[CPU] - ] + list(SCALES.keys()), - 'resources': [ - { - 'name': 'memory', - 'options': ['--mem={size}'], - } - ], - 'extras': { - # Make sure to round down, otherwise a job might ask for more mem than is available - # per node - 'mem_per_node': __MEM_PER_NODE__, - }, - 'max_jobs': 1 - } - ] - } - ], - 'environments': [ - { - 'name': 'default', - 'cc': 'cc', - 'cxx': '', - 'ftn': '' - } - ], - 'general': [ - { - 'purge_environment': True, - 'resolve_module_conflicts': False, # avoid loading the module before submitting the job - 'remote_detect': True, - } - ], - 'logging': common_logging_config(), -} diff --git a/test_suite.sh b/test_suite.sh index 1f0b91c477..4121a37c2e 100755 --- a/test_suite.sh +++ b/test_suite.sh @@ -132,56 +132,42 @@ else fi # Configure ReFrame, see https://www.eessi.io/docs/test-suite/installation-configuration -export RFM_CONFIG_FILES=$TOPDIR/reframe_config_bot.py -export RFM_CONFIG_FILE_TEMPLATE=$TOPDIR/reframe_config_bot.py.tmpl +# RFM_CONFIG_FILES _has_ to be set by the site hosting the bot, so that it knows where to find the ReFrame +# config file that matches the bot config. See https://gitlab.com/eessi/support/-/issues/114#note_2293660921 +if [ -z "$RFM_CONFIG_FILES" ]; then + if [ -z "${shared_fs_path}" ]; then + fatal_error "Environment variable 'shared_fs_path' was expected, but was not set" + fi + # Try to find a config file at $shared_fs_path/reframe_config.py + export RFM_CONFIG_FILES="${shared_fs_path}/reframe_config.py" + if [ ! -f "${RFM_CONFIG_FILES}" ]; then + # If we haven't found the ReFrame config, print an informative error + err_msg="Please put a ReFrame configuration file in ${shared_fs_path}/reframe_config.py" + err_msg="${err_msg} or set RFM_CONFIG_FILES in the environment of this bot instance to point to a valid" + err_msg="${err_msg} ReFrame configuration file that matches the bot config." + err_msg="${err_msg} For more information, see https://gitlab.com/eessi/support/-/issues/114#note_2293660921" + fatal_error "${err_msg}" + fi +fi export RFM_CHECK_SEARCH_PATH=$TESTSUITEPREFIX/eessi/testsuite/tests export RFM_CHECK_SEARCH_RECURSIVE=1 export RFM_PREFIX=$PWD/reframe_runs -echo "Configured reframe with the following environment variables:" -env | grep "RFM_" - -# The /sys inside the container is not the same as the /sys of the host -# We want to extract the memory limit from the cgroup on the host (which is typically set by SLURM). -# Thus, bot/test.sh bind-mounts the host's /sys/fs/cgroup into /hostsys/fs/cgroup -# and that's the prefix we use to extract the memory limit from -cgroup_v1_mem_limit="/hostsys/fs/cgroup/memory/$(