Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 # Copyright 2016 The Chromium Authors. All rights reserved. | |
| 2 # Use of this source code is governed by a BSD-style license that can be | |
| 3 # found in the LICENSE file. | |
| 4 | |
| 5 | |
| 6 # Recipe for uploading DM results. | |
| 7 | |
| 8 | |
| 9 DEPS = [ | |
| 10 'recipe_engine/json', | |
| 11 'recipe_engine/path', | |
| 12 'recipe_engine/properties', | |
| 13 'recipe_engine/shutil', | |
| 14 'recipe_engine/step', | |
| 15 'recipe_engine/time', | |
| 16 ] | |
| 17 | |
| 18 | |
| 19 DM_JSON = 'dm.json' | |
| 20 GS_BUCKET = 'gs://chromium-skia-gm' | |
| 21 VERBOSE_LOG = 'verbose.log' | |
| 22 | |
| 23 | |
| 24 def RunSteps(api): | |
| 25 builder_name = api.properties['buildername'] | |
| 26 revision = api.properties['revision'] | |
| 27 issue = str(api.properties.get('issue', '')) | |
| 28 patchset = str(api.properties.get('patchset', '')) | |
| 29 | |
| 30 results_dir = api.path['cwd'].join('dm') | |
| 31 | |
| 32 # Validate the JSON file. | |
| 33 json_file = results_dir.join(DM_JSON) | |
| 34 api.json.read('validate dm.json', json_file) | |
| 35 | |
| 36 # Move dm.json and verbose.log to their own directory. | |
| 37 log_file = results_dir.join(VERBOSE_LOG) | |
| 38 tmp_dir = api.path['cwd'].join('tmp_upload') | |
| 39 api.shutil.makedirs('tmp dir', tmp_dir, infra_step=True) | |
| 40 api.shutil.copy('copy dm.json', json_file, tmp_dir) | |
| 41 api.shutil.copy('copy verbose.log', log_file, tmp_dir) | |
| 42 api.shutil.remove('rm old dm.json', json_file) | |
| 43 api.shutil.remove('rm old verbose.log', log_file) | |
| 44 | |
| 45 # Upload the images. | |
| 46 # 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
| |
| 47 image_dest_path = '/'.join((GS_BUCKET, 'dm-images-v1-test')) | |
| 48 api.step( | |
| 49 'upload images', | |
| 50 cmd=['gsutil', 'cp', results_dir.join('*'), image_dest_path], | |
| 51 ) | |
| 52 | |
| 53 # Upload the JSON summary and verbose.log. | |
| 54 now = api.time.utcnow() | |
| 55 # TODO(borenet): These used to also be keyed by build number, which is no | |
| 56 # 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.
| |
| 57 summary_dest_path = '/'.join([ | |
| 58 'dm-json-v1-test', | |
| 59 str(now.year ).zfill(4), | |
| 60 str(now.month).zfill(2), | |
| 61 str(now.day ).zfill(2), | |
| 62 str(now.hour ).zfill(2), | |
| 63 revision, | |
| 64 builder_name]) | |
| 65 | |
| 66 # Trybot results are further siloed by issue/patchset. | |
| 67 if builder_name.endswith('-Trybot'): | |
| 68 if not (issue and patchset): # pragma: nocover | |
| 69 raise Exception('issue and patchset properties are required for trybots.') | |
| 70 summary_dest_path = '/'.join(('trybot', summary_dest_path, issue, patchset)) | |
| 71 | |
| 72 summary_dest_path = '/'.join((GS_BUCKET, summary_dest_path)) | |
| 73 | |
| 74 api.step( | |
| 75 'upload JSON and logs', | |
| 76 cmd=['gsutil', 'cp', '-Z', tmp_dir.join('*'), summary_dest_path], | |
| 77 ) | |
| 78 | |
| 79 | |
| 80 def GenTests(api): | |
| 81 builder = 'Test-Ubuntu-GCC-GCE-CPU-AVX2-x86_64-Debug' | |
| 82 yield ( | |
| 83 api.test('normal_bot') + | |
| 84 api.properties(buildername=builder, | |
| 85 revision='abc123', | |
| 86 path_config='kitchen') | |
| 87 ) | |
| 88 | |
| 89 builder = 'Test-Ubuntu-GCC-GCE-CPU-AVX2-x86_64-Debug-Trybot' | |
| 90 yield ( | |
| 91 api.test('trybot') + | |
| 92 api.properties(buildername=builder, | |
| 93 revision='abc123', | |
| 94 path_config='kitchen', | |
| 95 issue='12345', | |
| 96 patchset='1002') | |
| 97 ) | |
| OLD | NEW |