@@ -76,6 +76,7 @@ def prepare_benchmark_parameters(
76
76
username = None ,
77
77
private_key = None ,
78
78
client_ssh_port = None ,
79
+ redis_password = None ,
79
80
):
80
81
command_arr = None
81
82
command_str = None
@@ -98,6 +99,7 @@ def prepare_benchmark_parameters(
98
99
username ,
99
100
private_key ,
100
101
client_ssh_port ,
102
+ redis_password ,
101
103
)
102
104
# v0.4 spec
103
105
elif type (benchmark_config [config_key ]) == dict :
@@ -117,6 +119,7 @@ def prepare_benchmark_parameters(
117
119
username ,
118
120
private_key ,
119
121
client_ssh_port ,
122
+ redis_password ,
120
123
)
121
124
printed_command_str = command_str
122
125
printed_command_arr = command_arr
@@ -146,6 +149,7 @@ def prepare_benchmark_parameters_specif_tooling(
146
149
username ,
147
150
private_key ,
148
151
client_ssh_port ,
152
+ redis_password = None ,
149
153
):
150
154
if "redis-benchmark" in benchmark_tool :
151
155
command_arr , command_str = prepare_redis_benchmark_command (
@@ -192,6 +196,7 @@ def prepare_benchmark_parameters_specif_tooling(
192
196
entry ,
193
197
current_workdir ,
194
198
cluster_api_enabled ,
199
+ redis_password ,
195
200
)
196
201
197
202
if "tsbs_" in benchmark_tool :
@@ -252,6 +257,7 @@ def prepare_benchmark_parameters_specif_tooling(
252
257
input_data_file ,
253
258
isremote ,
254
259
cluster_api_enabled ,
260
+ redis_password ,
255
261
)
256
262
if "aibench_" in benchmark_tool :
257
263
input_data_file = None
@@ -520,68 +526,74 @@ def run_redis_pre_steps(benchmark_config, r, required_modules):
520
526
# In case we have modules we use it's artifact version
521
527
# otherwise we use redis version as artifact version
522
528
version = "N/A"
529
+ # run initialization commands before benchmark starts
530
+ logging .info ("Running initialization commands before benchmark starts." )
531
+ execute_init_commands_start_time = datetime .datetime .now ()
532
+ execute_init_commands (benchmark_config , r )
533
+ execute_init_commands_duration_seconds = (
534
+ datetime .datetime .now () - execute_init_commands_start_time
535
+ ).seconds
536
+ logging .info (
537
+ "Running initialization commands took {} secs." .format (
538
+ execute_init_commands_duration_seconds
539
+ )
540
+ )
541
+ stdout = r .execute_command ("info modules" )
542
+ (
543
+ module_names ,
544
+ artifact_versions ,
545
+ ) = extract_module_semver_from_info_modules_cmd (stdout )
546
+ if "search" in module_names :
547
+ logging .info (
548
+ "Detected redisearch module. Ensuring all indices are indexed prior benchmark"
549
+ )
550
+ search_specific_init (r , module_names )
523
551
if required_modules is not None and len (required_modules ) > 0 :
524
- stdout = r .execute_command ("info modules" )
525
- (
526
- module_names ,
527
- artifact_versions ,
528
- ) = extract_module_semver_from_info_modules_cmd (stdout )
552
+
529
553
check_required_modules (module_names , required_modules )
530
- # run initialization commands before benchmark starts
531
- logging .info ("Running initialization commands before benchmark starts." )
532
- execute_init_commands_start_time = datetime .datetime .now ()
533
- execute_init_commands (benchmark_config , r )
534
- execute_init_commands_duration_seconds = (
535
- datetime .datetime .now () - execute_init_commands_start_time
536
- ).seconds
554
+
555
+ version = artifact_versions [0 ]
556
+ else :
557
+ version = r .info ("server" )["redis_version" ]
558
+
559
+ return version
560
+
561
+
562
+ def search_specific_init (r , module_names ):
563
+ if "search" in module_names :
537
564
logging .info (
538
- "Running initialization commands took {} secs." .format (
539
- execute_init_commands_duration_seconds
540
- )
565
+ "Given redisearch was detected, checking for any index that is still indexing."
541
566
)
542
- if "search" in module_names :
567
+ loading_indices = r .execute_command ("ft._list" )
568
+ logging .info ("Detected {} indices." .format (len (loading_indices )))
569
+ while len (loading_indices ) > 0 :
543
570
logging .info (
544
- "Given redisearch was detected, checking for any index that is still indexing."
571
+ "There are still {} indices loading. {}" .format (
572
+ len (loading_indices ), loading_indices
573
+ )
545
574
)
546
- loading_indices = r .execute_command ("ft._list" )
547
- logging .info ("Detected {} indices." .format (len (loading_indices )))
548
- while len (loading_indices ) > 0 :
575
+ for index_pos , fts_indexname in enumerate (loading_indices , start = 0 ):
576
+ if type (fts_indexname ) == bytes :
577
+ fts_indexname = fts_indexname .decode ()
578
+ ft_info = r .execute_command ("ft.info {}" .format (fts_indexname ))
579
+ is_indexing = None
580
+ percent_indexed = "0.0"
581
+ for arraypos , arrayval in enumerate (ft_info , start = 0 ):
582
+ if arrayval == b"percent_indexed" or arrayval == "percent_indexed" :
583
+ percent_indexed = ft_info [arraypos + 1 ]
584
+ if arrayval == b"indexing" or arrayval == "indexing" :
585
+ is_indexing = ft_info [arraypos + 1 ]
586
+
549
587
logging .info (
550
- "There are still {} indices loading. {} " .format (
551
- len ( loading_indices ), loading_indices
588
+ "indexing= {} ; percent_indexed={}. " .format (
589
+ is_indexing , percent_indexed
552
590
)
553
591
)
554
- for index_pos , fts_indexname in enumerate (loading_indices , start = 0 ):
555
- if type (fts_indexname ) == bytes :
556
- fts_indexname = fts_indexname .decode ()
557
- ft_info = r .execute_command ("ft.info {}" .format (fts_indexname ))
558
- is_indexing = None
559
- percent_indexed = "0.0"
560
- for arraypos , arrayval in enumerate (ft_info , start = 0 ):
561
- if (
562
- arrayval == b"percent_indexed"
563
- or arrayval == "percent_indexed"
564
- ):
565
- percent_indexed = ft_info [arraypos + 1 ]
566
- if arrayval == b"indexing" or arrayval == "indexing" :
567
- is_indexing = ft_info [arraypos + 1 ]
568
-
569
- logging .info (
570
- "indexing={} ; percent_indexed={}." .format (
571
- is_indexing , percent_indexed
572
- )
573
- )
574
- if is_indexing == "0" or is_indexing == b"0" or is_indexing == 0 :
575
- loading_indices .pop (index_pos )
592
+ if is_indexing == "0" or is_indexing == b"0" or is_indexing == 0 :
593
+ loading_indices .pop (index_pos )
576
594
577
- time .sleep (5 )
578
- logging .info ("Loaded all secondary indices." )
579
-
580
- version = artifact_versions [0 ]
581
- else :
582
- version = r .info ("server" )["redis_version" ]
583
-
584
- return version
595
+ time .sleep (5 )
596
+ logging .info ("Loaded all secondary indices." )
585
597
586
598
587
599
def dso_check (dso , local_module_file ):
0 commit comments