Attempt to fix nanobench upload
BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2356813003
Review-Url: https://codereview.chromium.org/2356813003
diff --git a/infra/bots/recipe_modules/core/resources/upload_bench_results.py b/infra/bots/recipe_modules/core/resources/upload_bench_results.py
index 25cfcc2..cf0ec7a 100755
--- a/infra/bots/recipe_modules/core/resources/upload_bench_results.py
+++ b/infra/bots/recipe_modules/core/resources/upload_bench_results.py
@@ -29,19 +29,12 @@
gs_dir = '/'.join(('trybot', gs_dir, build_number, issue_number))
full_path_to_upload = full_json_path
file_to_upload = os.path.basename(full_path_to_upload)
- http_header = ['Content-Type:application/json']
+ gzip_args = []
if gzipped:
- http_header.append('Content-Encoding:gzip')
- gzipped_file = os.path.join(tempfile.gettempdir(), file_to_upload)
- # Apply gzip.
- with open(full_path_to_upload, 'rb') as f_in:
- with gzip.open(gzipped_file, 'wb') as f_out:
- f_out.writelines(f_in)
- full_path_to_upload = gzipped_file
- cmd = ['python', gsutil_path]
- for header in http_header:
- cmd.extend(['-h', header])
- cmd.extend(['cp', '-a', 'public-read', full_path_to_upload,
+ gzip_args = ['-z', 'json']
+ cmd = ['python', gsutil_path, 'cp', '-a', 'public-read']
+ cmd.extend(gzip_args)
+ cmd.extend([full_path_to_upload,
'/'.join((dest_gsbase, gs_dir, file_to_upload))])
print ' '.join(cmd)
subprocess.check_call(cmd)
diff --git a/infra/bots/recipes/swarm_housekeeper.expected/Housekeeper-PerCommit-Trybot.json b/infra/bots/recipes/swarm_housekeeper.expected/Housekeeper-PerCommit-Trybot.json
index 2fdcad6..e520e21 100644
--- a/infra/bots/recipes/swarm_housekeeper.expected/Housekeeper-PerCommit-Trybot.json
+++ b/infra/bots/recipes/swarm_housekeeper.expected/Housekeeper-PerCommit-Trybot.json
@@ -43,7 +43,7 @@
"--githash",
"abc123",
"--gsutil_path",
- "[DEPOT_TOOLS]/third_party/gsutil/gsutil",
+ "[DEPOT_TOOLS]/gsutil.py",
"--issue_number",
"500"
],
diff --git a/infra/bots/recipes/swarm_housekeeper.expected/Housekeeper-PerCommit.json b/infra/bots/recipes/swarm_housekeeper.expected/Housekeeper-PerCommit.json
index 9be48d4..ea85e6e 100644
--- a/infra/bots/recipes/swarm_housekeeper.expected/Housekeeper-PerCommit.json
+++ b/infra/bots/recipes/swarm_housekeeper.expected/Housekeeper-PerCommit.json
@@ -38,7 +38,7 @@
"cmd": [
"python",
"RECIPE_MODULE[skia::core]/resources/generate_and_upload_doxygen.py",
- "[DEPOT_TOOLS]/third_party/gsutil/gsutil"
+ "[DEPOT_TOOLS]/gsutil.py"
],
"cwd": "[SLAVE_BUILD]/skia",
"env": {
@@ -57,7 +57,7 @@
"--githash",
"abc123",
"--gsutil_path",
- "[DEPOT_TOOLS]/third_party/gsutil/gsutil"
+ "[DEPOT_TOOLS]/gsutil.py"
],
"cwd": "[SLAVE_BUILD]/skia",
"env": {
diff --git a/infra/bots/recipes/swarm_housekeeper.py b/infra/bots/recipes/swarm_housekeeper.py
index 43e694c..e318463 100644
--- a/infra/bots/recipes/swarm_housekeeper.py
+++ b/infra/bots/recipes/swarm_housekeeper.py
@@ -42,8 +42,7 @@
# TODO(borenet): Detect static initializers?
- gsutil_path = api.path['depot_tools'].join('third_party', 'gsutil',
- 'gsutil')
+ gsutil_path = api.path['depot_tools'].join('gsutil.py')
if not api.vars.is_trybot:
api.run(
api.step,
diff --git a/infra/bots/recipes/swarm_trigger.expected/Perf-Ubuntu-GCC-GCE-CPU-AVX2-x86_64-Release-Trybot.json b/infra/bots/recipes/swarm_trigger.expected/Perf-Ubuntu-GCC-GCE-CPU-AVX2-x86_64-Release-Trybot.json
index 2c31930..a5a2dcc 100644
--- a/infra/bots/recipes/swarm_trigger.expected/Perf-Ubuntu-GCC-GCE-CPU-AVX2-x86_64-Release-Trybot.json
+++ b/infra/bots/recipes/swarm_trigger.expected/Perf-Ubuntu-GCC-GCE-CPU-AVX2-x86_64-Release-Trybot.json
@@ -839,7 +839,7 @@
"5",
"[SLAVE_BUILD]/perfdata/Perf-Ubuntu-GCC-GCE-CPU-AVX2-x86_64-Release-Trybot/data",
"abc123",
- "[SLAVE_BUILD]/skia/infra/bots/.recipe_deps/depot_tools/third_party/gsutil/gsutil",
+ "[SLAVE_BUILD]/skia/infra/bots/.recipe_deps/depot_tools/gsutil.py",
"500"
],
"cwd": "[SLAVE_BUILD]/skia",
diff --git a/infra/bots/recipes/swarm_trigger.py b/infra/bots/recipes/swarm_trigger.py
index 04e5564..a272730 100644
--- a/infra/bots/recipes/swarm_trigger.py
+++ b/infra/bots/recipes/swarm_trigger.py
@@ -489,8 +489,7 @@
infra_step=True)
gsutil_path = api.path['slave_build'].join(
- 'skia', 'infra', 'bots', '.recipe_deps', 'depot_tools', 'third_party',
- 'gsutil', 'gsutil')
+ 'skia', 'infra', 'bots', '.recipe_deps', 'depot_tools', 'gsutil.py')
upload_args = [api.properties['buildername'], api.properties['buildnumber'],
perf_data_dir, got_revision, gsutil_path]
if is_trybot: