[infra] Switch from isolate to RBE-CAS

Bug: skia:10883
Change-Id: Ief129fe8c8dfdda6bb345578f21bcf800249ade2
Reviewed-on: https://skia-review.googlesource.com/c/lottie-ci/+/340845
Commit-Queue: Eric Boren <borenet@google.com>
Reviewed-by: Weston Tracey <westont@google.com>
diff --git a/DEPS b/DEPS
index 36fdc55..a6999ac 100644
--- a/DEPS
+++ b/DEPS
@@ -11,7 +11,7 @@
   # Three lines of non-changing comments so that
   # the commit queue can handle CLs rolling Skia
   # and whatever else without interference from each other.
-  'skia_revision': 'd6d7957648e91a2b43c5de3684dc5ebbfe3ebc7e',
+  'skia_revision': '3b31f68d2b1aa8399ea905f66f2b3fe377d808cc',
   # Three lines of non-changing comments so that
   # the commit queue can handle CLs rolling Skia
   # and whatever else without interference from each other.
diff --git a/go.sum b/go.sum
index 489fdb8..44d6261 100644
--- a/go.sum
+++ b/go.sum
@@ -2131,6 +2131,10 @@
 go.skia.org/infra v0.0.0-20201217154708-25854a97e536/go.mod h1:5q1SY6pVIsvuPD68rYiVzgjguBKFy1DlJN5UzFem3uk=
 go.skia.org/infra v0.0.0-20201221193112-e9c390189fa6 h1:Si4o3D+S8uveMzJlwP6Xpuo8hwwDMIJl/6w0Ub+6d8I=
 go.skia.org/infra v0.0.0-20201221193112-e9c390189fa6/go.mod h1:5q1SY6pVIsvuPD68rYiVzgjguBKFy1DlJN5UzFem3uk=
+go.skia.org/infra v0.0.0-20201202154606-0465c3c93699 h1:1Y4qJn9QboZrrux7v+/q4OonFk0SOpPc+Hb4DwcPfOk=
+go.skia.org/infra v0.0.0-20201202154606-0465c3c93699/go.mod h1:oFkIcc1CyrdaKdUCEdzTaEYrZ5VQilTafssIyqmDX5c=
+go.skia.org/infra v0.0.0-20201204114949-38985f19dfd1 h1:x1rKLSwjyk52Ns/iLX/efd7aIWgsK8EFfeoe3FIP3y4=
+go.skia.org/infra v0.0.0-20201204114949-38985f19dfd1/go.mod h1:Y9eqtwoOyMrt8v6BhHkKeowb5NtwW0QS7acq62C5hYA=
 go.starlark.net v0.0.0-20201118183435-e55f603d8c79/go.mod h1:5YFcFnRptTN+41758c2bMPiqpGg4zBfYji1IQz8wNFk=
 go.uber.org/atomic v1.3.2/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE=
 go.uber.org/atomic v1.4.0/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE=
diff --git a/infra/bots/gen_tasks.go b/infra/bots/gen_tasks.go
index 714ef93..4145e1a 100644
--- a/infra/bots/gen_tasks.go
+++ b/infra/bots/gen_tasks.go
@@ -9,9 +9,21 @@
 */
 
 import (
+	"fmt"
+
 	"go.skia.org/skia/infra/bots/gen_tasks_logic"
 )
 
 func main() {
+	fmt.Println("main start")
+	gen_tasks_logic.CAS_SPEC_WHOLE_REPO.Paths = append(gen_tasks_logic.CAS_SPEC_WHOLE_REPO.Paths,
+		"lottie-ci",
+	)
+	fmt.Println("set whole_repo paths")
+	gen_tasks_logic.CAS_SPEC_LOTTIE_CI.Paths = append(gen_tasks_logic.CAS_SPEC_LOTTIE_CI.Paths,
+		"lottie",
+	)
+	fmt.Println("set lottie-ci paths")
 	gen_tasks_logic.GenTasks(nil)
-}
+	fmt.Println("done")
+}
\ No newline at end of file
diff --git a/infra/bots/infra_tests.isolate b/infra/bots/infra_tests.isolate
deleted file mode 100644
index 9ea1dd7..0000000
--- a/infra/bots/infra_tests.isolate
+++ /dev/null
@@ -1,12 +0,0 @@
-{
-  'includes': [
-    '../../../skia/infra/bots/infra_tests.isolate',
-  ],
-  'variables': {
-    'files': [
-      '../../go.mod',
-      '../../go.sum',
-      './',
-    ],
-  },
-}
diff --git a/infra/bots/infra_tests.py b/infra/bots/infra_tests.py
index 603fcf2..149df46 100755
--- a/infra/bots/infra_tests.py
+++ b/infra/bots/infra_tests.py
@@ -22,7 +22,7 @@
   try:
     subprocess.check_output(cmd, cwd=cwd, stderr=subprocess.STDOUT)
   except subprocess.CalledProcessError as e:
