[zorg] r375204 - Separate automatic schedulers for builders depending on is_legacy_mode.

Galina Kistanova via llvm-commits llvm-commits at lists.llvm.org
Thu Oct 17 22:51:12 PDT 2019


Author: gkistanova
Date: Thu Oct 17 22:51:12 2019
New Revision: 375204

URL: http://llvm.org/viewvc/llvm-project?rev=375204&view=rev
Log:
Separate automatic schedulers for builders depending on is_legacy_mode. 

Changes from SVN should be scheduled for builders which checkout from SVN, changes from github should be scheduled for builders which checkout from github. For a transition period we need the both types of schedulers.

Patch by Andrei Lebedev.

Differential Revision: https://reviews.llvm.org/D69159

Modified:
    zorg/trunk/buildbot/osuosl/master/config/schedulers.py

Modified: zorg/trunk/buildbot/osuosl/master/config/schedulers.py
URL: http://llvm.org/viewvc/llvm-project/zorg/trunk/buildbot/osuosl/master/config/schedulers.py?rev=375204&r1=375203&r2=375204&view=diff
==============================================================================
--- zorg/trunk/buildbot/osuosl/master/config/schedulers.py (original)
+++ zorg/trunk/buildbot/osuosl/master/config/schedulers.py Thu Oct 17 22:51:12 2019
@@ -23,17 +23,40 @@ def getSingleBranchSchedulers(builders,
     }
 
     builders_with_automatic_schedulers = []
+    legacy_builders_with_automatic_schedulers = []
     for builder in builders:
         # Only for the builders created with LLVMBuildFactory or similar.
         if getattr(builder['factory'], 'depends_on_projects', None):
-            # And only if this builder is in the legacy mode and
-            # does not yet have an assigned scheduler.
-            if getattr(builder['factory'], 'is_legacy_mode', True) and \
-               builder['name'] not in builders_with_schedulers:
-                # This builder is a candidate for an automatic scheduler.
+            if getattr(builder['factory'], 'is_legacy_mode', True):
+                # Only if this builder is in the legacy mode and
+                # does not yet have an assigned scheduler.
+                if builder['name'] not in builders_with_schedulers:
+                    legacy_builders_with_automatic_schedulers.append(builder)
+            else:
+                # There are no manually assigned schedulers in this case.
                 builders_with_automatic_schedulers.append(builder)
 
     automatic_schedulers = []
+    automatic_schedulers.extend(
+         _getSingleBranchAutomaticSchedulers(
+            builders_with_automatic_schedulers,
+            filter_branch='master',     # git monorepo branch.
+            treeStableTimer=kwargs.get('treeStableTimer', 2*60)))
+    automatic_schedulers.extend(
+        _getSingleBranchAutomaticSchedulers(
+            legacy_builders_with_automatic_schedulers,
+            filter_branch='trunk',      # svn repo branch.
+            treeStableTimer=kwargs.get('treeStableTimer', 2*60)))
+
+    return automatic_schedulers
+
+def _getSingleBranchAutomaticSchedulers(
+        builders_with_automatic_schedulers,
+        filter_branch,
+        treeStableTimer):
+
+    automatic_schedulers = []
+
     # Do we have any to take care of?
     if builders_with_automatic_schedulers:
         # Let's reconsile first to get a unique set of dependencies.
@@ -43,8 +66,6 @@ def getSingleBranchSchedulers(builders,
             for b in builders_with_automatic_schedulers
         ])
 
-        treeStableTimer = kwargs.get('treeStableTimer', 2*60)
-        automatic_schedulers = []
         for projects in set_of_dependencies:
             sch_builders = [
                 b['name']
@@ -52,7 +73,7 @@ def getSingleBranchSchedulers(builders,
                 if frozenset(getattr(b['factory'], 'depends_on_projects')) == projects
             ]
 
-            automatic_scheduler_name = ",".join(sorted(projects))
+            automatic_scheduler_name =  filter_branch + ":" + ",".join(sorted(projects))
             projects_to_filter = getProjectsToFilter(projects)
 
             automatic_schedulers.append(
@@ -60,13 +81,13 @@ def getSingleBranchSchedulers(builders,
                     name=automatic_scheduler_name,
                     treeStableTimer=treeStableTimer,
                     builderNames=sch_builders,
-                    change_filter=ChangeFilter(project=projects_to_filter)
+                    change_filter=ChangeFilter(project=projects_to_filter, branch=filter_branch)
                 )
             )
 
             log.msg(
                 "Generated SingleBranchScheduler: { name='%s'" % automatic_scheduler_name,
                 ", builderNames=", sch_builders,
-                ", change_filter=", projects_to_filter,
+                ", change_filter=", projects_to_filter, " (branch: %s)" % filter_branch,
                 "}")
     return automatic_schedulers




More information about the llvm-commits mailing list