Skip to content

Commit 428e3f2

Browse files
authored
Merge pull request #43 from openhpc/2025-10-08-disk
Add `--to-disk ` to support new to disk provisioning (warewulf4)
2 parents e0c2bd5 + 2085697 commit 428e3f2

File tree

3 files changed

+84
-39
lines changed

3 files changed

+84
-39
lines changed

ansible/roles/test/files/run-ci.sh

Lines changed: 71 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -9,67 +9,96 @@ show_usage() {
99
echo " $0 [<options>]"
1010
echo
1111
echo "Options:"
12-
echo " -d <DISTRIBUTION> Run the CI test on the specified distribution"
13-
echo " -v <VERSION> Run the CI test on the specified version of OpenHPC"
14-
echo " -r <REPOSITORY> Run the CI test using the specified repository"
15-
echo " (Factory, Staging, Release)"
16-
echo " -m <RMS> Run the CI test using the specified resource manager"
17-
echo " (openpbs, slurm (default))"
18-
echo " -p <PROVISIONER> Run the CI test using the specified provisioner"
19-
echo " (confluent, warewulf (default))"
20-
echo " -i Install and run tests using packages built with the"
21-
echo " Intel compiler"
22-
echo " -g <GPU> Run the CI test with GPU installation and tests enabled"
23-
echo " (nvidia, none (default))"
24-
echo " -o <RPM> Use this RPM to overwrite the default docs-ohpc RPM"
25-
echo " -b Use InfiniBand"
26-
echo " -n Don't upload test results"
27-
echo " -h Show this help"
12+
echo " -d, --distribution <DISTRIBUTION> Run the CI test on the specified distribution"
13+
echo " -v, --version <VERSION> Run the CI test on the specified version of OpenHPC"
14+
echo " -r, --repository <REPOSITORY> Run the CI test using the specified repository"
15+
echo " (Factory, Staging, Release)"
16+
echo " -m, --rms <RMS> Run the CI test using the specified resource manager"
17+
echo " (openpbs, slurm (default))"
18+
echo " -p, --provisioner <PROVISIONER> Run the CI test using the specified provisioner"
19+
echo " (confluent, warewulf (default))"
20+
echo " -i, --intel Install and run tests using packages built with the"
21+
echo " Intel compiler"
22+
echo " -g, --gpu <GPU> Run the CI test with GPU installation and tests enabled"
23+
echo " (nvidia, none (default))"
24+
echo " -o, --overwrite-rpm <RPM> Use this RPM to overwrite the default docs-ohpc RPM"
25+
echo " -b, --infiniband Use InfiniBand"
26+
echo " -n, --no-upload Don't upload test results"
27+
echo " --to-disk Provision compute node image to disk"
28+
echo " -h, --help Show this help"
2829
}
2930

3031
TIMEOUT="100"
3132

32-
while getopts "d:v:r:m:p:ig:nbo:h" OPTION; do
33-
case $OPTION in
34-
d)
35-
DISTRIBUTION=$OPTARG
33+
# Parse command line options using external getopt
34+
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
35+
echo "Failed to parse options"
36+
show_usage
37+
exit 1
38+
fi
39+
40+
# Set the parsed options back to the positional parameters
41+
eval set -- "$PARSED"
42+
43+
# Process the options
44+
while true; do
45+
case "$1" in
46+
-d | --distribution)
47+
DISTRIBUTION="$2"
48+
shift 2
3649
;;
37-
v)
38-
VERSION=$OPTARG
50+
-v | --version)
51+
VERSION="$2"
52+
shift 2
3953
;;
40-
r)
41-
REPO=$OPTARG
54+
-r | --repository)
55+
REPO="$2"
56+
shift 2
4257
;;
43-
m)
44-
RMS=$OPTARG
58+
-m | --rms)
59+
RMS="$2"
60+
shift 2
4561
;;
46-
p)
47-
PROVISIONER=$OPTARG
62+
-p | --provisioner)
63+
PROVISIONER="$2"
64+
shift 2
4865
;;
49-
i)
66+
-i | --intel)
5067
WITH_INTEL="true"
5168
((TIMEOUT += 50))
69+
shift
5270
;;
53-
b)
71+
-b | --infiniband)
5472
USE_IB="true"
73+
shift
5574
;;
56-
o)
57-
RPM=$OPTARG
75+
-o | --overwrite-rpm)
76+
RPM="$2"
77+
shift 2
5878
;;
59-
n)
79+
-n | --no-upload)
6080
UPLOAD="false"
81+
shift
6182
;;
62-
g)
63-
WITH_GPU=$OPTARG
83+
-g | --gpu)
84+
WITH_GPU="$2"
6485
((TIMEOUT += 50))
86+
shift 2
6587
;;
66-
h)
88+
--to-disk)
89+
ENABLE_TODISK="true"
90+
shift
91+
;;
92+
-h | --help)
6793
show_usage
6894
exit 0
6995
;;
96+
--)
97+
shift
98+
break
99+
;;
70100
*)
71-
echo "Incorrect options provided"
72-
show_usage
101+
echo "Internal error during option parsing"
73102
exit 1
74103
;;
75104
esac
@@ -418,6 +447,10 @@ if [[ "${WITH_GPU}" == "nvidia" ]]; then
418447
echo "export enable_nvidia_gpu_driver=1" >>"${VARS}"
419448
fi
420449

450+
if [ -n "${ENABLE_TODISK}" ]; then
451+
echo "export enable_todisk=1" >>"${VARS}"
452+
fi
453+
421454
scp "${VARS}" "${SMS}":/root/vars
422455
scp /root/.bash_history "${SMS}":
423456

ansible/roles/test/files/support_functions.sh

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -228,7 +228,7 @@ EOF
228228
echo "export UCX_NET_DEVICES=eth3"
229229
} >>/tmp/user_integration_tests
230230
fi
231-
if [[ ${CI_CLUSTER} == "huawei" ]] && [[ "${DISTRIBUTION}" == "openEuler_22.03" ]]; then
231+
if [[ ${CI_CLUSTER} == "huawei" ]] && [[ "${DISTRIBUTION}" == "openEuler"* ]]; then
232232
echo "export UCX_NET_DEVICES=eth0,eth2" >>/tmp/user_integration_tests
233233
elif [[ ${CI_CLUSTER} == "huawei" ]]; then
234234
echo "export UCX_NET_DEVICES=enp125s0f0" >>/tmp/user_integration_tests
@@ -309,6 +309,12 @@ install_openHPC_cluster() {
309309
sed '/export CHROOT/a /usr/bin/cp -vf /etc/yum.repos.d/BaseOS*repo $CHROOT/etc/yum.repos.d' -i "${recipeFile}"
310310
# shellcheck disable=SC2016
311311
sed '/export CHROOT/a /usr/bin/cp -vf /etc/yum.repos.d/AppStream*repo $CHROOT/etc/yum.repos.d' -i "${recipeFile}"
312+
if [[ "${DISTRIBUTION}" == "openEuler"* ]]; then
313+
sed "/export CHROOT/a sed -i 's,\\\(metalink\\\),#\\\1,g' \$CHROOT/etc/yum.repos.d/openEuler.repo" -i "${recipeFile}"
314+
sed "/export CHROOT/a sed -i 's,\\\(baseurl=http\\\)s,\\\1,g' \$CHROOT/etc/yum.repos.d/openEuler.epo" -i "${recipeFile}"
315+
# shellcheck disable=SC2016
316+
sed '/export CHROOT/a wwctl profile set --yes nodes -A "selinux=0"' -i "${recipeFile}"
317+
fi
312318
fi
313319
elif [[ $CI_CLUSTER == "lenovo" ]]; then
314320
echo "CI Customization: PXE boot selection is not persistent"
@@ -330,6 +336,11 @@ install_openHPC_cluster() {
330336
if [ "${Provisioner}" == "openchami" ]; then
331337
echo "CI Customization: Switch to http in repository definition"
332338
sed -e "s,https://dl,http://dl,g" -i "${recipeFile}"
339+
# Switch host to Factory
340+
sed -e '/ohpc-release/ s,dnf -y install.*ohpc-release.*rpm,dnf config-manager --add-repo http://obs.openhpc.community:82/OpenHPC4:/4.0:/Factory/EL_10/,g' -i "${recipeFile}"
341+
# Switch client to Factory
342+
sed -e '/ohpc-release/d' -i "${recipeFile}"
343+
sed -e 's,\(cmd: dnf config-manager --set-enabled crb\),\1 ; dnf config-manager --add-repo http://obs.openhpc.community:82/OpenHPC4:/4.0:/Factory/EL_10/; echo "user_agent=curl" >> /etc/dnf/dnf.conf,g' -i "${recipeFile}"
333344
fi
334345
if [ "${Provisioner}" == "warewulf4" ]; then
335346
echo "CI Customization: Switch to http in repository definition"

ansible/roles/test/templates/el-kickstart

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ text
4343
ipmitool
4444
-firewalld
4545
openssl-devel
46+
policycoreutils-python-utils
4647

4748
{% if type == 'el' %}
4849
python3-pip

0 commit comments

Comments
 (0)