Skip to content

Commit 7678cea

Browse files
Enabled running forks source built benchmarks (#264)
* Enabled running forks source built benchmarks * Fixed server_name Null check
1 parent e9b242f commit 7678cea

File tree

9 files changed

+549
-12
lines changed

9 files changed

+549
-12
lines changed

pyproject.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[tool.poetry]
22
name = "redis-benchmarks-specification"
3-
version = "0.1.216"
3+
version = "0.1.217"
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 <[email protected]>","Redis Performance Group <[email protected]>"]
66
readme = "Readme.md"

redis_benchmarks_specification/__builder__/builder.py

+35
Original file line numberDiff line numberDiff line change
@@ -234,6 +234,7 @@ def builder_process_stream(
234234
if b"git_hash" in testDetails:
235235
git_hash = testDetails[b"git_hash"]
236236
logging.info("Received commit hash specifier {}.".format(git_hash))
237+
logging.info(f"Received the following build stream: {testDetails}.")
237238
binary_zip_key = testDetails[b"zip_archive_key"]
238239
logging.info(
239240
"Retriving zipped source from key {}.".format(
@@ -271,6 +272,16 @@ def builder_process_stream(
271272
if b"tests_groups_regexp" in testDetails:
272273
tests_groups_regexp = testDetails[b"tests_groups_regexp"].decode()
273274

275+
github_org = "redis"
276+
if b"github_org" in testDetails:
277+
github_org = testDetails[b"github_org"].decode()
278+
logging.info(f"detected github_org info on build stream {github_org}")
279+
280+
github_repo = "redis"
281+
if b"github_repo" in testDetails:
282+
github_repo = testDetails[b"github_repo"].decode()
283+
logging.info(f"detected github_repo info on build stream {github_repo}")
284+
274285
# github updates
275286
is_actionable_pr = False
276287
contains_regression_comment = False
@@ -321,6 +332,14 @@ def builder_process_stream(
321332
build_artifacts = ["redis-server"]
322333
if "build_artifacts" in build_config:
323334
build_artifacts = build_config["build_artifacts"]
335+
if b"build_artifacts" in testDetails:
336+
new_build_artifacts = (
337+
testDetails[b"build_artifacts"].decode().split(",")
338+
)
339+
logging.info(
340+
f"overriding default build artifacts {build_artifacts} by {new_build_artifacts}"
341+
)
342+
build_artifacts = new_build_artifacts
324343
build_vars_str = ""
325344
if "env" in build_config:
326345
if build_config["env"] is not None:
@@ -361,6 +380,12 @@ def builder_process_stream(
361380
"redis-server",
362381
build_vars_str,
363382
)
383+
if b"build_command" in testDetails:
384+
build_command = testDetails[b"build_command"].decode()
385+
server_name = "redis"
386+
if b"server_name" in testDetails:
387+
server_name = testDetails[b"server_name"].decode()
388+
364389
build_start_datetime = datetime.datetime.utcnow()
365390
logging.info(
366391
"Using the following build command {}.".format(build_command)
@@ -435,6 +460,9 @@ def builder_process_stream(
435460
tests_priority_upper_limit,
436461
tests_regexp,
437462
use_git_timestamp,
463+
server_name,
464+
github_org,
465+
github_repo,
438466
)
439467
if result is True:
440468
benchmark_stream_id = conn.xadd(
@@ -572,6 +600,9 @@ def generate_benchmark_stream_request(
572600
tests_priority_upper_limit=10000,
573601
tests_regexp=".*",
574602
use_git_timestamp=False,
603+
server_name="redis",
604+
github_org="redis",
605+
github_repo="redis",
575606
):
576607
build_stream_fields = {
577608
"id": id,
@@ -584,6 +615,9 @@ def generate_benchmark_stream_request(
584615
"tests_priority_upper_limit": tests_priority_upper_limit,
585616
"tests_priority_lower_limit": tests_priority_lower_limit,
586617
"tests_groups_regexp": tests_groups_regexp,
618+
"server_name": server_name,
619+
"github_org": github_org,
620+
"github_repo": github_repo,
587621
}
588622
if build_config_metadata is not None:
589623
build_stream_fields["metadata"] = json.dumps(build_config_metadata)
@@ -594,6 +628,7 @@ def generate_benchmark_stream_request(
594628
if build_vars_str is not None:
595629
build_stream_fields["build_vars"] = build_vars_str
596630
if build_command is not None:
631+
logging.info(f"adding build_command: {build_command}")
597632
build_stream_fields["build_command"] = build_command
598633
if build_image is not None:
599634
build_stream_fields["build_image"] = build_image

redis_benchmarks_specification/__cli__/args.py

+15
Original file line numberDiff line numberDiff line change
@@ -166,6 +166,21 @@ def spec_cli_args(parser):
166166
action="store_true",
167167
help="Iterate over the git commits.",
168168
)
169+
parser.add_argument(
170+
"--build_artifacts",
171+
type=str,
172+
default="",
173+
)
174+
parser.add_argument(
175+
"--build_command",
176+
type=str,
177+
default="",
178+
)
179+
parser.add_argument(
180+
"--git_hash",
181+
type=str,
182+
default="",
183+
)
169184
parser.add_argument(
170185
"--dry-run",
171186
default=False,

redis_benchmarks_specification/__cli__/cli.py

+16
Original file line numberDiff line numberDiff line change
@@ -355,6 +355,14 @@ def trigger_tests_cli_command_logic(args, project_name, project_version):
355355
filtered_hash_commits = []
356356
for cdict in commits:
357357
commit_hash = cdict["git_hash"]
358+
if args.git_hash != "":
359+
if args.git_hash != commit_hash:
360+
logging.info(
361+
"Skipping {} given it does not match commit hash {}".format(
362+
commit_hash, args.git_hash
363+
)
364+
)
365+
continue
358366
commit_summary = cdict["commit_summary"]
359367
commit_datetime = cdict["commit_datetime"]
360368
match_obj = re.search(hash_regexp_string, commit_hash)
@@ -412,6 +420,14 @@ def trigger_tests_cli_command_logic(args, project_name, project_version):
412420
commit_dict["tests_priority_lower_limit"] = tests_priority_lower_limit
413421
commit_dict["tests_regexp"] = tests_regexp
414422
commit_dict["tests_groups_regexp"] = tests_groups_regexp
423+
commit_dict["github_org"] = args.gh_org
424+
commit_dict["github_repo"] = args.gh_repo
425+
if args.server_name is not None and args.server_name != "":
426+
commit_dict["server_name"] = args.server_name
427+
if args.build_artifacts != "":
428+
commit_dict["build_artifacts"] = args.build_artifacts
429+
if args.build_command != "":
430+
commit_dict["build_command"] = args.build_command
415431
if pull_request is not None:
416432
logging.info(
417433
f"Have a pull request info to include in build request {pull_request}"

redis_benchmarks_specification/__common__/runner.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ def exporter_datasink_common(
150150
git_hash=None,
151151
):
152152
logging.info(
153-
f"Using datapoint_time_ms: {datapoint_time_ms}. git_has={git_hash}, git_branch={git_branch}, git_version={git_version}"
153+
f"Using datapoint_time_ms: {datapoint_time_ms}. git_hash={git_hash}, git_branch={git_branch}, git_version={git_version}. gh_org={tf_github_org}, gh_repo={tf_github_repo}"
154154
)
155155
timeseries_test_sucess_flow(
156156
datasink_push_results_redistimeseries,

redis_benchmarks_specification/__self_contained_coordinator__/self_contained_coordinator.py

+5
Original file line numberDiff line numberDiff line change
@@ -547,6 +547,11 @@ def process_self_contained_coordinator_stream(
547547
logging.info(
548548
f"detected a server_name definition on the streamdata: {server_name}."
549549
)
550+
new_executable = f"{mnt_point}{server_name}-server"
551+
logging.info(
552+
"changing executable from {executable} to {new_executable}"
553+
)
554+
executable = new_executable
550555

551556
if b"restore_build_artifacts" in testDetails:
552557
restore_build_artifacts = bool(

0 commit comments

Comments
 (0)