Skip to content

Commit fa718be

Browse files
committed
Add loading vector-db-benchmark results into vdb_results variable
1 parent 89767aa commit fa718be

File tree

6 files changed

+34
-8
lines changed

6 files changed

+34
-8
lines changed

redis_benchmarks_specification/__runner__/runner.py

+3-2
Original file line numberDiff line numberDiff line change
@@ -209,8 +209,8 @@ def prepare_vector_db_benchmark_parameters(
209209
port,
210210
server,
211211
password,
212+
client_mnt_point
212213
):
213-
logging.info(f"Marcin debug prepare_vdb: {full_benchmark_path}")
214214
benchmark_command = []
215215
# if port is not None:
216216
# benchmark_command.extend(["REDIS_PORT={}".format(port)])
@@ -221,9 +221,10 @@ def prepare_vector_db_benchmark_parameters(
221221
"--host",
222222
f"{server}",
223223
])
224-
benchmark_command.extend(["--engines", clientconfig.get("engines", "redis-hnsw-m-16-ef-128")])
224+
benchmark_command.extend(["--engines", clientconfig.get("engines", "redis-test")])
225225
benchmark_command.extend(["--datasets", clientconfig.get("datasets", "glove-100-angular")])
226226
benchmark_command_str = " ".join(benchmark_command)
227+
benchmark_command_str = f"bash -c 'ITERATIONS=1 {benchmark_command_str} && mv /code/results {client_mnt_point}.'"
227228
return None, benchmark_command_str
228229

229230
def prepare_memtier_benchmark_parameters(
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
import os
2+
import json
3+
4+
def post_process_vector_db(temporary_dir):
5+
results_dir = os.path.join(temporary_dir, 'results')
6+
results = {}
7+
for file in os.listdir(results_dir):
8+
if "upload" in file:
9+
with open(os.path.join(results_dir, file), 'r') as f:
10+
upload_results = json.load(f)
11+
results['upload_time'] = upload_results['results']['upload_time']
12+
else:
13+
with open(os.path.join(results_dir, file), 'r') as f:
14+
query_results = json.load(f)
15+
results['rps'] = query_results['results']['rps']
16+
results['precision'] = query_results['results']['mean_precisions']
17+
results['total_time'] = query_results['results']['total_time']
18+
return results

redis_benchmarks_specification/__self_contained_coordinator__/self_contained_coordinator.py

+7
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
import time
1616

1717
from docker.models.containers import Container
18+
from redis_benchmarks_specification.__self_contained_coordinator__.post_processing import post_process_vector_db
1819
from redisbench_admin.profilers.profilers_local import (
1920
check_compatible_system_and_kernel_and_prepare_profile,
2021
)
@@ -823,6 +824,7 @@ def process_self_contained_coordinator_stream(
823824
)
824825
)
825826
if restore_build_artifacts:
827+
print(f"Marcin debug1: Restoring build artifacts")
826828
restore_build_artifacts_from_test_details(
827829
build_artifacts,
828830
github_event_conn,
@@ -968,6 +970,7 @@ def process_self_contained_coordinator_stream(
968970
redis_proc_start_port,
969971
"localhost",
970972
None,
973+
client_mnt_point,
971974
)
972975
else:
973976
(
@@ -1155,6 +1158,10 @@ def process_self_contained_coordinator_stream(
11551158
and git_timestamp_ms is not None
11561159
):
11571160
datapoint_time_ms = git_timestamp_ms
1161+
if "vector_db_benchmark" in benchmark_tool:
1162+
print(f"Debug: Post-processing vector-db-benchmark results")
1163+
vdb_results = post_process_vector_db(temporary_dir_client)
1164+
print(f"Debug: results: {vdb_results}")
11581165
post_process_benchmark_results(
11591166
benchmark_tool,
11601167
local_benchmark_output_filename,

redis_benchmarks_specification/setups/builders/gcc:11.5.0-amd64-debian-bullseye-redisearch.yml renamed to redis_benchmarks_specification/setups/builders/gcc:10.5.0-amd64-debian-bullseye-redisearch.yml

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,21 @@
11
version: 0.1
2-
id: gcc:11.5.0-amd64-debian-bullseye-redisearch
2+
id: gcc:10.5.0-amd64-debian-bullseye-redisearch
33
os: debian-bullseye
44
arch: amd64
55
compiler: "gcc"
66
cpp_compiler: "g++"
77
kind: docker
8-
build_image: gcc:11.5.0-bullseye
8+
build_image: gcc:10.5.0-bullseye
99
run_image: debian:bullseye
1010
description: "Using GNU Compiler Containers (https://hub.docker.com/_/gcc?tab=description)
1111
pre-configured environment with all the tools required to build with gcc."
1212
build_artifacts:
1313
- redisearch.so
1414
- redis-server
15-
build_command: "sh -c 'BUILD_WITH_MODULES=yes make --ignore-errors -j && cd modules/redisearch/src && make setup && make build && cd -'"
15+
build_command: "sh -c 'apt update && apt install python3-pip -y && BUILD_WITH_MODULES=yes make --ignore-errors -j && cd modules/redisearch/src && make setup && make build && cd -'"
1616
metadata:
1717
compiler: "gcc"
18-
compiler_version: "11.5.0"
18+
compiler_version: "10.5.0"
1919
os: debian-bullseye
2020
arch: amd64
2121

redis_benchmarks_specification/setups/topologies/topologies.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ spec:
1515
redis_topology:
1616
primaries: 1
1717
replicas: 0
18-
redis_arguments: --loadmodule /mnt/redis/modules/redisearch/src/bin/linux-x64-release/search-community/redisearch.so
18+
redis_arguments: --loadmodule /mnt/redis/redisearch.so
1919
resources:
2020
requests:
2121
cpus: "1"

redis_benchmarks_specification/test-suites/vector_db_benchmark_test.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ tested-commands:
1616
redis-topologies:
1717
- oss-standalone-with-redisearch
1818
build-variants:
19-
- gcc:11.5.0-amd64-debian-bullseye-redisearch
19+
- gcc:10.5.0-amd64-debian-bullseye-redisearch
2020
- dockerhub
2121
clientconfig:
2222
run_image: vector-db-benchmark:test

0 commit comments

Comments
 (0)