2018-10-08 17:58:47 +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 buildstats results to Perf.
|
|
|
|
|
2021-11-15 18:06:47 +00:00
|
|
|
PYTHON_VERSION_COMPATIBILITY = "PY3"
|
2018-10-08 17:58:47 +00:00
|
|
|
|
|
|
|
DEPS = [
|
|
|
|
'recipe_engine/context',
|
|
|
|
'recipe_engine/file',
|
|
|
|
'recipe_engine/path',
|
|
|
|
'recipe_engine/properties',
|
|
|
|
'recipe_engine/step',
|
|
|
|
'recipe_engine/time',
|
2019-10-08 00:11:36 +00:00
|
|
|
'vars',
|
2018-10-08 17:58:47 +00:00
|
|
|
]
|
|
|
|
|
|
|
|
|
|
|
|
def RunSteps(api):
|
|
|
|
# Upload the buildstats results.
|
2019-10-08 00:11:36 +00:00
|
|
|
api.vars.setup()
|
2018-10-08 17:58:47 +00:00
|
|
|
|
|
|
|
now = api.time.utcnow()
|
|
|
|
src_path = api.path['start_dir'].join('perf')
|
|
|
|
with api.context(cwd=src_path):
|
|
|
|
results = api.file.glob_paths(
|
|
|
|
'find results',
|
|
|
|
src_path,
|
|
|
|
'*.json',
|
|
|
|
test_data=['buildstats_abc123.json', 'buildstats_def.json'])
|
|
|
|
if not len(results): # pragma: nocover
|
|
|
|
raise Exception('Unable to find buildstats JSON file!')
|
|
|
|
|
|
|
|
for src in results:
|
|
|
|
basename = api.path.basename(src)
|
2018-10-08 19:17:12 +00:00
|
|
|
basename = api.properties['revision'] + '_' + basename
|
2018-10-08 17:58:47 +00:00
|
|
|
gs_path = '/'.join((
|
|
|
|
'buildstats-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))
|
2018-10-08 17:58:47 +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)))
|
2018-10-08 17:58:47 +00:00
|
|
|
|
|
|
|
dst = '/'.join((
|
|
|
|
'gs://%s' % api.properties['gs_bucket'], gs_path, basename))
|
|
|
|
|
|
|
|
api.step(
|
|
|
|
'upload %s' % src,
|
|
|
|
cmd=['gsutil', 'cp', '-z', 'json', src, dst],
|
|
|
|
infra_step=True)
|
|
|
|
|
|
|
|
|
|
|
|
def GenTests(api):
|
2020-04-07 01:27:14 +00:00
|
|
|
builder = 'BuildStats-Debian10-EMCC-wasm-Release-PathKit'
|
2018-10-08 17:58:47 +00:00
|
|
|
yield (
|
|
|
|
api.test('normal_bot') +
|
|
|
|
api.properties(buildername=builder,
|
|
|
|
gs_bucket='skia-perf',
|
|
|
|
revision='abc123',
|
|
|
|
path_config='kitchen')
|
|
|
|
)
|
|
|
|
|
|
|
|
yield (
|
|
|
|
api.test('trybot') +
|
|
|
|
api.properties.tryserver(
|
|
|
|
gerrit_project='skia',
|
|
|
|
gerrit_url='https://skia-review.googlesource.com/',
|
2019-10-08 00:11:36 +00:00
|
|
|
) +
|
|
|
|
api.properties(buildername=builder,
|
|
|
|
gs_bucket='skia-perf',
|
|
|
|
revision='abc123',
|
|
|
|
path_config='kitchen')
|
2018-10-08 17:58:47 +00:00
|
|
|
)
|