Add LUCI configs using lucicfg.

Bug: 954455
Change-Id: If457cb56be7f76a68737ed0235e569cd7bef8f1f
diff --git a/infra/config/generated/commit-queue.cfg b/infra/config/generated/commit-queue.cfg
new file mode 100644
index 0000000..1d22b5f
--- /dev/null
+++ b/infra/config/generated/commit-queue.cfg
@@ -0,0 +1,34 @@
+# Auto-generated by lucicfg.
+# Do not modify manually.
+#
+# For the schema of this file, see Config message:
+#   https://luci-config.appspot.com/schemas/projects:commit-queue.cfg
+
+cq_status_host: "chromium-cq-status.appspot.com"
+config_groups: <
+  gerrit: <
+    url: "https://chromium-review.googlesource.com"
+    projects: <
+      name: "infra/goma/server"
+      ref_regexp: "refs/heads/master"
+    >
+  >
+  verifiers: <
+    gerrit_cq_ability: <
+      committer_list: "project-goma-server-tryjob-access"
+      dry_run_access_list: "project-chromium-tryjob-access"
+    >
+    tryjob: <
+      builders: <
+        name: "goma-server/try/linux_rel"
+      >
+      retry_config: <
+        single_quota: 1
+        global_quota: 2
+        failure_weight: 100
+        transient_failure_weight: 1
+        timeout_weight: 100
+      >
+    >
+  >
+>
diff --git a/infra/config/generated/cr-buildbucket.cfg b/infra/config/generated/cr-buildbucket.cfg
new file mode 100644
index 0000000..b1d3394
--- /dev/null
+++ b/infra/config/generated/cr-buildbucket.cfg
@@ -0,0 +1,30 @@
+# Auto-generated by lucicfg.
+# Do not modify manually.
+#
+# For the schema of this file, see BuildbucketCfg message:
+#   https://luci-config.appspot.com/schemas/projects:buildbucket.cfg
+
+buckets: <
+  name: "try"
+  acls: <
+    group: "all"
+  >
+  acls: <
+    role: SCHEDULER
+    group: "project-goma-server-tryjob-access"
+  >
+  swarming: <
+    builders: <
+      name: "linux_rel"
+      swarming_host: "chromium-swarm.appspot.com"
+      dimensions: "cpu:x86-64"
+      dimensions: "os:Ubuntu-16.04"
+      dimensions: "pool:luci.flex.try"
+      recipe: <
+        name: "goma_server"
+        cipd_package: "infra/recipe_bundles/chromium.googlesource.com/chromium/tools/build"
+        cipd_version: "refs/heads/master"
+      >
+    >
+  >
+>
diff --git a/infra/config/generated/luci-milo.cfg b/infra/config/generated/luci-milo.cfg
new file mode 100644
index 0000000..ac7aa23
--- /dev/null
+++ b/infra/config/generated/luci-milo.cfg
@@ -0,0 +1,14 @@
+# Auto-generated by lucicfg.
+# Do not modify manually.
+#
+# For the schema of this file, see Project message:
+#   https://luci-config.appspot.com/schemas/projects:luci-milo.cfg
+
+consoles: <
+  id: "Try Builders"
+  name: "Try Builders"
+  builders: <
+    name: "buildbucket/luci.goma-server.try/linux_rel"
+  >
+  builder_view_only: true
+>
diff --git a/infra/config/generated/project.cfg b/infra/config/generated/project.cfg
new file mode 100644
index 0000000..f15f1a0
--- /dev/null
+++ b/infra/config/generated/project.cfg
@@ -0,0 +1,8 @@
+# Auto-generated by lucicfg.
+# Do not modify manually.
+#
+# For the schema of this file, see ProjectCfg message:
+#   https://luci-config.appspot.com/schemas/projects:project.cfg
+
+name: "goma-server"
+access: "group:all"
diff --git a/infra/config/main.star b/infra/config/main.star
new file mode 100755
index 0000000..7a52be2
--- /dev/null
+++ b/infra/config/main.star
@@ -0,0 +1,91 @@
+#!/usr/bin/env lucicfg
+
+luci.project(
+    name = "goma-server",
+
+    buildbucket = "cr-buildbucket.appspot.com",
+    logdog = "luci-logdog.appspot.com",
+    milo = "luci-milo.appspot.com",
+    swarming = "chromium-swarm.appspot.com",
+
+    acls = [
+        # This project is publicly readable.
+        acl.entry(
+            roles = [
+                acl.BUILDBUCKET_READER,
+                acl.LOGDOG_READER,
+                acl.PROJECT_CONFIGS_READER,
+                acl.SCHEDULER_READER,
+            ],
+            groups = "all",
+        ),
+        # Allow committers to use CQ and to force-trigger and stop CI builds.
+        acl.entry(
+            roles = [
+                acl.SCHEDULER_OWNER,
+                acl.CQ_COMMITTER,
+            ],
+            groups = "project-goma-server-tryjob-access"
+        ),
+        # Ability to launch CQ dry runs.
+        acl.entry(
+            roles = acl.CQ_DRY_RUNNER,
+            groups = "project-chromium-tryjob-access"
+        ),
+
+        acl.entry(
+            roles = acl.LOGDOG_WRITER,
+            groups = "luci-logdog-chromium-writers"
+        ),
+    ],
+)
+
+luci.cq(status_host = "chromium-cq-status.appspot.com")
+
+luci.bucket(
+    name = "try",
+    acls = [
+        # Allow launching tryjobs directly (in addition to doing it through CQ).
+        acl.entry(
+            roles = acl.BUILDBUCKET_TRIGGERER,
+            groups = "project-goma-server-tryjob-access",
+        ),
+    ]
+)
+
+
+# The Milo builder list with all pre-submit builders, referenced below.
+luci.list_view(
+    name = "Try Builders",
+)
+
+# The CQ group with all pre-submit builders, referenced below.
+luci.cq_group(
+    name = "Main CQ",
+    watch = cq.refset("https://chromium-review.googlesource.com/infra/goma/server"),
+)
+luci.builder(
+    name = "linux_rel",
+    bucket = "try",
+    executable = luci.recipe(
+        name = "goma_server",
+        cipd_package = "infra/recipe_bundles/chromium.googlesource.com/chromium/tools/build",
+    ),
+    dimensions = {
+        "pool": "luci.flex.try",
+        "os": "Ubuntu-16.04",
+        "cpu": "x86-64",
+    },
+)
+
+# Add to the CQ.
+luci.cq_tryjob_verifier(
+    builder = "try/linux_rel",
+    cq_group = "Main CQ",
+)
+
+# And also to the pre-submit builders list.
+luci.list_view_entry(
+    builder = "try/linux_rel",
+    list_view = "Try Builders",
+)
diff --git a/infra/config/project.cfg b/infra/config/project.cfg
deleted file mode 100644
index 118806b..0000000
--- a/infra/config/project.cfg
+++ /dev/null
@@ -1,4 +0,0 @@
-# For the schema of this file and documentation, see ProjectCfg message in
-# https://luci-config.appspot.com/schemas/projects:project.cfg
-name: "goma-server"
-access: "group:all" # public