Skip to content

Commit 6470e46

Browse files
authored
Merge pull request #124 from casparvl/match_partition_name_to_job_cfg
Infer the ReFrame partition name based on the node_type listed in the job's cfg
2 parents aee6812 + 2548173 commit 6470e46

File tree

2 files changed

+34
-7
lines changed

2 files changed

+34
-7
lines changed

bot/test.sh

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -189,6 +189,10 @@ EESSI_OS_TYPE=$(cfg_get_value "architecture" "os_type")
189189
export EESSI_OS_TYPE=${EESSI_OS_TYPE:-linux}
190190
echo "bot/test.sh: EESSI_OS_TYPE='${EESSI_OS_TYPE}'"
191191

192+
# Get node_type from .architecture.node_type in ${JOB_CFG_FILE}
193+
export BOT_NODE_TYPE=$(cfg_get_value "architecture" "node_type")
194+
echo "bot/test.sh: BOT_NODE_TYPE='${BOT_NODE_TYPE}"
195+
192196
# prepare arguments to eessi_container.sh common to build and tarball steps
193197
declare -a COMMON_ARGS=()
194198
COMMON_ARGS+=("--verbose")
@@ -237,6 +241,9 @@ fi
237241
if [[ ${SHARED_FS_PATH} ]]; then
238242
TEST_SUITE_ARGS+=("--shared-fs-path" "${SHARED_FS_PATH}")
239243
fi
244+
if [[ ${BOT_NODE_TYPE} ]]; then
245+
TEST_SUITE_ARGS+=("--partition" "${BOT_NODE_TYPE}")
246+
fi
240247
# [[ ! -z ${BUILD_LOGS_DIR} ]] && TEST_SUITE_ARGS+=("--build-logs-dir" "${BUILD_LOGS_DIR}")
241248
# [[ ! -z ${SHARED_FS_PATH} ]] && TEST_SUITE_ARGS+=("--shared-fs-path" "${SHARED_FS_PATH}")
242249

test_suite.sh

Lines changed: 27 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
display_help() {
1414
echo "usage: $0 [OPTIONS]"
1515
echo " -g | --generic - instructs script to test for generic architecture target"
16+
echo " -p | --partition - the partition name on which to test (used by ReFrame to load the right config)"
1617
echo " -h | --help - display this usage information"
1718
echo " -x | --http-proxy URL - provides URL for the environment variable http_proxy"
1819
echo " -y | --https-proxy URL - provides URL for the environment variable https_proxy"
@@ -26,6 +27,10 @@ while [[ $# -gt 0 ]]; do
2627
DETECTION_PARAMETERS="--generic"
2728
shift
2829
;;
30+
-p|--partition)
31+
REFRAME_PARTITION_NAME="${2}"
32+
shift 2
33+
;;
2934
-h|--help)
3035
display_help # Call your function
3136
# no shifting needed here, we're done.
@@ -153,13 +158,6 @@ export RFM_CHECK_SEARCH_PATH=$TESTSUITEPREFIX/eessi/testsuite/tests
153158
export RFM_CHECK_SEARCH_RECURSIVE=1
154159
export RFM_PREFIX=$PWD/reframe_runs
155160

156-
# Get the correct partition name
157-
REFRAME_PARTITION_NAME=${EESSI_SOFTWARE_SUBDIR//\//_}
158-
if [ ! -z "$EESSI_ACCELERATOR_TARGET_OVERRIDE" ]; then
159-
REFRAME_PARTITION_NAME=${REFRAME_PARTITION_NAME}_${EESSI_ACCELERATOR_TARGET_OVERRIDE//\//_}
160-
fi
161-
echo "Constructed partition name based on EESSI_SOFTWARE_SUBDIR and EESSI_ACCELERATOR_TARGET: ${REFRAME_PARTITION_NAME}"
162-
163161
# Set the reframe system name, including partition
164162
export RFM_SYSTEM="BotBuildTests:${REFRAME_PARTITION_NAME}"
165163

@@ -185,6 +183,28 @@ else
185183
fatal_error "Failed to run 'reframe --version'"
186184
fi
187185

186+
# Check if the partition specified by RFM_SYSTEM is in the config file
187+
# Redirect to /dev/null because we don't want to print an ERROR, we want to try a fallback
188+
reframe --show-config | grep -v "could not find a configuration entry for the requested system/partition combination" > /dev/null
189+
if [[ $? -eq 1 ]]; then
190+
# There was a match by grep, so we failed to find the system/partition combination
191+
# Try the previous approach for backwards compatibility
192+
# This fallback can be scrapped once all bots have adopted the new naming convention
193+
# (i.e. using the node_type name from app.cfg) for ReFrame partitions
194+
# Get the correct partition name
195+
echo "Falling back to old naming scheme for REFRAME_PARTITION_NAME."
196+
echo "This naming scheme is deprecated, please update your partition names in the ReFrame config file."
197+
REFRAME_PARTITION_NAME=${EESSI_SOFTWARE_SUBDIR//\//_}
198+
if [ ! -z "$EESSI_ACCELERATOR_TARGET_OVERRIDE" ]; then
199+
REFRAME_PARTITION_NAME=${REFRAME_PARTITION_NAME}_${EESSI_ACCELERATOR_TARGET_OVERRIDE//\//_}
200+
fi
201+
echo "Constructed partition name based on EESSI_SOFTWARE_SUBDIR and EESSI_ACCELERATOR_TARGET: ${REFRAME_PARTITION_NAME}"
202+
export RFM_SYSTEM="BotBuildTests:${REFRAME_PARTITION_NAME}"
203+
fi
204+
205+
# Log the config for this partition:
206+
reframe --show-config
207+
188208
# Get the subset of test names based on the test mapping and tags (e.g. CI, 1_node)
189209
module_list="module_files.list.txt"
190210
mapping_config="tests/eessi_test_mapping/software_to_tests.yml"

0 commit comments

Comments
 (0)