mirror of
https://github.com/ceph/ceph
synced 2024-12-26 13:33:57 +00:00
Enable killing runs that haven't even started yet
This requires passing --machine-type. Signed-off-by: Zack Cerza <zack.cerza@inktank.com>
This commit is contained in:
parent
be3ea71cdb
commit
7759473e3e
@ -5,6 +5,7 @@ import teuthology.kill
|
||||
|
||||
doc = """
|
||||
usage: teuthology-kill [-h] [-a ARCHIVE] -r RUN
|
||||
teuthology-kill [-h] [-a ARCHIVE] -m MACHINE_TYPE -r RUN
|
||||
teuthology-kill [-h] [-a ARCHIVE] -r RUN -j JOB ...
|
||||
teuthology-kill [-h] -o OWNER -m MACHINE_TYPE -r RUN
|
||||
|
||||
@ -22,7 +23,9 @@ optional arguments:
|
||||
-j, --job JOB The job_id of the job to kill
|
||||
-o, --owner OWNER The owner of the job(s)
|
||||
-m, --machine_type MACHINE_TYPE
|
||||
The type of machine the job(s) are running on
|
||||
The type of machine the job(s) are running on.
|
||||
This is required if killing a job that is still
|
||||
entirely in the queue.
|
||||
""".format(archive_base=teuthology.config.config.archive_base)
|
||||
|
||||
|
||||
|
@ -31,14 +31,19 @@ def kill_run(run_name, archive_base=None, owner=None, machine_type=None):
|
||||
run_info = {}
|
||||
if archive_base:
|
||||
run_archive_dir = os.path.join(archive_base, run_name)
|
||||
run_info = find_run_info(run_archive_dir)
|
||||
machine_type = run_info['machine_type']
|
||||
owner = run_info['owner']
|
||||
if os.path.isdir(run_archive_dir):
|
||||
run_info = find_run_info(run_archive_dir)
|
||||
machine_type = run_info['machine_type']
|
||||
owner = run_info['owner']
|
||||
elif machine_type is None:
|
||||
raise RuntimeError("The run is still entirely enqueued; " +
|
||||
"you must also pass --machine-type")
|
||||
|
||||
remove_beanstalk_jobs(run_name, machine_type)
|
||||
kill_processes(run_name, run_info.get('pids'))
|
||||
targets = find_targets(run_name, owner)
|
||||
nuke_targets(targets, owner)
|
||||
if owner is not None:
|
||||
targets = find_targets(run_name, owner)
|
||||
nuke_targets(targets, owner)
|
||||
|
||||
|
||||
def kill_job(run_name, job_id, archive_base=None, owner=None,
|
||||
|
Loading…
Reference in New Issue
Block a user