Skip to content

Commit a4fa679

Browse files
Enabled defaults metrics parsing and merging (#226)
* Enabled defaults metrics parsing and merging * Include arm64 build variant * Fixed missing default_metrics passing within scc * Fixed missing default_metrics passing within scc * Fixed missing default_metrics passing within scc
1 parent 82e394d commit a4fa679

File tree

7 files changed

+98
-8
lines changed

7 files changed

+98
-8
lines changed

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[tool.poetry]
22
name = "redis-benchmarks-specification"
3-
version = "0.1.68"
3+
version = "0.1.69"
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 <filipecosta.90@gmail.com>","Redis Performance Group <performance@redis.com>"]
66
readme = "Readme.md"

redis_benchmarks_specification/__builder__/builder.py

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ def main():
6161
"--logname", type=str, default=None, help="logname to write the logs to"
6262
)
6363
parser.add_argument(
64-
"--arch", type=str, default="x86", help="arch to build artifacts"
64+
"--arch", type=str, default="amd64", help="arch to build artifacts"
6565
)
6666
parser.add_argument(
6767
"--setups-folder",
@@ -132,6 +132,9 @@ def main():
132132
logging.error("Error message {}".format(e.__str__()))
133133
exit(1)
134134

135+
arch = args.arch
136+
logging.info("Building for arch: {}".format(arch))
137+
135138
build_spec_image_prefetch(builders_folder, different_build_specs)
136139

137140
builder_consumer_group_create(conn)
@@ -144,6 +147,7 @@ def main():
144147
different_build_specs,
145148
previous_id,
146149
args.docker_air_gap,
150+
arch,
147151
)
148152

149153

@@ -169,7 +173,12 @@ def builder_consumer_group_create(conn, id="$"):
169173

170174

