]> git.apps.os.sepia.ceph.com Git - teuthology.git/commitdiff
suite: rename disable-num-jobs-check to job-threshold 1660/head
authorKyr Shatskyy <kyrylo.shatskyy@suse.com>
Thu, 15 Jul 2021 10:32:21 +0000 (12:32 +0200)
committerKyr Shatskyy <kyrylo.shatskyy@suse.com>
Thu, 15 Jul 2021 16:14:08 +0000 (18:14 +0200)
Rename --disable-num-jobs-check to --job-threshold:
- for shorter recallable name;
- to allow change threshold value via parameter;
- to allow define default threshold value in teuthology config.

Use `--job-threshold 0` to disable job threshold check.

Signed-off-by: Kyr Shatskyy <kyrylo.shatskyy@suse.com>
docs/siteconfig.rst
scripts/suite.py
teuthology/config.py
teuthology/suite/__init__.py
teuthology/suite/run.py

index 1a66bd0e684988fdd1b73b66dadef0806ca9238d..40d5bf29c3766bedaf61e9e48bc20301b6a7be5c 100644 (file)
@@ -242,3 +242,7 @@ Here is a sample configuration with many of the options set and documented::
     pelagos:
       endpoint: http://head.ses.suse.de:5000/
       machine_types: ['type1', 'type2', 'type3']
+
+    # Do not allow more than that many jobs in a single run by default.
+    # To disable this check use 0.
+    job_threshold: 500
index f8a0f8f84f08e8e51bf925ff4ab41cbb29cf07e4..ba235da0c29c21832c235c7b7ebd490cdd35105d 100644 (file)
@@ -172,11 +172,9 @@ Scheduler arguments:
                               in the output of teuthology-suite command. -1
                               for a random seed [default: -1].
  --force-priority             Skip the priority check.
- --disable-num-jobs-check     Skip the number of jobs check. By default,
-                              teuthology will not allow you to schedule more
-                              than JOBS_TO_SCHEDULE_THRESHOLD=500 jobs, because
-                              it is too high. Use this if you need to schedule
-                              more than 500 jobs.
+ --job-threshold <threshold>  Do not allow to schedule the run if the number
+                              of jobs exceeds <threshold>. Use 0 to allow
+                              any number [default: {default_job_threshold}].
 
 """.format(
     default_machine_type=config.default_machine_type,
@@ -186,6 +184,7 @@ Scheduler arguments:
     default_suite_repo=defaults('--suite-repo',
                             config.get_ceph_qa_suite_git_url()),
     default_ceph_branch=defaults('--ceph-branch', 'master'),
+    default_job_threshold=config.job_threshold,
 )
 
 
index 18e26d2cc311d1448fa6a9d77ee046afce888b69..d20b23c1aa3d8b66c19bd2b466f3a90e32d25264 100644 (file)
@@ -151,6 +151,7 @@ class TeuthologyConfig(YamlConfig):
         'gitbuilder_host': 'gitbuilder.ceph.com',
         'githelper_base_url': 'http://git.ceph.com:8080',
         'check_package_signatures': True,
+        'job_threshold': 500,
         'lab_domain': 'front.sepia.ceph.com',
         'lock_server': 'http://paddles.front.sepia.ceph.com/',
         'max_job_time': 259200,  # 3 days
index adca68a9a219dd8fd4ba1161cc4678e4c2584123..a4850b8c992761ea3b7d6a5c159d60924a16df70 100644 (file)
@@ -59,7 +59,7 @@ def process_args(args):
             value = normalize_suite_name(value)
         if key == 'suite_relpath' and value is None:
             value = ''
-        elif key in ('limit', 'priority', 'num', 'newest', 'seed'):
+        elif key in ('limit', 'priority', 'num', 'newest', 'seed', 'job_threshold'):
             value = int(value)
         elif key == 'subset' and value is not None:
             # take input string '2/3' and turn into (2, 3)
index aedaec8004fe07dc301a133fd31dea81870b9418..fda03bb7b494558a2f259430617d510a6fdb2631 100644 (file)
@@ -29,7 +29,6 @@ log = logging.getLogger(__name__)
 class Run(object):
     WAIT_MAX_JOB_TIME = 30 * 60
     WAIT_PAUSE = 5 * 60
-    JOBS_TO_SCHEDULE_THRESHOLD = 500
     __slots__ = (
         'args', 'name', 'base_config', 'suite_repo_path', 'base_yaml_paths',
         'base_args', 'package_versions', 'kernel_dict', 'config_input',
@@ -527,10 +526,14 @@ Note: To force run, use --force-priority'''
             util.schedule_fail(msg)
 
     def check_num_jobs(self, jobs_to_schedule):
-        msg=f'''Unable to schedule {jobs_to_schedule} jobs, too many jobs.
+        """
+        Fail schedule if number of jobs exceeds job threshold.
+        """
+        threshold = self.args.job_threshold
+        msg=f'''Unable to schedule {jobs_to_schedule} jobs, too many jobs, when maximum {threshold} jobs allowed.
 
-Note: If you still want to go ahead, use --disable-num-jobs-check'''
-        if jobs_to_schedule > Run.JOBS_TO_SCHEDULE_THRESHOLD:
+Note: If you still want to go ahead, use --job-threshold 0'''
+        if threshold and jobs_to_schedule > threshold:
             util.schedule_fail(msg)
 
     def schedule_suite(self):
@@ -649,9 +652,7 @@ Note: If you still want to go ahead, use --disable-num-jobs-check'''
         if self.args.priority and jobs_to_schedule and not self.args.force_priority:
             self.check_priority(len(jobs_to_schedule))
 
-        # Before scheduling jobs, check number of jobs to avoid scheduling 1000s
-        if jobs_to_schedule and not self.args.disable_num_jobs_check:
-            self.check_num_jobs(len(jobs_to_schedule))
+        self.check_num_jobs(len(jobs_to_schedule))
 
         self.schedule_jobs(jobs_missing_packages, jobs_to_schedule, name)