[cig-commits] r11375 - cs/buildbot/trunk/buildbot

leif at geodynamics.org leif at geodynamics.org
Fri Mar 7 13:41:27 PST 2008


Author: leif
Date: 2008-03-07 13:41:27 -0800 (Fri, 07 Mar 2008)
New Revision: 11375

Modified:
   cs/buildbot/trunk/buildbot/bs.py
   cs/buildbot/trunk/buildbot/config.py
   cs/buildbot/trunk/buildbot/lines.py
   cs/buildbot/trunk/buildbot/projects.py
   cs/buildbot/trunk/buildbot/scheduler.py
Log:
Perform "packaging" and "shipping" steps in the "binaries" column only
when it makes sense to do so.  As a consequence of this change,
projects that want BuildBot-manufactured binaries must enable it in
"master.cfg".

Increased the timeout for the PETSc build to 2 hours (p-wave has added
difficulty with Sieve because it runs two builds at once).

Added a "lamboot" step in the LAM/MPI columns.

Added a "nice" feature to Scheduler, which prevents builds from being
scheduled during the given hours of the day.  Currently, "master.cfg"
prevents builds during office hours.


Modified: cs/buildbot/trunk/buildbot/bs.py
===================================================================
--- cs/buildbot/trunk/buildbot/bs.py	2008-03-07 21:28:29 UTC (rev 11374)
+++ cs/buildbot/trunk/buildbot/bs.py	2008-03-07 21:41:27 UTC (rev 11375)
@@ -265,7 +265,7 @@
               command=["make"],
               workdir=workdir,
               env=env,
-              timeout=3600, # Building Sieve takes a long time...
+              timeout=3600*2, # Building Sieve takes a long time...
               ),
             ]
 

Modified: cs/buildbot/trunk/buildbot/config.py
===================================================================
--- cs/buildbot/trunk/buildbot/config.py	2008-03-07 21:28:29 UTC (rev 11374)
+++ cs/buildbot/trunk/buildbot/config.py	2008-03-07 21:41:27 UTC (rev 11375)
@@ -73,12 +73,37 @@
         return
 
 
+    def preSteps(self, line, buildEnv, buildConfig, env,
+                 desc, workdir, configureArgs):
+        return []
+
     def postSteps(self, line, buildEnv, buildConfig, env,
                   desc, workdir, configureArgs):
         return []
 
 
 
+class LAMBuildConfig(BuildConfig):
+
+    def preSteps(self, line, buildEnv, buildConfig, env,
+                 desc, workdir, configureArgs):
+        from buildbot.process import step
+        from buildbot.process.factory import s
+        from buildbot.steps.shell import WithProperties
+        steps = [
+            s(step.ShellCommand,
+              description=["lambooting"] + desc,
+              descriptionDone=desc + ["lamboot"],
+              command=["lamboot", "-s"], # hangs w/o "-s"
+              workdir=".", # for PETSc
+              env=env,
+              haltOnFailure=True,
+              ),
+            ]
+        return steps
+
+
+
 class BinaryBuildConfig(BuildConfig):
 
     def __init__(self, name, env, **kwds):
@@ -89,6 +114,9 @@
 
     def postSteps(self, line, buildEnv, buildConfig, env,
                   desc, workdir, configureArgs):
+
+        if not line.project.binaries:
+            return []
         
         from buildbot.process import step
         from buildbot.process.factory import s

Modified: cs/buildbot/trunk/buildbot/lines.py
===================================================================
--- cs/buildbot/trunk/buildbot/lines.py	2008-03-07 21:28:29 UTC (rev 11374)
+++ cs/buildbot/trunk/buildbot/lines.py	2008-03-07 21:41:27 UTC (rev 11375)
@@ -155,6 +155,9 @@
             steps += self.buildSteps(buildEnv, buildConfig, env,
                                      desc, workdir, configureArgs)
 
+        steps = buildConfig.preSteps(self, buildEnv, buildConfig, env,
+                                     desc, workdir, configureArgs) + steps
+        
         steps += buildConfig.postSteps(self, buildEnv, buildConfig, env,
                                        desc, workdir, configureArgs)
         

Modified: cs/buildbot/trunk/buildbot/projects.py
===================================================================
--- cs/buildbot/trunk/buildbot/projects.py	2008-03-07 21:28:29 UTC (rev 11374)
+++ cs/buildbot/trunk/buildbot/projects.py	2008-03-07 21:41:27 UTC (rev 11375)
@@ -16,6 +16,7 @@
         self.branches = branches
         self.owners = owners
         self.defaultBuildSystem = bs
+        self.binaries = False
         
         self.configureArgs = {}
 

Modified: cs/buildbot/trunk/buildbot/scheduler.py
===================================================================
--- cs/buildbot/trunk/buildbot/scheduler.py	2008-03-07 21:28:29 UTC (rev 11374)
+++ cs/buildbot/trunk/buildbot/scheduler.py	2008-03-07 21:41:27 UTC (rev 11375)
@@ -80,7 +80,7 @@
                      'fileIsImportant')
     
     def __init__(self, name, root, branch, category, treeStableTimer, builderNames,
-                 fileIsImportant=None):
+                 fileIsImportant=None, nice=None):
         """
         @param name: the name of this Scheduler
         @param branch: The branch name that the Scheduler should pay
@@ -119,6 +119,7 @@
         if fileIsImportant:
             assert callable(fileIsImportant)
             self.fileIsImportant = fileIsImportant
+        self.nice = nice
 
         self.importantChanges = []
         self.unimportantChanges = []
@@ -153,8 +154,26 @@
         self.importantChanges.append(change)
         self.nextBuildTime = max(self.nextBuildTime,
                                  change.when + self.treeStableTimer)
+        if self.nice:
+            self.beNice()
         self.setTimer(self.nextBuildTime)
 
+    def beNice(self):
+        """If the next build time falls in given hours of the day,
+        reschedule the build for later."""
+        
+        hour = time.localtime(self.nextBuildTime)[3]
+        if not hour in self.nice:
+            return
+        for delay in xrange(1, 23):
+            rescheduledTime = self.nextBuildTime + delay*3600
+            hour = time.localtime(rescheduledTime)[3]
+            if not hour in self.nice:
+                self.nextBuildTime = rescheduledTime
+                return
+        self.nextBuildTime = None
+        return
+
     def addUnimportantChange(self, change):
         log.msg("%s: change is not important, adding %s" % (self, change))
         self.unimportantChanges.append(change)



More information about the cig-commits mailing list