Skip to content

Commit ca41ef7

Browse files
committed
Add new builder yaml to build redisearch.so
1 parent 84fb7d8 commit ca41ef7

File tree

8 files changed

+156
-56
lines changed

8 files changed

+156
-56
lines changed

redis_benchmarks_specification/__builder__/builder.py

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -381,6 +381,9 @@ def builder_process_stream(
381381
# build_vars_str,
382382
# )
383383
build_command = "sh -c 'make -j'"
384+
print(f"Marcin debug: build_config: {build_config}")
385+
if "build_command" in build_config:
386+
build_command = build_config["build_command"]
384387
if b"build_command" in testDetails:
385388
build_command = testDetails[b"build_command"].decode()
386389
server_name = "redis"
@@ -427,7 +430,7 @@ def builder_process_stream(
427430
volumes={
428431
redis_temporary_dir: {"bind": "/mnt/redis/", "mode": "rw"},
429432
},
430-
auto_remove=True,
433+
auto_remove=False,
431434
privileged=True,
432435
working_dir="/mnt/redis/",
433436
command=build_command,
@@ -647,9 +650,13 @@ def generate_benchmark_stream_request(
647650
build_stream_fields["git_timestamp_ms"] = git_timestamp_ms
648651

649652
prefix = f"github_org={github_org}/github_repo={github_repo}/git_branch={str(git_branch)}/git_version={str(git_version)}/git_hash={str(git_hash)}"
653+
print(f"Marcin debug: build_artifacts: {build_artifacts}")
650654
for artifact in build_artifacts:
651655
bin_key = f"zipped:artifacts:{prefix}:{id}:{artifact}.zip"
652-
bin_artifact = open(f"{redis_temporary_dir}src/{artifact}", "rb").read()
656+
if artifact == "redisearch.so":
657+
bin_artifact = open(f"{redis_temporary_dir}modules/redisearch/src/bin/linux-x64-release/search-community/{artifact}", "rb").read()
658+
else:
659+
bin_artifact = open(f"{redis_temporary_dir}src/{artifact}", "rb").read()
653660
bin_artifact_len = len(bytes(bin_artifact))
654661
assert bin_artifact_len > 0
655662
conn.set(bin_key, bytes(bin_artifact), ex=REDIS_BINS_EXPIRE_SECS)

redis_benchmarks_specification/__runner__/runner.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -210,17 +210,18 @@ def prepare_vector_db_benchmark_parameters(
210210
server,
211211
password,
212212
):
213+
logging.info(f"Marcin debug prepare_vdb: {full_benchmark_path}")
213214
benchmark_command = []
214-
if port is not None:
215-
benchmark_command.extend(["REDIS_PORT={}".format(port)])
216-
if password is not None:
217-
benchmark_command.extend(["REDIS_AUTH={}".format(password)])
215+
# if port is not None:
216+
# benchmark_command.extend(["REDIS_PORT={}".format(port)])
217+
# if password is not None:
218+
# benchmark_command.extend(["REDIS_AUTH={}".format(password)])
218219
benchmark_command.extend([
219220
full_benchmark_path,
220221
"--host",
221222
f"{server}",
222223
])
223-
benchmark_command.extend(["--engines", clientconfig.get("engines", "redis-m-8-ef-16")])
224+
benchmark_command.extend(["--engines", clientconfig.get("engines", "redis-hnsw-m-16-ef-128")])
224225
benchmark_command.extend(["--datasets", clientconfig.get("datasets", "glove-100-angular")])
225226
benchmark_command_str = " ".join(benchmark_command)
226227
return None, benchmark_command_str

redis_benchmarks_specification/__self_contained_coordinator__/clients.py

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,3 +22,23 @@ def prepare_memtier_benchmark_parameters(
2222
benchmark_command_str = benchmark_command_str + " " + clientconfig["arguments"]
2323

2424
return None, benchmark_command_str
25+
26+
27+
def prepare_vector_db_benchmark_parameters(
28+
clientconfig,
29+
full_benchmark_path,
30+
port,
31+
server,
32+
):
33+
benchmark_command = []
34+
if port is not None:
35+
benchmark_command.extend(["REDIS_PORT={}".format(port)])
36+
benchmark_command.extend([
37+
full_benchmark_path,
38+
"--host",
39+
f"{server}",
40+
])
41+
benchmark_command.extend(["--engines", clientconfig.get("engines", "redis-m-8-ef-16")])
42+
benchmark_command.extend(["--datasets", clientconfig.get("datasets", "glove-100-angular")])
43+
benchmark_command_str = " ".join(benchmark_command)
44+
return None, benchmark_command_str

redis_benchmarks_specification/__self_contained_coordinator__/runners.py

Lines changed: 27 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@
5656
)
5757
from redis_benchmarks_specification.__self_contained_coordinator__.clients import (
5858
prepare_memtier_benchmark_parameters,
59+
prepare_vector_db_benchmark_parameters,
5960
)
6061
from redis_benchmarks_specification.__self_contained_coordinator__.cpuset import (
6162
extract_db_cpu_limit,
@@ -347,9 +348,12 @@ def process_self_contained_coordinator_stream(
347348
# backwards compatible
348349
if benchmark_tool is None:
349350
benchmark_tool = "redis-benchmark"
350-
full_benchmark_path = "/usr/local/bin/{}".format(
351-
benchmark_tool
352-
)
351+
if benchmark_tool == "vector_db_benchmark":
352+
full_benchmark_path = "python /code/run.py"
353+
else:
354+
full_benchmark_path = "/usr/local/bin/{}".format(
355+
benchmark_tool
356+
)
353357

354358
# setup the benchmark
355359
(
@@ -370,34 +374,45 @@ def process_self_contained_coordinator_stream(
370374
local_benchmark_output_filename
371375
)
372376
)
373-
if "memtier_benchmark" not in benchmark_tool:
374-
# prepare the benchmark command
377+
if "memtier_benchmark" in benchmark_tool:
375378
(
376-
benchmark_command,
379+
_,
377380
benchmark_command_str,
378-
) = prepare_benchmark_parameters(
379-
benchmark_config,
381+
) = prepare_memtier_benchmark_parameters(
382+
benchmark_config["clientconfig"],
380383
full_benchmark_path,
381384
redis_proc_start_port,
382385
"localhost",
383386
local_benchmark_output_filename,
384-
False,
385387
benchmark_tool_workdir,
386-
False,
387388
)
388-
else:
389+
elif "vector_db_benchmark" in benchmark_tool:
389390
(
390391
_,
391392
benchmark_command_str,
392-
) = prepare_memtier_benchmark_parameters(
393+
) = prepare_vector_db_benchmark_parameters(
393394
benchmark_config["clientconfig"],
394395
full_benchmark_path,
395396
redis_proc_start_port,
396397
"localhost",
398+
)
399+
else:
400+
# prepare the benchmark command
401+
(
402+
benchmark_command,
403+
benchmark_command_str,
404+
) = prepare_benchmark_parameters(
405+
benchmark_config,
406+
full_benchmark_path,
407+
redis_proc_start_port,
408+
"localhost",
397409
local_benchmark_output_filename,
410+
False,
398411
benchmark_tool_workdir,
412+
False,
399413
)
400414

415+
401416
client_container_image = extract_client_container_image(
402417
benchmark_config
403418
)

redis_benchmarks_specification/__self_contained_coordinator__/self_contained_coordinator.py

Lines changed: 56 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
import traceback
88
import re
99
import docker
10+
import docker.errors
1011
import redis
1112
import os
1213
from pathlib import Path
@@ -55,6 +56,7 @@
5556
from redis_benchmarks_specification.__runner__.runner import (
5657
print_results_table_stdout,
5758
prepare_memtier_benchmark_parameters,
59+
prepare_vector_db_benchmark_parameters,
5860
)
5961
from redis_benchmarks_specification.__self_contained_coordinator__.args import (
6062
create_self_contained_coordinator_args,
@@ -357,13 +359,15 @@ def self_contained_coordinator_blocking_read(
357359
get_runners_consumer_group_name(platform_name), consumer_name
358360
)
359361
)
362+
logging.info(f"Marcin Debug githubevent_conn {github_event_conn}")
360363
newTestInfo = github_event_conn.xreadgroup(
361364
get_runners_consumer_group_name(platform_name),
362365
consumer_name,
363366
{STREAM_KEYNAME_NEW_BUILD_EVENTS: stream_id},
364367
count=1,
365368
block=0,
366369
)
370+
logging.info(f"New test info: {newTestInfo}")
367371
if len(newTestInfo[0]) < 2 or len(newTestInfo[0][1]) < 1:
368372
stream_id = ">"
369373
else:
@@ -549,7 +553,7 @@ def process_self_contained_coordinator_stream(
549553
)
550554
new_executable = f"{mnt_point}{server_name}-server"
551555
logging.info(
552-
"changing executable from {executable} to {new_executable}"
556+
f"changing executable from {executable} to {new_executable}"
553557
)
554558
executable = new_executable
555559

@@ -906,9 +910,12 @@ def process_self_contained_coordinator_stream(
906910
# backwards compatible
907911
if benchmark_tool is None:
908912
benchmark_tool = "redis-benchmark"
909-
full_benchmark_path = "/usr/local/bin/{}".format(
910-
benchmark_tool
911-
)
913+
if benchmark_tool == "vector_db_benchmark":
914+
full_benchmark_path = "python /code/run.py"
915+
else:
916+
full_benchmark_path = "/usr/local/bin/{}".format(
917+
benchmark_tool
918+
)
912919

913920
# setup the benchmark
914921
(
@@ -929,41 +936,52 @@ def process_self_contained_coordinator_stream(
929936
local_benchmark_output_filename
930937
)
931938
)
932-
if "memtier_benchmark" not in benchmark_tool:
939+
if "memtier_benchmark" in benchmark_tool:
933940
# prepare the benchmark command
934941
(
935-
benchmark_command,
942+
_,
936943
benchmark_command_str,
937-
) = prepare_benchmark_parameters(
938-
benchmark_config,
944+
arbitrary_command,
945+
) = prepare_memtier_benchmark_parameters(
946+
benchmark_config["clientconfig"],
939947
full_benchmark_path,
940948
redis_proc_start_port,
941949
"localhost",
950+
None,
942951
local_benchmark_output_filename,
943952
False,
944-
benchmark_tool_workdir,
945953
False,
954+
False,
955+
None,
956+
None,
957+
None,
958+
None,
959+
override_test_time,
946960
)
947-
else:
961+
elif "vector_db_benchmark" in benchmark_tool:
948962
(
949963
_,
950964
benchmark_command_str,
951-
arbitrary_command,
952-
) = prepare_memtier_benchmark_parameters(
965+
) = prepare_vector_db_benchmark_parameters(
953966
benchmark_config["clientconfig"],
954967
full_benchmark_path,
955968
redis_proc_start_port,
956969
"localhost",
957970
None,
971+
)
972+
else:
973+
(
974+
benchmark_command,
975+
benchmark_command_str,
976+
) = prepare_benchmark_parameters(
977+
benchmark_config,
978+
full_benchmark_path,
979+
redis_proc_start_port,
980+
"localhost",
958981
local_benchmark_output_filename,
959982
False,
983+
benchmark_tool_workdir,
960984
False,
961-
False,
962-
None,
963-
None,
964-
None,
965-
None,
966-
override_test_time,
967985
)
968986

969987
client_container_image = extract_client_container_image(
@@ -995,23 +1013,27 @@ def process_self_contained_coordinator_stream(
9951013
)
9961014
# run the benchmark
9971015
benchmark_start_time = datetime.datetime.now()
998-
999-
client_container_stdout = docker_client.containers.run(
1000-
image=client_container_image,
1001-
volumes={
1002-
temporary_dir_client: {
1003-
"bind": client_mnt_point,
1004-
"mode": "rw",
1016+
try:
1017+
client_container_stdout = docker_client.containers.run(
1018+
image=client_container_image,
1019+
volumes={
1020+
temporary_dir_client: {
1021+
"bind": client_mnt_point,
1022+
"mode": "rw",
1023+
},
10051024
},
1006-
},
1007-
auto_remove=True,
1008-
privileged=True,
1009-
working_dir=benchmark_tool_workdir,
1010-
command=benchmark_command_str,
1011-
network_mode="host",
1012-
detach=False,
1013-
cpuset_cpus=client_cpuset_cpus,
1014-
)
1025+
#auto_remove=True,
1026+
privileged=True,
1027+
working_dir=benchmark_tool_workdir,
1028+
command=benchmark_command_str,
1029+
network_mode="host",
1030+
detach=False,
1031+
cpuset_cpus=client_cpuset_cpus,
1032+
)
1033+
except docker.errors.ContainerError as e:
1034+
logging.info("stdout: {}".format(e.container.logs(stdout=True)))
1035+
logging.info("stderr: {}".format(e.container.logs(stderr=True)))
1036+
raise e
10151037

10161038
benchmark_end_time = datetime.datetime.now()
10171039
benchmark_duration_seconds = (
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
version: 0.1
2+
id: gcc:11.5.0-amd64-debian-bullseye-redisearch
3+
os: debian-bullseye
4+
arch: amd64
5+
compiler: "gcc"
6+
cpp_compiler: "g++"
7+
kind: docker
8+
build_image: gcc:11.5.0-bullseye
9+
run_image: debian:bullseye
10+
description: "Using GNU Compiler Containers (https://hub.docker.com/_/gcc?tab=description)
11+
pre-configured environment with all the tools required to build with gcc."
12+
build_artifacts:
13+
- redisearch.so
14+
- redis-server
15+
build_command: "sh -c 'BUILD_WITH_MODULES=yes make --ignore-errors -j && cd modules/redisearch/src && make setup && make build && cd -'"
16+
metadata:
17+
compiler: "gcc"
18+
compiler_version: "11.5.0"
19+
os: debian-bullseye
20+
arch: amd64
21+
22+
env:
23+
REDIS_CFLAGS: "-g -fno-omit-frame-pointer"
24+

redis_benchmarks_specification/setups/topologies/topologies.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,17 @@ spec:
1010
cpus: "1"
1111
memory: "10g"
1212

13+
- name: oss-standalone-with-redisearch
14+
type: oss-standalone
15+
redis_topology:
16+
primaries: 1
17+
replicas: 0
18+
redis_arguments: --loadmodule /mnt/redis/modules/redisearch/src/bin/linux-x64-release/search-community/redisearch.so
19+
resources:
20+
requests:
21+
cpus: "1"
22+
memory: "10g"
23+
1324
- name: oss-standalone-02-io-threads
1425
type: oss-standalone
1526
redis_topology:

redis_benchmarks_specification/test-suites/vector_db_benchmark_test.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,15 @@ tested-groups:
1414
tested-commands:
1515
- search
1616
redis-topologies:
17-
- oss-standalone
17+
- oss-standalone-with-redisearch
1818
build-variants:
19-
- gcc:8.5.0-amd64-debian-buster-default
19+
- gcc:11.5.0-amd64-debian-bullseye-redisearch
2020
- dockerhub
2121
clientconfig:
2222
run_image: vector-db-benchmark:test
2323
tool: vector_db_benchmark
2424
dataset: glove-100-angular
25-
engine: redis-m-16-ef-64
25+
engine: redis-hnsw-m-16-ef-128
2626
#arguments: '"--data-size" "100" --command "LPUSH __key__ __data__" --command-key-pattern="P" --key-minimum=1 --key-maximum 1000000 --test-time 180 -c 50 -t 4 --hide-histogram'
2727
resources:
2828
requests:

0 commit comments

Comments
 (0)