Skip to content

Commit f2c0f34

Browse files
Added support for --unix-socket connection on CLI benchmark runner (#279)
1 parent 67f7340 commit f2c0f34

8 files changed

+130
-7
lines changed

.github/workflows/validate-spec-fields.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ on:
88
jobs:
99
pytest:
1010
name: Validate SPEC fields
11-
runs-on: ubuntu-latest
11+
runs-on: ubuntu-22.04
1212
env:
1313
ACTIONS_ALLOW_UNSECURE_COMMANDS: true
1414
steps:

pyproject.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[tool.poetry]
22
name = "redis-benchmarks-specification"
3-
version = "0.1.259"
3+
version = "0.1.260"
44
description = "The Redis benchmarks specification describes the cross-language/tools requirements and expectations to foster performance and observability standards around redis related technologies. Members from both industry and academia, including organizations and individuals are encouraged to contribute."
55
authors = ["filipecosta90 <[email protected]>","Redis Performance Group <[email protected]>"]
66
readme = "Readme.md"

redis_benchmarks_specification/__common__/runner.py

+5
Original file line numberDiff line numberDiff line change
@@ -106,11 +106,16 @@ def extract_testsuites(args):
106106
testsuite_spec_files = get_benchmark_specs(
107107
testsuites_folder, args.test, args.tests_regexp
108108
)
109+
testsuite_spec_files.sort()
109110
logging.info(
110111
"There are a total of {} test-suites in folder {}".format(
111112
len(testsuite_spec_files), testsuites_folder
112113
)
113114
)
115+
if len(testsuite_spec_files) < 11:
116+
for test in testsuite_spec_files:
117+
logging.info(f"Test {test}")
118+
114119
return testsuite_spec_files
115120

116121

redis_benchmarks_specification/__runner__/args.py

+5
Original file line numberDiff line numberDiff line change
@@ -214,4 +214,9 @@ def create_client_runner_args(project_name):
214214
action="store_true",
215215
help="Run client in cluster mode.",
216216
)
217+
parser.add_argument(
218+
"--unix-socket",
219+
default="",
220+
help="UNIX Domain socket name",
221+
)
217222
return parser

redis_benchmarks_specification/__runner__/runner.py

