-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
+ -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
from teuthology.config import config as teuth_config
from teuthology.exceptions import SkipJob
from teuthology import setup_log_file, install_except_hook
-from teuthology.lock.ops import reimage_many
+from teuthology.lock.ops import reimage_machines
from teuthology.misc import get_user, archive_logs, compress_logs
from teuthology.config import FakeNamespace
from teuthology.job_status import get_status
# reimage target machines before running the job
if 'targets' in job_config:
- reimage_machines(job_config)
+ reimage(job_config)
with open(config_file_path, 'w') as f:
yaml.safe_dump(job_config, f, default_flow_style=False)
unlock_targets(job_config)
-def reimage_machines(job_config):
+def reimage(job_config):
# Reimage the targets specified in job config
# and update their keys in config after reimaging
ctx = create_fake_context(job_config)
report.try_push_job_info(ctx.config, dict(status='waiting'))
targets = job_config['targets']
try:
- reimaged = reimage_many(ctx, targets, job_config['machine_type'])
+ reimaged = reimage_machines(ctx, targets, job_config['machine_type'])
except Exception:
log.info('Reimaging error. Nuking machines...')
# Reimage failures should map to the 'dead' status instead of 'fail'
update_nodes(ok_machs)
return ok_machs
elif reimage and machine_type in reimage_types:
- return reimage_many(ctx, machines, machine_type)
+ return reimage_machines(ctx, machines, machine_type)
return machines
elif response.status_code == 503:
log.error('Insufficient nodes available to lock %d %s nodes.',
return ret
-def reimage(ctx, machines, machine_type):
- reimaged = dict()
- with teuthology.parallel.parallel() as p:
- for machine in machines:
- log.info("Start node '%s' reimaging", machine)
- update_nodes([machine], True)
- p.spawn(teuthology.provision.reimage, ctx,
- machine, machine_type)
- reimaged[machine] = machines[machine]
- log.info("Node '%s' reimaging is complete", machine)
- return reimaged
-
-
-def reimage_many(ctx, machines, machine_type):
+def reimage_machines(ctx, machines, machine_type):
# Setup log file, reimage machines and update their keys
reimaged = dict()
console_log_conf = dict(
for machine in machines],
)
with console_log.task(ctx, console_log_conf):
- reimaged = reimage(ctx, machines, machine_type)
+ with teuthology.parallel.parallel() as p:
+ for machine in machines:
+ log.info("Start node '%s' reimaging", machine)
+ update_nodes([machine], True)
+ p.spawn(teuthology.provision.reimage, ctx,
+ machine, machine_type)
+ reimaged[machine] = machines[machine]
+ log.info("Node '%s' reimaging is complete", machine)
reimaged = do_update_keys(list(reimaged.keys()))[1]
update_nodes(reimaged)
return reimaged