diff --git a/redis_benchmarks_specification/__builder__/builder.py b/redis_benchmarks_specification/__builder__/builder.py index a90fc40..5e46bd1 100644 --- a/redis_benchmarks_specification/__builder__/builder.py +++ b/redis_benchmarks_specification/__builder__/builder.py @@ -654,7 +654,10 @@ def generate_benchmark_stream_request( for artifact in build_artifacts: bin_key = f"zipped:artifacts:{prefix}:{id}:{artifact}.zip" if artifact == "redisearch.so": - bin_artifact = open(f"{redis_temporary_dir}modules/redisearch/src/bin/linux-x64-release/search-community/{artifact}", "rb").read() + bin_artifact = open( + f"{redis_temporary_dir}modules/redisearch/src/bin/linux-x64-release/search-community/{artifact}", + "rb", + ).read() else: bin_artifact = open(f"{redis_temporary_dir}src/{artifact}", "rb").read() bin_artifact_len = len(bytes(bin_artifact)) diff --git a/redis_benchmarks_specification/__runner__/runner.py b/redis_benchmarks_specification/__runner__/runner.py index db94571..71c96cc 100644 --- a/redis_benchmarks_specification/__runner__/runner.py +++ b/redis_benchmarks_specification/__runner__/runner.py @@ -203,30 +203,31 @@ def run_client_runner_logic(args, project_name, project_name_suffix, project_ver override_memtier_test_time, ) + def prepare_vector_db_benchmark_parameters( - clientconfig, - full_benchmark_path, - port, - server, - password, - client_mnt_point + clientconfig, full_benchmark_path, port, server, password, client_mnt_point ): benchmark_command = [] # if port is not None: # benchmark_command.extend(["REDIS_PORT={}".format(port)]) # if password is not None: # benchmark_command.extend(["REDIS_AUTH={}".format(password)]) - benchmark_command.extend([ - full_benchmark_path, - "--host", - f"{server}", - ]) + benchmark_command.extend( + [ + full_benchmark_path, + "--host", + f"{server}", + ] + ) benchmark_command.extend(["--engines", clientconfig.get("engines", "redis-test")]) - benchmark_command.extend(["--datasets", clientconfig.get("datasets", "glove-100-angular")]) + benchmark_command.extend( + ["--datasets", clientconfig.get("datasets", "glove-100-angular")] + ) benchmark_command_str = " ".join(benchmark_command) benchmark_command_str = f"bash -c 'ITERATIONS=1 {benchmark_command_str} && mv /code/results {client_mnt_point}.'" return None, benchmark_command_str + def prepare_memtier_benchmark_parameters( clientconfig, full_benchmark_path, @@ -771,7 +772,6 @@ def delete_temporary_files( False, ) - if ( arbitrary_command and oss_cluster_api_enabled diff --git a/redis_benchmarks_specification/__self_contained_coordinator__/clients.py b/redis_benchmarks_specification/__self_contained_coordinator__/clients.py index 6973969..788b964 100644 --- a/redis_benchmarks_specification/__self_contained_coordinator__/clients.py +++ b/redis_benchmarks_specification/__self_contained_coordinator__/clients.py @@ -33,12 +33,18 @@ def prepare_vector_db_benchmark_parameters( benchmark_command = [] if port is not None: benchmark_command.extend(["REDIS_PORT={}".format(port)]) - benchmark_command.extend([ - full_benchmark_path, - "--host", - f"{server}", - ]) - benchmark_command.extend(["--engines", clientconfig.get("engines", "redis-m-8-ef-16")]) - benchmark_command.extend(["--datasets", clientconfig.get("datasets", "glove-100-angular")]) + benchmark_command.extend( + [ + full_benchmark_path, + "--host", + f"{server}", + ] + ) + benchmark_command.extend( + ["--engines", clientconfig.get("engines", "redis-m-8-ef-16")] + ) + benchmark_command.extend( + ["--datasets", clientconfig.get("datasets", "glove-100-angular")] + ) benchmark_command_str = " ".join(benchmark_command) return None, benchmark_command_str diff --git a/redis_benchmarks_specification/__self_contained_coordinator__/post_processing.py b/redis_benchmarks_specification/__self_contained_coordinator__/post_processing.py index f607806..15676c6 100644 --- a/redis_benchmarks_specification/__self_contained_coordinator__/post_processing.py +++ b/redis_benchmarks_specification/__self_contained_coordinator__/post_processing.py @@ -1,18 +1,19 @@ import os import json + def post_process_vector_db(temporary_dir): - results_dir = os.path.join(temporary_dir, 'results') + results_dir = os.path.join(temporary_dir, "results") results = {} for file in os.listdir(results_dir): if "upload" in file: - with open(os.path.join(results_dir, file), 'r') as f: + with open(os.path.join(results_dir, file), "r") as f: upload_results = json.load(f) - results['upload_time'] = upload_results['results']['upload_time'] + results["upload_time"] = upload_results["results"]["upload_time"] else: - with open(os.path.join(results_dir, file), 'r') as f: + with open(os.path.join(results_dir, file), "r") as f: query_results = json.load(f) - results['rps'] = query_results['results']['rps'] - results['precision'] = query_results['results']['mean_precisions'] - results['total_time'] = query_results['results']['total_time'] + results["rps"] = query_results["results"]["rps"] + results["precision"] = query_results["results"]["mean_precisions"] + results["total_time"] = query_results["results"]["total_time"] return results diff --git a/redis_benchmarks_specification/__self_contained_coordinator__/runners.py b/redis_benchmarks_specification/__self_contained_coordinator__/runners.py index eb8aa1f..067c782 100644 --- a/redis_benchmarks_specification/__self_contained_coordinator__/runners.py +++ b/redis_benchmarks_specification/__self_contained_coordinator__/runners.py @@ -412,7 +412,6 @@ def process_self_contained_coordinator_stream( False, ) - client_container_image = extract_client_container_image( benchmark_config ) diff --git a/redis_benchmarks_specification/__self_contained_coordinator__/self_contained_coordinator.py b/redis_benchmarks_specification/__self_contained_coordinator__/self_contained_coordinator.py index 2312d10..3020e07 100644 --- a/redis_benchmarks_specification/__self_contained_coordinator__/self_contained_coordinator.py +++ b/redis_benchmarks_specification/__self_contained_coordinator__/self_contained_coordinator.py @@ -15,7 +15,9 @@ import time from docker.models.containers import Container -from redis_benchmarks_specification.__self_contained_coordinator__.post_processing import post_process_vector_db +from redis_benchmarks_specification.__self_contained_coordinator__.post_processing import ( + post_process_vector_db, +) from redisbench_admin.profilers.profilers_local import ( check_compatible_system_and_kernel_and_prepare_profile, ) @@ -1025,7 +1027,7 @@ def process_self_contained_coordinator_stream( "mode": "rw", }, }, - #auto_remove=True, + auto_remove=True, privileged=True, working_dir=benchmark_tool_workdir, command=benchmark_command_str, @@ -1034,8 +1036,16 @@ def process_self_contained_coordinator_stream( cpuset_cpus=client_cpuset_cpus, ) except docker.errors.ContainerError as e: - logging.info("stdout: {}".format(e.container.logs(stdout=True))) - logging.info("stderr: {}".format(e.container.logs(stderr=True))) + logging.info( + "stdout: {}".format( + e.container.logs(stdout=True) + ) + ) + logging.info( + "stderr: {}".format( + e.container.logs(stderr=True) + ) + ) raise e benchmark_end_time = datetime.datetime.now() @@ -1159,8 +1169,12 @@ def process_self_contained_coordinator_stream( ): datapoint_time_ms = git_timestamp_ms if "vector_db_benchmark" in benchmark_tool: - print(f"Debug: Post-processing vector-db-benchmark results") - results_dict = post_process_vector_db(temporary_dir_client) + print( + f"Debug: Post-processing vector-db-benchmark results" + ) + results_dict = post_process_vector_db( + temporary_dir_client + ) print(f"Debug: results: {results_dict}") else: post_process_benchmark_results(