@@ -79,84 +79,86 @@ def local_db_spin(
79
79
redis_processes ,
80
80
)
81
81
else :
82
- # setup Redis
83
- # copy the rdb to DB machine
84
- redis_7 = args .redis_7
85
- logging .info (
86
- "Using local temporary dir to spin up Redis Instance. Path: {}" .format (
87
- temporary_dir
88
- )
89
- )
90
- if dbdir_folder is not None :
91
- from distutils .dir_util import copy_tree
92
-
93
- copy_tree (dbdir_folder , temporary_dir )
82
+ if args .skip_redis_spin is False :
83
+ # setup Redis
84
+ # copy the rdb to DB machine
85
+ redis_7 = args .redis_7
94
86
logging .info (
95
- "Copied entire content of {} into temporary path : {}" .format (
96
- dbdir_folder , temporary_dir
87
+ "Using local temporary dir to spin up Redis Instance. Path : {}" .format (
88
+ temporary_dir
97
89
)
98
90
)
99
- (
100
- _ ,
101
- _ ,
102
- redis_configuration_parameters ,
103
- dataset_load_timeout_secs ,
104
- modules_configuration_parameters_map ,
105
- ) = extract_redis_dbconfig_parameters (benchmark_config , "dbconfig" )
91
+ if dbdir_folder is not None :
92
+ from distutils .dir_util import copy_tree
106
93
107
- logging .info (
108
- "Using a dataset load timeout of {} seconds." .format (
109
- dataset_load_timeout_secs
110
- )
111
- )
112
-
113
- if setup_type == "oss-cluster" :
114
- cluster_api_enabled = True
115
- shard_host = "127.0.0.1"
116
- redis_processes , redis_conns = spin_up_local_redis_cluster (
117
- binary ,
118
- temporary_dir ,
119
- shard_count ,
120
- shard_host ,
121
- args .port ,
122
- local_module_file ,
94
+ copy_tree (dbdir_folder , temporary_dir )
95
+ logging .info (
96
+ "Copied entire content of {} into temporary path: {}" .format (
97
+ dbdir_folder , temporary_dir
98
+ )
99
+ )
100
+ (
101
+ _ ,
102
+ _ ,
123
103
redis_configuration_parameters ,
124
104
dataset_load_timeout_secs ,
125
105
modules_configuration_parameters_map ,
126
- redis_7 ,
127
- )
106
+ ) = extract_redis_dbconfig_parameters (benchmark_config , "dbconfig" )
128
107
129
- status = setup_redis_cluster_from_conns (
130
- redis_conns , shard_count , shard_host , args .port
131
- )
132
- if status is False :
133
- raise Exception ("Redis cluster setup failed. Failing test." )
134
-
135
- if setup_type == "oss-standalone" :
136
- redis_processes = spin_up_local_redis (
137
- binary ,
138
- args .port ,
139
- temporary_dir ,
140
- local_module_file ,
141
- redis_configuration_parameters ,
142
- dbdir_folder ,
143
- dataset_load_timeout_secs ,
144
- modules_configuration_parameters_map ,
145
- redis_7 ,
108
+ logging .info (
109
+ "Using a dataset load timeout of {} seconds." .format (
110
+ dataset_load_timeout_secs
111
+ )
146
112
)
147
- if setup_type == "oss-cluster" :
148
- for shardn , redis_process in enumerate (redis_processes ):
149
- logging .info (
150
- "Checking if shard #{} process with pid={} is alive" .format (
151
- shardn + 1 , redis_process .pid
152
- )
113
+
114
+ if setup_type == "oss-cluster" :
115
+ cluster_api_enabled = True
116
+ redis_processes , redis_conns = spin_up_local_redis_cluster (
117
+ binary ,
118
+ temporary_dir ,
119
+ shard_count ,
120
+ args .host ,
121
+ args .port ,
122
+ local_module_file ,
123
+ redis_configuration_parameters ,
124
+ dataset_load_timeout_secs ,
125
+ modules_configuration_parameters_map ,
126
+ redis_7 ,
127
+ )
128
+
129
+ status = setup_redis_cluster_from_conns (
130
+ redis_conns , shard_count , args .host , args .port
131
+ )
132
+ if status is False :
133
+ raise Exception ("Redis cluster setup failed. Failing test." )
134
+
135
+ if setup_type == "oss-standalone" :
136
+ redis_processes = spin_up_local_redis (
137
+ binary ,
138
+ args .port ,
139
+ temporary_dir ,
140
+ local_module_file ,
141
+ redis_configuration_parameters ,
142
+ dbdir_folder ,
143
+ dataset_load_timeout_secs ,
144
+ modules_configuration_parameters_map ,
145
+ redis_7 ,
153
146
)
154
- if is_process_alive (redis_process ) is False :
155
- raise Exception ("Redis process is not alive. Failing test." )
156
- cluster_init_steps (clusterconfig , redis_conns , local_module_file )
147
+ if setup_type == "oss-cluster" :
148
+ for shardn , redis_process in enumerate (redis_processes ):
149
+ logging .info (
150
+ "Checking if shard #{} process with pid={} is alive" .format (
151
+ shardn + 1 , redis_process .pid
152
+ )
153
+ )
154
+ if is_process_alive (redis_process ) is False :
155
+ raise Exception ("Redis process is not alive. Failing test." )
156
+ cluster_init_steps (clusterconfig , redis_conns , local_module_file )
157
+ else :
158
+ logging .info ("Skipping DB spin step..." )
157
159
158
160
if setup_type == "oss-standalone" :
159
- r = redis .Redis (port = args .port )
161
+ r = redis .Redis (port = args .port , host = args . host )
160
162
r .ping ()
161
163
r .client_setname ("redisbench-admin-standalone" )
162
164
redis_conns .append (r )
@@ -184,7 +186,7 @@ def local_db_spin(
184
186
benchmark_config ,
185
187
full_benchmark_path ,
186
188
args .port ,
187
- "localhost" ,
189
+ args . host ,
188
190
local_benchmark_output_filename ,
189
191
False ,
190
192
benchmark_tool_workdir ,
0 commit comments