Skip to content

Commit b41d345

Browse files
Fixed preload step on coordinator (#260)
* fixed preload step on coordinator * Fixed test length check on CI
1 parent a948794 commit b41d345

File tree

6 files changed

+166
-3
lines changed

6 files changed

+166
-3
lines changed

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.213"
3+
version = "0.1.214"
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/__runner__/runner.py

+1
Original file line numberDiff line numberDiff line change
@@ -255,6 +255,7 @@ def prepare_memtier_benchmark_parameters(
255255

256256
if oss_cluster_api_enabled is True:
257257
benchmark_command.append("--cluster-mode")
258+
logging.info(f"Preparing the benchmark parameters. {benchmark_command}.")
258259
benchmark_command_str = " ".join(benchmark_command)
259260
if "arguments" in clientconfig:
260261
benchmark_command_str = benchmark_command_str + " " + clientconfig["arguments"]

redis_benchmarks_specification/__self_contained_coordinator__/self_contained_coordinator.py

+2
Original file line numberDiff line numberDiff line change
@@ -1596,11 +1596,13 @@ def data_prepopulation_step(
15961596
(
15971597
_,
15981598
preload_command_str,
1599+
_,
15991600
) = prepare_memtier_benchmark_parameters(
16001601
benchmark_config["dbconfig"]["preload_tool"],
16011602
full_benchmark_path,
16021603
port,
16031604
"localhost",
1605+
None,
16041606
local_benchmark_output_filename,
16051607
False,
16061608
)
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
version: 0.4
2+
name: memtier_benchmark-1Mkeys-generic-touch-pipeline-10
3+
description: Runs memtier_benchmark, for a keyspace length of 1M keys focusing on TOUCH performance.
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: '"--data-size" "100" "--command" "SETEX __key__ 3600 __data__" "--command-key-pattern" "P" "-c" "50" "-t" "2" "--hide-histogram" "--key-minimum" "1"'
13+
resources:
14+
requests:
15+
memory: 1g
16+
tested-commands:
17+
- touch
18+
tested-groups:
19+
- generic
20+
redis-topologies:
21+
- oss-standalone
22+
build-variants:
23+
- gcc:8.5.0-amd64-debian-buster-default
24+
- dockerhub
25+
clientconfig:
26+
run_image: redislabs/memtier_benchmark:edge
27+
tool: memtier_benchmark
28+
arguments: --command "TOUCH __key__" --pipeline 10 --command-key-pattern="R" -c 50 -t 2 --hide-histogram --test-time 180
29+
resources:
30+
requests:
31+
cpus: '2'
32+
memory: 2g
33+
34+
priority: 41

utils/tests/test_runner.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -258,7 +258,7 @@ def test_extract_testsuites():
258258
]
259259
)
260260
tests = extract_testsuites(args)
261-
assert len(tests) == 6
261+
assert len(tests) == 7
262262

263263
args = parser.parse_args(
264264
args=[
@@ -269,7 +269,7 @@ def test_extract_testsuites():
269269
]
270270
)
271271
tests = extract_testsuites(args)
272-
assert len(tests) == 6
272+
assert len(tests) == 7
273273

274274
args = parser.parse_args(
275275
args=[

utils/tests/test_self_contained_coordinator_memtier.py

+126
Original file line numberDiff line numberDiff line change
@@ -226,6 +226,132 @@ def run_coordinator_tests_dockerhub():
226226
return run_coordinator
227227

228228

229+
def test_self_contained_coordinator_dockerhub_preload():
230+
try:
231+
if run_coordinator_tests_dockerhub():
232+
db_port = int(os.getenv("DATASINK_PORT", "6379"))
233+
conn = redis.StrictRedis(port=db_port)
234+
conn.ping()
235+
conn.flushall()
236+
237+
id = "dockerhub"
238+
redis_version = "7.4.0"
239+
run_image = f"redis:{redis_version}"
240+
build_arch = "amd64"
241+
testDetails = {}
242+
build_os = "test_build_os"
243+
build_stream_fields, result = generate_benchmark_stream_request(
244+
id,
245+
conn,
246+
run_image,
247+
build_arch,
248+
testDetails,
249+
build_os,
250+
)
251+
build_stream_fields["mnt_point"] = ""
252+
if result is True:
253+
benchmark_stream_id = conn.xadd(
254+
STREAM_KEYNAME_NEW_BUILD_EVENTS, build_stream_fields
255+
)
256+
logging.info(
257+
"sucessfully requested a new run {}. Stream id: {}".format(
258+
build_stream_fields, benchmark_stream_id
259+
)
260+
)
261+
262+
build_variant_name = "gcc:8.5.0-amd64-debian-buster-default"
263+
expected_datapoint_ts = None
264+
265+
assert conn.exists(STREAM_KEYNAME_NEW_BUILD_EVENTS)
266+
assert conn.xlen(STREAM_KEYNAME_NEW_BUILD_EVENTS) > 0
267+
running_platform = "fco-ThinkPad-T490"
268+
269+
build_runners_consumer_group_create(conn, running_platform, "0")
270+
datasink_conn = redis.StrictRedis(port=db_port)
271+
docker_client = docker.from_env()
272+
home = str(Path.home())
273+
stream_id = ">"
274+
topologies_map = get_topologies(
275+
"./redis_benchmarks_specification/setups/topologies/topologies.yml"
276+
)
277+
# we use a benchmark spec with smaller CPU limit for client given github machines only contain 2 cores
278+
# and we need 1 core for DB and another for CLIENT
279+
testsuite_spec_files = [
280+
"./utils/tests/test_data/test-suites/generic-touch.yml"
281+
]
282+
defaults_filename = "./utils/tests/test_data/test-suites/defaults.yml"
283+
(
284+
_,
285+
_,
286+
default_metrics,
287+
_,
288+
_,
289+
_,
290+
) = get_defaults(defaults_filename)
291+
292+
(
293+
result,
294+
stream_id,
295+
number_processed_streams,
296+
num_process_test_suites,
297+
) = self_contained_coordinator_blocking_read(
298+
conn,
299+
True,
300+
docker_client,
301+
home,
302+
stream_id,
303+
datasink_conn,
304+
testsuite_spec_files,
305+
topologies_map,
306+
running_platform,
307+
False,
308+
[],
309+
"",
310+
0,
311+
6399,
312+
1,
313+
False,
314+
5,
315+
default_metrics,
316+
"amd64",
317+
None,
318+
0,
319+
10000,
320+
"unstable",
321+
"",
322+
True,
323+
False,
324+
)
325+
326+
assert result == True
327+
assert number_processed_streams == 1
328+
assert num_process_test_suites == 1
329+
by_version_key = f"ci.benchmarks.redislabs/ci/redis/redis/memtier_benchmark-1Mkeys-generic-touch-pipeline-10/by.version/{redis_version}/benchmark_end/oss-standalone/memory_maxmemory"
330+
assert datasink_conn.exists(by_version_key)
331+
rts = datasink_conn.ts()
332+
# check we have by version metrics
333+
assert "version" in rts.info(by_version_key).labels
334+
assert redis_version == rts.info(by_version_key).labels["version"]
335+
336+
# get all keys
337+
all_keys = datasink_conn.keys("*")
338+
by_hash_keys = []
339+
for key in all_keys:
340+
if "/by.hash/" in key.decode():
341+
by_hash_keys.append(key)
342+
343+
# ensure we have by hash keys
344+
assert len(by_hash_keys) > 0
345+
for hash_key in by_hash_keys:
346+
# ensure we have both version and hash info on the key
347+
assert "version" in rts.info(hash_key).labels
348+
assert "hash" in rts.info(hash_key).labels
349+
assert redis_version == rts.info(hash_key).labels["version"]
350+
351+
except redis.exceptions.ConnectionError:
352+
pass
353+
354+
229355
def test_self_contained_coordinator_dockerhub():
230356
try:
231357
if run_coordinator_tests_dockerhub():

0 commit comments

Comments
 (0)