Commit 0b087e51 authored by Garrett Beaty's avatar Garrett Beaty Committed by Commit Bot

Remove config code for handling bucket milestones.

Using per-milestone buckets caused the scheduler jobs names to have the
bucket name prefixed to them when the number of jobs for a builder with
a given name was >1. To account for this, the bucketed_triggers property
modified the behavior of the chromium recipe to prefix the builder name
with the bucket name to trigger the appropriate builder. A generator
ensured that builders in the ci bucket could be triggered with or
without the bucket prefix so that when new branch builders were added,
outstanding builds wouldn't infra fail attempting to trigger a scheduler
job that no longer existed.

With milestone-based buckets removed, neither of these things is
necessary.

Change-Id: I479d1bcb56908e677f59dfa5b4b8a2394c8ada6e
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2458451
Auto-Submit: Garrett Beaty <gbeaty@chromium.org>
Reviewed-by: default avatarErik Staab <estaab@chromium.org>
Commit-Queue: Erik Staab <estaab@chromium.org>
Cr-Commit-Position: refs/heads/master@{#814828}
parent 9bcf62a6
This source diff could not be displayed because it is too large. You can view the blob instead.
# Copyright 2020 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
def _ensure_ci_jobs_can_be_bucketed_or_not(ctx):
cfg = ctx.output["luci-scheduler.cfg"]
ci_jobs = {}
for j in cfg.job:
# The default behavior is the same as 'triggered', so look for non-empty
# schedules that are not 'triggered', we don't want to create duplicates of
# those jobs because it will cause double the number of builds to be
# scheduled
if j.schedule and j.schedule != "triggered":
continue
bucket = j.buildbucket.bucket
if bucket != "luci.chromium.ci":
continue
builder = j.buildbucket.builder
if builder in ci_jobs:
fail("Multiple jobs defined for CI builder ci/{}".format(builder))
ci_jobs[builder] = j
for builder, job in ci_jobs.items():
new_job = proto.from_wirepb(proto.message_type(job), proto.to_wirepb(job))
new_job.id = builder if job.id != builder else "ci-{}".format(builder)
cfg.job.append(new_job)
jobs = sorted(cfg.job, key = lambda j: j.id)
cfg.job.clear()
cfg.job.extend(jobs)
lucicfg.generator(_ensure_ci_jobs_can_be_bucketed_or_not)
......@@ -151,13 +151,9 @@ _DEFAULT_BUILDERLESS_OS_CATEGORIES = [os_category.LINUX]
# setting ssd:0 dimension
_EXCLUDE_BUILDERLESS_SSD_OS_CATEGORIES = [os_category.MAC]
def _chromium_tests_property(*, bucketed_triggers, project_trigger_overrides):
def _chromium_tests_property(*, project_trigger_overrides):
chromium_tests = {}
bucketed_triggers = defaults.get_value("bucketed_triggers", bucketed_triggers)
if bucketed_triggers:
chromium_tests["bucketed_triggers"] = True
project_trigger_overrides = defaults.get_value("project_trigger_overrides", project_trigger_overrides)
if project_trigger_overrides:
chromium_tests["project_trigger_overrides"] = project_trigger_overrides
......@@ -254,7 +250,6 @@ defaults = args.defaults(
auto_builder_dimension = args.COMPUTE,
builder_group = None,
builderless = args.COMPUTE,
bucketed_triggers = False,
configure_kitchen = False,
cores = None,
cpu = None,
......@@ -300,7 +295,6 @@ def builder(
builder_group = args.DEFAULT,
pool = args.DEFAULT,
ssd = args.DEFAULT,
bucketed_triggers = args.DEFAULT,
project_trigger_overrides = args.DEFAULT,
configure_kitchen = args.DEFAULT,
goma_backend = args.DEFAULT,
......@@ -368,10 +362,6 @@ def builder(
If True, emits a 'ssd:1' dimension. If False, emits a 'ssd:0' parameter.
By default, considered False if builderless is considered True and
otherwise None.
* bucketed_triggers - a boolean indicating whether jobs triggered by the
builder being defined should have the bucket prepended to the builder name
to trigger. If True, the 'bucketed_triggers' field will be set in the
'$build/chromium_tests' property. By default, considered False.
* project_trigger_overrides - a dict mapping the LUCI projects declared in
recipe BotSpecs to the LUCI project to use when triggering builders. When
this builder triggers another builder, if the BotSpec for that builder has
......@@ -500,7 +490,6 @@ def builder(
}
chromium_tests = _chromium_tests_property(
bucketed_triggers = bucketed_triggers,
project_trigger_overrides = project_trigger_overrides,
)
if chromium_tests != None:
......
......@@ -132,15 +132,6 @@ branches.exec("//subprojects/webrtc/subproject.star")
branches.exec("//generators/cq-builders-md.star")
# This should be exec'ed before exec'ing scheduler-noop-jobs.star because
# attempting to read the buildbucket field that is not set for the noop jobs
# actually causes an empty buildbucket message to be set
# TODO(https://crbug.com/1062385) The automatic generation of job IDs causes
# problems when the number of builders with the same name goes from 1 to >1 or
# vice-versa. This generator makes sure both the bucketed and non-bucketed IDs
# work so that there aren't transient failures when the configuration changes
branches.exec("//generators/scheduler-bucketed-jobs.star")
# TODO(https://crbug.com/819899) There are a number of noop jobs for dummy
# builders defined due to legacy requirements that trybots mirror CI bots
# no-op scheduler jobs are not supported by the lucicfg libraries, so this
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment