Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using metadata property in run-remote tool. Updated ann-benchmarks #308

Merged
merged 2 commits into from
Mar 10, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "redisbench-admin"
version = "0.7.7"
version = "0.7.8"
description = "Redis benchmark run helper. A wrapper around Redis and Redis Modules benchmark tools ( ftsb_redisearch, memtier_benchmark, redis-benchmark, aibench, etc... )."
authors = ["filipecosta90 <filipecosta.90@gmail.com>","Redis Performance Group <performance@redis.com>"]
readme = "README.md"
Expand Down
2 changes: 1 addition & 1 deletion redisbench_admin/run/args.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
BENCHMARK_GLOB = os.getenv("BENCHMARK_GLOB", "*.yml")
S3_BUCKET_NAME = os.getenv("S3_BUCKET_NAME", "ci.benchmarks.redislabs")
PUSH_S3 = bool(os.getenv("PUSH_S3", False))
FAIL_FAST = bool(os.getenv("FAIL_FAST", False))
FAIL_FAST = bool(int(os.getenv("FAIL_FAST", 0)))
PROFILERS_DSO = os.getenv("PROFILERS_DSO", None)
PROFILERS_ENABLED = bool(int(os.getenv("PROFILE", 0)))
PROFILERS = os.getenv("PROFILERS", PROFILERS_DEFAULT)
Expand Down
8 changes: 8 additions & 0 deletions redisbench_admin/run_remote/run_remote.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@
)
from redisbench_admin.utils.benchmark_config import (
prepare_benchmark_definitions,
get_metadata_tags,
)
from redisbench_admin.utils.redisgraph_benchmark_go import setup_remote_benchmark_agent
from redisbench_admin.utils.remote import (
Expand Down Expand Up @@ -211,6 +212,12 @@ def run_remote_command_logic(args, project_name, project_version):
overall_tables[setup_name] = {}

for test_name, benchmark_config in benchmarks_map.items():
metadata_tags = get_metadata_tags(benchmark_config)
logging.info(
"Including the extra metadata tags into this test generated time-series: {}".format(
metadata_tags
)
)
for repetition in range(1, BENCHMARK_REPETITIONS + 1):
remote_perf = None
logging.info(
Expand Down Expand Up @@ -665,6 +672,7 @@ def run_remote_command_logic(args, project_name, project_version):
tf_github_org,
tf_github_repo,
tf_triggering_env,
metadata_tags,
)
if branch_target_tables is not None:
for (
Expand Down
7 changes: 7 additions & 0 deletions redisbench_admin/utils/benchmark_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -292,6 +292,13 @@ def extract_exporter_metrics(default_config):
return default_metrics, exporter_timemetric_path


def get_metadata_tags(benchmark_config):
metadata_tags = {}
if "metadata" in benchmark_config:
metadata_tags = benchmark_config["metadata"]
return metadata_tags


def extract_benchmark_type_from_config(
benchmark_config,
config_key="clientconfig",
Expand Down
13 changes: 13 additions & 0 deletions tests/test_benchmark_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
check_required_modules,
extract_redis_dbconfig_parameters,
extract_benchmark_type_from_config,
get_metadata_tags,
)


Expand Down Expand Up @@ -132,3 +133,15 @@ def test_extract_benchmark_type_from_config():
)
assert benchmark_type == "mixed"
assert benchmark_config_present == False


def test_get_metadata_tags():
with open("./tests/test_data/vecsim-memtier.yml", "r") as yml_file:
benchmark_config = yaml.safe_load(yml_file)
metadata_tags = get_metadata_tags(benchmark_config)
assert metadata_tags == {"component": "vecsim"}

with open("./tests/test_data/redis-benchmark.yml", "r") as yml_file:
benchmark_config = yaml.safe_load(yml_file)
metadata_tags = get_metadata_tags(benchmark_config)
assert metadata_tags == {}
2 changes: 2 additions & 0 deletions tests/test_data/vecsim-memtier.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@

name: "vecsim_hybrid_HNSW_05"
description: "hybrid hnsw with 0.5% filtered results"
metadata:
component: "vecsim"
remote:
- type: oss-standalone
- setup: redisearch-m5d
Expand Down
7 changes: 5 additions & 2 deletions tests/test_run_remote.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,13 @@
import os

import redis
from redisbench_admin.run.metrics import collect_redis_metrics
import yaml

from redisbench_admin.run.metrics import collect_redis_metrics

from redisbench_admin.run_remote.run_remote import export_redis_metrics
from redisbench_admin.run_remote.run_remote import (
export_redis_metrics,
)


def test_export_redis_metrics():
Expand Down