Initial CQ configuration

Change-Id: I6af1836b6a3dddab0291bb4166e94d57c9e5eaa0
diff --git a/PRESUBMIT.py b/PRESUBMIT.py
new file mode 100644
index 0000000..8fb81fd
--- /dev/null
+++ b/PRESUBMIT.py
@@ -0,0 +1,9 @@
+# Copyright (c) 2018 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 CheckChangeOnUpload(input_api, output_api):
+    return input_api.canned_checks.CheckChangedLUCIConfigs(input_api, output_api)
+
+def CheckChangeOnCommit(input_api, output_api):
+    return input_api.canned_checks.CheckChangedLUCIConfigs(input_api, output_api)
diff --git a/codereview.settings b/codereview.settings
new file mode 100644
index 0000000..3894052
--- /dev/null
+++ b/codereview.settings
@@ -0,0 +1,3 @@
+# This file is used by git cl to get repository specific information.
+GERRIT_HOST: True
+CODE_REVIEW_SERVER: https://dawn-review.googlesource.com
diff --git a/infra/config/OWNERS b/infra/config/OWNERS
new file mode 100644
index 0000000..6b5005f
--- /dev/null
+++ b/infra/config/OWNERS
@@ -0,0 +1,2 @@
+cwallez@chromium.org
+tandrii@chromium.org
diff --git a/infra/config/README.md b/infra/config/README.md
new file mode 100644
index 0000000..a93b7f2
--- /dev/null
+++ b/infra/config/README.md
@@ -0,0 +1 @@
+This directory contains configurations for infra services.
diff --git a/infra/config/branch/cq.cfg b/infra/config/branch/cq.cfg
new file mode 100644
index 0000000..b412608
--- /dev/null
+++ b/infra/config/branch/cq.cfg
@@ -0,0 +1,25 @@
+# See http://luci-config.appspot.com/schemas/projects/refs:cq.cfg for the
+# documentation of this file format.
+
+version: 1
+cq_name: "dawn"
+cq_status_url: "https://chromium-cq-status.appspot.com"
+git_repo_url: "https://chromium.googlesource.com/angle/angle"
+
+verifiers {
+  gerrit_cq_ability {
+    committer_list: "project-dawn-committers"
+    dry_run_access_list: "project-dawn-tryjob-access"
+  }
+  try_job {
+    buckets {
+      name: "luci.dawn.try"
+      builders { name: "linux-clang-dbg-x64" }
+      builders { name: "linux-clang-rel-x64" }
+      builders { name: "mac-dbg" }
+      builders { name: "mac-rel" }
+      builders { name: "win-clang-dbg-x64" }
+      builders { name: "win-clang-rel-x64" }
+    }
+  }
+}
diff --git a/infra/config/global/cr-buildbucket.cfg b/infra/config/global/cr-buildbucket.cfg
new file mode 100644
index 0000000..3b047b3
--- /dev/null
+++ b/infra/config/global/cr-buildbucket.cfg
@@ -0,0 +1,228 @@
+# Defines buckets on cr-buildbucket.appspot.com, used to schedule builds
+# on buildbot. In particular, CQ uses some of these buckets to schedule tryjobs.
+#
+# See http://luci-config.appspot.com/schemas/projects:cr-buildbucket.cfg for
+# schema of this file and documentation.
+#
+# Please keep this list sorted by bucket name.
+
+acl_sets {
+  name: "ci"
+  acls {
+    role: READER
+    group: "all"
+  }
+  acls {
+    role: SCHEDULER
+    identity: "luci-scheduler@appspot.gserviceaccount.com"
+  }
+}
+
+acl_sets {
+  name: "try"
+  acls {
+    role: READER
+    group: "all"
+  }
+  acls {
+    role: SCHEDULER
+    group: "project-dawn-tryjob-access"
+  }
+  acls {
+    role: SCHEDULER
+    group: "service-account-cq"
+  }
+}
+
+builder_mixins {
+  name: "release"
+  recipe {
+    properties_j: "debug:false"
+  }
+}
+builder_mixins {
+  name: "debug"
+  recipe {
+    properties_j: "debug:true"
+  }
+}
+builder_mixins {
+  name: "x86"
+  recipe {
+    properties: "target_cpu:x86"
+  }
+}
+builder_mixins {
+  name: "x64"
+  recipe {
+    properties: "target_cpu:x64"
+  }
+}
+
+buckets {
+  name: "luci.dawn.ci"
+  acl_sets: "ci"
+
+  swarming {
+    hostname: "chromium-swarm.appspot.com"
+    builder_defaults {
+      dimensions: "pool:luci.flex.ci"
+      caches {
+        path: "win_toolchain"
+        name: "win_toolchain"
+      }
+      recipe {
+        cipd_package: "infra/recipe_bundles/chromium.googlesource.com/chromium/tools/build"
+        cipd_version: "refs/heads/master"
+        name: "dawn"
+      }
+      service_account: "dawn-ci-builder@chops-service-accounts.iam.gserviceaccount.com"
+    }
+
+    # Linux: test combinations of {clang}x{release,debug}x{x86,x64}
+    builders {
+      name: "linux-clang-dbg-x64"
+      dimensions: "os:Ubuntu-14.04"
+      mixins: "debug"
+      mixins: "x64"
+    }
+    builders {
+      name: "linux-clang-dbg-x86"
+      dimensions: "os:Ubuntu-14.04"
+      mixins: "debug"
+      mixins: "x86"
+    }
+    builders {
+      name: "linux-clang-rel-x64"
+      dimensions: "os:Ubuntu-14.04"
+      mixins: "release"
+      mixins: "x64"
+    }
+    builders {
+      name: "linux-clang-rel-x86"
+      dimensions: "os:Ubuntu-14.04"
+      mixins: "release"
+      mixins: "x86"
+    }
+
+    # Mac: unlike Linux we only need to test x64 (and only clang too)
+    builders {
+      name: "mac-dbg"
+      dimensions: "os:Mac"
+      mixins: "debug"
+    }
+    builders {
+      name: "mac-rel"
+      dimensions: "os:Mac"
+      mixins: "release"
+    }
+
+    # Linux: test combinations of {clang,msvc}x{release,debug}x{x86,x64}
+    # but limit msvc to x64
+    builders {
+      name: "win-clang-dbg-x64"
+      dimensions: "os:Windows"
+      mixins: "clang"
+      mixins: "debug"
+      mixins: "x64"
+    }
+    builders {
+      name: "win-clang-dbg-x86"
+      dimensions: "os:Windows"
+      mixins: "clang"
+      mixins: "debug"
+      mixins: "x86"
+    }
+    builders {
+      name: "win-clang-rel-x64"
+      dimensions: "os:Windows"
+      mixins: "clang"
+      mixins: "release"
+      mixins: "x64"
+    }
+    builders {
+      name: "win-clang-rel-x86"
+      dimensions: "os:Windows"
+      mixins: "clang"
+      mixins: "release"
+      mixins: "x86"
+    }
+    builders {
+      name: "win-msvc-dbg-x64"
+      dimensions: "os:Windows"
+      mixins: "no_clang"
+      mixins: "debug"
+      mixins: "x64"
+    }
+    builders {
+      name: "win-msvc-rel-x64"
+      dimensions: "os:Windows"
+      mixins: "no_clang"
+      mixins: "release"
+      mixins: "x64"
+    }
+  }
+}
+
+buckets: {
+  name: "luci.dawn.try"
+  acl_sets: "try"
+
+  swarming {
+    hostname: "chromium-swarm.appspot.com"
+
+    builder_defaults {
+      dimensions: "pool:luci.flex.try"
+      caches {
+        path: "win_toolchain"
+        name: "win_toolchain"
+      }
+      recipe {
+        cipd_package: "infra/recipe_bundles/chromium.googlesource.com/chromium/tools/build"
+        cipd_version: "refs/heads/master"
+        name: "dawn"
+        properties_j: "$depot_tools/bot_update:{\"apply_patch_on_gclient\":true}"
+      }
+      service_account: "dawn-try-builder@chops-service-accounts.iam.gserviceaccount.com"
+    }
+
+    builders {
+      name: "linux-clang-dbg-x64"
+      dimensions: "os:Ubuntu-14.04"
+      mixins: "debug"
+      mixins: "x64"
+    }
+    builders {
+      name: "linux-clang-rel-x64"
+      dimensions: "os:Ubuntu-14.04"
+      mixins: "release"
+      mixins: "x64"
+    }
+
+    builders {
+      name: "mac-dbg"
+      dimensions: "os:Mac"
+      mixins: "debug"
+    }
+    builders {
+      name: "mac-rel"
+      dimensions: "os:Mac"
+      mixins: "release"
+    }
+
+    builders {
+      name: "win-clang-dbg-x64"
+      dimensions: "os:Windows"
+      mixins: "clang"
+      mixins: "debug"
+      mixins: "x64"
+    }
+    builders {
+      name: "win-clang-rel-x64"
+      dimensions: "os:Windows"
+      mixins: "clang"
+      mixins: "release"
+      mixins: "x64"
+    }
+  }
+}
diff --git a/infra/config/global/luci-logdog.cfg b/infra/config/global/luci-logdog.cfg
new file mode 100644
index 0000000..3bd0e96
--- /dev/null
+++ b/infra/config/global/luci-logdog.cfg
@@ -0,0 +1,17 @@
+# Copyright (c) 2018 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.
+#
+# For the schema of this file and documentation, see ProjectConfig message in
+# https://luci-config.appspot.com/schemas/services/luci-logdog:logdog.cfg
+
+# Auth groups who can read log streams.
+reader_auth_groups: "all"
+
+# Auth groups who can register and emit new log streams.
+writer_auth_groups: "luci-logdog-chromium-writers"
+
+# The base Google Storage archival path for this project.
+#
+# Archived LogDog logs will be written to this bucket/path.
+archive_gs_bucket: "chromium-luci-logdog"
diff --git a/infra/config/global/luci-milo.cfg b/infra/config/global/luci-milo.cfg
new file mode 100644
index 0000000..04a7fb4
--- /dev/null
+++ b/infra/config/global/luci-milo.cfg
@@ -0,0 +1,98 @@
+consoles {
+  id: "ci"
+  name: "Dawn CI Builders"
+  repo_url: "https://dawn.googlesource.com/dawn"
+  refs: "refs/heads/master"
+  manifest_name: "REVISION"
+
+  builders {
+    name: "buildbucket/luci.dawn.ci/linux-clang-dbg-x64"
+    category: "linux|clang|dbg"
+    short_name: "x64"
+  }
+  builders {
+    name: "buildbucket/luci.dawn.ci/linux-clang-dbg-x86"
+    category: "linux|clang|dbg"
+    short_name: "x86"
+  }
+  builders {
+    name: "buildbucket/luci.dawn.ci/linux-clang-rel-x64"
+    category: "linux|clang|rel"
+    short_name: "x64"
+  }
+  builders {
+    name: "buildbucket/luci.dawn.ci/linux-clang-rel-x86"
+    category: "linux|clang|rel"
+    short_name: "x86"
+  }
+
+  builders {
+    name: "buildbucket/luci.dawn.ci/mac-dbg"
+    category: "mac"
+    short_name: "dbg"
+  }
+  builders {
+    name: "buildbucket/luci.dawn.ci/mac-rel"
+    category: "mac"
+    short_name: "rel"
+  }
+
+  builders {
+    name: "buildbucket/luci.dawn.ci/win-clang-dbg-x64"
+    category: "win|clang|dbg"
+    short_name: "x64"
+  }
+  builders {
+    name: "buildbucket/luci.dawn.ci/win-clang-dbg-x86"
+    category: "win|clang|dbg"
+    short_name: "x86"
+  }
+  builders {
+    name: "buildbucket/luci.dawn.ci/win-clang-rel-x64"
+    category: "win|clang|rel"
+    short_name: "x64"
+  }
+  builders {
+    name: "buildbucket/luci.dawn.ci/win-clang-rel-x86"
+    category: "win|clang|rel"
+    short_name: "x86"
+  }
+  builders {
+    name: "buildbucket/luci.dawn.ci/win-msvc-dbg-x64"
+    category: "win|msvc"
+    short_name: "dbg"
+  }
+  builders {
+    name: "buildbucket/luci.dawn.ci/win-msvc-rel-x64"
+    category: "win|msvc"
+    short_name: "rel"
+  }
+}
+
+consoles {
+  id: "try"
+  name: "Dawn try Builders"
+  manifest_name: "PATCHED"
+  builder_view_only: true
+
+  builders {
+    name: "buildbucket/luci.dawn.try/linux-clang-dbg-x64"
+  }
+  builders {
+    name: "buildbucket/luci.dawn.try/linux-clang-rel-x64"
+  }
+
+  builders {
+    name: "buildbucket/luci.dawn.try/mac-dbg"
+  }
+  builders {
+    name: "buildbucket/luci.dawn.try/mac-rel"
+  }
+
+  builders {
+    name: "buildbucket/luci.dawn.try/win-clang-dbg-x64"
+  }
+  builders {
+    name: "buildbucket/luci.dawn.try/win-clang-rel-x64"
+  }
+}
diff --git a/infra/config/global/luci-scheduler.cfg b/infra/config/global/luci-scheduler.cfg
new file mode 100644
index 0000000..b7d0897
--- /dev/null
+++ b/infra/config/global/luci-scheduler.cfg
@@ -0,0 +1,144 @@
+# Defines jobs on luci-scheduler.appspot.com.
+#
+# For schema of this file and documentation see ProjectConfig message in
+#
+# https://chromium.googlesource.com/infra/luci/luci-go/+/master/scheduler/appengine/messages/cron.proto
+
+
+acl_sets {
+  name: "default"
+  acls {
+    role: READER
+    granted_to: "group:all"
+  }
+  acls {
+    role: OWNER
+    granted_to: "group:project-dawn-admins"
+  }
+}
+
+trigger {
+  id: "master-gitiles-trigger"
+  acl_sets: "default"
+  gitiles {
+    repo: "https://dawn.googlesource.com/dawn.git"
+    refs: "refs/heads/master"
+  }
+  triggers: "linux-clang-dbg-x64"
+  triggers: "linux-clang-rel-x64"
+  triggers: "mac-dbg"
+  triggers: "mac-rel"
+  triggers: "win-clang-dbg-x64"
+  triggers: "win-clang-rel-x64"
+}
+
+job {
+  id: "linux-clang-dbg-x64"
+  acl_sets: "default"
+  buildbucket: {
+    server: "cr-buildbucket.appspot.com"
+    bucket: "luci.dawn.ci"
+    builder: "linux-clang-dbg-x64"
+  }
+}
+job {
+  id: "linux-clang-dbg-x86"
+  acl_sets: "default"
+  buildbucket: {
+    server: "cr-buildbucket.appspot.com"
+    bucket: "luci.dawn.ci"
+    builder: "linux-clang-dbg-x86"
+  }
+}
+job {
+  id: "linux-clang-rel-x64"
+  acl_sets: "default"
+  buildbucket: {
+    server: "cr-buildbucket.appspot.com"
+    bucket: "luci.dawn.ci"
+    builder: "linux-clang-rel-x64"
+  }
+}
+job {
+  id: "linux-clang-dbg-x86"
+  acl_sets: "default"
+  buildbucket: {
+    server: "cr-buildbucket.appspot.com"
+    bucket: "luci.dawn.ci"
+    builder: "linux-clang-rel-x86"
+  }
+}
+
+job {
+  id: "mac-dbg"
+  acl_sets: "default"
+  buildbucket: {
+    server: "cr-buildbucket.appspot.com"
+    bucket: "luci.dawn.ci"
+    builder: "mac-dbg"
+  }
+}
+job {
+  id: "mac-rel"
+  acl_sets: "default"
+  buildbucket: {
+    server: "cr-buildbucket.appspot.com"
+    bucket: "luci.dawn.ci"
+    builder: "mac-rel"
+  }
+}
+
+job {
+  id: "win-clang-dbg-x64"
+  acl_sets: "default"
+  buildbucket: {
+    server: "cr-buildbucket.appspot.com"
+    bucket: "luci.dawn.ci"
+    builder: "win-clang-dbg-x64"
+  }
+}
+job {
+  id: "win-clang-dbg-x86"
+  acl_sets: "default"
+  buildbucket: {
+    server: "cr-buildbucket.appspot.com"
+    bucket: "luci.dawn.ci"
+    builder: "win-clang-dbg-x86"
+  }
+}
+job {
+  id: "win-clang-rel-x64"
+  acl_sets: "default"
+  buildbucket: {
+    server: "cr-buildbucket.appspot.com"
+    bucket: "luci.dawn.ci"
+    builder: "win-clang-rel-x64"
+  }
+}
+job {
+  id: "win-clang-dbg-x86"
+  acl_sets: "default"
+  buildbucket: {
+    server: "cr-buildbucket.appspot.com"
+    bucket: "luci.dawn.ci"
+    builder: "win-clang-rel-x86"
+  }
+}
+job {
+  id: "win-msvc-dbg-x64"
+  acl_sets: "default"
+  buildbucket: {
+    server: "cr-buildbucket.appspot.com"
+    bucket: "luci.dawn.ci"
+    builder: "win-msvc-dbg-x64"
+  }
+}
+job {
+  id: "win-msvc-rel-x64"
+  acl_sets: "default"
+  buildbucket: {
+    server: "cr-buildbucket.appspot.com"
+    bucket: "luci.dawn.ci"
+    builder: "win-msvc-rel-x64"
+  }
+}
diff --git a/infra/config/global/project.cfg b/infra/config/global/project.cfg
new file mode 100644
index 0000000..b06b70f
--- /dev/null
+++ b/infra/config/global/project.cfg
@@ -0,0 +1,4 @@
+# For the schema of this file and documentation, see ProjectCfg message in
+# https://luci-config.appspot.com/schemas/projects:project.cfg
+name: "dawn"
+access: "group:all"  # The project is public, everybody can see build results.
diff --git a/infra/config/global/refs.cfg b/infra/config/global/refs.cfg
new file mode 100644
index 0000000..b287e22
--- /dev/null
+++ b/infra/config/global/refs.cfg
@@ -0,0 +1,6 @@
+# Refs configuration file. The documentation of the format can be found
+# at https://luci-config.appspot.com/schemas/projects:refs.cfg.
+refs {
+  name: "refs/heads/master"
+  config_path: "infra/config/branch"
+}