2016-09-23 13:37:57 +00:00
|
|
|
# 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 nanobench results.
|
|
|
|
|
2021-11-17 14:56:04 +00:00
|
|
|
PYTHON_VERSION_COMPATIBILITY = "PY2+3"
|
2016-09-23 13:37:57 +00:00
|
|
|
|
|
|
|
DEPS = [
|
2017-05-13 02:09:38 +00:00
|
|
|
'recipe_engine/context',
|
2017-06-16 17:10:22 +00:00
|
|
|
'recipe_engine/file',
|
2017-04-10 12:19:10 +00:00
|
|
|
'recipe_engine/path',
|
2016-09-23 13:37:57 +00:00
|
|
|
'recipe_engine/properties',
|
2017-04-10 12:19:10 +00:00
|
|
|
'recipe_engine/step',
|
|
|
|
'recipe_engine/time',
|
2019-10-08 00:11:36 +00:00
|
|
|
'vars',
|
2016-09-23 13:37:57 +00:00
|
|
|
]
|
|
|
|
|
|
|
|
|
|
|
|
def RunSteps(api):
|
2018-10-08 17:58:47 +00:00
|
|
|
# Upload the nanobench results.
|
2019-10-08 00:11:36 +00:00
|
|
|
api.vars.setup()
|
2017-04-10 12:19:10 +00:00
|
|
|
|
|
|
|
now = api.time.utcnow()
|
2018-06-20 17:23:16 +00:00
|
|
|
src_path = api.path['start_dir'].join('perf')
|
2017-05-13 02:09:38 +00:00
|
|
|
with api.context(cwd=src_path):
|
2017-06-16 17:10:22 +00:00
|
|
|
results = api.file.glob_paths(
|
2017-04-10 12:19:10 +00:00
|
|
|
'find results',
|
2017-06-16 17:10:22 +00:00
|
|
|
src_path,
|
|
|
|
'*.json',
|
|
|
|
test_data=['nanobench_abc123.json'])
|
2017-04-10 12:19:10 +00:00
|
|
|
if len(results) != 1: # pragma: nocover
|
|
|
|
raise Exception('Unable to find nanobench or skpbench JSON file!')
|
|
|
|
|
|
|
|
src = results[0]
|
|
|
|
basename = api.path.basename(src)
|
|
|
|
gs_path = '/'.join((
|
|
|
|
'nano-json-v1', str(now.year).zfill(4),
|
|
|
|
str(now.month).zfill(2), str(now.day).zfill(2), str(now.hour).zfill(2),
|
2019-10-08 00:11:36 +00:00
|
|
|
api.vars.builder_name))
|
2017-04-10 12:19:10 +00:00
|
|
|
|
2019-10-08 00:11:36 +00:00
|
|
|
if api.vars.is_trybot:
|
|
|
|
gs_path = '/'.join(('trybot', gs_path,
|
|
|
|
str(api.vars.issue), str(api.vars.patchset)))
|
2017-04-10 12:19:10 +00:00
|
|
|
|
|
|
|
dst = '/'.join((
|
|
|
|
'gs://%s' % api.properties['gs_bucket'], gs_path, basename))
|
|
|
|
|
|
|
|
api.step(
|
|
|
|
'upload',
|
|
|
|
cmd=['gsutil', 'cp', '-z', 'json', src, dst],
|
|
|
|
infra_step=True)
|
2016-09-23 13:37:57 +00:00
|
|
|
|
|
|
|
|
|
|
|
def GenTests(api):
|
2020-04-07 01:27:14 +00:00
|
|
|
builder = 'Perf-Debian10-Clang-GCE-CPU-AVX2-x86_64-All-Debug'
|
2016-09-23 13:37:57 +00:00
|
|
|
yield (
|
2017-04-10 12:19:10 +00:00
|
|
|
api.test('normal_bot') +
|
|
|
|
api.properties(buildername=builder,
|
2017-02-06 20:38:41 +00:00
|
|
|
gs_bucket='skia-perf',
|
2016-09-23 13:37:57 +00:00
|
|
|
revision='abc123',
|
|
|
|
path_config='kitchen')
|
|
|
|
)
|
2017-04-10 12:19:10 +00:00
|
|
|
|
|
|
|
yield (
|
|
|
|
api.test('trybot') +
|
|
|
|
api.properties(buildername=builder,
|
|
|
|
gs_bucket='skia-perf',
|
|
|
|
revision='abc123',
|
2019-10-08 00:11:36 +00:00
|
|
|
path_config='kitchen') +
|
2017-04-10 13:56:10 +00:00
|
|
|
api.properties.tryserver(
|
|
|
|
buildername=builder,
|
|
|
|
gerrit_project='skia',
|
|
|
|
gerrit_url='https://skia-review.googlesource.com/',
|
|
|
|
)
|
2017-04-10 12:19:10 +00:00
|
|
|
)
|