"""
usage: teuthology-dispatcher --help
- teuthology-dispatcher --supervisor [-v] --bin-path BIN_PATH --job-config COFNFIG --archive-dir DIR
+ teuthology-dispatcher --supervisor [-v] --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
-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
"""
keep_running = False
try:
- job_config, teuth_bin_path = prep_job(
+ job_config = prep_job(
job_config,
log_file_path,
archive_dir,
job_config = lock_machines(job_config)
run_args = [
- os.path.join(teuth_bin_path, 'teuthology-dispatcher'),
+ 'teuthology-dispatcher',
'--supervisor',
'-v',
- '--bin-path', teuth_bin_path,
'--archive-dir', archive_dir,
]
verbose = args["--verbose"]
archive_dir = args["--archive-dir"]
- teuth_bin_path = args["--bin-path"]
config_file_path = args["--job-config"]
with open(config_file_path, 'r') as config_file:
try:
return run_job(
job_config,
- teuth_bin_path,
archive_dir,
verbose
)
return 0
-def run_job(job_config, teuth_bin_path, archive_dir, verbose):
+def run_job(job_config, archive_dir, verbose):
safe_archive = safepath.munge(job_config['name'])
if job_config.get('first_in_suite') or job_config.get('last_in_suite'):
job_archive = os.path.join(archive_dir, safe_archive)
args = [
- os.path.join(teuth_bin_path, 'teuthology-results'),
+ 'teuthology-results',
'--archive-dir', job_archive,
'--name', job_config['name'],
]
log.info('Running job %s', job_config['job_id'])
- arg = [
- os.path.join(teuth_bin_path, 'teuthology'),
- ]
+ arg = ['teuthology']
# The following is for compatibility with older schedulers, from before we
# started merging the contents of job_config['config'] into job_config
# itself.
m_p.returncode = 0
m_popen.return_value = m_p
m_t_config.results_server = True
- worker.run_job(config, "teuth/bin/path", "archive/dir", verbose=False)
+ worker.run_job(config, "archive/dir", verbose=False)
m_run_watchdog.assert_called_with(m_p, config)
expected_args = [
- 'teuth/bin/path/teuthology',
+ 'teuthology',
'-v',
'--lock',
'--block',
m_p.returncode = 1
m_popen.return_value = m_p
m_t_config.results_server = False
- worker.run_job(config, "teuth/bin/path", "archive/dir", verbose=False)
+ worker.run_job(config, "archive/dir", verbose=False)
m_symlink_log.assert_called_with(config["worker_log"], config["archive_path"])
@patch("teuthology.worker.report.try_push_job_info")
m_fetch_qa_suite.return_value = '/suite/path'
m_isdir.return_value = True
m_teuth_config.teuthology_path = None
- got_config, teuth_bin_path = worker.prep_job(
+ got_config = worker.prep_job(
config,
log_file_path,
archive_dir,
)
assert got_config['teuthology_branch'] == 'master'
assert m_fetch_teuthology.called_once_with_args(branch='master')
- assert teuth_bin_path == '/teuth/path/virtualenv/bin'
assert m_fetch_qa_suite.called_once_with_args(branch='master')
assert got_config['suite_path'] == '/suite/path'
)
m_connection.reserve.side_effect = jobs
m_connect.return_value = m_connection
- m_prep_job.return_value = (dict(), '/bin/path')
+ m_prep_job.return_value = dict()
worker.main(self.ctx)
# There should be one reserve call per item in the jobs list
expected_reserve_calls = [
keep_running = False
try:
- job_config, teuth_bin_path = prep_job(
+ job_config = prep_job(
job_config,
log_file_path,
ctx.archive_dir,
)
run_job(
job_config,
- teuth_bin_path,
ctx.archive_dir,
ctx.verbose,
)
log.info('Using teuthology sha1 %s', teuthology_sha1)
try:
- if teuth_config.teuthology_path is not None:
- teuth_path = teuth_config.teuthology_path
- else:
- teuth_path = fetch_teuthology(branch=teuthology_branch,
- commit=teuthology_sha1)
# For the teuthology tasks, we look for suite_branch, and if we
# don't get that, we look for branch, and fall back to 'master'.
# last-in-suite jobs don't have suite_branch or branch set.
)
raise SkipJob()
- teuth_bin_path = os.path.join(teuth_path, 'virtualenv', 'bin')
- if not os.path.isdir(teuth_bin_path):
- raise RuntimeError("teuthology branch %s at %s not bootstrapped!" %
- (teuthology_branch, teuth_bin_path))
- return job_config, teuth_bin_path
+ return job_config
-def run_job(job_config, teuth_bin_path, archive_dir, verbose):
+def run_job(job_config, archive_dir, verbose):
safe_archive = safepath.munge(job_config['name'])
if job_config.get('first_in_suite') or job_config.get('last_in_suite'):
if teuth_config.results_server:
suite_archive_dir = os.path.join(archive_dir, safe_archive)
safepath.makedirs('/', suite_archive_dir)
args = [
- os.path.join(teuth_bin_path, 'teuthology-results'),
+ 'teuthology-results',
'--archive-dir', suite_archive_dir,
'--name', job_config['name'],
]
log.info('Running job %s', job_config['job_id'])
suite_path = job_config['suite_path']
- arg = [
- os.path.join(teuth_bin_path, 'teuthology'),
- ]
+ arg = ['teuthology']
# The following is for compatibility with older schedulers, from before we
# started merging the contents of job_config['config'] into job_config
# itself.