From: Zack Cerza Date: Wed, 15 Mar 2023 21:28:32 +0000 (-0600) Subject: fix circ better X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fheads%2Ftiming-fixed;p=teuthology.git fix circ better --- diff --git a/teuthology/beanstalk.py b/teuthology/beanstalk.py index abba88ea85..76bc2c97ae 100644 --- a/teuthology/beanstalk.py +++ b/teuthology/beanstalk.py @@ -6,8 +6,7 @@ import pprint import sys from collections import OrderedDict -import teuthology.report as report - +from teuthology import report from teuthology.config import config log = logging.getLogger(__name__) diff --git a/teuthology/dispatcher/__init__.py b/teuthology/dispatcher/__init__.py index 69b27072bf..3d31a1f2a5 100644 --- a/teuthology/dispatcher/__init__.py +++ b/teuthology/dispatcher/__init__.py @@ -8,16 +8,20 @@ import yaml from datetime import datetime from typing import Dict, List -import teuthology.dispatcher.supervisor as supervisor -import teuthology.lock.ops as lock_ops -import teuthology.nuke as nuke -import teuthology.worker as worker - -from teuthology import setup_log_file, install_except_hook -from teuthology import beanstalk -from teuthology import report +from teuthology import ( + # non-modules + setup_log_file, + install_except_hook, + # modules + beanstalk, + nuke, + report, + worker, +) from teuthology.config import config as teuth_config +from teuthology.dispatcher import supervisor from teuthology.exceptions import SkipJob +from teuthology.lock import ops as lock_ops from teuthology.repo_utils import fetch_qa_suite, fetch_teuthology from teuthology import safepath diff --git a/teuthology/dispatcher/supervisor.py b/teuthology/dispatcher/supervisor.py index c38118a378..caf0e802c8 100644 --- a/teuthology/dispatcher/supervisor.py +++ b/teuthology/dispatcher/supervisor.py @@ -8,19 +8,15 @@ import requests from urllib.parse import urljoin from datetime import datetime -import teuthology.lock.ops as lock_ops -import teuthology.nuke as nuke - -from teuthology import report -from teuthology import safepath +from teuthology import kill, nuke, report, safepath from teuthology.config import config as teuth_config from teuthology.exceptions import SkipJob, MaxWhileTries from teuthology import setup_log_file, install_except_hook from teuthology.misc import get_user, archive_logs, compress_logs from teuthology.config import FakeNamespace from teuthology.job_status import get_status -from teuthology.kill import kill_job -from teuthology.task.internal import add_remotes +from teuthology.lock import ops as lock_ops +from teuthology.task import internal from teuthology.misc import decanonicalize_hostname as shortname from teuthology.lock import query @@ -285,9 +281,11 @@ def run_with_watchdog(process, job_config): try: # kill processes but do not nuke yet so we can save # the logs, coredumps, etc. - kill_job(job_info['name'], job_info['job_id'], - teuth_config.archive_base, job_config['owner'], - skip_nuke=True) + kill.kill_job( + job_info['name'], job_info['job_id'], + teuth_config.archive_base, job_config['owner'], + skip_nuke=True + ) except Exception: log.exception('Failed to kill job') @@ -299,8 +297,10 @@ def run_with_watchdog(process, job_config): try: # this time remove everything and unlock the machines - kill_job(job_info['name'], job_info['job_id'], - teuth_config.archive_base, job_config['owner']) + kill.kill_job( + job_info['name'], job_info['job_id'], + teuth_config.archive_base, job_config['owner'] + ) except Exception: log.exception('Failed to kill job and unlock machines') @@ -350,7 +350,7 @@ def transfer_archives(run_name, job_id, archive_base, job_config): if 'archive' in job_info: ctx = create_fake_context(job_config) - add_remotes(ctx, job_config) + internal.add_remotes(ctx, job_config) for log_type, log_path in job_info['archive'].items(): if log_type == 'init': diff --git a/teuthology/lock/ops.py b/teuthology/lock/ops.py index bc66dd1c62..e33e7d5c5a 100644 --- a/teuthology/lock/ops.py +++ b/teuthology/lock/ops.py @@ -10,9 +10,8 @@ import requests import teuthology.orchestra.remote import teuthology.parallel import teuthology.provision -import teuthology.report as report -from teuthology import misc +from teuthology import misc, report from teuthology.config import config from teuthology.contextutil import safe_while from teuthology.task import console_log diff --git a/teuthology/nuke/__init__.py b/teuthology/nuke/__init__.py index 15749702b3..77d48ccc00 100644 --- a/teuthology/nuke/__init__.py +++ b/teuthology/nuke/__init__.py @@ -8,9 +8,9 @@ import subprocess import yaml import teuthology -import teuthology.lock.ops as lock_ops from teuthology import provision +from teuthology.lock import ops as lock_ops from teuthology.lock.query import is_vm, list_locks, \ find_stale_locks, get_status from teuthology.lock.util import locked_since_seconds diff --git a/teuthology/worker.py b/teuthology/worker.py index b99fab33d7..cb3030da11 100644 --- a/teuthology/worker.py +++ b/teuthology/worker.py @@ -8,14 +8,13 @@ import yaml from datetime import datetime -from teuthology import setup_log_file, install_except_hook +from teuthology import setup_log_file, install_except_hook, kill from teuthology import beanstalk from teuthology import report from teuthology import safepath from teuthology.config import config as teuth_config from teuthology.config import set_config_attr from teuthology.exceptions import BranchNotFoundError, CommitNotFoundError, SkipJob, MaxWhileTries -from teuthology.kill import kill_job from teuthology.repo_utils import fetch_qa_suite, fetch_teuthology, ls_remote, build_git_url log = logging.getLogger(__name__) @@ -331,7 +330,7 @@ def run_with_watchdog(process, job_config): if total_seconds > teuth_config.max_job_time: log.warning("Job ran longer than {max}s. Killing...".format( max=teuth_config.max_job_time)) - kill_job(job_info['name'], job_info['job_id'], + kill.kill_job(job_info['name'], job_info['job_id'], teuth_config.archive_base, job_config['owner']) # calling this without a status just updates the jobs updated time