def __init__(self, name, builderNames, inipath, treebuildername): """ @param name: the name of this Scheduler @param builderNames: a list of Builder names. When this Scheduler decides to start a set of builds, they will be run on the Builders named by this list. @param inipath: path to l10nbuilds.ini, describing the apps @param treebuildername: the name of the builder that collects tree info from remote l10n.ini files """ BaseUpstreamScheduler.__init__(self, name) self.builderNames = builderNames # Path to the l10nbuilds.ini file that is read synchronously # Can be None for testing if inipath is not None: assert os.path.exists(inipath) self.inipath = inipath self.treebuilder = treebuildername self.trees = {} # just volatile data below # cache tree data per hg repo branch self.branches = defaultdict(self.BranchData) self.l10nbranches = defaultdict(self.L10nDirs) # map tree/locale tuples to list of changes self.pendings = defaultdict(list) self.dSubmitBuildsets = None # deferred that's non-None if a tree builds are currently running self.waitOnTree = None self.pendingChanges = [] self.treesToDo = set() # trees that changed on a tree build self.timeout = 5 self.headers = { 'User-Agent': 'Elmo/1.0 (l10n.mozilla.org)' }
def startService(self): BaseUpstreamScheduler.startService(self) log.msg("starting l10n scheduler") if self.inipath is None: # testing, don't trigger tree builds return # trigger tree builds for our trees, clear() first cp = ConfigParser() cp.read(self.inipath) self.trees.clear() _ds = [] for tree in cp.sections(): # create a BuildSet, submit it to the BuildMaster props = properties.Properties() props.update({ 'tree': tree, 'l10nbuilds': self.inipath, }, "Scheduler") bs = buildset.BuildSet([self.treebuilder], SourceStamp(), properties=props) self.submitBuildSet(bs) _ds.append(bs.waitUntilFinished()) d = defer.DeferredList(_ds) d.addCallback(self.onTreesBuilt) self.waitOnTree = d
def buildSetFinished(self, bss): if not self.running: return ss = bss.getSourceStamp() for w in self.finishedWatchers: w(ss) BaseUpstreamScheduler.buildSetFinished(self,bss)
def __init__(self, name, project, upstream, builderNames, branch): BaseUpstreamScheduler.__init__(self, name) self.project = project self.upstream = upstream self.branch = branch self.builderNames = builderNames self.finishedWatchers = []
def __init__(self, name, tree, branch, builderNames, repourl, locales=None, enBranch=None): BaseUpstreamScheduler.__init__(self, name) self.tree = tree self.branch = branch self.enBranch = enBranch if enBranch else branch self.builderNames = builderNames self.repourl = repourl self.locales = locales
def __init__(self, name, builders, treeStableTimer, properties = {}): BaseUpstreamScheduler.__init__(self, name, properties) self.builders = builders[:] self.builders.sort() self.treeStableTimer = treeStableTimer # Check for dependency cycles self.builder_map = {} for builder in self.builders: if builder.has_cycle(): raise Exception('Detected cycle in builder dependencies.') self.builder_map[builder.name] = builder
def __init__(self, name, tree, branch, builderNames, repourl): BaseUpstreamScheduler.__init__(self, name) self.tree = tree self.branch = branch self.builderNames = builderNames self.repourl = repourl