-    return e.output
+    return 'Failed running %s: %s' % (cmd, e.output)
 
 
 def python_unit_tests(train):
@@ -34,7 +34,7 @@
 
 
 def gen_tasks_test(train):
-  cmd = ['go', 'run', 'gen_tasks.go']
+  cmd = ['go', 'run', 'gen_tasks.go', '--logtostderr']
   if not train:
     cmd.append('--test')
   try:
diff --git a/infra/bots/tasks.json b/infra/bots/tasks.json
index 31a1f8c..190f00c 100644
--- a/infra/bots/tasks.json
+++ b/infra/bots/tasks.json
@@ -45,6 +45,7 @@
           "path": "cache/vpython"
         }
       ],
+      "casSpec": "compile",
       "cipd_packages": [
         {
           "name": "infra/tools/luci-auth/${platform}",
@@ -106,7 +107,6 @@
       },
       "idempotent": true,
       "io_timeout_ns": 3600000000000,
-      "isolate": "../../../skia/infra/bots/compile.isolate",
       "max_attempts": 2,
       "outputs": [
         "build"
@@ -128,6 +128,7 @@
           "path": "cache/vpython"
         }
       ],
+      "casSpec": "run-recipe",
       "cipd_packages": [
         {
           "name": "infra/3pp/tools/git/linux-amd64",
@@ -195,11 +196,11 @@
         "log_location": "logdog://logs.chromium.org/skia/${SWARMING_TASK_ID}/+/annotations"
       },
       "io_timeout_ns": 3600000000000,
-      "isolate": "../../../skia/infra/bots/run_recipe.isolate",
       "max_attempts": 2,
       "service_account": "skia-external-compile-tasks@skia-swarming-bots.iam.gserviceaccount.com"
     },
     "Housekeeper-PerCommit-BundleRecipes": {
+      "casSpec": "recipes",
       "cipd_packages": [
         {
           "name": "infra/3pp/tools/cpython/linux-amd64",
@@ -245,8 +246,7 @@
           "cipd_bin_packages/bin"
         ]
       },
-      "idempotent": true,
-      "isolate": "../../../skia/infra/bots/recipes.isolate"
+      "idempotent": true
     },
     "Housekeeper-PerCommit-InfraTests": {
       "caches": [
@@ -271,6 +271,7 @@
           "path": "cache/vpython"
         }
       ],
+      "casSpec": "whole-repo",
       "cipd_packages": [
         {
           "name": "infra/3pp/tools/git/linux-amd64",
@@ -347,7 +348,6 @@
       },
       "idempotent": true,
       "io_timeout_ns": 3600000000000,
-      "isolate": "infra_tests.isolate",
       "max_attempts": 2,
       "service_account": "skia-external-compile-tasks@skia-swarming-bots.iam.gserviceaccount.com"
     },
@@ -358,6 +358,7 @@
           "path": "cache/vpython"
         }
       ],
+      "casSpec": "test",
       "cipd_packages": [
         {
           "name": "infra/tools/luci-auth/${platform}",
@@ -429,7 +430,6 @@
         "log_location": "logdog://logs.chromium.org/skia/${SWARMING_TASK_ID}/+/annotations"
       },
       "io_timeout_ns": 14400000000000,
-      "isolate": "../../../skia/infra/bots/test_skia_bundled.isolate",
       "max_attempts": 2,
       "outputs": [
         "test"
@@ -442,6 +442,7 @@
           "path": "cache/vpython"
         }
       ],
+      "casSpec": "lottie-ci",
       "cipd_packages": [
         {
           "name": "infra/tools/luci-auth/${platform}",
@@ -498,7 +499,6 @@
         "log_location": "logdog://logs.chromium.org/skia/${SWARMING_TASK_ID}/+/annotations"
       },
       "io_timeout_ns": 14400000000000,
-      "isolate": "../../../skia/infra/bots/lottie_ci.isolate",
       "max_attempts": 2,
       "outputs": [
         "test"
@@ -511,6 +511,7 @@
           "path": "cache/vpython"
         }
       ],
