Use right bucket for buildstats

Additionally, include the revision name in the json file name
to avoid collisions.

Bug: skia:
Change-Id: I6601c28679f82406721d740041a60077b460c0f4
Reviewed-on: https://skia-review.googlesource.com/c/160560
Reviewed-by: Eric Boren <borenet@google.com>
diff --git a/infra/bots/gen_tasks.go b/infra/bots/gen_tasks.go
index 7a13538..e2705f6 100644
--- a/infra/bots/gen_tasks.go
+++ b/infra/bots/gen_tasks.go
@@ -312,7 +312,7 @@
 		Dependencies: []string{BUNDLE_RECIPES_NAME},
 		Dimensions:   dimensions,
 		EnvPrefixes: map[string][]string{
-			"PATH": []string{"cipd_bin_packages", "cipd_bin_packages/bin"},
+			"PATH":                    []string{"cipd_bin_packages", "cipd_bin_packages/bin"},
 			"VPYTHON_VIRTUALENV_ROOT": []string{"cache/vpython"},
 		},
 		ExtraTags: map[string]string{
@@ -997,9 +997,9 @@
 	// Always upload the results (just don't run the task otherwise.)
 	uploadName := fmt.Sprintf("%s%s%s", PREFIX_UPLOAD, jobNameSchema.Sep, name)
 	extraProps := map[string]string{
-		"gs_bucket": CONFIG.GsBucketCalm,
+		"gs_bucket": CONFIG.GsBucketNano,
 	}
-	uploadTask := kitchenTask(name, "upload_buildstats_results", "swarm_recipe.isolate", SERVICE_ACCOUNT_UPLOAD_CALMBENCH, linuxGceDimensions(MACHINE_TYPE_SMALL), extraProps, OUTPUT_NONE)
+	uploadTask := kitchenTask(name, "upload_buildstats_results", "swarm_recipe.isolate", SERVICE_ACCOUNT_UPLOAD_NANO, linuxGceDimensions(MACHINE_TYPE_SMALL), extraProps, OUTPUT_NONE)
 	uploadTask.CipdPackages = append(uploadTask.CipdPackages, CIPD_PKGS_GSUTIL...)
 	uploadTask.Dependencies = append(uploadTask.Dependencies, name)
 	b.MustAddTask(uploadName, uploadTask)
diff --git a/infra/bots/recipes/upload_buildstats_results.expected/normal_bot.json b/infra/bots/recipes/upload_buildstats_results.expected/normal_bot.json
index 95daa36..56e24fb 100644
--- a/infra/bots/recipes/upload_buildstats_results.expected/normal_bot.json
+++ b/infra/bots/recipes/upload_buildstats_results.expected/normal_bot.json
@@ -27,7 +27,7 @@
       "-z",
       "json",
       "[START_DIR]/perf/buildstats_abc123.json",
-      "gs://skia-perf/buildstats-json-v1/2012/05/14/12/BuildStats-Debian9-EMCC-wasm-Release-PathKit/buildstats_abc123.json"
+      "gs://skia-perf/buildstats-json-v1/2012/05/14/12/BuildStats-Debian9-EMCC-wasm-Release-PathKit/abc123_buildstats_abc123.json"
     ],
     "infra_step": true,
     "name": "upload [START_DIR]/perf/buildstats_abc123.json"
@@ -39,7 +39,7 @@
       "-z",
       "json",
       "[START_DIR]/perf/buildstats_def.json",
-      "gs://skia-perf/buildstats-json-v1/2012/05/14/12/BuildStats-Debian9-EMCC-wasm-Release-PathKit/buildstats_def.json"
+      "gs://skia-perf/buildstats-json-v1/2012/05/14/12/BuildStats-Debian9-EMCC-wasm-Release-PathKit/abc123_buildstats_def.json"
     ],
     "infra_step": true,
     "name": "upload [START_DIR]/perf/buildstats_def.json"
diff --git a/infra/bots/recipes/upload_buildstats_results.expected/trybot.json b/infra/bots/recipes/upload_buildstats_results.expected/trybot.json
index 9890bf0..9fe9a47 100644
--- a/infra/bots/recipes/upload_buildstats_results.expected/trybot.json
+++ b/infra/bots/recipes/upload_buildstats_results.expected/trybot.json
@@ -27,7 +27,7 @@
       "-z",
       "json",
       "[START_DIR]/perf/buildstats_abc123.json",
-      "gs://skia-perf/trybot/buildstats-json-v1/2012/05/14/12/BuildStats-Debian9-EMCC-wasm-Release-PathKit/456789/12/buildstats_abc123.json"
+      "gs://skia-perf/trybot/buildstats-json-v1/2012/05/14/12/BuildStats-Debian9-EMCC-wasm-Release-PathKit/456789/12/abc123_buildstats_abc123.json"
     ],
     "infra_step": true,
     "name": "upload [START_DIR]/perf/buildstats_abc123.json"
@@ -39,7 +39,7 @@
       "-z",
       "json",
       "[START_DIR]/perf/buildstats_def.json",
-      "gs://skia-perf/trybot/buildstats-json-v1/2012/05/14/12/BuildStats-Debian9-EMCC-wasm-Release-PathKit/456789/12/buildstats_def.json"
+      "gs://skia-perf/trybot/buildstats-json-v1/2012/05/14/12/BuildStats-Debian9-EMCC-wasm-Release-PathKit/456789/12/abc123_buildstats_def.json"
     ],
     "infra_step": true,
     "name": "upload [START_DIR]/perf/buildstats_def.json"