171175
def builder_process_stream(
172-
builders_folder, conn, different_build_specs, previous_id, docker_air_gap=False
176+
builders_folder,
177+
conn,
178+
different_build_specs,
179+
previous_id,
180+
docker_air_gap=False,
181+
arch="amd64",
173182
):
174183
new_builds_count = 0
175184
logging.info("Entering blocking read waiting for work.")
@@ -217,6 +226,14 @@ def builder_process_stream(
217226
build_config_metadata = get_build_config_metadata(build_config)
218227

219228
build_image = build_config["build_image"]
229+
build_arch = build_config["arch"]
230+
if build_arch != arch:
231+
logging.info(
232+
"skipping build spec {} given arch {}!={}".format(
233+
build_spec, build_arch, arch
234+
)
235+
)
236+
continue
220237
run_image = build_image
221238
if "run_image" in build_config:
222239
run_image = build_config["run_image"]
@@ -247,7 +264,6 @@ def builder_process_stream(
247264
compiler = build_config["compiler"]
248265
cpp_compiler = build_config["cpp_compiler"]
249266
build_os = build_config["os"]
250-
build_arch = build_config["arch"]
251267

252268
build_artifacts = ["redis-server"]
253269
if "build_artifacts" in build_config:

redis_benchmarks_specification/__common__/runner.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,7 @@ def exporter_datasink_common(
143143
tf_github_repo,
144144
tf_triggering_env,
145145
topology_spec_name,
146+
default_metrics=None,
146147
):
147148
logging.info("Using datapoint_time_ms: {}".format(datapoint_time_ms))
148149
timeseries_test_sucess_flow(
@@ -151,7 +152,7 @@ def exporter_datasink_common(
151152
benchmark_config,
152153
benchmark_duration_seconds,
153154
dataset_load_duration_seconds,
154-
None,
155+
default_metrics,
155156
topology_spec_name,
156157
setup_name,
157158
None,

redis_benchmarks_specification/__runner__/runner.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ def run_client_runner_logic(args, project_name, project_name_suffix, project_ver
157157
resp_version = args.resp
158158
client_aggregated_results_folder = args.client_aggregated_results_folder
159159
preserve_temporary_client_dirs = args.preserve_temporary_client_dirs
160-
override_memtier_test_time = args.override_memtier_test_time
160+
161161
docker_client = docker.from_env()
162162
home = str(Path.home())
163163
profilers_list = []
@@ -172,6 +172,7 @@ def run_client_runner_logic(args, project_name, project_name_suffix, project_ver
172172
)
173173
)
174174
exit(1)
175+
override_memtier_test_time = args.override_memtier_test_time
175176
if override_memtier_test_time > 0:
176177
logging.info(
177178
"Overriding memtier benchmark --test-time to {} seconds".format(
@@ -855,6 +856,7 @@ def process_self_contained_coordinator_stream(
855856
tf_github_repo,
856857
tf_triggering_env,
857858
topology_spec_name,
859+
default_metrics,
858860
)
859861
test_result = True
860862
total_test_suite_runs = total_test_suite_runs + 1

redis_benchmarks_specification/__self_contained_coordinator__/args.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,4 +135,16 @@ def create_self_contained_coordinator_args(project_name):
135135
action="store_true",
136136
help="Run in verbose mode.",
137137
)
138+
parser.add_argument(
139+
"--override-memtier-test-time",
140+
default=0,
141+
type=int,
142+
help="override memtier test-time for each benchmark. By default will preserve test time specified in test spec",
143+
)
144+
parser.add_argument(
145+
"--defaults_filename",
146+
type=str,
147+
default="{}/defaults.yml".format(SPECS_PATH_TEST_SUITES),
148+
help="specify the defaults file containing spec topologies, common metric extractions,etc...",
149+
)
138150
return parser

redis_benchmarks_specification/__self_contained_coordinator__/self_contained_coordinator.py

Lines changed: 41 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,9 @@
3333
reset_commandstats,
3434
exporter_datasink_common,
3535
)
36+
from redis_benchmarks_specification.__runner__.runner import (
37+
print_results_table_stdout,
38+
)
3639
from redis_benchmarks_specification.__self_contained_coordinator__.args import (
3740
create_self_contained_coordinator_args,
3841
)
@@ -61,6 +64,7 @@
6164
from redisbench_admin.utils.benchmark_config import (
6265
get_final_benchmark_config,
6366
extract_redis_dbconfig_parameters,
67+
get_defaults,
6468
)
6569
from redisbench_admin.utils.local import get_local_run_full_filename
6670
from redisbench_admin.utils.results import post_process_benchmark_results
@@ -197,6 +201,15 @@ def main():
197201
datasink_push_results_redistimeseries = args.datasink_push_results_redistimeseries
198202
grafana_profile_dashboard = args.grafana_profile_dashboard
199203

204+
defaults_filename = args.defaults_filename
205+
(
206+
_,
207+
default_metrics,
208+
_,
209+
_,
210+
_,
211+
) = get_defaults(defaults_filename)
212+
200213
# Consumer id
201214
consumer_pos = args.consumer_pos
202215
logging.info("Consumer pos {}".format(consumer_pos))
@@ -221,6 +234,13 @@ def main():
221234
)
222235
exit(1)
223236

237+
override_memtier_test_time = args.override_memtier_test_time
238+
if override_memtier_test_time > 0:
239+
logging.info(
240+
"Overriding memtier benchmark --test-time to {} seconds".format(
241+
override_memtier_test_time
242+
)
243+
)
224244
logging.info("Entering blocking read waiting for work.")
225245
if stream_id is None:
226246
stream_id = args.consumer_start_id
@@ -242,6 +262,8 @@ def main():
242262
redis_proc_start_port,
243263
consumer_pos,
244264
docker_air_gap,
265+
override_memtier_test_time,
266+
default_metrics,
245267
)
246268

247269

@@ -262,6 +284,8 @@ def self_contained_coordinator_blocking_read(
262284
redis_proc_start_port=6379,
263285
consumer_pos=1,
264286
docker_air_gap=False,
287+
override_test_time=None,
288+
default_metrics=None,
265289
):
266290
num_process_streams = 0
267291
num_process_test_suites = 0
@@ -304,6 +328,9 @@ def self_contained_coordinator_blocking_read(
304328
cpuset_start_pos,
305329
redis_proc_start_port,
306330
docker_air_gap,
331+
"defaults.yml",
332+
None,
333+
default_metrics,
307334
)
308335
num_process_streams = num_process_streams + 1
309336
num_process_test_suites = num_process_test_suites + total_test_suite_runs
@@ -373,6 +400,8 @@ def process_self_contained_coordinator_stream(
373400
redis_proc_start_port=6379,
374401
docker_air_gap=False,
375402
defaults_filename="defaults.yml",
403+
override_test_time=None,
404+
default_metrics=[],
376405
):
377406
stream_id = "n/a"
378407
overall_result = False
@@ -796,6 +825,15 @@ def process_self_contained_coordinator_stream(
796825
"r",
797826
) as json_file:
798827
results_dict = json.load(json_file)
828+
print_results_table_stdout(
829+
benchmark_config,
830+
default_metrics,
831+
results_dict,
832+
setup_type,
833+
test_name,
834+
None,
835+
)
836+
799837
dataset_load_duration_seconds = 0
800838

801839
exporter_datasink_common(
@@ -819,6 +857,7 @@ def process_self_contained_coordinator_stream(
819857
tf_github_repo,
820858
tf_triggering_env,
821859
topology_spec_name,
860+
default_metrics,
822861
)
823862
r.shutdown(save=False)
824863
test_result = True
@@ -867,13 +906,13 @@ def process_self_contained_coordinator_stream(
867906
)
868907
)
869908
pass
870-
shutil.rmtree(temporary_dir, ignore_errors=True)
871-
shutil.rmtree(temporary_dir_client, ignore_errors=True)
872909
logging.info(
873910
"Removing temporary dirs {} and {}".format(
874911
temporary_dir, temporary_dir_client
875912
)
876913
)
914+
shutil.rmtree(temporary_dir, ignore_errors=True)
915+
shutil.rmtree(temporary_dir_client, ignore_errors=True)
877916

878917
overall_result &= test_result
879918

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
version: 0.1
2+
id: gcc:8.5.0-arm64-debian-buster-default
3+
os: debian-buster
4+
arch: arm64
5+
compiler: "gcc"
6+
cpp_compiler: "g++"
7+
kind: docker
8+
build_image: gcc:8.5.0-buster
9+
run_image: debian:buster
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+
metadata:
13+
compiler: "gcc"
14+
compiler_version: "8.5.0"
15+
os: debian-buster
16+
arch: arm64
17+
18+
env:
19+
REDIS_CFLAGS: "-g -fno-omit-frame-pointer"
20+

0 commit comments

Comments
 (0)