From acbc26ec1273e5d4a6fa95501d94c54b84ed858b Mon Sep 17 00:00:00 2001 From: Patrick Donnelly Date: Mon, 11 Mar 2024 10:46:05 -0400 Subject: [PATCH] qa/crontab: simplify and minimize argument specification Signed-off-by: Patrick Donnelly --- qa/crontab/teuthology-cronjobs | 87 +++++++++++++++++---------------- qa/nightlies/schedule_subset.sh | 30 ++++++------ 2 files changed, 59 insertions(+), 58 deletions(-) diff --git a/qa/crontab/teuthology-cronjobs b/qa/crontab/teuthology-cronjobs index e6cbc2f9cbaaa..be28b3900e637 100644 --- a/qa/crontab/teuthology-cronjobs +++ b/qa/crontab/teuthology-cronjobs @@ -5,19 +5,22 @@ # - ~/teuthology/virtualenv : a virtualenv created by ./bootstrap (in teuthology.git) # - ~/.bash_environment : non-interactive shell configuration, including: `source ~/teuthology/virtualenv/bin/activate` -SHELL=/bin/bash +SHELL="/bin/bash" # This is necessary when running bash non-interactively. -BASH_ENV=/home/teuthology/.bash_environment +BASH_ENV="/home/teuthology/.bash_environment" -CW=/home/teuthology/ceph/qa/nightlies/cron_wrapper -SCHEDULE=/home/teuthology/ceph/qa/machine_types/schedule_subset.sh -TEUTH_CEPH_REPO='https://github.com/ceph/ceph.git' -TEUTH_SUITE_REPO='https://github.com/ceph/ceph.git' +TEUTH_CEPH_REPO="https://github.com/ceph/ceph.git" +TEUTH_SUITE_REPO="https://github.com/ceph/ceph.git" MAILTO="ceph-infra@redhat.com;yweinste@redhat.com" CEPH_QA_EMAIL="ceph-qa@ceph.io" +CW="/home/teuthology/ceph/qa/nightlies/cron_wrapper" +SS="/home/teuthology/ceph/qa/nightlies/schedule_subset.sh" +# default/common arguments added by schedule_subset.sh +TEUTHOLOGY_SUITE_ARGS="--non-interactive --newest=100 --ceph-repo=https://git.ceph.com/ceph.git --suite-repo=https://git.ceph.com/ceph.git --machine-type smithi --force-priority" + ### !!!!!!!!!!!!!!!!!!!!!!!!!! ## THIS CRONTAB MUST NOT BE EDITED MANUALLY !!!! ## AUTOMATED CRONTAB UPDATING @@ -46,11 +49,10 @@ CEPH_QA_EMAIL="ceph-qa@ceph.io" ## ********** smoke tests on main and release branches -00 05 * * 0,2,4 CEPH_BRANCH=main; MACHINE_NAME=smithi; $CW teuthology-suite -v -c $CEPH_BRANCH -n 100 -m $MACHINE_NAME -s smoke -k distro -e $CEPH_QA_EMAIL --force-priority -p 70 -08 05 * * 0 CEPH_BRANCH=squid; MACHINE_NAME=smithi; $CW teuthology-suite -v -c $CEPH_BRANCH -m $MACHINE_NAME -s smoke -k distro -e $CEPH_QA_EMAIL --force-priority -p 70 -16 05 * * 0 CEPH_BRANCH=reef; MACHINE_NAME=smithi; $CW teuthology-suite -v -c $CEPH_BRANCH -m $MACHINE_NAME -s smoke -k distro -e $CEPH_QA_EMAIL --force-priority -p 70 -24 05 * * 0 CEPH_BRANCH=quincy; MACHINE_NAME=smithi; $CW teuthology-suite -v -c $CEPH_BRANCH -m $MACHINE_NAME -s smoke -k distro -e $CEPH_QA_EMAIL --force-priority -p 70 - +00 05 * * 0,2,4 $CW $SS 1 --ceph main --suite smoke -p 70 +08 05 * * 0 $CW $SS 1 --ceph squid --suite smoke -p 70 +16 05 * * 0 $CW $SS 1 --ceph reef --suite smoke -p 70 +24 05 * * 0 $CW $SS 1 --ceph quincy --suite smoke -p 70 ## ********** windows tests on main branch - weekly # 00 03 * * 1 CEPH_BRANCH=main; MACHINE_NAME=smithi; $CW teuthology-suite -v -c $CEPH_BRANCH -n 100 -m $MACHINE_NAME -s windows -k distro -e $CEPH_QA_EMAIL @@ -61,7 +63,7 @@ CEPH_QA_EMAIL="ceph-qa@ceph.io" ## ********** teuthology/nop on main branch - daily -@daily CEPH_BRANCH=main; MACHINE_NAME=smithi; $CW teuthology-suite -v -c $CEPH_BRANCH -n 10 -m $MACHINE_NAME -s teuthology/nop -k distro -e $CEPH_QA_EMAIL --force-priority -p 50 +@daily $CW $SS 1 --ceph main --suite teuthology/nop -p 50 ## main branch runs - weekly @@ -69,13 +71,13 @@ CEPH_QA_EMAIL="ceph-qa@ceph.io" ## see script in https://github.com/ceph/ceph/tree/main/qa/machine_types # rados is massive and difficult to bring down to less than 300 jobs, use one higher priority -00 20 * * 0 CEPH_BRANCH=main; MACHINE_NAME=smithi; SUITE_NAME=rados; KERNEL=distro; $CW $SCHEDULE 100000 $CEPH_BRANCH $MACHINE_NAME $SUITE_NAME $CEPH_QA_EMAIL $KERNEL --force-priority -p 201 -08 20 * * 1 CEPH_BRANCH=main; MACHINE_NAME=smithi; SUITE_NAME=orch; KERNEL=distro; $CW $SCHEDULE 64 $CEPH_BRANCH $MACHINE_NAME $SUITE_NAME $CEPH_QA_EMAIL $KERNEL --force-priority -p 200 -16 20 * * 2 CEPH_BRANCH=main; MACHINE_NAME=smithi; SUITE_NAME=rbd; KERNEL=distro; $CW $SCHEDULE 128 $CEPH_BRANCH $MACHINE_NAME $SUITE_NAME $CEPH_QA_EMAIL $KERNEL --force-priority -p 200 -24 20 * * 3 CEPH_BRANCH=main; MACHINE_NAME=smithi; SUITE_NAME=fs; KERNEL=distro; $CW $SCHEDULE 512 $CEPH_BRANCH $MACHINE_NAME $SUITE_NAME $CEPH_QA_EMAIL $KERNEL --force-priority -p 200 -32 20 * * 4 CEPH_BRANCH=main; MACHINE_NAME=smithi; SUITE_NAME=powercycle; KERNEL=distro; $CW $SCHEDULE 4 $CEPH_BRANCH $MACHINE_NAME $SUITE_NAME $CEPH_QA_EMAIL $KERNEL --force-priority -p 200 -40 20 * * 5 CEPH_BRANCH=main; MACHINE_NAME=smithi; SUITE_NAME=rgw; KERNEL=distro; $CW $SCHEDULE 1 $CEPH_BRANCH $MACHINE_NAME $SUITE_NAME $CEPH_QA_EMAIL $KERNEL --force-priority -p 200 -48 20 * * 6 CEPH_BRANCH=main; MACHINE_NAME=smithi; SUITE_NAME=krbd; KERNEL=testing; $CW $SCHEDULE 4 $CEPH_BRANCH $MACHINE_NAME $SUITE_NAME $CEPH_QA_EMAIL $KERNEL --force-priority -p 200 +00 20 * * 0 $CW $SS 100000 --ceph main --suite rados -p 201 +08 20 * * 1 $CW $SS 64 --ceph main --suite orch -p 200 +16 20 * * 2 $CW $SS 128 --ceph main --suite rbd -p 200 +24 20 * * 3 $CW $SS 512 --ceph main --suite fs -p 200 +32 20 * * 4 $CW $SS 4 --ceph main --suite powercycle -p 200 +40 20 * * 5 $CW $SS 1 --ceph main --suite rgw -p 200 +48 20 * * 6 $CW $SS 4 --ceph main --suite krbd -p 200 --kernel testing ## squid branch runs - twice weekly @@ -83,27 +85,26 @@ CEPH_QA_EMAIL="ceph-qa@ceph.io" ## see script in https://github.com/ceph/ceph/tree/main/qa/machine_types # rados is massive and difficult to bring down to less than 300 jobs, use one higher priority -00 21 * * 0,4 CEPH_BRANCH=squid; MACHINE_NAME=smithi; SUITE_NAME=rados; KERNEL=distro; $CW $SCHEDULE 100000 $CEPH_BRANCH $MACHINE_NAME $SUITE_NAME $CEPH_QA_EMAIL $KERNEL --force-priority -p 101 -08 21 * * 1,5 CEPH_BRANCH=squid; MACHINE_NAME=smithi; SUITE_NAME=orch; KERNEL=distro; $CW $SCHEDULE 64 $CEPH_BRANCH $MACHINE_NAME $SUITE_NAME $CEPH_QA_EMAIL $KERNEL --force-priority -p 100 -16 21 * * 2,6 CEPH_BRANCH=squid; MACHINE_NAME=smithi; SUITE_NAME=rbd; KERNEL=distro; $CW $SCHEDULE 128 $CEPH_BRANCH $MACHINE_NAME $SUITE_NAME $CEPH_QA_EMAIL $KERNEL --force-priority -p 100 -24 21 * * 3,0 CEPH_BRANCH=squid; MACHINE_NAME=smithi; SUITE_NAME=fs; KERNEL=distro; $CW $SCHEDULE 512 $CEPH_BRANCH $MACHINE_NAME $SUITE_NAME $CEPH_QA_EMAIL $KERNEL --force-priority -p 100 -32 21 * * 4,1 CEPH_BRANCH=squid; MACHINE_NAME=smithi; SUITE_NAME=powercycle; KERNEL=distro; $CW $SCHEDULE 4 $CEPH_BRANCH $MACHINE_NAME $SUITE_NAME $CEPH_QA_EMAIL $KERNEL --force-priority -p 100 -40 21 * * 5,2 CEPH_BRANCH=squid; MACHINE_NAME=smithi; SUITE_NAME=rgw; KERNEL=distro; $CW $SCHEDULE 1 $CEPH_BRANCH $MACHINE_NAME $SUITE_NAME $CEPH_QA_EMAIL $KERNEL --force-priority -p 100 -48 21 * * 6,3 CEPH_BRANCH=squid; MACHINE_NAME=smithi; SUITE_NAME=krbd; KERNEL=testing; $CW $SCHEDULE 4 $CEPH_BRANCH $MACHINE_NAME $SUITE_NAME $CEPH_QA_EMAIL $KERNEL --force-priority -p 100 - +00 21 * * 0,4 $CW $SS 100000 --ceph squid --suite rados -p 101 +08 21 * * 1,5 $CW $SS 64 --ceph squid --suite orch -p 100 +16 21 * * 2,6 $CW $SS 128 --ceph squid --suite rbd -p 100 +24 21 * * 3,0 $CW $SS 512 --ceph squid --suite fs -p 100 +32 21 * * 4,1 $CW $SS 4 --ceph squid --suite powercycle -p 100 +40 21 * * 5,2 $CW $SS 1 --ceph squid --suite rgw -p 100 +48 21 * * 6,3 $CW $SS 4 --ceph squid --suite krbd -p 100 --kernel testing ## reef branch runs - weekly ## suites rados and rbd use --subset arg and must be call with schedule_subset.sh ## see script in https://github.com/ceph/ceph/tree/main/qa/machine_types # rados is massive and difficult to bring down to less than 300 jobs, use one higher priority -00 22 * * 0 CEPH_BRANCH=reef; MACHINE_NAME=smithi; SUITE_NAME=rados; KERNEL=distro; $CW $SCHEDULE 100000 $CEPH_BRANCH $MACHINE_NAME $SUITE_NAME $CEPH_QA_EMAIL $KERNEL --force-priority -p 181 -08 22 * * 1 CEPH_BRANCH=reef; MACHINE_NAME=smithi; SUITE_NAME=orch; KERNEL=distro; $CW $SCHEDULE 64 $CEPH_BRANCH $MACHINE_NAME $SUITE_NAME $CEPH_QA_EMAIL $KERNEL --force-priority -p 180 -16 22 * * 2 CEPH_BRANCH=reef; MACHINE_NAME=smithi; SUITE_NAME=rbd; KERNEL=distro; $CW $SCHEDULE 128 $CEPH_BRANCH $MACHINE_NAME $SUITE_NAME $CEPH_QA_EMAIL $KERNEL --force-priority -p 180 -24 22 * * 3 CEPH_BRANCH=reef; MACHINE_NAME=smithi; SUITE_NAME=fs; KERNEL=distro; $CW $SCHEDULE 512 $CEPH_BRANCH $MACHINE_NAME $SUITE_NAME $CEPH_QA_EMAIL $KERNEL --force-priority -p 180 -32 22 * * 4 CEPH_BRANCH=reef; MACHINE_NAME=smithi; SUITE_NAME=powercycle; KERNEL=distro; $CW $SCHEDULE 4 $CEPH_BRANCH $MACHINE_NAME $SUITE_NAME $CEPH_QA_EMAIL $KERNEL --force-priority -p 180 -40 22 * * 5 CEPH_BRANCH=reef; MACHINE_NAME=smithi; SUITE_NAME=rgw; KERNEL=distro; $CW $SCHEDULE 1 $CEPH_BRANCH $MACHINE_NAME $SUITE_NAME $CEPH_QA_EMAIL $KERNEL --force-priority -p 180 -48 22 * * 6 CEPH_BRANCH=reef; MACHINE_NAME=smithi; SUITE_NAME=krbd; KERNEL=testing; $CW $SCHEDULE 4 $CEPH_BRANCH $MACHINE_NAME $SUITE_NAME $CEPH_QA_EMAIL $KERNEL --force-priority -p 180 +00 22 * * 0 $CW $SS 100000 --ceph reef --suite rados -p 181 +08 22 * * 1 $CW $SS 64 --ceph reef --suite orch -p 180 +16 22 * * 2 $CW $SS 128 --ceph reef --suite rbd -p 180 +24 22 * * 3 $CW $SS 512 --ceph reef --suite fs -p 180 +32 22 * * 4 $CW $SS 4 --ceph reef --suite powercycle -p 180 +40 22 * * 5 $CW $SS 1 --ceph reef --suite rgw -p 180 +48 22 * * 6 $CW $SS 4 --ceph reef --suite krbd -p 180 --kernel testing ### The suite below must run on bare-metal because it's performance suite and run 3 times to produce more data points @@ -118,24 +119,24 @@ CEPH_QA_EMAIL="ceph-qa@ceph.io" ## !!!! the client suites below MUST use --suite-branch octopus, pacific (see https://tracker.ceph.com/issues/24021) -08 00 * * 1 CEPH_BRANCH=quincy; MACHINE_NAME=smithi; $CW teuthology-suite -v -c $CEPH_BRANCH -n 100 -m $MACHINE_NAME -s upgrade-clients/client-upgrade-octopus-quincy -k distro -e $CEPH_QA_EMAIL --suite-branch octopus --suite-repo https://github.com/ceph/ceph.git --ceph-repo https://github.com/ceph/ceph.git --force-priority -p 175 -16 00 * * 1 CEPH_BRANCH=quincy; MACHINE_NAME=smithi; $CW teuthology-suite -v -c $CEPH_BRANCH -n 100 -m $MACHINE_NAME -s upgrade-clients/client-upgrade-pacific-quincy -k distro -e $CEPH_QA_EMAIL --suite-branch pacific --suite-repo https://github.com/ceph/ceph.git --ceph-repo https://github.com/ceph/ceph.git --force-priority -p 175 -24 00 * * 1 CEPH_BRANCH=quincy; MACHINE_NAME=smithi; $CW $SCHEDULE 120000 $CEPH_BRANCH $MACHINE_NAME upgrade:octopus-x $CEPH_QA_EMAIL distro --force-priority -p 175 -32 00 * * 1 CEPH_BRANCH=quincy; MACHINE_NAME=smithi; $CW $SCHEDULE 120000 $CEPH_BRANCH $MACHINE_NAME upgrade:pacific-x $CEPH_QA_EMAIL distro --force-priority -p 175 -40 00 * * 1 CEPH_BRANCH=quincy; MACHINE_NAME=smithi; $CW teuthology-suite -v -c $CEPH_BRANCH -n 100 -m $MACHINE_NAME -s upgrade/quincy-p2p -k distro -e $CEPH_QA_EMAIL --force-priority -p 175 +08 00 * * 1 $CW $SS 1 --ceph quincy --suite upgrade-clients/client-upgrade-octopus-quincy --suite-branch octopus -p 175 +16 00 * * 1 $CW $SS 1 --ceph quincy --suite upgrade-clients/client-upgrade-pacific-quincy --suite-branch pacific -p 175 +24 00 * * 1 $CW $SS 120000 --ceph quincy --suite upgrade:octopus-x -p 175 +32 00 * * 1 $CW $SS 120000 --ceph quincy --suite upgrade:pacific-x -p 175 +40 00 * * 1 $CW $SS 1 --ceph quincy --suite upgrade/quincy-p2p -p 175 ### upgrade runs for reef release ###### on smithi -08 01 * * 3 CEPH_BRANCH=reef; MACHINE_NAME=smithi; $CW teuthology-suite -v -c $CEPH_BRANCH -n 100 -m $MACHINE_NAME -s upgrade:pacific-x -k distro -e $CEPH_QA_EMAIL --force-priority -p 170 -16 01 * * 3 CEPH_BRANCH=reef; MACHINE_NAME=smithi; $CW teuthology-suite -v -c $CEPH_BRANCH -n 100 -m $MACHINE_NAME -s upgrade:quincy-x -k distro -e $CEPH_QA_EMAIL --force-priority -p 170 +08 01 * * 3 $CW $SS 1 --ceph reef --suite upgrade:pacific-x -p 170 +16 01 * * 3 $CW $SS 1 --ceph reef --suite upgrade:quincy-x -p 170 ### upgrade runs for squid release ###### on smithi -08 02 * * 5 CEPH_BRANCH=squid; MACHINE_NAME=smithi; SUITE_NAME=upgrade; KERNEL=distro; $CW $SCHEDULE 32 $CEPH_BRANCH $MACHINE_NAME $SUITE_NAME $CEPH_QA_EMAIL $KERNEL --force-priority -p 165 +08 02 * * 5 $CW $SS 32 --ceph squid --suite upgrade -p 165 ### upgrade runs for main ###### on smithi -08 03 * * 6 CEPH_BRANCH=main; MACHINE_NAME=smithi; SUITE_NAME=upgrade; KERNEL=distro; $CW $SCHEDULE 32 $CEPH_BRANCH $MACHINE_NAME $SUITE_NAME $CEPH_QA_EMAIL $KERNEL --force-priority -p 160 +08 03 * * 6 $CW $SS 32 --ceph main --suite upgrade -p 160 diff --git a/qa/nightlies/schedule_subset.sh b/qa/nightlies/schedule_subset.sh index 7f18c81ef6723..7bf926c1716f9 100755 --- a/qa/nightlies/schedule_subset.sh +++ b/qa/nightlies/schedule_subset.sh @@ -1,20 +1,20 @@ -#!/bin/bash -e +#!/bin/bash -#command line => CEPH_BRANCH=; MACHINE_NAME=; SUITE_NAME=; ../schedule_subset.sh $CEPH_BRANCH $MACHINE_NAME $SUITE_NAME $CEPH_QA_EMAIL $KERNEL <$FILTER> +set -e + +function prun { + printf '%s\n' "$*" >&2 + "$@" +} partitions="$1" shift -branch="$1" -shift -machine="$1" -shift -suite="$1" -shift -email="$1" -shift -kernel="$1" -shift -# rest of arguments passed directly to teuthology-suite -echo "Scheduling $branch branch" -teuthology-suite -v -c "$branch" -m "$machine" -k "$kernel" -s "$suite" --ceph-repo https://git.ceph.com/ceph.git --suite-repo https://git.ceph.com/ceph.git --subset "$((RANDOM % partitions))/$partitions" --newest 100 -e "$email" "$@" +ARGS=() +ARGS+=("--subset=$((RANDOM % partitions))/$partitions") + +if [ -n "$CEPH_QA_EMAIL" ]; then + ARGS+=("--email=$CEPH_QA_EMAIL") +fi + +prun teuthology-suite "${ARGS[@]}" $TEUTHOLOGY_SUITE_ARGS "$@" -- 2.39.5