Skip to content

Commit 01cc3b9

Browse files
Introduce runner group definition. (via --runner-group-member-id/--runner-group-total-members or env vars) (#397)
* WIP on benchmark runner groups (splitting tests among workers) * Introduce runner group definition. (via --runner-group-member-id/--runner-group-total-members or env vars) * Addressed org change from RedisLabsModules to redis-performance * Addressed org change from RedisLabsModules to redis-performance
1 parent 0a82c5b commit 01cc3b9

File tree

10 files changed

+121
-27
lines changed

10 files changed

+121
-27
lines changed

README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
1-
[![codecov](https://codecov.io/gh/RedisLabsModules/redisbench-admin/branch/master/graph/badge.svg)](https://codecov.io/gh/RedisLabsModules/redisbench-admin)
2-
![Actions](https://github.com/RedisLabsModules/redisbench-admin/workflows/Run%20Tests/badge.svg?branch=master)
1+
[![codecov](https://codecov.io/gh/redis-performance/redisbench-admin/branch/master/graph/badge.svg)](https://codecov.io/gh/redis-performance/redisbench-admin)
2+
![Actions](https://github.com/redis-performance/redisbench-admin/workflows/Run%20Tests/badge.svg?branch=master)
33
![Actions](https://badge.fury.io/py/redisbench-admin.svg)
44

5-
# [redisbench-admin](https://github.com/RedisLabsModules/redisbench-admin)
5+
# [redisbench-admin](https://github.com/redis-performance/redisbench-admin)
66

77
Redis benchmark run helper can help you with the following tasks:
88

99
- Setup abd teardown of benchmarking infrastructure specified
10-
on [RedisLabsModules/testing-infrastructure](https://github.com/RedisLabsModules/testing-infrastructure)
10+
on [redis-performance/testing-infrastructure](https://github.com/redis-performance/testing-infrastructure)
1111
- Setup and teardown of an Redis and Redis Modules DBs for benchmarking
1212
- Management of benchmark data and specifications across different setups
1313
- Running benchmarks and recording results
@@ -19,7 +19,7 @@ Current supported benchmark tools:
1919

2020
- [redis-benchmark](https://github.com/redis/redis)
2121
- [memtier_benchmark](https://github.com/RedisLabs/memtier_benchmark)
22-
- [redis-benchmark-go](https://github.com/filipecosta90/redis-benchmark-go)
22+
- [redis-benchmark-go](https://github.com/redis-performance/redis-benchmark-go)
2323
- [YCSB](https://github.com/RediSearch/YCSB)
2424
- [tsbs](https://github.com/RedisTimeSeries/tsbs)
2525
- [redisgraph-benchmark-go](https://github.com/RedisGraph/redisgraph-benchmark-go)

docs/Readme.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
The automated benchmark definitions provides a framework for evaluating and comparing feature branches and catching regressions prior letting them into the master branch.
55

6-
To be able to run local benchmarks you need `redisbench_admin>=0.1.64` [[tool repo for full details](https://github.com/RedisLabsModules/redisbench-admin)] and the benchmark tool specified on each configuration file . You can install redisbench-admin via PyPi as any other package.
6+
To be able to run local benchmarks you need `redisbench_admin>=0.1.64` [[tool repo for full details](https://github.com/redis-performance/redisbench-admin)] and the benchmark tool specified on each configuration file . You can install redisbench-admin via PyPi as any other package.
77
```
88
pip3 install redisbench_admin>=0.1.64
99
```
@@ -21,7 +21,7 @@ A benchmark definition will then consist of:
2121

2222
- mandatory client configuration (`clientconfig`) specifing the parameters to pass to the benchmark tool tool. The properties allowed here are: `tool`, `min-tool-version`, `tool_source`, `parameters`. If you don't have the required tools and the `tool_source` property is specified then the benchmark client will be downloaded once to a local path `./binaries/<tool>`.
2323

24-
- optional ci remote definition (`remote`), with the proper terraform deployment configurations definition. The properties allowed here are `type` and `setup`. Both properties are used to find the proper benchmark specification folder within [RedisLabsModules/testing-infrastructure](https://github.com/RedisLabsModules/testing-infrastructure). As an example, if you specify ` - type: oss-standalone` and `- setup: redistimeseries-m5` the used terraform setup will be described by the setup at [`testing-infrastructure/tree/terraform/oss-standalone-redistimeseries-m5`](https://github.com/RedisLabsModules/testing-infrastructure/tree/master/terraform/oss-standalone-redistimeseries-m5)
24+
- optional ci remote definition (`remote`), with the proper terraform deployment configurations definition. The properties allowed here are `type` and `setup`. Both properties are used to find the proper benchmark specification folder within [redis-performance/testing-infrastructure](https://github.com/redis-performance/testing-infrastructure). As an example, if you specify ` - type: oss-standalone` and `- setup: redistimeseries-m5` the used terraform setup will be described by the setup at [`testing-infrastructure/tree/terraform/oss-standalone-redistimeseries-m5`](https://github.com/redis-performance/testing-infrastructure/tree/master/terraform/oss-standalone-redistimeseries-m5)
2525

2626
- optional KPIs definition (`kpis`), specifying the target upper or lower bounds for each relevant performance metric. If specified the KPIs definitions constraints the tests passing/failing.
2727

docs/export.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,22 @@
11

22

33

4-
# [redisbench-admin export](https://github.com/RedisLabsModules/redisbench-admin)
4+
# [redisbench-admin export](https://github.com/redis-performance/redisbench-admin)
55

66
Redis benchmark exporter can help you exporting performance results based on several formats input (CSV, JSON) and
77
pushing them to data sinks in a time-series format.
88

99
Ultimately it provides a framework for evaluating and comparing feature branches and catching regressions prior letting them into the master branch,
10-
as shown on the bellow sample dashboard produced from exported data via [redisbench-admin export](https://github.com/RedisLabsModules/redisbench-admin).
10+
as shown on the bellow sample dashboard produced from exported data via [redisbench-admin export](https://github.com/redis-performance/redisbench-admin).
1111

1212
![RedisTimeSeries Sample CI dashboard detail](screenshot_RedisTimeSeries_CI_benchmarks_Grafana.png)
1313

1414
Current supported benchmark tools to export data from:
1515

1616
- [redis-benchmark](https://github.com/redis/redis)
1717
- [memtier_benchmark](https://github.com/RedisLabs/memtier_benchmark)
18-
- [redis-benchmark-go](https://github.com/filipecosta90/redis-benchmark-go)
19-
- [YCSB](https://github.com/RediSearch/YCSB)
18+
- [redis-benchmark-go](https://github.com/redis-performance/redis-benchmark-go)
19+
- [YCSB](https://github.com/redis-performance/go-ycsb)
2020
- [tsbs](https://github.com/RedisTimeSeries/tsbs)
2121
- [redisgraph-benchmark-go](https://github.com/RedisGraph/redisgraph-benchmark-go)
2222
- [ftsb_redisearch](https://github.com/RediSearch/ftsb)
@@ -161,7 +161,7 @@ memtier_benchmark --json-out-file results.json
161161

162162
After the benchmark ends we will have the `results.json` file.
163163
Together with the "Sample exporter definition for memtier_benchmark" YAML above, that you can download at
164-
[exporter-memtier-metrics.yml](https://github.com/RedisLabsModules/redisbench-admin/blob/master/docs/exporter-memtier-metrics.yml)
164+
[exporter-memtier-metrics.yml](https://github.com/redis-performance/redisbench-admin/blob/master/docs/exporter-memtier-metrics.yml)
165165
you can push the memtier results to redistimeseries via:
166166

167167
**Command:**

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[tool.poetry]
22
name = "redisbench-admin"
3-
version = "0.9.44"
3+
version = "0.9.55"
44
description = "Redis benchmark run helper. A wrapper around Redis and Redis Modules benchmark tools ( ftsb_redisearch, memtier_benchmark, redis-benchmark, aibench, etc... )."
55
authors = ["filipecosta90 <filipecosta.90@gmail.com>","Redis Performance Group <performance@redis.com>"]
66
readme = "README.md"

redisbench_admin/run/args.py

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@
2525
SETUP = os.getenv("SETUP", "")
2626
BENCHMARK_GLOB = os.getenv("BENCHMARK_GLOB", "*.yml")
2727
BENCHMARK_REGEX = os.getenv("BENCHMARK_REGEX", ".*")
28+
BENCHMARK_RUNNER_GROUP_TOTAL = int(os.getenv("BENCHMARK_RUNNER_GROUP_TOTAL", "1"))
29+
BENCHMARK_RUNNER_GROUP_M_ID = int(os.getenv("BENCHMARK_RUNNER_GROUP_M_ID", "1"))
2830
S3_BUCKET_NAME = os.getenv("S3_BUCKET_NAME", "ci.benchmarks.redislabs")
2931
PUSH_S3 = bool(os.getenv("PUSH_S3", False))
3032
REDIS_7 = bool(os.getenv("REDIS_7", True))
@@ -89,7 +91,18 @@ def common_run_args(parser):
8991
default=BENCHMARK_REGEX,
9092
help="specify a test regex pattern to use on the tests directory. by default uses '.*'. If --test is defined this options has no effect.",
9193
)
92-
94+
parser.add_argument(
95+
"--runner-group-member-id",
96+
type=str,
97+
default=BENCHMARK_RUNNER_GROUP_M_ID,
98+
help="Split test files evenly among a runner group. This is the id of the runner. Non-zero remainder of the division of tests will be attributed to the last member.",
99+
)
100+
parser.add_argument(
101+
"--runner-group-total-members",
102+
type=str,
103+
default=BENCHMARK_RUNNER_GROUP_TOTAL,
104+
help="Split test files evenly among a runner group. This is the total number of elements of the runner group",
105+
)
93106
parser.add_argument(
94107
"--defaults_filename",
95108
type=str,

redisbench_admin/run_remote/terraform.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ def terraform_spin_or_reuse_env(
3333
):
3434
(remote_setup, deployment_type, remote_id,) = fetch_remote_setup_from_config(
3535
benchmark_config["remote"],
36-
"https://github.com/RedisLabsModules/testing-infrastructure.git",
36+
"https://github.com/redis-performance/testing-infrastructure.git",
3737
"master",
3838
tf_folder_path,
3939
)

redisbench_admin/utils/benchmark_config.py

Lines changed: 30 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,12 @@ def prepare_benchmark_definitions(args):
5757
result = True
5858
defaults_filename = args.defaults_filename
5959
files = get_testfiles_to_process(
60-
args.test_glob, args.test, defaults_filename, args.test_regex
60+
args.test_glob,
61+
args.test,
62+
defaults_filename,
63+
args.test_regex,
64+
args.runner_group_member_id,
65+
args.runner_group_total_members,
6166
)
6267

6368
(
@@ -485,7 +490,14 @@ def min_ver_check(
485490
)
486491

487492

488-
def get_testfiles_to_process(test_glob, test_name, defaults_filename, test_regex=".*"):
493+
def get_testfiles_to_process(
494+
test_glob,
495+
test_name,
496+
defaults_filename,
497+
test_regex=".*",
498+
runner_group_member_id=1,
499+
runner_group_total_members=1,
500+
):
489501
if test_name == "":
490502
files = pathlib.Path().glob(test_glob)
491503
files = [str(x) for x in files]
@@ -507,6 +519,22 @@ def get_testfiles_to_process(test_glob, test_name, defaults_filename, test_regex
507519
else:
508520
files = test_name.split(",")
509521
logging.info("Running specific benchmark in file: {}".format(files))
522+
523+
if runner_group_total_members > 1:
524+
tests_per_member = round(len(files) / runner_group_total_members)
525+
member_test_start_pos = (runner_group_member_id - 1) * tests_per_member
526+
member_test_end_pos = runner_group_member_id * tests_per_member
527+
if runner_group_member_id == runner_group_total_members:
528+
member_test_end_pos = len(files)
529+
final_files = files[member_test_start_pos:member_test_end_pos]
530+
logging.info(
531+
"Detected a benchmark runner group. Splitting tests evenly. Non-zero remainder will be attributed to the last member. Member ID: {}. Total members: {}. Benchmarks per runner {}.".format(
532+
runner_group_member_id, runner_group_total_members, tests_per_member
533+
)
534+
)
535+
logging.info("Tests for this runner: {}".format(",".join(final_files)))
536+
files = final_files
537+
510538
return files
511539

512540

redisbench_admin/utils/remote.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -540,7 +540,7 @@ def common_tf(branch, path, repo, temporary_dir=None, destroy=False):
540540

541541
def fetch_remote_setup_from_config(
542542
remote_setup_config,
543-
repo="https://github.com/RedisLabsModules/testing-infrastructure.git",
543+
repo="https://github.com/redis-performance/testing-infrastructure.git",
544544
branch="master",
545545
path=None,
546546
):

tests/test_benchmark_config.py

Lines changed: 55 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -237,10 +237,10 @@ def test_process_benchmark_definitions_remote_timeouts():
237237
def test_get_testfiles_to_process():
238238
test_glob_pattern_all = "./tests/test_data/benchmark_definitions/*.yml"
239239
test_glob_pattern_graph500 = "./tests/test_data/benchmark_definitions/graph500*.yml"
240-
test_files_to_process = get_testfiles_to_process(
240+
test_files_to_process_all = get_testfiles_to_process(
241241
test_glob_pattern_all, "", "defaults.yml"
242242
)
243-
assert 6 == len(test_files_to_process)
243+
assert 6 == len(test_files_to_process_all)
244244
test_files_to_process_graph500_glob = get_testfiles_to_process(
245245
test_glob_pattern_graph500, "", "defaults.yml"
246246
)
@@ -263,3 +263,56 @@ def test_get_testfiles_to_process():
263263
assert 3 == len(test_files_to_process)
264264
for test_graph in test_files_to_process_graph500_glob:
265265
assert test_graph not in test_files_to_process
266+
267+
test_files_to_process_group_member_1 = get_testfiles_to_process(
268+
test_glob_pattern_all, "", "defaults.yml", ".*", 1, 2
269+
)
270+
test_files_to_process_group_member_2 = get_testfiles_to_process(
271+
test_glob_pattern_all, "", "defaults.yml", ".*", 2, 2
272+
)
273+
assert 3 == len(test_files_to_process_group_member_1)
274+
assert 3 == len(test_files_to_process_group_member_2)
275+
276+
test_files_to_process_graph500_glob_group_member_1 = get_testfiles_to_process(
277+
test_glob_pattern_graph500, "", "defaults.yml", ".*", 1, 2
278+
)
279+
assert 2 == len(test_files_to_process_graph500_glob_group_member_1)
280+
test_files_to_process_graph500_glob_group_member_2 = get_testfiles_to_process(
281+
test_glob_pattern_graph500, "", "defaults.yml", ".*", 2, 2
282+
)
283+
assert 1 == len(test_files_to_process_graph500_glob_group_member_2)
284+
285+
test_files_to_process_graph500_glob_group_member_1 = get_testfiles_to_process(
286+
test_glob_pattern_graph500, "", "defaults.yml", ".*", 1, 3
287+
)
288+
test_files_to_process_graph500_glob_group_member_2 = get_testfiles_to_process(
289+
test_glob_pattern_graph500, "", "defaults.yml", ".*", 2, 3
290+
)
291+
test_files_to_process_graph500_glob_group_member_3 = get_testfiles_to_process(
292+
test_glob_pattern_graph500, "", "defaults.yml", ".*", 3, 3
293+
)
294+
assert 1 == len(test_files_to_process_graph500_glob_group_member_1)
295+
assert 1 == len(test_files_to_process_graph500_glob_group_member_2)
296+
assert 1 == len(test_files_to_process_graph500_glob_group_member_3)
297+
298+
test_files_to_process_all_glob_group_member_1 = get_testfiles_to_process(
299+
test_glob_pattern_all, "", "defaults.yml", ".*", 1, 5
300+
)
301+
assert 1 == len(test_files_to_process_all_glob_group_member_1)
302+
assert (
303+
test_files_to_process_all[0] == test_files_to_process_all_glob_group_member_1[0]
304+
)
305+
test_files_to_process_all_glob_group_member_4 = get_testfiles_to_process(
306+
test_glob_pattern_all, "", "defaults.yml", ".*", 4, 5
307+
)
308+
assert 1 == len(test_files_to_process_all_glob_group_member_4)
309+
assert (
310+
test_files_to_process_all[3] == test_files_to_process_all_glob_group_member_4[0]
311+
)
312+
test_files_to_process_all_glob_group_member_5 = get_testfiles_to_process(
313+
test_glob_pattern_all, "", "defaults.yml", ".*", 5, 5
314+
)
315+
assert 2 == len(test_files_to_process_all_glob_group_member_5)
316+
assert (
317+
test_files_to_process_all[4:6] == test_files_to_process_all_glob_group_member_5
318+
)

tests/test_remote.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ def test_extract_git_vars():
3434
github_branch,
3535
github_branch_detached,
3636
) = extract_git_vars(".")
37-
assert github_org_name == "RedisLabsModules"
37+
assert github_org_name == "redis-performance"
3838
assert github_repo_name == "redisbench-admin"
3939
assert github_sha != None and github_branch != ""
4040
if github_branch_detached is False:
@@ -51,9 +51,9 @@ def test_extract_git_vars_passing_repo():
5151
github_branch,
5252
github_branch_detached,
5353
) = extract_git_vars(
54-
".", github_url="https://github.com/RedisLabsModules/redisbench-admin"
54+
".", github_url="https://github.com/redis-performance/redisbench-admin"
5555
)
56-
assert github_org_name == "RedisLabsModules"
56+
assert github_org_name == "redis-performance"
5757
assert github_repo_name == "redisbench-admin"
5858
assert github_sha != None and github_branch != ""
5959
if github_branch_detached is False:
@@ -70,9 +70,9 @@ def test_extract_git_vars_passing_repo2():
7070
github_branch,
7171
github_branch_detached,
7272
) = extract_git_vars(
73-
".", github_url="https://github.com/RedisLabsModules/redisbench-admin/"
73+
".", github_url="https://github.com/redis-performance/redisbench-admin/"
7474
)
75-
assert github_org_name == "RedisLabsModules"
75+
assert github_org_name == "redis-performance"
7676
assert github_repo_name == "redisbench-admin"
7777
assert github_sha != None and github_branch != ""
7878
if github_branch_detached is False:
@@ -89,9 +89,9 @@ def test_extract_git_vars_passing_repo3():
8989
github_branch,
9090
github_branch_detached,
9191
) = extract_git_vars(
92-
".", github_url="git@github.com:RedisLabsModules/redisbench-admin.git"
92+
".", github_url="git@github.com:redis-performance/redisbench-admin.git"
9393
)
94-
assert github_org_name == "RedisLabsModules"
94+
assert github_org_name == "redis-performance"
9595
assert github_repo_name == "redisbench-admin"
9696
assert github_sha != None and github_branch != ""
9797
if github_branch_detached is False:

0 commit comments

Comments
 (0)