diff --git a/infra/bots/recipes/upload_buildstats_results.py b/infra/bots/recipes/upload_buildstats_results.py
index aff5954..ebf76c1 100644
--- a/infra/bots/recipes/upload_buildstats_results.py
+++ b/infra/bots/recipes/upload_buildstats_results.py
@@ -33,6 +33,7 @@
 
   for src in results:
     basename = api.path.basename(src)
+    basename = api.properties['revision'] + '_' + basename
     gs_path = '/'.join((
         'buildstats-json-v1', str(now.year).zfill(4),
         str(now.month).zfill(2), str(now.day).zfill(2), str(now.hour).zfill(2),
diff --git a/infra/bots/tasks.json b/infra/bots/tasks.json
index 4dca010..82f724e 100755
--- a/infra/bots/tasks.json
+++ b/infra/bots/tasks.json
@@ -68765,7 +68765,7 @@
         "-recipe",
         "upload_buildstats_results",
         "-properties",
-        "{\"$kitchen\":{\"devshell\":true,\"git_auth\":true},\"buildbucket_build_id\":\"<(BUILDBUCKET_BUILD_ID)\",\"buildername\":\"BuildStats-Debian9-EMCC-asmjs-Release-PathKit\",\"gs_bucket\":\"skia-calmbench\",\"patch_issue\":\"<(ISSUE)\",\"patch_ref\":\"<(PATCH_REF)\",\"patch_repo\":\"<(PATCH_REPO)\",\"patch_set\":\"<(PATCHSET)\",\"patch_storage\":\"<(PATCH_STORAGE)\",\"repository\":\"<(REPO)\",\"revision\":\"<(REVISION)\",\"swarm_out_dir\":\"output_ignored\"}",
+        "{\"$kitchen\":{\"devshell\":true,\"git_auth\":true},\"buildbucket_build_id\":\"<(BUILDBUCKET_BUILD_ID)\",\"buildername\":\"BuildStats-Debian9-EMCC-asmjs-Release-PathKit\",\"gs_bucket\":\"skia-perf\",\"patch_issue\":\"<(ISSUE)\",\"patch_ref\":\"<(PATCH_REF)\",\"patch_repo\":\"<(PATCH_REPO)\",\"patch_set\":\"<(PATCHSET)\",\"patch_storage\":\"<(PATCH_STORAGE)\",\"repository\":\"<(REPO)\",\"revision\":\"<(REVISION)\",\"swarm_out_dir\":\"output_ignored\"}",
         "-logdog-annotation-url",
         "logdog://logs.chromium.org/skia/<(TASK_ID)/+/annotations"
       ],
@@ -68795,7 +68795,7 @@
       },
       "io_timeout_ns": 3600000000000,
       "isolate": "swarm_recipe.isolate",
-      "service_account": "skia-external-calmbench-upload@skia-swarming-bots.iam.gserviceaccount.com"
+      "service_account": "skia-external-nano-uploader@skia-swarming-bots.iam.gserviceaccount.com"
     },
     "Upload-BuildStats-Debian9-EMCC-wasm-Release-PathKit": {
       "caches": [
@@ -68864,7 +68864,7 @@
         "-recipe",
         "upload_buildstats_results",
         "-properties",
-        "{\"$kitchen\":{\"devshell\":true,\"git_auth\":true},\"buildbucket_build_id\":\"<(BUILDBUCKET_BUILD_ID)\",\"buildername\":\"BuildStats-Debian9-EMCC-wasm-Release-PathKit\",\"gs_bucket\":\"skia-calmbench\",\"patch_issue\":\"<(ISSUE)\",\"patch_ref\":\"<(PATCH_REF)\",\"patch_repo\":\"<(PATCH_REPO)\",\"patch_set\":\"<(PATCHSET)\",\"patch_storage\":\"<(PATCH_STORAGE)\",\"repository\":\"<(REPO)\",\"revision\":\"<(REVISION)\",\"swarm_out_dir\":\"output_ignored\"}",
+        "{\"$kitchen\":{\"devshell\":true,\"git_auth\":true},\"buildbucket_build_id\":\"<(BUILDBUCKET_BUILD_ID)\",\"buildername\":\"BuildStats-Debian9-EMCC-wasm-Release-PathKit\",\"gs_bucket\":\"skia-perf\",\"patch_issue\":\"<(ISSUE)\",\"patch_ref\":\"<(PATCH_REF)\",\"patch_repo\":\"<(PATCH_REPO)\",\"patch_set\":\"<(PATCHSET)\",\"patch_storage\":\"<(PATCH_STORAGE)\",\"repository\":\"<(REPO)\",\"revision\":\"<(REVISION)\",\"swarm_out_dir\":\"output_ignored\"}",
         "-logdog-annotation-url",
         "logdog://logs.chromium.org/skia/<(TASK_ID)/+/annotations"
       ],
@@ -68894,7 +68894,7 @@
       },
       "io_timeout_ns": 3600000000000,
       "isolate": "swarm_recipe.isolate",
-      "service_account": "skia-external-calmbench-upload@skia-swarming-bots.iam.gserviceaccount.com"
+      "service_account": "skia-external-nano-uploader@skia-swarming-bots.iam.gserviceaccount.com"
     },
     "Upload-Calmbench-Debian9-Clang-GCE-CPU-AVX2-x86_64-Release-All": {
       "caches": [