Commit 134fd737 authored by Caleb Rouleau's avatar Caleb Rouleau Committed by Commit Bot

[Perf Waterfall] Remove option to create a shard map for a single benchmark.

This feature was originally intended for Pinpoint's use,
but that never happened. Supporting this feature would complicate
my work in crbug.com/965158. We can re-add this feature
later if Pinpoint ever wants it.

Bug: 965158
Change-Id: Ifef1e2ae844b5bd047e033461a4f9a0bb116c5af
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1935748Reviewed-by: default avatarJohn Chen <johnchen@chromium.org>
Commit-Queue: Caleb Rouleau <crouleau@chromium.org>
Cr-Commit-Position: refs/heads/master@{#719239}
parent 174a1b45
......@@ -70,26 +70,6 @@ def GetParser():
_AddBuilderPlatformSelectionArgs(parser_update_timing)
parser_update_timing.set_defaults(func=_UpdateTimingDataCommand)
parser_create = subparsers.add_parser(
'create',
help='Create a shard map for a single benchmark.')
parser_create.add_argument(
'--benchmark', help='The benchmark that you want to create shard for',
required=True)
parser_create.add_argument(
'--timing-data-source', '-t', choices=bot_platforms.ALL_PLATFORM_NAMES,
help='The timing data that you want to use. If not set, it will assume '
'all stories use the same amount of time to run')
parser_create.add_argument(
# pinpoint typically has 16 machines for each hardware types, so we set
# the default to use half of them to avoid starving the pool.
'--shards-num', type=int, default=8,
help="The number of shards you'd like to use, default is %(default)s")
parser_create.add_argument(
'--output-path', default='new_shard_map.json',
help='Output file path for the shard map, default is `%(default)s`')
parser_create.set_defaults(func=_CreateShardMapForBenchmark)
parser_deschedule = subparsers.add_parser(
'deschedule',
help=('After you deschedule one or more '
......@@ -165,14 +145,13 @@ def _LoadTimingData(args):
def _GenerateShardMap(
builder, num_of_shards, output_path, debug, benchmark):
builder, num_of_shards, output_path, debug):
timing_data = []
if builder:
with open(builder.timing_file_path) as f:
timing_data = json.load(f)
benchmarks_to_shard = _GenerateBenchmarksToShardsList(
[b for b in builder.benchmarks_to_run if not benchmark or (
b.Name() == benchmark)])
list(builder.benchmarks_to_run))
sharding_map = sharding_map_generator.generate_sharding_map(
benchmarks_to_shard, timing_data, num_shards=num_of_shards,
debug=debug)
......@@ -236,30 +215,10 @@ def _UpdateShardsForBuilders(args):
_UpdateTimingData(builders)
for b in builders:
_GenerateShardMap(
b, b.num_shards, b.shards_map_file_path, args.debug, benchmark=None)
b, b.num_shards, b.shards_map_file_path, args.debug)
print('Updated sharding map for %s' % repr(b.name))
def _CreateShardMapForBenchmark(args):
"""Create the shard map for the given benchmark.
Args:
args(Namespace object): the namespace object for the subparser `create`. It
will contain the attributes:
`benchmark`: the name of the benchmark that we want the shard for
`num_shards`: the total number of shards that we want to use
`output_path`: the output file path for the shard map
`builder`: the builder name, unlike the above, this is a string instead
of a list of string like above
"""
builder = None
if args.timing_data_source:
[builder] = [b for b in bot_platforms.ALL_PLATFORMS
if b.name == args.timing_data_source]
_GenerateShardMap(
builder, args.shards_num, args.output_path, args.debug, args.benchmark)
def _DescheduleBenchmark(args):
"""Remove benchmarks from the shard maps without re-sharding."""
del args
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment