Revert^2: LUCI: Use "device_type" dimension to select target bots."

Change-Id: I0553484a1f388cb39c4a0593c8c2dbd740badb17
diff --git a/tools/luci/config/generated/cr-buildbucket.cfg b/tools/luci/config/generated/cr-buildbucket.cfg
index f8a5337..1da398c 100644
--- a/tools/luci/config/generated/cr-buildbucket.cfg
+++ b/tools/luci/config/generated/cr-buildbucket.cfg
@@ -17,7 +17,8 @@
     builders {
       name: "angler-armv7-debug"
       swarming_host: "chromium-swarm.appspot.com"
-      dimensions: "builder:angler-armv7-debug"
+      dimensions: "device_type:bonito|oriole|walleye"
+      dimensions: "os:Android"
       dimensions: "pool:luci.art.ci"
       recipe {
         name: "art"
@@ -41,7 +42,8 @@
     builders {
       name: "angler-armv7-ndebug"
       swarming_host: "chromium-swarm.appspot.com"
-      dimensions: "builder:angler-armv7-ndebug"
+      dimensions: "device_type:bonito|oriole|walleye"
+      dimensions: "os:Android"
       dimensions: "pool:luci.art.ci"
       recipe {
         name: "art"
@@ -65,8 +67,8 @@
     builders {
       name: "angler-armv7-non-gen-cc"
       swarming_host: "chromium-swarm.appspot.com"
-      dimensions: "builder:angler-armv7-non-gen-cc"
       dimensions: "device_type:oriole"
+      dimensions: "os:Android"
       dimensions: "pool:luci.art.ci"
       recipe {
         name: "art"
@@ -90,7 +92,8 @@
     builders {
       name: "angler-armv8-debug"
       swarming_host: "chromium-swarm.appspot.com"
-      dimensions: "builder:angler-armv8-debug"
+      dimensions: "device_type:bonito|oriole|walleye"
+      dimensions: "os:Android"
       dimensions: "pool:luci.art.ci"
       recipe {
         name: "art"
@@ -114,7 +117,8 @@
     builders {
       name: "angler-armv8-ndebug"
       swarming_host: "chromium-swarm.appspot.com"
-      dimensions: "builder:angler-armv8-ndebug"
+      dimensions: "device_type:bonito|oriole|walleye"
+      dimensions: "os:Android"
       dimensions: "pool:luci.art.ci"
       recipe {
         name: "art"
@@ -138,8 +142,8 @@
     builders {
       name: "angler-armv8-non-gen-cc"
       swarming_host: "chromium-swarm.appspot.com"
-      dimensions: "builder:angler-armv8-non-gen-cc"
       dimensions: "device_type:oriole"
+      dimensions: "os:Android"
       dimensions: "pool:luci.art.ci"
       recipe {
         name: "art"
@@ -163,7 +167,8 @@
     builders {
       name: "bullhead-armv7-gcstress-ndebug"
       swarming_host: "chromium-swarm.appspot.com"
-      dimensions: "builder:bullhead-armv7-gcstress-ndebug"
+      dimensions: "device_type:bonito|oriole|walleye"
+      dimensions: "os:Android"
       dimensions: "pool:luci.art.ci"
       recipe {
         name: "art"
@@ -187,7 +192,8 @@
     builders {
       name: "bullhead-armv8-gcstress-debug"
       swarming_host: "chromium-swarm.appspot.com"
-      dimensions: "builder:bullhead-armv8-gcstress-debug"
+      dimensions: "device_type:bonito|oriole|walleye"
+      dimensions: "os:Android"
       dimensions: "pool:luci.art.ci"
       recipe {
         name: "art"
@@ -211,7 +217,8 @@
     builders {
       name: "bullhead-armv8-gcstress-ndebug"
       swarming_host: "chromium-swarm.appspot.com"
-      dimensions: "builder:bullhead-armv8-gcstress-ndebug"
+      dimensions: "device_type:bonito|oriole|walleye"
+      dimensions: "os:Android"
       dimensions: "pool:luci.art.ci"
       recipe {
         name: "art"
@@ -235,7 +242,8 @@
     builders {
       name: "fugu-debug"
       swarming_host: "chromium-swarm.appspot.com"
-      dimensions: "builder:fugu-debug"
+      dimensions: "device_type:fugu"
+      dimensions: "os:Android"
       dimensions: "pool:luci.art.ci"
       recipe {
         name: "art"
@@ -259,7 +267,8 @@
     builders {
       name: "fugu-ndebug"
       swarming_host: "chromium-swarm.appspot.com"
-      dimensions: "builder:fugu-ndebug"
+      dimensions: "device_type:fugu"
+      dimensions: "os:Android"
       dimensions: "pool:luci.art.ci"
       recipe {
         name: "art"
@@ -547,7 +556,8 @@
     builders {
       name: "walleye-armv7-poison-debug"
       swarming_host: "chromium-swarm.appspot.com"
-      dimensions: "builder:walleye-armv7-poison-debug"
+      dimensions: "device_type:bonito|oriole|walleye"
+      dimensions: "os:Android"
       dimensions: "pool:luci.art.ci"
       recipe {
         name: "art"
@@ -571,7 +581,8 @@
     builders {
       name: "walleye-armv8-poison-debug"
       swarming_host: "chromium-swarm.appspot.com"
-      dimensions: "builder:walleye-armv8-poison-debug"
+      dimensions: "device_type:bonito|oriole|walleye"
+      dimensions: "os:Android"
       dimensions: "pool:luci.art.ci"
       recipe {
         name: "art"
@@ -595,7 +606,8 @@
     builders {
       name: "walleye-armv8-poison-ndebug"
       swarming_host: "chromium-swarm.appspot.com"
-      dimensions: "builder:walleye-armv8-poison-ndebug"
+      dimensions: "device_type:bonito|oriole|walleye"
+      dimensions: "os:Android"
       dimensions: "pool:luci.art.ci"
       recipe {
         name: "art"
diff --git a/tools/luci/config/main.star b/tools/luci/config/main.star
index 144c323..b1ecde1 100755
--- a/tools/luci/config/main.star
+++ b/tools/luci/config/main.star
@@ -154,12 +154,7 @@
     refs = ["refs/heads/master-art"],
 )
 
-def ci_builder(name, category, short_name, dimensions=None):
-    dimensions = dimensions or {}  # Initialize if it is None.
-    if category.startswith("host"):
-      dimensions["os"] = ["Linux"]
-    else:
-      dimensions["builder"] = name
+def ci_builder(name, category, short_name, dimensions):
     luci.builder(
         name = name,
         bucket = "ci",
@@ -204,31 +199,37 @@
         short_name = short_name,
     )
 
-# userfault-GC configurations must be run on Pixel 6.
-userfault_gc_target_dims = {"device_type": "oriole"}
+# Dimensions specify which bots we can run on.
+host_dims = {"os": "Linux"}
+target_dims = {"os": "Android"}
+arm_target_dims = target_dims | {"device_type": "bonito|oriole|walleye"}
+x86_target_dims = target_dims | {"device_type": "fugu"}
 
-ci_builder("angler-armv7-debug", "angler|armv7", "dbg")
+# userfault-GC configurations must be run on Pixel 6.
+userfault_gc_target_dims = target_dims | {"device_type": "oriole"}
+
+ci_builder("angler-armv7-debug", "angler|armv7", "dbg", arm_target_dims)
 ci_builder("angler-armv7-non-gen-cc", "angler|armv7", "ngen", userfault_gc_target_dims)
-ci_builder("angler-armv7-ndebug", "angler|armv7", "ndbg")
-ci_builder("angler-armv8-debug", "angler|armv8", "dbg")
+ci_builder("angler-armv7-ndebug", "angler|armv7", "ndbg", arm_target_dims)
+ci_builder("angler-armv8-debug", "angler|armv8", "dbg", arm_target_dims)
 ci_builder("angler-armv8-non-gen-cc", "angler|armv8", "ngen", userfault_gc_target_dims)
-ci_builder("angler-armv8-ndebug", "angler|armv8", "ndbg")
-ci_builder("bullhead-armv7-gcstress-ndebug", "bullhead|armv7|gcstress", "dbg")
-ci_builder("bullhead-armv8-gcstress-debug", "bullhead|armv8|gcstress", "dbg")
-ci_builder("bullhead-armv8-gcstress-ndebug", "bullhead|armv8|gcstress", "ndbg")
-ci_builder("fugu-debug", "fugu", "dbg")
-ci_builder("fugu-ndebug", "fugu", "ndbg")
-ci_builder("host-x86-cms", "host|x86", "cms")
-ci_builder("host-x86-debug", "host|x86", "dbg")
-ci_builder("host-x86-ndebug", "host|x86", "ndbg")
-ci_builder("host-x86-gcstress-debug", "host|x86", "gcs")
-ci_builder("host-x86-poison-debug", "host|x86", "psn")
-ci_builder("host-x86_64-cdex-fast", "host|x64", "cdx")
-ci_builder("host-x86_64-cms", "host|x64", "cms")
-ci_builder("host-x86_64-debug", "host|x64", "dbg")
-ci_builder("host-x86_64-non-gen-cc", "host|x64", "ngen")
-ci_builder("host-x86_64-ndebug", "host|x64", "ndbg")
-ci_builder("host-x86_64-poison-debug", "host|x64", "psn")
-ci_builder("walleye-armv7-poison-debug", "walleye|armv7|poison", "dbg")
-ci_builder("walleye-armv8-poison-debug", "walleye|armv8|poison", "dbg")
-ci_builder("walleye-armv8-poison-ndebug", "walleye|armv8|poison", "ndbg")
+ci_builder("angler-armv8-ndebug", "angler|armv8", "ndbg", arm_target_dims)
+ci_builder("bullhead-armv7-gcstress-ndebug", "bullhead|armv7|gcstress", "dbg", arm_target_dims)
+ci_builder("bullhead-armv8-gcstress-debug", "bullhead|armv8|gcstress", "dbg", arm_target_dims)
+ci_builder("bullhead-armv8-gcstress-ndebug", "bullhead|armv8|gcstress", "ndbg", arm_target_dims)
+ci_builder("fugu-debug", "fugu", "dbg", x86_target_dims)
+ci_builder("fugu-ndebug", "fugu", "ndbg", x86_target_dims)
+ci_builder("host-x86-cms", "host|x86", "cms", host_dims)
+ci_builder("host-x86-debug", "host|x86", "dbg", host_dims)
+ci_builder("host-x86-ndebug", "host|x86", "ndbg", host_dims)
+ci_builder("host-x86-gcstress-debug", "host|x86", "gcs", host_dims)
+ci_builder("host-x86-poison-debug", "host|x86", "psn", host_dims)
+ci_builder("host-x86_64-cdex-fast", "host|x64", "cdx", host_dims)
+ci_builder("host-x86_64-cms", "host|x64", "cms", host_dims)
+ci_builder("host-x86_64-debug", "host|x64", "dbg", host_dims)
+ci_builder("host-x86_64-non-gen-cc", "host|x64", "ngen", host_dims)
+ci_builder("host-x86_64-ndebug", "host|x64", "ndbg", host_dims)
+ci_builder("host-x86_64-poison-debug", "host|x64", "psn", host_dims)
+ci_builder("walleye-armv7-poison-debug", "walleye|armv7|poison", "dbg", arm_target_dims)
+ci_builder("walleye-armv8-poison-debug", "walleye|armv8|poison", "dbg", arm_target_dims)
+ci_builder("walleye-armv8-poison-ndebug", "walleye|armv8|poison", "ndbg", arm_target_dims)