From: Kyr Shatskyy Date: Fri, 11 Dec 2020 17:48:16 +0000 (+0100) Subject: scripts: add wait script for watching run X-Git-Tag: 1.1.0~26^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F1589%2Fhead;p=teuthology.git scripts: add wait script for watching run While using teuthology-suite with --wait option it is usefull sometimes to split the suite scheduling and the run waiting. For example, when using tools like Jenkins we might want to schedule a suite, report about successful schedule and start waiting only in the next steps. Signed-off-by: Kyr Shatskyy --- diff --git a/scripts/wait.py b/scripts/wait.py new file mode 100644 index 00000000..6b2ff34a --- /dev/null +++ b/scripts/wait.py @@ -0,0 +1,31 @@ +import docopt +import sys + +import logging + +import teuthology +import teuthology.suite +from teuthology.config import config + +doc = """ +usage: teuthology-wait --help + teuthology-wait [-v] --run + +Wait until run is finished. Returns exit code 0 on success, otherwise 1. + +Miscellaneous arguments: + -h, --help Show this help message and exit + -v, --verbose Be more verbose + +Standard arguments: + -r, --run Run name to watch. +""" + + +def main(argv=sys.argv[1:]): + args = docopt.docopt(doc, argv=argv) + if args.get('--verbose'): + teuthology.log.setLevel(logging.DEBUG) + name = args.get('--run') + return teuthology.suite.wait(name, config.max_job_time, None) + diff --git a/setup.py b/setup.py index e595da4a..cdbe8139 100644 --- a/setup.py +++ b/setup.py @@ -129,7 +129,8 @@ setup( 'teuthology-queue = scripts.queue:main', 'teuthology-prune-logs = scripts.prune_logs:main', 'teuthology-describe = scripts.describe:main', - 'teuthology-reimage = scripts.reimage:main' + 'teuthology-reimage = scripts.reimage:main', + 'teuthology-wait = scripts.wait:main', ], },