Update dimnesions for runners

This will change the dimensions to:
  - On windows: always windows machine
  - On internal: always internal (single machine)
  - On archive: use the archive machine, or any vacant normal machine
  - On all other: normal machines

Bug: 301889931
Change-Id: Id2819c5e643aa7bab5432e3def288c3af3f418b0
diff --git a/infra/config/global/generated/cr-buildbucket.cfg b/infra/config/global/generated/cr-buildbucket.cfg
index 4cac940..0e4e8a2 100644
--- a/infra/config/global/generated/cr-buildbucket.cfg
+++ b/infra/config/global/generated/cr-buildbucket.cfg
@@ -22,6 +22,7 @@
       name: "archive"
       swarming_host: "chrome-swarming.appspot.com"
       swarming_tags: "vpython:native-python-wrapper"
+      dimensions: "archive:true"
       dimensions: "cpu:x86-64"
       dimensions: "os:Ubuntu-20.04"
       dimensions: "pool:luci.r8.ci"
@@ -50,6 +51,7 @@
       name: "archive_release"
       swarming_host: "chrome-swarming.appspot.com"
       swarming_tags: "vpython:native-python-wrapper"
+      dimensions: "archive:true"
       dimensions: "cpu:x86-64"
       dimensions: "os:Ubuntu-20.04"
       dimensions: "pool:luci.r8.ci"
@@ -79,6 +81,7 @@
       swarming_host: "chrome-swarming.appspot.com"
       swarming_tags: "vpython:native-python-wrapper"
       dimensions: "cpu:x86-64"
