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

Unified Diff: infra/bots/recipes/upload_dm_results.py

Issue 2360203004: Add swarming task for upload_dm_results (Closed)
Patch Set: gzip 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
Index: infra/bots/recipes/upload_dm_results.py
diff --git a/infra/bots/recipes/upload_dm_results.py b/infra/bots/recipes/upload_dm_results.py
new file mode 100644
index 0000000000000000000000000000000000000000..27cab8bd04c66e0cf25dcf9ace27a92663adf0cf
--- /dev/null
+++ b/infra/bots/recipes/upload_dm_results.py
@@ -0,0 +1,97 @@
+# Copyright 2016 The Chromium Authors. All rights reserved.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+
+
+# Recipe for uploading DM results.
+
+
+DEPS = [
+ 'recipe_engine/json',
+ 'recipe_engine/path',
+ 'recipe_engine/properties',
+ 'recipe_engine/shutil',
+ 'recipe_engine/step',
+ 'recipe_engine/time',
+]
+
+
+DM_JSON = 'dm.json'
+GS_BUCKET = 'gs://chromium-skia-gm'
+VERBOSE_LOG = 'verbose.log'
+
+
+def RunSteps(api):
+ builder_name = api.properties['buildername']
+ revision = api.properties['revision']
+ issue = str(api.properties.get('issue', ''))
+ patchset = str(api.properties.get('patchset', ''))
+
+ results_dir = api.path['cwd'].join('dm')
+
+ # Validate the JSON file.
+ json_file = results_dir.join(DM_JSON)
+ api.json.read('validate dm.json', json_file)
+
+ # Move dm.json and verbose.log to their own directory.
+ log_file = results_dir.join(VERBOSE_LOG)
+ tmp_dir = api.path['cwd'].join('tmp_upload')
+ api.shutil.makedirs('tmp dir', tmp_dir, infra_step=True)
+ api.shutil.copy('copy dm.json', json_file, tmp_dir)
+ api.shutil.copy('copy verbose.log', log_file, tmp_dir)
+ api.shutil.remove('rm old dm.json', json_file)
+ api.shutil.remove('rm old verbose.log', log_file)
+
+ # Upload the images.
+ # TODO(borenet): Are the permissions correct? We want only Google-readable.
borenet 2016/09/23 15:56:39 It *seems* to be correct, eg. Old upload: http://
stephana 2016/09/26 16:11:24 We should set this to the new bucket before we lan
borenet 2016/09/26 17:35:38 Changed to use the new bucket, and the default per
+ image_dest_path = '/'.join((GS_BUCKET, 'dm-images-v1-test'))
+ api.step(
+ 'upload images',
+ cmd=['gsutil', 'cp', results_dir.join('*'), image_dest_path],
+ )
+
+ # Upload the JSON summary and verbose.log.
+ now = api.time.utcnow()
+ # TODO(borenet): These used to also be keyed by build number, which is no
+ # longer a concept. What should we use instead?
borenet 2016/09/23 15:56:39 For nanobench results we don't use a build number;
stephana 2016/09/26 16:11:24 Per our offline conversation we should inject a ti
borenet 2016/09/26 17:35:38 Added the timestamp.
+ summary_dest_path = '/'.join([
+ 'dm-json-v1-test',
+ str(now.year ).zfill(4),
+ str(now.month).zfill(2),
+ str(now.day ).zfill(2),
+ str(now.hour ).zfill(2),
+ revision,
+ builder_name])
+
+ # Trybot results are further siloed by issue/patchset.
+ if builder_name.endswith('-Trybot'):
+ if not (issue and patchset): # pragma: nocover
+ raise Exception('issue and patchset properties are required for trybots.')
+ summary_dest_path = '/'.join(('trybot', summary_dest_path, issue, patchset))
+
+ summary_dest_path = '/'.join((GS_BUCKET, summary_dest_path))
+
+ api.step(
+ 'upload JSON and logs',
+ cmd=['gsutil', 'cp', '-Z', tmp_dir.join('*'), summary_dest_path],
+ )
+
+
+def GenTests(api):
+ builder = 'Test-Ubuntu-GCC-GCE-CPU-AVX2-x86_64-Debug'
+ yield (
+ api.test('normal_bot') +
+ api.properties(buildername=builder,
+ revision='abc123',
+ path_config='kitchen')
+ )
+
+ builder = 'Test-Ubuntu-GCC-GCE-CPU-AVX2-x86_64-Debug-Trybot'
+ yield (
+ api.test('trybot') +
+ api.properties(buildername=builder,
+ revision='abc123',
+ path_config='kitchen',
+ issue='12345',
+ patchset='1002')
+ )

Powered by Google App Engine
This is Rietveld 408576698