Commit 9728e341 authored by Garrett Beaty's avatar Garrett Beaty Committed by Commit Bot

Remove code that existed for handling milestone bucket config.

In order to limit the introduction of issues when creating new milestone
buckets or making modifications in the presence of milestone buckets,
the creation of the buckets and setting module level defaults was
abstracted into functions so that files could be copied to the new
milestone directory and only having to add a milestone vars file. With
the removal of milestone buckets, these functions only introduce an
unnecessary level of indirection.

Change-Id: Iececeb1a9e122f2f8e862697d453ee731ffdeb98
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2467547Reviewed-by: default avatarErik Staab <estaab@chromium.org>
Commit-Queue: Erik Staab <estaab@chromium.org>
Auto-Submit: Garrett Beaty <gbeaty@chromium.org>
Cr-Commit-Position: refs/heads/master@{#816747}
parent 4dd6f4ab
...@@ -26,7 +26,7 @@ luci.bucket( ...@@ -26,7 +26,7 @@ luci.bucket(
) )
luci.gitiles_poller( luci.gitiles_poller(
name = "master-gitiles-trigger", name = "chromium-gitiles-trigger",
bucket = "ci", bucket = "ci",
repo = "https://chromium.googlesource.com/chromium/src", repo = "https://chromium.googlesource.com/chromium/src",
) )
...@@ -51,7 +51,7 @@ defaults.swarming_tags.set(["vpython:native-python-wrapper"]) ...@@ -51,7 +51,7 @@ defaults.swarming_tags.set(["vpython:native-python-wrapper"])
def ci_builder(*, name, **kwargs): def ci_builder(*, name, **kwargs):
return builder( return builder(
name = name, name = name,
triggered_by = ["master-gitiles-trigger"], triggered_by = ["chromium-gitiles-trigger"],
resultdb_bigquery_exports = [resultdb.export_test_results( resultdb_bigquery_exports = [resultdb.export_test_results(
bq_table = "luci-resultdb-dev.chromium.ci_test_results", bq_table = "luci-resultdb-dev.chromium.ci_test_results",
)], )],
......
...@@ -1773,7 +1773,7 @@ consoles { ...@@ -1773,7 +1773,7 @@ consoles {
} }
consoles { consoles {
id: "try" id: "try"
name: "Chromium CQ console" name: "Chromium CQ Console"
builders { builders {
name: "buildbucket/luci.chromium.try/android-binary-size" name: "buildbucket/luci.chromium.try/android-binary-size"
} }
......
...@@ -75,7 +75,7 @@ job { ...@@ -75,7 +75,7 @@ job {
} }
} }
trigger { trigger {
id: "master-gitiles-trigger" id: "chromium-gitiles-trigger"
realm: "ci" realm: "ci"
acl_sets: "ci" acl_sets: "ci"
triggers: "android-lollipop-arm-rel-swarming" triggers: "android-lollipop-arm-rel-swarming"
......
...@@ -6103,7 +6103,7 @@ job { ...@@ -6103,7 +6103,7 @@ job {
} }
} }
trigger { trigger {
id: "master-gitiles-trigger" id: "chromium-gitiles-trigger"
realm: "ci" realm: "ci"
acl_sets: "ci" acl_sets: "ci"
triggers: "ASAN Debug" triggers: "ASAN Debug"
......
...@@ -35,8 +35,11 @@ def defaults(extends = None, **vars): ...@@ -35,8 +35,11 @@ def defaults(extends = None, **vars):
* get_value_from_kwargs(name, kwargs) - Gets the value of a keyword * get_value_from_kwargs(name, kwargs) - Gets the value of a keyword
argument. If `name` is in `kwargs`, `kwargs[name]` is returned. Otherwise, argument. If `name` is in `kwargs`, `kwargs[name]` is returned. Otherwise,
the module-level default for `name` is returned. the module-level default for `name` is returned.
* set(**kwargs) - Sets module-level defaults. For each keyword, sets the
module-level default with the keyword as the name to the value of the
keyword.
""" """
methods = ["get_value", "get_value_from_kwargs"] methods = ["get_value", "get_value_from_kwargs", "set"]
for m in methods: for m in methods:
if m in vars: if m in vars:
fail("{!r} can't be used as the name of a default: it is a method" fail("{!r} can't be used as the name of a default: it is a method"
...@@ -55,9 +58,14 @@ def defaults(extends = None, **vars): ...@@ -55,9 +58,14 @@ def defaults(extends = None, **vars):
def get_value_from_kwargs(name, kwargs): def get_value_from_kwargs(name, kwargs):
return get_value(name, kwargs.get(name, DEFAULT)) return get_value(name, kwargs.get(name, DEFAULT))
def set(**kwargs):
for k, v in kwargs.items():
vars[k].set(v)
return struct( return struct(
get_value = get_value, get_value = get_value,
get_value_from_kwargs = get_value_from_kwargs, get_value_from_kwargs = get_value_from_kwargs,
set = set,
**vars **vars
) )
......
...@@ -15,7 +15,6 @@ to set the default value. Can also be accessed through `ci.defaults`. ...@@ -15,7 +15,6 @@ to set the default value. Can also be accessed through `ci.defaults`.
load("@stdlib//internal/graph.star", "graph") load("@stdlib//internal/graph.star", "graph")
load("@stdlib//internal/luci/common.star", "keys") load("@stdlib//internal/luci/common.star", "keys")
load("//project.star", "settings")
load("./args.star", "args") load("./args.star", "args")
load("./branches.star", "branches") load("./branches.star", "branches")
load("./builders.star", "builders") load("./builders.star", "builders")
...@@ -31,91 +30,6 @@ defaults = args.defaults( ...@@ -31,91 +30,6 @@ defaults = args.defaults(
refs = None, refs = None,
) )
def declare_bucket(milestone_vars, *, branch_selector = branches.MAIN):
if not branches.matches(branch_selector):
return
luci.bucket(
name = milestone_vars.ci_bucket,
acls = [
acl.entry(
roles = acl.BUILDBUCKET_READER,
groups = "all",
),
acl.entry(
roles = acl.BUILDBUCKET_TRIGGERER,
groups = "project-chromium-ci-schedulers",
),
acl.entry(
roles = acl.BUILDBUCKET_OWNER,
groups = "google/luci-task-force@google.com",
),
],
)
luci.gitiles_poller(
name = milestone_vars.ci_poller,
bucket = milestone_vars.ci_bucket,
repo = "https://chromium.googlesource.com/chromium/src",
refs = [milestone_vars.ref],
)
# TODO(gbeaty) Determine what should be in each main console and define it
# separately
for name, title in (
(milestone_vars.main_console_name, milestone_vars.main_console_title),
(milestone_vars.cq_mirrors_console_name, milestone_vars.cq_mirrors_console_title),
):
ci.overview_console_view(
name = name,
branch_selector = branch_selector,
repo = "https://chromium.googlesource.com/chromium/src",
refs = [milestone_vars.ref],
title = title,
top_level_ordering = [
"chromium",
"chromium.win",
"chromium.mac",
"chromium.linux",
"chromium.chromiumos",
"chromium.android",
"chrome",
"chromium.memory",
"chromium.dawn",
"chromium.gpu",
"chromium.fyi",
"chromium.android.fyi",
"chromium.clang",
"chromium.fuzz",
"chromium.gpu.fyi",
"chromium.swangle",
],
)
def set_defaults(milestone_vars, **kwargs):
default_values = dict(
add_to_console_view = milestone_vars.is_master,
bucket = milestone_vars.ci_bucket,
build_numbers = True,
configure_kitchen = True,
cores = 8,
cpu = builders.cpu.X86_64,
executable = "recipe:chromium",
execution_timeout = 3 * time.hour,
os = builders.os.LINUX_DEFAULT,
pool = "luci.chromium.ci",
project_trigger_overrides = {"chromium": settings.project} if not settings.is_master else None,
repo = "https://chromium.googlesource.com/chromium/src",
refs = [milestone_vars.ref],
service_account = "chromium-ci-builder@chops-service-accounts.iam.gserviceaccount.com",
swarming_tags = ["vpython:native-python-wrapper"],
triggered_by = [milestone_vars.ci_poller],
# TODO(crbug.com/1129723): set default goma_backend here.
)
default_values.update(kwargs)
for k, v in default_values.items():
getattr(defaults, k).set(v)
def _console_view_ordering_graph_key(console_name): def _console_view_ordering_graph_key(console_name):
return graph.key("@chromium", "", "console_view_ordering", console_name) return graph.key("@chromium", "", "console_view_ordering", console_name)
...@@ -1085,14 +999,19 @@ def win_builder( ...@@ -1085,14 +999,19 @@ def win_builder(
) )
ci = struct( ci = struct(
builder = ci_builder, # Module-level defaults for ci functions
console_view = console_view,
console_view_entry = console_view_entry,
declare_bucket = declare_bucket,
defaults = defaults, defaults = defaults,
# Functions for declaring automatically maintained consoles
console_view = console_view,
overview_console_view = overview_console_view, overview_console_view = overview_console_view,
ordering = ordering, ordering = ordering,
set_defaults = set_defaults,
# Functions for declaring CI builders
builder = ci_builder,
console_view_entry = console_view_entry,
# More specific builder wrapper functions
android_builder = android_builder, android_builder = android_builder,
android_fyi_builder = android_fyi_builder, android_fyi_builder = android_fyi_builder,
chromium_builder = chromium_builder, chromium_builder = chromium_builder,
......
...@@ -39,94 +39,6 @@ defaults = args.defaults( ...@@ -39,94 +39,6 @@ defaults = args.defaults(
subproject_list_view = None, subproject_list_view = None,
) )
def declare_bucket(milestone_vars, *, branch_selector = branches.MAIN):
if not branches.matches(branch_selector):
return
luci.bucket(
name = milestone_vars.try_bucket,
acls = [
acl.entry(
roles = acl.BUILDBUCKET_READER,
groups = "all",
),
acl.entry(
roles = acl.BUILDBUCKET_TRIGGERER,
users = [
"findit-for-me@appspot.gserviceaccount.com",
"tricium-prod@appspot.gserviceaccount.com",
],
groups = [
"project-chromium-tryjob-access",
# Allow Pinpoint to trigger builds for bisection
"service-account-chromeperf",
"service-account-cq",
],
projects = milestone_vars.try_triggering_projects,
),
acl.entry(
roles = acl.BUILDBUCKET_OWNER,
groups = "service-account-chromium-tryserver",
),
],
)
luci.cq_group(
name = milestone_vars.cq_group,
retry_config = cq.RETRY_ALL_FAILURES,
tree_status_host = milestone_vars.tree_status_host,
watch = cq.refset(
repo = "https://chromium.googlesource.com/chromium/src",
refs = [milestone_vars.cq_ref_regexp],
),
acls = [
acl.entry(
acl.CQ_COMMITTER,
groups = "project-chromium-committers",
),
acl.entry(
acl.CQ_DRY_RUNNER,
groups = "project-chromium-tryjob-access",
),
],
)
try_.list_view(
name = milestone_vars.main_list_view_name,
branch_selector = branch_selector,
title = milestone_vars.main_list_view_title,
)
def set_defaults(milestone_vars, **kwargs):
default_values = dict(
add_to_list_view = milestone_vars.is_master,
bucket = milestone_vars.try_bucket,
build_numbers = True,
caches = [
swarming.cache(
name = "win_toolchain",
path = "win_toolchain",
),
],
configure_kitchen = True,
cores = 8,
cpu = builders.cpu.X86_64,
cq_group = milestone_vars.cq_group,
executable = "recipe:chromium_trybot",
execution_timeout = 4 * time.hour,
# Max. pending time for builds. CQ considers builds pending >2h as timed
# out: http://shortn/_8PaHsdYmlq. Keep this in sync.
expiration_timeout = 2 * time.hour,
os = builders.os.LINUX_DEFAULT,
pool = "luci.chromium.try",
service_account = "chromium-try-builder@chops-service-accounts.iam.gserviceaccount.com",
swarming_tags = ["vpython:native-python-wrapper"],
task_template_canary_percentage = 5,
)
default_values.update(kwargs)
for k, v in default_values.items():
getattr(defaults, k).set(v)
def _sorted_list_view_graph_key(console_name): def _sorted_list_view_graph_key(console_name):
return graph.key("@chromium", "", "sorted_list_view", console_name) return graph.key("@chromium", "", "sorted_list_view", console_name)
...@@ -525,12 +437,17 @@ def gpu_chromium_win_builder(*, name, os = builders.os.WINDOWS_ANY, **kwargs): ...@@ -525,12 +437,17 @@ def gpu_chromium_win_builder(*, name, os = builders.os.WINDOWS_ANY, **kwargs):
) )
try_ = struct( try_ = struct(
# Module-level defaults for try functions
defaults = defaults, defaults = defaults,
# Functions for declaring automatically maintained list views
list_view = list_view,
# Functions for declaring try builders
builder = try_builder, builder = try_builder,
declare_bucket = declare_bucket,
job = tryjob, job = tryjob,
list_view = list_view,
set_defaults = set_defaults, # More specific builder wrapper functions
blink_builder = blink_builder, blink_builder = blink_builder,
blink_mac_builder = blink_mac_builder, blink_mac_builder = blink_mac_builder,
chromium_builder = chromium_builder, chromium_builder = chromium_builder,
......
...@@ -2,35 +2,75 @@ ...@@ -2,35 +2,75 @@
# Use of this source code is governed by a BSD-style license that can be # Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file. # found in the LICENSE file.
settings = struct( def _project_settings(
*,
project,
branch_title,
is_master,
is_lts_branch,
ref,
cq_ref_regexp,
try_triggering_projects,
tree_status_host):
"""Declare settings for the project.
This provides the central location for what must be modified when
setting up the project for a new branch or when a branch changes category
(e.g. moves from a standard release channel to the long-term support
channel).
Args:
* project - The name of the LUCI project.
* branch_title - A string identifying the branch in console titles.
* is_master - Whether this branch is main/master/trunk.
* is_lts_branch - Whether this branch is in the LTS channel.
* ref - The git ref containing the code for this branch.
* cq_ref_regexp - A regular expression determining the git refs that the
CQ group for this project should watch.
* try_trigger_projects - A list of names of other LUCI projects whose CQ
is allowed to trigger this project's try builders. None can also be
passed to prohibit other projects' CQ from triggering this project's try
builders.
* tree_status_host - The host of the tree status app associated with this
project. Builders with tree closers configured will notify this host and
CQ attempts will block if the host indicates the tree is closed. It also
appears at the top of the console header. None indicates there is no
associated tree status app for the project.
"""
if is_master and is_lts_branch:
fail("is_master and is_lts_branch can't both be True")
return struct(
project = project,
is_master = is_master,
is_lts_branch = is_lts_branch,
ref = ref,
cq_ref_regexp = cq_ref_regexp,
try_triggering_projects = try_triggering_projects,
tree_status_host = tree_status_host,
main_console_title = "{} Main Console".format(branch_title),
cq_mirrors_console_title = "{} CQ Mirrors Console".format(branch_title),
main_list_view_title = "{} CQ Console".format(branch_title),
)
settings = _project_settings(
# Set this to the name of the milestone's project
project = "chromium", project = "chromium",
# Switch this to False for branches # Set this to how the branch should be referred to in console titles
branch_title = "Chromium",
# Set this to False for branches
is_master = True, is_master = True,
# Switch this to True for LTC/LTS branches # Set this to True for LTC/LTS branches
is_lts_branch = False, is_lts_branch = False,
# Set this to the branch ref for branches
ref = "refs/heads/master", ref = "refs/heads/master",
ci_bucket = "ci", # Set this to the branch ref for branches
ci_poller = "master-gitiles-trigger",
main_console_name = "main",
main_console_title = "Chromium Main Console",
cq_mirrors_console_name = "mirrors",
cq_mirrors_console_title = "Chromium CQ Mirrors Console",
try_bucket = "try",
try_triggering_projects = ["angle", "dawn", "skia", "v8"],
cq_group = "cq",
cq_ref_regexp = "refs/heads/.+", cq_ref_regexp = "refs/heads/.+",
main_list_view_name = "try", # Set this to None for branches
main_list_view_title = "Chromium CQ console", try_triggering_projects = ["angle", "dawn", "skia", "v8"],
# Switch this to None for branches # Set this to None for branches
tree_status_host = "chromium-status.appspot.com", tree_status_host = "chromium-status.appspot.com",
) )
def _validate_settings():
if settings.is_master and settings.is_lts_branch:
fail("is_master and is_lts_branch can't both be True")
_validate_settings()
def _generate_project_pyl(ctx): def _generate_project_pyl(ctx):
ctx.output["project.pyl"] = "\n".join([ ctx.output["project.pyl"] = "\n".join([
"# This is a non-LUCI generated file", "# This is a non-LUCI generated file",
......
This diff is collapsed.
...@@ -2,15 +2,34 @@ ...@@ -2,15 +2,34 @@
# Use of this source code is governed by a BSD-style license that can be # Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file. # found in the LICENSE file.
load("//lib/builders.star", "goma", "os") load("//lib/builders.star", "cpu", "goma", "os")
load("//lib/try.star", "try_") load("//lib/try.star", "try_")
load("//project.star", "settings")
try_.set_defaults( try_.defaults.set(
settings, add_to_list_view = True,
bucket = "try",
build_numbers = True,
caches = [
swarming.cache(
name = "win_toolchain",
path = "win_toolchain",
),
],
configure_kitchen = True,
cores = 8,
cpu = cpu.X86_64,
cq_group = "cq",
executable = "recipe:chromium_trybot",
execution_timeout = 6 * time.hour, execution_timeout = 6 * time.hour,
subproject_list_view = "luci.chromium.try", # Max. pending time for builds. CQ considers builds pending >2h as timed
# out: http://shortn/_8PaHsdYmlq. Keep this in sync.
expiration_timeout = 2 * time.hour,
os = os.LINUX_DEFAULT,
pool = "luci.chromium.try",
service_account = "chromium-try-gpu-builder@chops-service-accounts.iam.gserviceaccount.com", service_account = "chromium-try-gpu-builder@chops-service-accounts.iam.gserviceaccount.com",
subproject_list_view = "luci.chromium.try",
swarming_tags = ["vpython:native-python-wrapper"],
task_template_canary_percentage = 5,
) )
# Builders appear after the function used to define them, with all builders # Builders appear after the function used to define them, with all builders
......
...@@ -2,14 +2,34 @@ ...@@ -2,14 +2,34 @@
# Use of this source code is governed by a BSD-style license that can be # Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file. # found in the LICENSE file.
load("//lib/builders.star", "cpu", "os")
load("//lib/try.star", "try_") load("//lib/try.star", "try_")
load("//project.star", "settings")
try_.set_defaults( try_.defaults.set(
settings, add_to_list_view = True,
bucket = "try",
build_numbers = True,
caches = [
swarming.cache(
name = "win_toolchain",
path = "win_toolchain",
),
],
configure_kitchen = True,
cores = 8,
cpu = cpu.X86_64,
cq_group = "cq",
executable = "recipe:chromium_trybot",
execution_timeout = 2 * time.hour, execution_timeout = 2 * time.hour,
subproject_list_view = "luci.chromium.try", # Max. pending time for builds. CQ considers builds pending >2h as timed
# out: http://shortn/_8PaHsdYmlq. Keep this in sync.
expiration_timeout = 2 * time.hour,
os = os.LINUX_DEFAULT,
pool = "luci.chromium.try",
service_account = "chromium-try-gpu-builder@chops-service-accounts.iam.gserviceaccount.com", service_account = "chromium-try-gpu-builder@chops-service-accounts.iam.gserviceaccount.com",
subproject_list_view = "luci.chromium.try",
swarming_tags = ["vpython:native-python-wrapper"],
task_template_canary_percentage = 5,
) )
try_.chromium_swangle_linux_builder( try_.chromium_swangle_linux_builder(
......
This diff is collapsed.
...@@ -35,7 +35,7 @@ defaults.service_account.set( ...@@ -35,7 +35,7 @@ defaults.service_account.set(
"goma-release-testing@chops-service-accounts.iam.gserviceaccount.com", "goma-release-testing@chops-service-accounts.iam.gserviceaccount.com",
) )
defaults.swarming_tags.set(["vpython:native-python-wrapper"]) defaults.swarming_tags.set(["vpython:native-python-wrapper"])
defaults.triggered_by.set(["master-gitiles-trigger"]) defaults.triggered_by.set(["chromium-gitiles-trigger"])
# Builders appear after the function used to define them, with all builders # Builders appear after the function used to define them, with all builders
# defined using the same function ordered lexicographically by name # defined using the same function ordered lexicographically by name
......
...@@ -36,7 +36,7 @@ defaults.execution_timeout.set(2 * time.hour) ...@@ -36,7 +36,7 @@ defaults.execution_timeout.set(2 * time.hour)
defaults.os.set(os.LINUX_DEFAULT) defaults.os.set(os.LINUX_DEFAULT)
defaults.service_account.set("chromium-ci-builder@chops-service-accounts.iam.gserviceaccount.com") defaults.service_account.set("chromium-ci-builder@chops-service-accounts.iam.gserviceaccount.com")
defaults.swarming_tags.set(["vpython:native-python-wrapper"]) defaults.swarming_tags.set(["vpython:native-python-wrapper"])
defaults.triggered_by.set(["master-gitiles-trigger"]) defaults.triggered_by.set(["chromium-gitiles-trigger"])
defaults.properties.set({ defaults.properties.set({
"perf_dashboard_machine_group": "ChromiumWebRTC", "perf_dashboard_machine_group": "ChromiumWebRTC",
......
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