+20-5
Original file line numberDiff line numberDiff line change
@@ -220,17 +220,26 @@ def prepare_memtier_benchmark_parameters(
220220
resp_version=None,
221221
override_memtier_test_time=0,
222222
override_test_runs=1,
223+
unix_socket="",
223224
):
224225
arbitrary_command = False
225226
benchmark_command = [
226227
full_benchmark_path,
227-
"--port",
228-
f"{port}",
229-
"--server",
230-
f"{server}",
231228
"--json-out-file",
232229
local_benchmark_output_filename,
233230
]
231+
if unix_socket != "":
232+
benchmark_command.extend(["--unix-socket", unix_socket])
233+
logging.info(f"Using UNIX SOCKET to connect {unix_socket}")
234+
else:
235+
benchmark_command.extend(
236+
[
237+
"--port",
238+
f"{port}",
239+
"--server",
240+
f"{server}",
241+
]
242+
)
234243
if password is not None:
235244
benchmark_command.extend(["--authenticate", password])
236245
if tls_enabled:
@@ -430,6 +439,7 @@ def delete_temporary_files(
430439

431440
port = args.db_server_port
432441
host = args.db_server_host
442+
unix_socket = args.unix_socket
433443
password = args.db_server_password
434444
oss_cluster_api_enabled = args.cluster_mode
435445
ssl_cert_reqs = "required"
@@ -606,7 +616,7 @@ def delete_temporary_files(
606616
)
607617
continue
608618
if "preload_tool" in benchmark_config["dbconfig"]:
609-
if args.skip_tests_with_preload_via_tool is False:
619+
if args.skip_tests_with_preload_via_tool is True:
610620
logging.warning(
611621
"Skipping test {} giving it implies dataset preload via tool".format(
612622
test_name
@@ -648,6 +658,7 @@ def delete_temporary_files(
648658
args.benchmark_local_install,
649659
password,
650660
oss_cluster_api_enabled,
661+
unix_socket,
651662
)
652663
if res is False:
653664
logging.warning(
@@ -748,6 +759,7 @@ def delete_temporary_files(
748759
resp_version,
749760
override_memtier_test_time,
750761
override_test_runs,
762+
unix_socket,
751763
)
752764

753765
if (
@@ -1151,6 +1163,7 @@ def data_prepopulation_step(
11511163
benchmark_local_install=False,
11521164
password=None,
11531165
oss_cluster_api_enabled=False,
1166+
unix_socket="",
11541167
):
11551168
result = True
11561169
# setup the benchmark
@@ -1193,6 +1206,8 @@ def data_prepopulation_step(
11931206
tls_cacert,
11941207
resp_version,
11951208
override_memtier_test_time_preload,
1209+
1,
1210+
unix_socket,
11961211
)
11971212
if arbitrary_command is True and oss_cluster_api_enabled:
11981213
logging.warning(
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
version: 0.4
2+
name: memtier_benchmark-10Mkeys-string-get-10B-pipeline-100-nokeyprefix
3+
description: Runs memtier_benchmark, for a keyspace length of 10M keys with a data size of 10 Bytes for each key.
4+
dbconfig:
5+
configuration-parameters:
6+
save: '""'
7+
check:
8+
keyspacelen: 10000000
9+
preload_tool:
10+
run_image: redislabs/memtier_benchmark:edge
11+
tool: memtier_benchmark
12+
arguments: '--key-maximum 10000000 -n allkeys --key-prefix "" --data-size 10 --ratio 1:0 --key-pattern P:P -c 50 -t 2 --hide-histogram --key-minimum 1'
13+
resources:
14+
requests:
15+
memory: 1g
16+
tested-commands:
17+
- get
18+
redis-topologies:
19+
- oss-standalone
20+
build-variants:
21+
- gcc:8.5.0-amd64-debian-buster-default
22+
- dockerhub
23+
clientconfig:
24+
run_image: redislabs/memtier_benchmark:edge
25+
tool: memtier_benchmark
26+
arguments: '--key-maximum 10000000 --key-minimum 1 --pipeline 100 --key-prefix "" --distinct-client-seed --data-size 10 --ratio 0:1 --key-pattern R:R -c 10 -t 10 --hide-histogram --test-time 120'
27+
resources:
28+
requests:
29+
cpus: '10'
30+
memory: 2g
31+
32+
tested-groups:
33+
- string
34+
priority: 1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
version: 0.4
2+
name: memtier_benchmark-1Mkeys-load-string-with-10B-values-pipeline-100-nokeyprefix
3+
description: Runs memtier_benchmark, for a keyspace length of 1M keys loading STRINGs in which the value has a data size of 10 Bytes.
4+
dbconfig:
5+
configuration-parameters:
6+
save: '""'
7+
check:
8+
keyspacelen: 0
9+
resources:
10+
requests:
11+
memory: 1g
12+
tested-commands:
13+
- set
14+
redis-topologies:
15+
- oss-standalone
16+
build-variants:
17+
- gcc:8.5.0-amd64-debian-buster-default
18+
- dockerhub
19+
clientconfig:
20+
run_image: redislabs/memtier_benchmark:edge
21+
tool: memtier_benchmark
22+
arguments: '"--pipeline" "100" "--data-size" "10" --distinct-client-seed --key-prefix "" --ratio 1:0 --key-pattern P:P --key-minimum=1 --key-maximum 1000000 --test-time 120 -c 10 -t 10 --hide-histogram'
23+
resources:
24+
requests:
25+
cpus: '10'
26+
memory: 2g
27+
28+
tested-groups:
29+
- string
30+
priority: 17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
version: 0.4
2+
name: memtier_benchmark-1Mkeys-string-get-10B-pipeline-100-nokeyprefix
3+
description: Runs memtier_benchmark, for a keyspace length of 1M keys with a data size of 10 Bytes for each key.
4+
dbconfig:
5+
configuration-parameters:
6+
save: '""'
7+
check:
8+
keyspacelen: 1000000
9+
preload_tool:
10+
run_image: redislabs/memtier_benchmark:edge
11+
tool: memtier_benchmark
12+
arguments: '--key-maximum 1000000 -n allkeys --key-prefix "" --data-size 10 --ratio 1:0 --key-pattern P:P -c 50 -t 2 --hide-histogram --key-minimum 1'
13+
resources:
14+
requests:
15+
memory: 1g
16+
tested-commands:
17+
- get
18+
redis-topologies:
19+
- oss-standalone
20+
build-variants:
21+
- gcc:8.5.0-amd64-debian-buster-default
22+
- dockerhub
23+
clientconfig:
24+
run_image: redislabs/memtier_benchmark:edge
25+
tool: memtier_benchmark
26+
arguments: '--key-maximum 1000000 --key-minimum 1 --pipeline 100 --key-prefix "" --distinct-client-seed --data-size 10 --ratio 0:1 --key-pattern R:R -c 10 -t 10 --hide-histogram --test-time 120'
27+
resources:
28+
requests:
29+
cpus: '10'
30+
memory: 2g
31+
32+
tested-groups:
33+
- string
34+
priority: 1

0 commit comments

Comments
 (0)