From f4d1d42e8ce01993817eb3e6161e3d834a5c7e28 Mon Sep 17 00:00:00 2001 From: Adrian Reber Date: Mon, 24 Nov 2025 13:47:19 +0000 Subject: [PATCH] ci: add --install-only-baseos option for minimal OS setup MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add a new --install-only-baseos flag to run-ci.sh that installs only the base operating system without the OpenHPC cluster, root-level tests, or user-level tests. This mode is useful for testing base OS provisioning independently. When this flag is set, the script: - Sets InstallCluster, RootLevelTests, and UserLevelTests to false - Skips copying test result logs from the SMS node - Skips determining and printing the last job ID - Disables data upload (no test data to upload) The control variables (InstallCluster, RootLevelTests, UserLevelTests) are now always set by run-ci.sh rather than having defaults in the vars file, ensuring consistent behavior based on the selected installation mode. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Signed-off-by: Adrian Reber --- ansible/roles/test/files/run-ci.sh | 42 +++++++++++++++++++++++------- ansible/roles/test/files/vars | 3 --- 2 files changed, 32 insertions(+), 13 deletions(-) diff --git a/ansible/roles/test/files/run-ci.sh b/ansible/roles/test/files/run-ci.sh index b23b464..f30cfea 100755 --- a/ansible/roles/test/files/run-ci.sh +++ b/ansible/roles/test/files/run-ci.sh @@ -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 @@ -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 @@ -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}" @@ -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 @@ -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 diff --git a/ansible/roles/test/files/vars b/ansible/roles/test/files/vars index ad830a1..f16498b 100644 --- a/ansible/roles/test/files/vars +++ b/ansible/roles/test/files/vars @@ -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