Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 32 additions & 10 deletions ansible/roles/test/files/run-ci.sh
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,14 @@ show_usage() {
echo " -b, --infiniband Use InfiniBand"
echo " -n, --no-upload Don't upload test results"
echo " --to-disk Provision compute node image to disk"
echo " --install-only-baseos Install only base OS without OpenHPC cluster"
echo " -h, --help Show this help"
}

TIMEOUT="100"

# Parse command line options using external getopt
if ! PARSED=$(getopt -o d:v:r:m:p:ig:nbo:h --long distribution:,version:,repository:,rms:,provisioner:,intel,gpu:,no-upload,infiniband,overwrite-rpm:,to-disk,help -n "$0" -- "$@"); then
if ! PARSED=$(getopt -o d:v:r:m:p:ig:nbo:h --long distribution:,version:,repository:,rms:,provisioner:,intel,gpu:,no-upload,infiniband,overwrite-rpm:,to-disk,install-only-baseos,help -n "$0" -- "$@"); then
echo "Failed to parse options"
show_usage
exit 1
Expand Down Expand Up @@ -89,6 +90,10 @@ while true; do
ENABLE_TODISK="true"
shift
;;
--install-only-baseos)
INSTALL_ONLY_BASEOS="true"
shift
;;
-h | --help)
show_usage
exit 0
Expand Down Expand Up @@ -452,6 +457,18 @@ echo "export IPMI_PASSWORD=${SMS_IPMI_PASSWORD}" >>"${VARS}"

set -x

# Set control variables based on --install-only-baseos flag
if [ -n "${INSTALL_ONLY_BASEOS}" ]; then
INSTALL_CLUSTER="false"
ROOT_LEVEL_TESTS="false"
USER_LEVEL_TESTS="false"
UPLOAD="false"
else
INSTALL_CLUSTER="true"
ROOT_LEVEL_TESTS="true"
USER_LEVEL_TESTS="true"
fi

{
echo "export DISTRIBUTION=${DISTRIBUTION}"
echo "export Version=${VERSION}"
Expand All @@ -468,6 +485,9 @@ set -x
echo "export dns_servers=1.1.1.1"
echo "export ipv4_gateway=${GATEWAY}"
echo "export sms_eth_internal=${SMS_ETH_INTERNAL}"
echo "export InstallCluster=${INSTALL_CLUSTER}"
echo "export RootLevelTests=${ROOT_LEVEL_TESTS}"
echo "export UserLevelTests=${USER_LEVEL_TESTS}"
} >>"${VARS}"

if [[ "${PROVISIONER}" == "confluent" ]]; then
Expand Down Expand Up @@ -542,17 +562,19 @@ echo "Finished install.sh on ${SMS} with timeout ${TIMEOUT}m at $(date -u +"%Y-%

rm -f "${VARS}"

ssh "${SMS}" "mkdir -p /home/ohpc-test/tests; cp *log.xml /home/ohpc-test/tests; cd /home/ohpc-test; find . -name '*log.xml' -print0 | tar -cf - --null -T -" >"${OUT}"/test-results.tar
if [ -z "${INSTALL_ONLY_BASEOS}" ]; then
ssh "${SMS}" "mkdir -p /home/ohpc-test/tests; cp *log.xml /home/ohpc-test/tests; cd /home/ohpc-test; find . -name '*log.xml' -print0 | tar -cf - --null -T -" >"${OUT}"/test-results.tar

if [[ "${RMS}" == "slurm" ]]; then
CMD="scontrol show job | grep JobId"
else
CMD="qstat -x"
fi
if [[ "${RMS}" == "slurm" ]]; then
CMD="scontrol show job | grep JobId"
else
CMD="qstat -x"
fi

# shellcheck disable=SC2029
LAST_JOB=$(ssh "${SMS}" "${CMD}" | tail -1 | cut -d\ -f1)
# shellcheck disable=SC2029
LAST_JOB=$(ssh "${SMS}" "${CMD}" | tail -1 | cut -d\ -f1)

echo "Last job ID: ${LAST_JOB}" | tee -a "${LOG}"
echo "Last job ID: ${LAST_JOB}" | tee -a "${LOG}"
fi

cleanup
3 changes: 0 additions & 3 deletions ansible/roles/test/files/vars
Original file line number Diff line number Diff line change
@@ -1,12 +1,9 @@
export InstallCluster=true
export EnableLongTests=true
export Upgrade=false
export Interactive=false
export provision_wait=100
export UserLevelTests=true
export LocalRepoFromDist=false
export UseExternalRepo=true
export RootLevelTests=true
export EnableArmCompiler=false
export CI=true
export DisableDefaultRepo=false
Expand Down