Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(71)

Unified Diff: infra/bots/recipe_modules/core/resources/upload_bench_results.py

Issue 2356813003: Attempt to fix nanobench upload (Closed)
Patch Set: Don't gzip locally Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | infra/bots/recipes/swarm_housekeeper.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: infra/bots/recipe_modules/core/resources/upload_bench_results.py
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 25cfcc263130954f272c537b13a90c15886a05ba..cf0ec7a5adbccc6ee0a447d188741a47b8e558b3 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 @@ def _UploadJSONResults(builder_name, build_number, dest_gsbase, gs_subdir,
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)
« no previous file with comments | « no previous file | infra/bots/recipes/swarm_housekeeper.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698