+      "casSpec": "run-recipe",
       "cipd_packages": [
         {
           "name": "infra/gsutil",
@@ -567,7 +568,6 @@
         "log_location": "logdog://logs.chromium.org/skia/${SWARMING_TASK_ID}/+/annotations"
       },
       "io_timeout_ns": 3600000000000,
-      "isolate": "../../../skia/infra/bots/swarm_recipe.isolate",
       "max_attempts": 2,
       "service_account": "skia-external-gm-uploader@skia-swarming-bots.iam.gserviceaccount.com"
     },
@@ -578,6 +578,7 @@
           "path": "cache/vpython"
         }
       ],
+      "casSpec": "run-recipe",
       "cipd_packages": [
         {
           "name": "infra/gsutil",
@@ -634,9 +635,231 @@
         "log_location": "logdog://logs.chromium.org/skia/${SWARMING_TASK_ID}/+/annotations"
       },
       "io_timeout_ns": 3600000000000,
-      "isolate": "../../../skia/infra/bots/swarm_recipe.isolate",
       "max_attempts": 2,
       "service_account": "skia-external-gm-uploader@skia-swarming-bots.iam.gserviceaccount.com"
     }
+  },
+  "casSpecs": {
+    "canvaskit": {
+      "root": "..",
+      "paths": [
+        "skia/infra/bots/run_recipe.py",
+        "skia/infra/canvaskit",
+        "skia/modules/canvaskit",
+        "skia/modules/pathkit/perf/perfReporter.js",
+        "skia/modules/pathkit/tests/testReporter.js"
+      ],
+      "excludes": [
+        "^(.*\\/)*\\.git(\\/.*)*$"
+      ]
+    },
+    "compile": {
+      "root": "..",
+      "paths": [
+        "skia/.clang-format",
+        "skia/.clang-tidy",
+        "skia/.gn",
+        "skia/BUILD.gn",
+        "skia/bench",
+        "skia/bin/fetch-clang-format",
+        "skia/bin/fetch-gn",
+        "skia/build/fuchsia",
+        "skia/build_overrides",
+        "skia/buildtools",
+        "skia/client_utils/android",
+        "skia/dm",
+        "skia/docs/examples",
+        "skia/example",
+        "skia/experimental",
+        "skia/fuzz",
+        "skia/gm",
+        "skia/gn",
+        "skia/include",
+        "skia/infra/bots/assets/android_ndk_darwin/VERSION",
+        "skia/infra/bots/assets/android_ndk_linux/VERSION",
+        "skia/infra/bots/assets/android_ndk_windows/VERSION",
+        "skia/infra/bots/assets/cast_toolchain/VERSION",
+        "skia/infra/bots/assets/clang_linux/VERSION",
+        "skia/infra/bots/assets/clang_win/VERSION",
+        "skia/infra/bots/run_recipe.py",
+        "skia/infra/canvaskit",
+        "skia/infra/pathkit",
+        "skia/modules",
+        "skia/platform_tools/android/apps/skottie/skottielib/src/main/cpp/native-lib.cpp",
+        "skia/platform_tools/android/launcher/skia_launcher.cpp",
+        "skia/platform_tools/android/vulkan/Skia_Vulkan_Android.h",
+        "skia/platform_tools/ios/app/LaunchScreen.storyboard",
+        "skia/platform_tools/libraries/include/arcore_c_api.h",
+        "skia/resources",
+        "skia/samplecode",
+        "skia/src",
+        "skia/tests",
+        "skia/third_party",
+        "skia/tools"
+      ],
+      "excludes": [
+        "^(.*\\/)*\\.git(\\/.*)*$"
+      ]
+    },
+    "empty": {
+      "digest": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855/0"
+    },
+    "lottie-ci": {
+      "root": "..",
+      "paths": [
+        "skia/infra/bots/run_recipe.py",
+        "skia/infra/lottiecap",
+        "skia/tools/lottie-web-perf",
+        "skia/tools/lottiecap",
+        "lottie"
+      ],
+      "excludes": [
+        "^(.*\\/)*\\.git(\\/.*)*$"
+      ]
+    },
+    "lottie-web": {
+      "root": "..",
+      "paths": [
+        "skia/infra/bots/run_recipe.py",
+        "skia/tools/lottie-web-perf"
+      ],
+      "excludes": [
+        "^(.*\\/)*\\.git(\\/.*)*$"
+      ]
+    },
+    "pathkit": {
+      "root": "..",
+      "paths": [
+        "skia/infra/bots/run_recipe.py",
+        "skia/infra/pathkit",
+        "skia/modules/pathkit"
+      ],
+      "excludes": [
+        "^(.*\\/)*\\.git(\\/.*)*$"
+      ]
+    },
+    "perf": {
+      "root": "..",
+      "paths": [
+        "skia/infra/bots/assets",
+        "skia/infra/bots/run_recipe.py",
+        "skia/platform_tools/ios/bin",
+        "skia/resources",
+        "skia/tools/valgrind.supp"
+      ],
+      "excludes": [
+        "^(.*\\/)*\\.git(\\/.*)*$"
+      ]
+    },
+    "puppeteer": {
+      "root": "../skia",
+      "paths": [
+        "tools/perf-canvaskit-puppeteer"
+      ],
+      "excludes": [
+        "^(.*\\/)*\\.git(\\/.*)*$"
+      ]
+    },
+    "recipes": {
+      "root": "..",
+      "paths": [
+        "skia/infra/config/recipes.cfg",
+        "skia/infra/bots/bundle_recipes.sh",
+        "skia/infra/bots/README.recipes.md",
+        "skia/infra/bots/recipe_modules",
+        "skia/infra/bots/recipes",
+        "skia/infra/bots/recipes.py"
+      ],
+      "excludes": [
+        "^(.*\\/)*\\.git(\\/.*)*$"
+      ]
+    },
+    "run-recipe": {
+      "root": "..",
+      "paths": [
+        "skia/infra/bots/run_recipe.py"
+      ],
+      "excludes": [
+        "^(.*\\/)*\\.git(\\/.*)*$"
+      ]
+    },
+    "skottie-wasm": {
+      "root": "..",
+      "paths": [
+        "skia/infra/bots/run_recipe.py",
+        "skia/tools/skottie-wasm-perf"
+      ],
+      "excludes": [
+        "^(.*\\/)*\\.git(\\/.*)*$"
+      ]
+    },
+    "skpbench": {
+      "root": "..",
+      "paths": [
+        "skia/infra/bots/assets",
+        "skia/infra/bots/run_recipe.py",
+        "skia/tools/skpbench",
+        "skia/tools/valgrind.supp"
+      ],
+      "excludes": [
+        "^(.*\\/)*\\.git(\\/.*)*$"
+      ]
+    },
+    "skqp": {
+      "root": "..",
+      "paths": [
+        "skia/infra/bots/run_recipe.py",
+        "skia/infra/skqp"
+      ],
+      "excludes": [
+        "^(.*\\/)*\\.git(\\/.*)*$"
+      ]
+    },
+    "task-drivers": {
+      "root": "..",
+      "paths": [
+        "skia/go.mod",
+        "skia/go.sum",
+        "skia/infra/bots/build_task_drivers.sh",
+        "skia/infra/bots/run_recipe.py",
+        "skia/infra/bots/task_drivers"
+      ],
+      "excludes": [
+        "^(.*\\/)*\\.git(\\/.*)*$"
+      ]
+    },
+    "test": {
+      "root": "..",
+      "paths": [
+        "skia/infra/bots/assets",
+        "skia/infra/bots/run_recipe.py",
+        "skia/platform_tools/ios/bin",
+        "skia/resources",
+        "skia/tools/valgrind.supp"
+      ],
+      "excludes": [
+        "^(.*\\/)*\\.git(\\/.*)*$"
+      ]
+    },
+    "wasm-gm": {
+      "root": "../skia",
+      "paths": [
+        "resources",
+        "tools/run-wasm-gm-tests"
+      ],
+      "excludes": [
+        "^(.*\\/)*\\.git(\\/.*)*$"
+      ]
+    },
+    "whole-repo": {
+      "root": "..",
+      "paths": [
+        "skia",
+        "lottie-ci"
+      ],
+      "excludes": [
+        "^(.*\\/)*\\.git(\\/.*)*$"
+      ]
+    }
   }
 }