Add Correctness tests for CanvasKit

Also make a CPU only and GPU only build (although
the latter still has a lot of CPU logic).

Bug: skia:
Change-Id: I857c2300021c2adb5344865c28e4ad3e8d332954
Reviewed-on: https://skia-review.googlesource.com/c/162022
Reviewed-by: Kevin Lubick <kjlubick@google.com>
diff --git a/infra/bots/gen_tasks.go b/infra/bots/gen_tasks.go
index d23283a..e3b8fc9 100644
--- a/infra/bots/gen_tasks.go
+++ b/infra/bots/gen_tasks.go
@@ -333,8 +333,7 @@
 	return nil
 }
 
-// linuxGceDimensions are the Swarming dimensions for Linux GCE
-// instances.
+// linuxGceDimensions are the Swarming dimensions for Linux GCE instances.
 func linuxGceDimensions(machineType string) []string {
 	return []string{
 		// Specify CPU to avoid running builds on bots with a more unique CPU.
@@ -347,6 +346,13 @@
 	}
 }
 
+func wasmGceDimensions() []string {
+	// There's limited parallelism for WASM builds, so we can get away with the medium
+	// instance instead of the beefy large instance.
+	// Docker being intsalled is the most important part.
+	return append(linuxGceDimensions(MACHINE_TYPE_MEDIUM), "docker_installed:true")
+}
+
 // deriveCompileTaskName returns the name of a compile task based on the given
 // job name.
 func deriveCompileTaskName(jobName string, parts map[string]string) string {
@@ -396,7 +402,12 @@
 			ec = []string{"PathKit"}
 		}
 		if strings.Contains(jobName, "CanvasKit") {
-			ec = []string{"CanvasKit"}
+			if parts["cpu_or_gpu"] == "CPU" {
+				ec = []string{"CanvasKit_CPU"}
+			} else {
+				ec = []string{"CanvasKit"}
+			}
+
 		}
 		if len(ec) > 0 {
 			jobNameMap["extra_config"] = strings.Join(ec, "_")
@@ -539,7 +550,11 @@
 				d["machine_type"] = MACHINE_TYPE_MEDIUM
 			}
 		} else {
-			if strings.Contains(parts["os"], "Win") {
+			if strings.Contains(parts["extra_config"], "CanvasKit") {
+				// GPU is defined for the WebGL version of CanvasKit, but
+				// it can still run on a GCE instance.
+				return wasmGceDimensions()
+			} else if strings.Contains(parts["os"], "Win") {
 				gpu, ok := map[string]string{
 					"GT610":         "10de:104a-23.21.13.9101",
 					"GTX660":        "10de:11c0-24.21.13.9882",
@@ -606,12 +621,7 @@
 		d["gpu"] = "none"
 		if d["os"] == DEFAULT_OS_DEBIAN {
 			if strings.Contains(parts["extra_config"], "PathKit") || strings.Contains(parts["extra_config"], "CanvasKit") {
-				// The build isn't really parallelized for pathkit, so
-				// the bulky machines don't buy us much. All we really need is
-				// docker, which was manually installed on the MEDIUM and LARGE
-				// Debian machines and should be on any newly-created Debian
-				// machines (after Aug 2018).
-				return linuxGceDimensions(MACHINE_TYPE_MEDIUM)
+				return wasmGceDimensions()
 			}
 			if parts["role"] == "BuildStats" {
 				// Doesn't require a lot of resources