forked from ceph/teuthology
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request ceph#1960 from ceph/worker-supervisor
Finish removing teuthology-worker
- Loading branch information
Showing
11 changed files
with
497 additions
and
109 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,35 +1,62 @@ | ||
""" | ||
usage: teuthology-dispatcher --help | ||
teuthology-dispatcher --supervisor [-v] --bin-path BIN_PATH --job-config COFNFIG --archive-dir DIR | ||
teuthology-dispatcher [-v] [--archive-dir DIR] [--exit-on-empty-queue] --log-dir LOG_DIR --tube TUBE | ||
Start a dispatcher for the specified tube. Grab jobs from a beanstalk | ||
queue and run the teuthology tests they describe as subprocesses. The | ||
subprocess invoked is a teuthology-dispatcher command run in supervisor | ||
mode. | ||
Supervisor mode: Supervise the job run described by its config. Reimage | ||
target machines and invoke teuthology command. Unlock the target machines | ||
at the end of the run. | ||
standard arguments: | ||
-h, --help show this help message and exit | ||
-v, --verbose be more verbose | ||
-t, --tube TUBE which beanstalk tube to read jobs from | ||
-l, --log-dir LOG_DIR path in which to store logs | ||
-a DIR, --archive-dir DIR path to archive results in | ||
--supervisor run dispatcher in job supervisor mode | ||
--bin-path BIN_PATH teuthology bin path | ||
--job-config CONFIG file descriptor of job's config file | ||
--exit-on-empty-queue if the queue is empty, exit | ||
""" | ||
|
||
import docopt | ||
import argparse | ||
import sys | ||
|
||
import teuthology.dispatcher | ||
import teuthology.dispatcher.supervisor | ||
|
||
from .supervisor import parse_args as parse_supervisor_args | ||
|
||
|
||
def parse_args(argv): | ||
parser = argparse.ArgumentParser( | ||
description="Start a dispatcher for the specified tube. Grab jobs from a beanstalk queue and run the teuthology tests they describe as subprocesses. The subprocess invoked is teuthology-supervisor." | ||
) | ||
parser.add_argument( | ||
"-v", | ||
"--verbose", | ||
action="store_true", | ||
help="be more verbose", | ||
) | ||
parser.add_argument( | ||
"-a", | ||
"--archive-dir", | ||
type=str, | ||
help="path to archive results in", | ||
) | ||
parser.add_argument( | ||
"-t", | ||
"--tube", | ||
type=str, | ||
help="which beanstalk tube to read jobs from", | ||
required=True, | ||
) | ||
parser.add_argument( | ||
"-l", | ||
"--log-dir", | ||
type=str, | ||
help="path in which to store the dispatcher log", | ||
required=True, | ||
) | ||
parser.add_argument( | ||
"--exit-on-empty-queue", | ||
action="store_true", | ||
help="if the queue is empty, exit", | ||
) | ||
return parser.parse_args(argv) | ||
|
||
|
||
def main(): | ||
args = docopt.docopt(__doc__) | ||
sys.exit(teuthology.dispatcher.main(args)) | ||
if "--supervisor" in sys.argv: | ||
# This is for transitional compatibility, so the old dispatcher can | ||
# invoke the new supervisor. Once old dispatchers are phased out, | ||
# this block can be as well. | ||
sys.argv.remove("--supervisor") | ||
sys.argv[0] = "teuthology-supervisor" | ||
sys.exit(teuthology.dispatcher.supervisor.main( | ||
parse_supervisor_args(sys.argv[1:]) | ||
)) | ||
else: | ||
sys.exit(teuthology.dispatcher.main(parse_args(sys.argv[1:]))) | ||
|
||
|
||
if __name__ == "__main__": | ||
main() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
import argparse | ||
import sys | ||
|
||
import teuthology.dispatcher.supervisor | ||
|
||
|
||
def parse_args(argv): | ||
parser = argparse.ArgumentParser( | ||
description="Supervise and run a teuthology job; normally only run by the dispatcher", | ||
) | ||
parser.add_argument( | ||
"-v", | ||
"--verbose", | ||
action="store_true", | ||
help="be more verbose", | ||
) | ||
parser.add_argument( | ||
"-a", | ||
"--archive-dir", | ||
type=str, | ||
help="path in which to store the job's logfiles", | ||
required=True, | ||
) | ||
parser.add_argument( | ||
"--bin-path", | ||
type=str, | ||
help="teuthology bin path", | ||
required=True, | ||
) | ||
parser.add_argument( | ||
"--job-config", | ||
type=str, | ||
help="file descriptor of job's config file", | ||
required=True, | ||
) | ||
return parser.parse_args(argv) | ||
|
||
|
||
def main(): | ||
sys.exit(teuthology.dispatcher.supervisor.main(parse_args(sys.argv[1:]))) | ||
|
||
|
||
if __name__ == "__main__": | ||
main() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
from script import Script | ||
|
||
|
||
class TestDispatcher(Script): | ||
script_name = 'teuthology-dispatcher' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
from script import Script | ||
|
||
|
||
class TestSupervisor(Script): | ||
script_name = 'teuthology-supervisor' |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.