From 94029b812f741f0085608e5a76beb81a189b370c Mon Sep 17 00:00:00 2001 From: Jeremy Leconte Date: Mon, 21 Mar 2022 10:37:55 +0100 Subject: [PATCH] Remove unused script webrtc_dashboard_upload.py The script process_perf_results.py is used instead. Bug: webrtc:13806 Change-Id: I672da41d7264d5f996eef38f1178f486dad968ee Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/256220 Reviewed-by: Mirko Bonadei Commit-Queue: Jeremy Leconte Cr-Commit-Position: refs/heads/main@{#36278} --- .vpython | 2 +- .vpython3 | 2 +- tools_webrtc/perf/BUILD.gn | 2 +- tools_webrtc/perf/webrtc_dashboard_upload.py | 135 ------------------- 4 files changed, 3 insertions(+), 138 deletions(-) delete mode 100644 tools_webrtc/perf/webrtc_dashboard_upload.py diff --git a/.vpython b/.vpython index a57f82ff3e..d226875f02 100644 --- a/.vpython +++ b/.vpython @@ -31,7 +31,7 @@ wheel: < version: "version:5.2.2" > -# Used by tools_webrtc/perf/webrtc_dashboard_upload.py. +# Used by tools_webrtc/perf/process_perf_results.py. wheel: < name: "infra/python/wheels/httplib2-py2_py3" version: "version:0.10.3" diff --git a/.vpython3 b/.vpython3 index 99b1a0d8e9..39d735dcd1 100644 --- a/.vpython3 +++ b/.vpython3 @@ -31,7 +31,7 @@ wheel: < version: "version:5.8.0.chromium.2" > -# Used by tools_webrtc/perf/webrtc_dashboard_upload.py. +# Used by tools_webrtc/perf/process_perf_results.py. wheel: < name: "infra/python/wheels/httplib2-py3" version: "version:0.19.1" diff --git a/tools_webrtc/perf/BUILD.gn b/tools_webrtc/perf/BUILD.gn index e45a170822..484f9565b5 100644 --- a/tools_webrtc/perf/BUILD.gn +++ b/tools_webrtc/perf/BUILD.gn @@ -10,7 +10,7 @@ import("../../webrtc.gni") if (rtc_enable_protobuf) { group("webrtc_dashboard_upload") { - data = [ "webrtc_dashboard_upload.py" ] + data = [ "process_perf_results.py" ] data_deps = [ "//third_party/catapult/tracing/tracing/proto:histogram_proto" ] } diff --git a/tools_webrtc/perf/webrtc_dashboard_upload.py b/tools_webrtc/perf/webrtc_dashboard_upload.py deleted file mode 100644 index e141b2803f..0000000000 --- a/tools_webrtc/perf/webrtc_dashboard_upload.py +++ /dev/null @@ -1,135 +0,0 @@ -#!/usr/bin/env vpython3 - -# Copyright (c) 2019 The WebRTC project authors. All Rights Reserved. -# -# Use of this source code is governed by a BSD-style license -# that can be found in the LICENSE file in the root of the source -# tree. An additional intellectual property rights grant can be found -# in the file PATENTS. All contributing project authors may -# be found in the AUTHORS file in the root of the source tree. -"""Adds build info to perf results and uploads them. - -The tests don't know which bot executed the tests or at what revision, so we -need to take their output and enrich it with this information. We load the proto -from the tests, add the build information as shared diagnostics and then -upload it to the dashboard. - -This script can't be in recipes, because we can't access the catapult APIs from -there. It needs to be here source-side. -""" - -import argparse -import os -import sys - -# Even if protobuf is not used directly, this allows transitive imports -# of the protobuf library to use the vpython wheel specified in the root -# level .vpython (see bugs.webrtc.org/12211 for context). -import google.protobuf # pylint: disable=unused-import - - -def _CreateParser(): - parser = argparse.ArgumentParser() - parser.add_argument('--perf-dashboard-machine-group', - required=True, - help='The "machine_group" the bots are grouped under.' - 'This string is the group in the the perf dashboard ' - 'path group/bot/perf_id/metric/subtest.') - parser.add_argument('--bot', - required=True, - help='The bot running the test (e.g. ' - 'webrtc-win-large-tests).') - parser.add_argument('--test-suite', - required=True, - help='The key for the test in the dashboard (i.e. what ' - 'you select in the top-level test suite selector in ' - 'the dashboard') - parser.add_argument('--webrtc-git-hash', - required=True, - help='webrtc.googlesource.com commit hash.') - parser.add_argument('--commit-position', - type=int, - required=True, - help='Commit pos corresponding to the git hash.') - parser.add_argument('--build-page-url', - required=True, - help='URL to the build page for this build.') - parser.add_argument('--dashboard-url', - required=True, - help='Which dashboard to use.') - parser.add_argument('--input-results-file', - required=True, - help='A HistogramSet proto file with output from ' - 'WebRTC tests.') - parser.add_argument('--output-json-file', - help='Where to write the output (for debugging).') - parser.add_argument('--outdir', - required=True, - help='Path to the local out/ dir (usually out/Default)') - # TODO(crbug.com/webrtc/13806): Remove this argument. - parser.add_argument('--wait-for-upload', - action='store_true', - help='DEPRECATED: this option will soon be removed') - return parser - - -def _ConfigurePythonPath(outdir): - # We just yank the python scripts we require into the PYTHONPATH. You could - # also imagine a solution where we use for instance - # protobuf:py_proto_runtime to copy catapult and protobuf code to out/. - # This is the convention in Chromium and WebRTC python scripts. We do need - # to build histogram_pb2 however, so that's why we add out/ to sys.path - # below. - # - # It would be better if there was an equivalent to py_binary in GN, but - # there's not. - script_dir = os.path.dirname(os.path.realpath(__file__)) - checkout_root = os.path.abspath(os.path.join(script_dir, os.pardir, - os.pardir)) - - sys.path.insert( - 0, os.path.join(checkout_root, 'third_party', 'catapult', 'tracing')) - sys.path.insert( - 0, os.path.join(checkout_root, 'third_party', 'protobuf', 'python')) - - # The webrtc_dashboard_upload gn rule will build the protobuf stub for - # python, so put it in the path for this script before we attempt to import - # it. - histogram_proto_path = os.path.join(outdir, 'pyproto', 'tracing', 'tracing', - 'proto') - sys.path.insert(0, histogram_proto_path) - - # Fail early in case the proto hasn't been built. - from tracing.proto import histogram_proto - if not histogram_proto.HAS_PROTO: - raise ImportError('Could not find histogram_pb2. You need to build the ' - 'webrtc_dashboard_upload target before invoking this ' - 'script. Expected to find ' - 'histogram_pb2.py in %s.' % histogram_proto_path) - - -def main(args): - parser = _CreateParser() - options = parser.parse_args(args) - - _ConfigurePythonPath(options.outdir) - - import catapult_uploader - - uploader_options = catapult_uploader.UploaderOptions( - perf_dashboard_machine_group=options.perf_dashboard_machine_group, - bot=options.bot, - test_suite=options.test_suite, - webrtc_git_hash=options.webrtc_git_hash, - commit_position=options.commit_position, - build_page_url=options.build_page_url, - dashboard_url=options.dashboard_url, - input_results_file=options.input_results_file, - output_json_file=options.output_json_file, - ) - - return catapult_uploader.UploadToDashboard(uploader_options) - - -if __name__ == '__main__': - sys.exit(main(sys.argv[1:]))