+      dimensions: "normal:true"
       dimensions: "os:Ubuntu-20.04"
       dimensions: "pool:luci.r8.ci"
       exe {
@@ -107,6 +110,7 @@
       swarming_host: "chrome-swarming.appspot.com"
       swarming_tags: "vpython:native-python-wrapper"
       dimensions: "cpu:x86-64"
+      dimensions: "normal:true"
       dimensions: "os:Ubuntu-20.04"
       dimensions: "pool:luci.r8.ci"
       exe {
@@ -143,6 +147,7 @@
       name: "lib_desugar-archive-jdk11"
       swarming_host: "chrome-swarming.appspot.com"
       swarming_tags: "vpython:native-python-wrapper"
+      dimensions: "archive:true"
       dimensions: "cpu:x86-64"
       dimensions: "os:Ubuntu-20.04"
       dimensions: "pool:luci.r8.ci"
@@ -176,6 +181,7 @@
       name: "lib_desugar-archive-jdk11-legacy"
       swarming_host: "chrome-swarming.appspot.com"
       swarming_tags: "vpython:native-python-wrapper"
+      dimensions: "archive:true"
       dimensions: "cpu:x86-64"
       dimensions: "os:Ubuntu-20.04"
       dimensions: "pool:luci.r8.ci"
@@ -207,6 +213,7 @@
       name: "lib_desugar-archive-jdk8"
       swarming_host: "chrome-swarming.appspot.com"
       swarming_tags: "vpython:native-python-wrapper"
+      dimensions: "archive:true"
       dimensions: "cpu:x86-64"
       dimensions: "os:Ubuntu-20.04"
       dimensions: "pool:luci.r8.ci"
@@ -1514,6 +1521,7 @@
       swarming_host: "chrome-swarming.appspot.com"
       swarming_tags: "vpython:native-python-wrapper"
       dimensions: "cpu:x86-64"
+      dimensions: "normal:true"
       dimensions: "os:Ubuntu-20.04"
       dimensions: "pool:luci.r8.ci"
       exe {
@@ -1550,6 +1558,7 @@
       swarming_host: "chrome-swarming.appspot.com"
       swarming_tags: "vpython:native-python-wrapper"
       dimensions: "cpu:x86-64"
+      dimensions: "normal:true"
       dimensions: "os:Ubuntu-20.04"
       dimensions: "pool:luci.r8.ci"
       exe {
@@ -1658,6 +1667,7 @@
       swarming_host: "chrome-swarming.appspot.com"
       swarming_tags: "vpython:native-python-wrapper"
       dimensions: "cpu:x86-64"
+      dimensions: "normal:true"
       dimensions: "os:Ubuntu-20.04"
       dimensions: "pool:luci.r8.ci"
       exe {
@@ -1691,6 +1701,7 @@
       swarming_host: "chrome-swarming.appspot.com"
       swarming_tags: "vpython:native-python-wrapper"
       dimensions: "cpu:x86-64"
+      dimensions: "normal:true"
       dimensions: "os:Ubuntu-20.04"
       dimensions: "pool:luci.r8.ci"
       exe {
@@ -1724,6 +1735,7 @@
       swarming_host: "chrome-swarming.appspot.com"
       swarming_tags: "vpython:native-python-wrapper"
       dimensions: "cpu:x86-64"
+      dimensions: "normal:true"
       dimensions: "os:Ubuntu-20.04"
       dimensions: "pool:luci.r8.ci"
       exe {
@@ -1752,6 +1764,7 @@
       swarming_host: "chrome-swarming.appspot.com"
       swarming_tags: "vpython:native-python-wrapper"
       dimensions: "cpu:x86-64"
+      dimensions: "normal:true"
       dimensions: "os:Windows-10"
       dimensions: "pool:luci.r8.ci"
       exe {
@@ -1786,6 +1799,7 @@
       swarming_host: "chrome-swarming.appspot.com"
       swarming_tags: "vpython:native-python-wrapper"
       dimensions: "cpu:x86-64"
+      dimensions: "normal:true"
       dimensions: "os:Windows-10"
       dimensions: "pool:luci.r8.ci"
       exe {
diff --git a/infra/config/global/main.star b/infra/config/global/main.star
index 9013087..86bbec8 100755
--- a/infra/config/global/main.star
+++ b/infra/config/global/main.star
@@ -168,7 +168,12 @@
     "--archive_failures"
 ]
 
-def get_dimensions(windows=False, internal=False, normal=False, smali=False):
+def get_dimensions(windows=False, internal=False, archive=False):
+  # We use the following setup:
+  #   windows -> always windows machine
+  #   internal -> always internal, single small, machine
+  #   archie -> archive or normal machines (normal machines set archive)
+  #   all_other -> normal linux machines
   dimensions = {
     "cpu" : "x86-64",
     "pool" : "luci.r8.ci"
@@ -179,7 +184,9 @@
     dimensions["os"] = "Ubuntu-20.04"
   if internal:
     dimensions["internal"] = "true"
-  if normal:
+  elif archive:
+    dimensions["archive"] = "true"
+  else:
     dimensions["normal"] = "true"
   return dimensions
 
@@ -224,7 +231,7 @@
     max_concurrent_invocations = 1,
     category=None,
     release_trigger=None):
-  dimensions = dimensions if dimensions else get_dimensions(normal=True)
+  dimensions = dimensions if dimensions else get_dimensions()
   for name in [name, name + "_release"]:
     r8_builder(
         name = name,
@@ -273,7 +280,7 @@
     r8_builder(
         name,
         category = "library_desugar" if desugar else "archive",
-        dimensions = get_dimensions(),
+        dimensions = get_dimensions(archive=True),
         triggering_policy = scheduler.policy(
             kind = scheduler.GREEDY_BATCHING_KIND,
             max_batch_size = 1,
@@ -309,7 +316,7 @@
   name = "linux-dex_default-new_gradle",
   execution_timeout = time.hour * 6,
   expiration_timeout = time.hour * 35,
-  dimensions = get_dimensions(normal=True),
+  dimensions = get_dimensions(),
   max_concurrent_invocations = 1,
   properties = {
     "test_options" : ["--runtimes=dex-default", "--command_cache_dir=/tmp/ccache", "--new-gradle"] + common_test_options,
@@ -455,7 +462,7 @@
     "smali",
     category = "aux",
     trigger = False,
-    dimensions = get_dimensions(smali=True),
+    dimensions = get_dimensions(),
     triggering_policy = scheduler.policy(
         kind = scheduler.GREEDY_BATCHING_KIND,
         max_concurrent_invocations = 1,