Example #1
0
 def __init__(self, platform, branch, **kwargs):
     self.platform = platform
     filter = ChangeFilter(branch=[branch, None], filter_fn=self.filter)
     AnyBranchScheduler.__init__(self,
                                 name=platform,
                                 change_filter=filter,
                                 **kwargs)
Example #2
0
def Update(config, _active_master, c):
    # Polls config.Master.trunk_url for changes
    cr_poller = gitiles_poller.GitilesPoller(
        'https://chromium.googlesource.com/chromium/src',
        pollInterval=30,
        project='chromium')
    c['change_source'].append(cr_poller)

    webkit_url = 'http://src.chromium.org/viewvc/blink?view=rev&revision=%s'
    webkit_poller = svnpoller.SVNPoller(svnurl=config.Master.webkit_root_url,
                                        svnbin=chromium_utils.SVN_BIN,
                                        split_file=WebkitFileSplitter,
                                        pollinterval=30,
                                        revlinktmpl=webkit_url,
                                        cachepath='webkit.svnrev',
                                        project='webkit')
    c['change_source'].append(webkit_poller)

    c['schedulers'].append(
        AnyBranchScheduler(name='global_scheduler',
                           branches=['trunk', 'master'],
                           treeStableTimer=60,
                           builderNames=[]))

    c['schedulers'].append(
        AnyBranchScheduler(name='global_deps_scheduler',
                           branches=['master'],
                           treeStableTimer=60,
                           builderNames=[]))
Example #3
0
 def __init__(self,
              name,
              branches,
              treeStableTimer,
              builderNames,
              fileIsImportant=None,
              properties={}):
     AnyBranchScheduler.__init__(self,
                                 name=name,
                                 branches=branches,
                                 treeStableTimer=treeStableTimer,
                                 builderNames=builderNames,
                                 fileIsImportant=fileIsImportant,
                                 properties=properties)
def Update(config, _active_master, c):
    # Polls config.Master.trunk_url for changes
    chromium_url = "http://src.chromium.org/viewvc/chrome?view=rev&revision=%s"
    webkit_url = "http://src.chromium.org/viewvc/blink?view=rev&revision=%s"
    cr_poller = svnpoller.SVNPoller(svnurl=config.Master.trunk_url,
                                    split_file=ChromeTreeFileSplitter,
                                    pollinterval=30,
                                    revlinktmpl=chromium_url,
                                    cachepath='chromium.svnrev',
                                    project='chromium')
    c['change_source'].append(cr_poller)

    webkit_poller = svnpoller.SVNPoller(svnurl=config.Master.webkit_root_url,
                                        split_file=WebkitFileSplitter,
                                        pollinterval=30,
                                        revlinktmpl=webkit_url,
                                        cachepath='webkit.svnrev',
                                        project='webkit')
    c['change_source'].append(webkit_poller)

    c['schedulers'].append(
        AnyBranchScheduler(name='global_scheduler',
                           branches=['trunk', 'src'],
                           treeStableTimer=60,
                           builderNames=[]))
Example #5
0
def any_branch_scheduler():
    return AnyBranchScheduler(
        name=util.env.BOOTSTRAP_SCHEDULER_NAME,
        treeStableTimer=5,
        change_filter=ChangeFilter(branch_re='.+'),  # build only branches
        builderNames=[util.env.BOOTSTRAP_BUILDER_NAME],
        reason='branch updated',
        properties={'reason': 'branch updated'})
def Update(config, _active_master, c):
  # Polls config.Master.trunk_url for changes
  cr_poller = gitiles_poller.GitilesPoller(
      'https://chromium.googlesource.com/chromium/src',
      pollInterval=30, project='chromium')
  c['change_source'].append(cr_poller)

  c['schedulers'].append(AnyBranchScheduler(
      name='global_scheduler', branches=['trunk', 'master'], treeStableTimer=60,
      builderNames=[]))
Example #7
0
def getSchedulers(builders):
    builders = map(lambda builder: (builder['name'], builder['periodic']),
                   builders)
    trunkBuilders = [
        name for name, periodic in builders
        if name.startswith('trunk-') and not periodic
    ]
    trunkBuilders.sort()
    stableBuilders = [
        name for name, periodic in builders
        if name.startswith('stable-') and not periodic
    ]
    stableBuilders.sort()
    periodicBuilders = [name for name, periodic in builders if periodic]
    periodicBuilders.sort()

    trunk = AnyBranchScheduler(name="trunk",
                               branches=['trunk'],
                               treeStableTimer=90,
                               builderNames=trunkBuilders)
    #    stable = AnyBranchScheduler(name="stable", branches=['branches/Safari-3-1-branch'], treeStableTimer=90, builderNames=stableBuilders)
    periodic = Periodic("periodic", periodicBuilders, 6 * 60 * 60)

    return [trunk, periodic]
def SetupBuildersAndSchedulers(c, builders, slaves, ActiveMaster):
    """Set up builders and schedulers for the build master."""
    # List of dicts for every builder.
    builder_dicts = []

    # Builder names by scheduler.
    builders_by_scheduler = {s: [] for s in SCHEDULERS}
    # Maps a triggering builder to its triggered builders.
    triggered_builders = collections.defaultdict(list)

    def process_builder(builder, is_trybot=False):
        """Create a dict for the given builder and place its name in the
    appropriate scheduler list.
    """
        builder_name = builder['name']
        if is_trybot:
            builder_name = builder_name_schema.TrybotName(builder_name)

        # Categorize the builder based on its role.
        try:
            category = builder_name_schema.DictForBuilderName(
                builder_name)['role']
            subcategory = builder_name.split(
                builder_name_schema.BUILDER_NAME_SEP)[1]
            category = '|'.join((category, subcategory))
        except ValueError:
            # Assume that all builders whose names don't play by our rules are named
            # upstream and are therefore canaries.
            category = builder_name_schema.BUILDER_ROLE_CANARY

        properties = builder.get('properties', {})
        cc = builder.get('cc')
        if cc:
            if isinstance(cc, basestring):
                cc = [cc]
            properties['owners'] = cc
        builder_dict = {
            'name':
            builder_name,
            'auto_reboot':
            builder.get('auto_reboot', DEFAULT_AUTO_REBOOT),
            'slavenames':
            slaves.GetSlavesName(builder=builder['name']),
            'category':
            category,
            'recipe':
            builder.get('recipe', DEFAULT_RECIPE),
            'properties':
            properties,
            'mergeRequests':
            builder.get('can_merge_requests', CanMergeBuildRequests),
            'slavebuilddir':
            SLAVE_WORKDIR,
        }
        builder_dicts.append(builder_dict)

        parent_builder = builder.get('triggered_by')
        if parent_builder is not None:
            assert builder.get('scheduler') is None
            if is_trybot:
                parent_builder = builder_name_schema.TrybotName(parent_builder)
            triggered_builders[parent_builder].append(builder_name)
        else:
            scheduler = builder.get('scheduler', BUILDBUCKET_SCHEDULER_NAME)
            # Setting the scheduler to BUILDBUCKET_SCHEDULER_NAME indicates that
            # BuildBucket is the only way to schedule builds for this bot; just
            # pretend to add a scheduler in those cases.
            builders_by_scheduler[scheduler].append(builder_name)

    # Create builders and trybots.
    for builder in builders:
        if builder.get('trybot_only', DEFAULT_TRYBOT_ONLY):
            # trybot_only=True should only be used in combination with do_trybot=True
            # Also, the buildername then needs to already have the '-Trybot' suffix.
            assert builder.get('do_trybot', DEFAULT_DO_TRYBOT)
            assert builder['name'] == builder_name_schema.TrybotName(
                builder['name'])
        else:
            process_builder(builder)
        if builder.get('do_trybot', DEFAULT_DO_TRYBOT):
            process_builder(builder, is_trybot=True)

    # Verify that all parent builders exist.
    all_nontriggered_builders = set(
        builders_by_scheduler[BUILDBUCKET_SCHEDULER_NAME])
    trigger_parents = set(triggered_builders.keys())
    nonexistent_parents = trigger_parents - all_nontriggered_builders
    if nonexistent_parents:
        raise Exception('Could not find parent builders: %s' %
                        ', '.join(nonexistent_parents))

    # Create the schedulers.
    infra_change_filter = change_filter.ChangeFilter(
        project='buildbot', repository=global_constants.INFRA_REPO)
    skia_master_only_change_filter = change_filter.ChangeFilter(
        project='skia', repository=ActiveMaster.repo_url, branch=MASTER_BRANCH)

    c['schedulers'] = []

    s = Scheduler(
        name=MASTER_ONLY_SCHEDULER_NAME,
        treeStableTimer=60,
        change_filter=skia_master_only_change_filter,
        builderNames=builders_by_scheduler[MASTER_ONLY_SCHEDULER_NAME])
    c['schedulers'].append(s)

    s = timed.Nightly(
        name=PERIODIC_15MINS_SCHEDULER_NAME,
        branch=MASTER_BRANCH,
        builderNames=builders_by_scheduler[PERIODIC_15MINS_SCHEDULER_NAME],
        minute=[i * 15 for i in xrange(60 / 15)],
        hour='*',
        dayOfMonth='*',
        month='*',
        dayOfWeek='*')
    c['schedulers'].append(s)

    s = timed.Nightly(
        name=NIGHTLY_SCHEDULER_NAME,
        branch=MASTER_BRANCH,
        builderNames=builders_by_scheduler[NIGHTLY_SCHEDULER_NAME],
        minute=0,
        hour=22,
        dayOfMonth='*',
        month='*',
        dayOfWeek='*')
    c['schedulers'].append(s)

    s = timed.Nightly(
        name=WEEKLY_SCHEDULER_NAME,
        branch=MASTER_BRANCH,
        builderNames=builders_by_scheduler[WEEKLY_SCHEDULER_NAME],
        minute=0,
        hour=0,
        dayOfMonth='*',
        month='*',
        dayOfWeek=6)  # Sunday (Monday = 0).
    c['schedulers'].append(s)

    s = AnyBranchScheduler(
        name=INFRA_PERCOMMIT_SCHEDULER_NAME,
        treeStableTimer=0,
        change_filter=infra_change_filter,
        builderNames=builders_by_scheduler[INFRA_PERCOMMIT_SCHEDULER_NAME])
    c['schedulers'].append(s)

    # Don't add triggerable schedulers for triggered_builders; triggers are now
    # handled on the slave-side through buildbucket.

    # Create the BuildFactorys.
    annotator = annotator_factory.AnnotatorFactory(ActiveMaster)

    for builder_dict in builder_dicts:
        factory = annotator.BaseFactory(builder_dict['recipe'], timeout=2400)
        factory.properties.update(builder_dict['properties'], 'BuildFactory')
        builder_dict['factory'] = factory

    # Finished!
    c['builders'] = builder_dicts