]> git.apps.os.sepia.ceph.com Git - teuthology.git/commitdiff
Add option to schedule jobs using simple subset
authorVasu Kulkarni <vasu@redhat.com>
Mon, 22 Jun 2020 09:32:26 +0000 (15:02 +0530)
committersunilkumarn417 <sunnagar@redhat.com>
Thu, 24 Sep 2020 05:19:04 +0000 (10:49 +0530)
Total number of jobs are divided into equal subsets based on
user options and can be scheduled using 1/10, 2/10 etc

If a suite produces 100 jobs, 1/10 would schedule first 10 jobs,
2/10 will schedule next set of 10 jobs and so on.

Signed-off-by: Vasu Kulkarni <vasu@redhat.com>
scripts/suite.py
setup.py
teuthology/suite/run.py

index 98f74481114d2ae08cfc9029efe2b3ddeb536f65..eab41f6b17486d01b7a53abab5eff63d1850c06c 100644 (file)
@@ -119,6 +119,12 @@ Scheduler arguments:
                               piece <index>.  Scheduling 0/<outof>, 1/<outof>,
                               2/<outof> ... <outof>-1/<outof> will schedule all
                               jobs in the suite (many more than once).
+  --simple-subset <index/outof>
+                              Instead of scheduling the entire suite, break the
+                              set of jobs into <outof> pieces, If --dry-run
+                              produces 400 jobs, with <outof> value of 4, each
+                              subset will produce 100 jobs, eg: 1/4 for above
+                              will produce 100 jobs, 2/4 will produce next 100 jobs
   -p <priority>, --priority <priority>
                               Job priority (lower is sooner)
                               [default: 1000]
index 1c75d8cfc62f0c5ee5bb81937f813b2bab286e9d..ee09fb904ccae22559ccf6f04c9fcc2e22f4709d 100644 (file)
--- a/setup.py
+++ b/setup.py
@@ -128,9 +128,7 @@ setup(
             'teuthology-queue = scripts.queue:main',
             'teuthology-prune-logs = scripts.prune_logs:main',
             'teuthology-describe = scripts.describe:main',
-            'teuthology-reimage = scripts.reimage:main'
-            'teuthology-describe-tests = scripts.describe_tests:main',
-            'teuthology-gencov = scripts.gencov:main',
+            'teuthology-reimage = scripts.reimage:main',
             'teuthology-polarion = scripts.polarion:main',
             ],
         },
index b84a6312b05ea8a41e4aa95ee47f4a3a3abbb981..2a3fd47551fee269c0dc049823a083ced6db1b2d 100644 (file)
@@ -10,6 +10,7 @@ from humanfriendly import format_timespan
 
 from datetime import datetime
 from tempfile import NamedTemporaryFile
+from math import floor
 
 from teuthology.config import config, JobConfig
 from teuthology.exceptions import (
@@ -542,6 +543,27 @@ Note: To force run, use --force-priority'''
         log.info('Suite %s in %s generated %d jobs (not yet filtered)' % (
             suite_name, suite_path, len(configs)))
 
+        if self.args.simple_subset:
+            simple_subset = self.args.simple_subset
+            log.info("Using simple subset options %s " % simple_subset)
+            (sset, outof) = simple_subset.split('/')
+            sset = int(sset)
+            outof = int(outof)
+            if outof < len(configs):
+                cycle = floor(len(configs) / outof)
+                if sset == outof:
+                    log.info("Final subset, including remainder jobs")
+                    start = (sset-1) * cycle
+                    end = len(configs)
+                else:
+                    start = (sset-1) * cycle
+                    end = start + (cycle-1)
+                start = int(start)
+                end = int(end)
+                log.info("using start index of %d , end index of %d" %(start, end))
+                configs = configs[start:end]
+                log.info("Number of Jobs after simple subset are %d" % len(configs))
+
         if self.args.dry_run:
             log.debug("Base job config:\n%s" % self.base_config)