Skip to content

Commit 6afc705

Browse files
committed
[add] Enabled the property on test suite spec (to avoid exploding total variants per build)
1 parent d638121 commit 6afc705

13 files changed

+263
-10
lines changed

redis_benchmarks_specification/__common__/spec.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,13 @@ def extract_client_cpu_limit(benchmark_config):
77
return ceil_db_cpu_limit
88

99

10+
def extract_build_variant_variations(benchmark_config, keyname="build-variants"):
11+
result = None
12+
if keyname in benchmark_config:
13+
result = benchmark_config[keyname]
14+
return result
15+
16+
1017
def extract_client_container_image(benchmark_config, keyname="clientconfig"):
1118
client_container_image = None
1219
if keyname in benchmark_config:

redis_benchmarks_specification/__self_contained_coordinator__/self_contained_coordinator.py

Lines changed: 29 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@
4444
extract_client_cpu_limit,
4545
extract_client_container_image,
4646
extract_client_tool,
47+
extract_build_variant_variations,
4748
)
4849
from redis_benchmarks_specification.__self_contained_coordinator__.args import (
4950
create_self_contained_coordinator_args,
@@ -165,7 +166,7 @@ def main():
165166
if stream_id is None:
166167
stream_id = args.consumer_start_id
167168
while True:
168-
_, stream_id, _ = self_contained_coordinator_blocking_read(
169+
_, stream_id, _, _ = self_contained_coordinator_blocking_read(
169170
conn,
170171
datasink_push_results_redistimeseries,
171172
docker_client,
@@ -218,6 +219,7 @@ def self_contained_coordinator_blocking_read(
218219
platform_name,
219220
):
220221
num_process_streams = 0
222+
num_process_test_suites = 0
221223
overall_result = False
222224
consumer_name = "{}-self-contained-proc#{}".format(
223225
get_runners_consumer_group_name(platform_name), "1"
@@ -232,7 +234,11 @@ def self_contained_coordinator_blocking_read(
232234
if len(newTestInfo[0]) < 2 or len(newTestInfo[0][1]) < 1:
233235
stream_id = ">"
234236
else:
235-
stream_id, overall_result = process_self_contained_coordinator_stream(
237+
(
238+
stream_id,
239+
overall_result,
240+
total_test_suite_runs,
241+
) = process_self_contained_coordinator_stream(
236242
conn,
237243
datasink_push_results_redistimeseries,
238244
docker_client,
@@ -244,6 +250,7 @@ def self_contained_coordinator_blocking_read(
244250
platform_name,
245251
)
246252
num_process_streams = num_process_streams + 1
253+
num_process_test_suites = num_process_test_suites + total_test_suite_runs
247254
if overall_result is True:
248255
ack_reply = conn.xack(
249256
STREAM_KEYNAME_NEW_BUILD_EVENTS,
@@ -264,7 +271,7 @@ def self_contained_coordinator_blocking_read(
264271
stream_id, ack_reply
265272
)
266273
)
267-
return overall_result, stream_id, num_process_streams
274+
return overall_result, stream_id, num_process_streams, num_process_test_suites
268275

269276

270277
def prepare_memtier_benchmark_parameters(
@@ -308,6 +315,7 @@ def process_self_contained_coordinator_stream(
308315
stream_id = stream_id.decode()
309316
logging.info("Received work . Stream id {}.".format(stream_id))
310317
overall_result = False
318+
total_test_suite_runs = 0
311319

312320
if b"git_hash" in testDetails:
313321
(
@@ -338,6 +346,22 @@ def process_self_contained_coordinator_stream(
338346
redis_configuration_parameters,
339347
_,
340348
) = extract_redis_dbconfig_parameters(benchmark_config, "dbconfig")
349+
build_variants = extract_build_variant_variations(benchmark_config)
350+
if build_variants is not None:
351+
logging.info("Detected build variant filter")
352+
if build_variant_name not in build_variants:
353+
logging.error(
354+
"Skipping {} given it's not part of build-variants for this test-suite {}".format(
355+
build_variant_name, build_variants
356+
)
357+
)
358+
continue
359+
else:
360+
logging.error(
361+
"Running build variant {} given it's present on the build-variants spec {}".format(
362+
build_variant_name, build_variants
363+
)
364+
)
341365
for topology_spec_name in benchmark_config["redis-topologies"]:
342366
test_result = False
343367
try:
@@ -557,6 +581,7 @@ def process_self_contained_coordinator_stream(
557581
running_platform,
558582
)
559583
test_result = True
584+
total_test_suite_runs = total_test_suite_runs + 1
560585

561586
except:
562587
logging.critical(
@@ -598,7 +623,7 @@ def process_self_contained_coordinator_stream(
598623

599624
else:
600625
logging.error("Missing commit information within received message.")
601-
return stream_id, overall_result
626+
return stream_id, overall_result, total_test_suite_runs
602627

603628

604629
def data_prepopulation_step(

redis_benchmarks_specification/test-suites/memtier_benchmark-1Mkeys-100B-expire-use-case.yml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,18 +8,22 @@ dbconfig:
88
preload_tool:
99
run_image: redislabs/memtier_benchmark:1.3.0
1010
tool: memtier_benchmark
11-
arguments: '"--command" "SETEX __key__ 360 __value__" "--command-key-pattern" "P" "-c" "50" "-t" "2" "--hide-histogram"'
11+
arguments: '"--data-size" "100" "--command" "SET __key__ __value__" "--command-key-pattern" "P" "-c" "50" "-t" "2" "--hide-histogram"'
1212
tested-commands:
1313
- SET
1414
- SETX
1515
- GET
1616
- DEL
1717
redis-topologies:
1818
- oss-standalone
19+
20+
build-variants:
21+
- gcc:8.5.0-amd64-debian-buster-default
22+
1923
clientconfig:
2024
run_image: redislabs/memtier_benchmark:1.3.0
2125
tool: memtier_benchmark
22-
arguments: '--command "SETEX __key__ 10 __value__" --command-key-pattern="R" --command "SET __key__ __value__" --command-key-pattern="R" --command "GET __key__" --command-key-pattern="R" --command "DEL __key__" --command-key-pattern="R" -c 50 -t 2 --hide-histogram --test-time 300'
26+
arguments: '"--data-size" "100" --command "SETEX __key__ 10 __value__" --command-key-pattern="R" --command "SET __key__ __value__" --command-key-pattern="R" --command "GET __key__" --command-key-pattern="R" --command "DEL __key__" --command-key-pattern="R" -c 50 -t 2 --hide-histogram --test-time 300'
2327
resources:
2428
requests:
2529
cpus: "3"
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
version: 0.4
2+
name: "memtier_benchmark-1Mkeys-10B-expire-use-case"
3+
description: "Runs memtier_benchmark, for a keyspace length of 1M keys
4+
with a data size of 10 Bytes for each key, which 50% of the keys have expiration set during the benchmark."
5+
dbconfig:
6+
configuration-parameters:
7+
save: '""'
8+
preload_tool:
9+
run_image: redislabs/memtier_benchmark:1.3.0
10+
tool: memtier_benchmark
11+
arguments: '"--data-size" "10" "--command" "SET __key__ __value__" "--command-key-pattern" "P" "-c" "50" "-t" "2" "--hide-histogram"'
12+
tested-commands:
13+
- SET
14+
- SETX
15+
- GET
16+
- DEL
17+
redis-topologies:
18+
- oss-standalone
19+
20+
build-variants:
21+
- gcc:8.5.0-amd64-debian-buster-default
22+
23+
clientconfig:
24+
run_image: redislabs/memtier_benchmark:1.3.0
25+
tool: memtier_benchmark
26+
arguments: '"--data-size" "10" --command "SETEX __key__ 10 __value__" --command-key-pattern="R" --command "SET __key__ __value__" --command-key-pattern="R" --command "GET __key__" --command-key-pattern="R" --command "DEL __key__" --command-key-pattern="R" -c 50 -t 2 --hide-histogram --test-time 300'
27+
resources:
28+
requests:
29+
cpus: "3"
30+
memory: "2g"
31+
exporter:
32+
redistimeseries:
33+
break_by:
34+
- version
35+
- commit
36+
timemetric: '$."ALL STATS".Runtime."Start time"'
37+
metrics:
38+
- '$."ALL STATS".*."Ops/sec"'
39+
- '$."ALL STATS".*."Latency"'
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
version: 0.4
2+
name: "memtier_benchmark-1Mkeys-1KiB-expire-use-case"
3+
description: "Runs memtier_benchmark, for a keyspace length of 1M keys
4+
with a data size of 1KiB Bytes for each key, which 50% of the keys have expiration set during the benchmark."
5+
dbconfig:
6+
configuration-parameters:
7+
save: '""'
8+
preload_tool:
9+
run_image: redislabs/memtier_benchmark:1.3.0
10+
tool: memtier_benchmark
11+
arguments: '"--data-size" "1000" "--command" "SET __key__ __value__" "--command-key-pattern" "P" "-c" "50" "-t" "2" "--hide-histogram"'
12+
tested-commands:
13+
- SET
14+
- SETX
15+
- GET
16+
- DEL
17+
redis-topologies:
18+
- oss-standalone
19+
20+
build-variants:
21+
- gcc:8.5.0-amd64-debian-buster-default
22+
23+
clientconfig:
24+
run_image: redislabs/memtier_benchmark:1.3.0
25+
tool: memtier_benchmark
26+
arguments: '"--data-size" "1000" --command "SETEX __key__ 10 __value__" --command-key-pattern="R" --command "SET __key__ __value__" --command-key-pattern="R" --command "GET __key__" --command-key-pattern="R" --command "DEL __key__" --command-key-pattern="R" -c 50 -t 2 --hide-histogram --test-time 300'
27+
resources:
28+
requests:
29+
cpus: "3"
30+
memory: "2g"
31+
exporter:
32+
redistimeseries:
33+
break_by:
34+
- version
35+
- commit
36+
timemetric: '$."ALL STATS".Runtime."Start time"'
37+
metrics:
38+
- '$."ALL STATS".*."Ops/sec"'
39+
- '$."ALL STATS".*."Latency"'

redis_benchmarks_specification/test-suites/redis-benchmark-full-suite-1Mkeys-100B.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,10 @@ tested-commands:
2323
- MSET
2424
redis-topologies:
2525
- oss-standalone
26+
27+
build-variants:
28+
- gcc:8.5.0-amd64-debian-buster-default
29+
2630
clientconfig:
2731
run_image: redis:6.2.4
2832
tool: redis-benchmark

utils/tests/test_data/api_builder_common.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,9 @@
1212
)
1313

1414

15-
def flow_1_and_2_api_builder_checks(conn):
15+
def flow_1_and_2_api_builder_checks(
16+
conn, build_spec_name="gcc:8.5.0-amd64-debian-buster-default"
17+
):
1618
builder_consumer_group_create(conn)
1719
assert conn.xlen(STREAM_KEYNAME_GH_EVENTS_COMMIT) == 0
1820
result, reply_fields, error_msg = commit_schema_to_stream(
@@ -26,7 +28,7 @@ def flow_1_and_2_api_builder_checks(conn):
2628
"redis",
2729
GH_TOKEN,
2830
)
29-
build_spec_name = "gcc:8.5.0-amd64-debian-buster-default"
31+
3032
assert result == True
3133
assert error_msg == None
3234
assert STREAM_KEYNAME_GH_EVENTS_COMMIT.encode() in conn.keys()

utils/tests/test_data/dump.rdb

2 Bytes
Binary file not shown.
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
version: 0.4
2+
name: "memtier_benchmark-1Mkeys-100B-expire-use-case"
3+
description: "Runs memtier_benchmark, for a keyspace length of 1M keys
4+
with a data size of 100 Bytes for each key, which 50% of the keys have expiration set during the benchmark."
5+
dbconfig:
6+
configuration-parameters:
7+
save: '""'
8+
preload_tool:
9+
run_image: redislabs/memtier_benchmark:1.3.0
10+
tool: memtier_benchmark
11+
arguments: '"--command" "SETEX __key__ 360 __value__" "--command-key-pattern" "P" "-c" "5" "-t" "2" "--hide-histogram"'
12+
tested-commands:
13+
- SET
14+
- SETX
15+
- GET
16+
- DEL
17+
redis-topologies:
18+
- oss-standalone
19+
build-variants:
20+
- abc
21+
clientconfig:
22+
run_image: redislabs/memtier_benchmark:1.3.0
23+
tool: memtier_benchmark
24+
arguments: '--command "SETEX __key__ 10 __value__" --command-key-pattern="R" --command "SET __key__ __value__" --command-key-pattern="R" --command "GET __key__" --command-key-pattern="R" --command "DEL __key__" --command-key-pattern="R" -c 5 -t 1 --hide-histogram --test-time 10'
25+
resources:
26+
requests:
27+
cpus: "1"
28+
memory: "2g"
29+
exporter:
30+
redistimeseries:
31+
break_by:
32+
- version
33+
- commit
34+
timemetric: '$."ALL STATS".Runtime."Start time"'
35+
metrics:
36+
- '$."ALL STATS".*."Ops/sec"'
37+
- '$."ALL STATS".*."Latency"'

utils/tests/test_data/test-suites/memtier_benchmark-1Mkeys-100B-expire-use-case.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@ tested-commands:
1616
- DEL
1717
redis-topologies:
1818
- oss-standalone
19+
build-variants:
20+
- gcc:8.5.0-amd64-debian-buster-default
1921
clientconfig:
2022
run_image: redislabs/memtier_benchmark:1.3.0
2123
tool: memtier_benchmark

0 commit comments

Comments
 (0)