@@ -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
3031TIMEOUT=" 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} "
419448fi
420449
450+ if [ -n " ${ENABLE_TODISK} " ]; then
451+ echo " export enable_todisk=1" >> " ${VARS} "
452+ fi
453+
421454scp " ${VARS} " " ${SMS} " :/root/vars
422455scp /root/.bash_history " ${SMS} " :
423456
0 commit comments