@@ -99,33 +99,51 @@ def __init__(self, effective_start_date, target_host, root_dir):
99
99
def report_path (self , track , challenge , car ):
100
100
return "%s/reports/rally/%s/%s/%s/%s/report.csv" % (self .root_dir , date_for_path (self .effective_start_date ), track , challenge , car )
101
101
102
- def runnable (self , track , challenge , car ):
102
+ def runnable (self , track , challenge , car , plugins ):
103
103
return True
104
104
105
- def command_line (self , track , challenge , car ):
105
+ def command_line (self , track , challenge , car , plugins ):
106
106
raise NotImplementedError ("abstract method" )
107
107
108
108
109
109
class SourceBasedCommand (BaseCommand ):
110
- def __init__ (self , effective_start_date , target_host , root_dir , revision , configuration_name , user_tag = None , override_src_dir = None ):
110
+ def __init__ (self , effective_start_date , target_host , root_dir , revision , configuration_name , user_tag = None ):
111
111
super ().__init__ (effective_start_date , target_host , root_dir )
112
112
self .revision = revision
113
113
self .configuration_name = configuration_name
114
114
self .pipeline = "from-sources-complete"
115
- if override_src_dir is not None :
116
- self .override = " --override-src-dir=%s" % override_src_dir
117
- else :
118
- self .override = ""
115
+ self .pipeline_with_plugins = "from-sources-complete"
119
116
if user_tag :
120
117
self .user_tag = " --user-tag=\" intention:%s\" " % user_tag
121
118
else :
122
119
self .user_tag = ""
123
120
124
- def command_line (self , track , challenge , car ):
125
- cmd = "{11} --configuration-name={9} --target-host={8} --pipeline={6} --quiet --revision \" {0}\" " \
126
- "--effective-start-date \" {1}\" --track={2} --challenge={3} --car={4} --report-format=csv --report-file={5}{7}{10}" . \
127
- format (self .revision , self .ts , track , challenge , car , self .report_path (track , challenge , car ), self .pipeline , self .override ,
128
- self .target_host , self .configuration_name , self .user_tag , RALLY_BINARY )
121
+ def command_line (self , track , challenge , car , plugins ):
122
+ cmd = RALLY_BINARY
123
+ cmd += " --configuration-name=%s" % self .configuration_name
124
+ cmd += " --target-host=%s" % self .target_host
125
+ # force a build if plugins are involved because we do not know whether we've build these plugins before
126
+ if plugins :
127
+ cmd += " --pipeline=%s" % self .pipeline_with_plugins
128
+ else :
129
+ cmd += " --pipeline=%s" % self .pipeline
130
+ #cmd += " --quiet"
131
+ cmd += " --revision \" %s\" " % self .revision
132
+ cmd += " --effective-start-date \" %s\" " % self .effective_start_date
133
+ cmd += " --track=%s" % track
134
+ cmd += " --challenge=%s" % challenge
135
+ cmd += " --car=%s" % car
136
+ cmd += " --report-format=csv"
137
+ cmd += " --report-file=%s" % self .report_path (track , challenge , car )
138
+ cmd += self .user_tag
139
+
140
+ if plugins :
141
+ self .pipeline_with_plugins = "from-sources-skip-build"
142
+ cmd += " --elasticsearch-plugins=\" %s\" " % plugins
143
+ if "x-pack:security" in plugins :
144
+ cmd += " --cluster-health=yellow"
145
+ cmd += " --client-options=\" use_ssl:true,verify_certs:false,basic_auth_user:'rally',basic_auth_password:'rally-password'\" "
146
+
129
147
# after we've executed the first benchmark, there is no reason to build again from sources
130
148
self .pipeline = "from-sources-skip-build"
131
149
return cmd
@@ -134,14 +152,14 @@ def command_line(self, track, challenge, car):
134
152
class NightlyCommand (SourceBasedCommand ):
135
153
CONFIG_NAME = "nightly"
136
154
137
- def __init__ (self , effective_start_date , target_host , root_dir , override_src_dir = None ):
155
+ def __init__ (self , effective_start_date , target_host , root_dir ):
138
156
super ().__init__ (effective_start_date , target_host , root_dir , "@%s" % to_iso8601 (effective_start_date ),
139
- NightlyCommand .CONFIG_NAME , user_tag = None , override_src_dir = override_src_dir )
157
+ NightlyCommand .CONFIG_NAME , user_tag = None )
140
158
141
159
142
160
class AdHocCommand (SourceBasedCommand ):
143
- def __init__ (self , revision , effective_start_date , target_host , root_dir , configuration_name , user_tag , override_src_dir = None ):
144
- super ().__init__ (effective_start_date , target_host , root_dir , revision , configuration_name , user_tag , override_src_dir )
161
+ def __init__ (self , revision , effective_start_date , target_host , root_dir , configuration_name , user_tag ):
162
+ super ().__init__ (effective_start_date , target_host , root_dir , revision , configuration_name , user_tag )
145
163
146
164
147
165
class ReleaseCommand (BaseCommand ):
@@ -153,26 +171,38 @@ def __init__(self, effective_start_date, target_host, plugins, root_dir, distrib
153
171
self .distribution_version = distribution_version
154
172
self ._tag = tag
155
173
156
- def runnable (self , track , challenge , car ):
174
+ def runnable (self , track , challenge , car , plugins ):
157
175
# Do not run 1g benchmarks at all at the moment. Earlier versions of ES OOM.
158
176
if car == "1gheap" :
159
177
return False
178
+ # Do not run plugin-specific tracks. We run either the whole suite with or without plugins.
179
+ if plugins != "" :
180
+ return False
160
181
# cannot run "sorted" challenges - it's a 6.0+ feature
161
182
if int (self .distribution_version [0 ]) < 6 :
162
183
return "sorted" not in challenge
163
184
return True
164
185
165
- def command_line (self , track , challenge , car ):
166
- cmd = "{10} --configuration-name={8} --target-host={7} --pipeline={6} --quiet --distribution-version={0} " \
167
- "--effective-start-date \" {1}\" --track={2} --challenge={3} --car={4} --report-format=csv --report-file={5} " \
168
- "--user-tag=\" {9}\" " .format (self .distribution_version , self .ts , track , challenge , car ,
169
- self .report_path (track , challenge , car ), self .pipeline ,
170
- self .target_host , self .configuration_name , self .tag (), RALLY_BINARY )
171
- if self .plugins :
172
- cmd += " --elasticsearch-plugins=\" %s\" " % self .plugins
173
- if "x-pack:security" in self .plugins :
174
- cmd += " --cluster-health=yellow " \
175
- "--client-options=\" use_ssl:true,verify_certs:false,basic_auth_user:'rally',basic_auth_password:'rally-password'\" "
186
+ def command_line (self , track , challenge , car , plugins ):
187
+ cmd = RALLY_BINARY
188
+ cmd += " --configuration-name=%s" % self .configuration_name
189
+ cmd += " --target-host=%s" % self .target_host
190
+ cmd += " --pipeline=%s" % self .pipeline
191
+ cmd += " --quiet"
192
+ cmd += " --distribution-version=%s" % self .distribution_version
193
+ cmd += " --effective-start-date \" %s\" " % self .effective_start_date
194
+ cmd += " --track=%s" % track
195
+ cmd += " --challenge=%s" % challenge
196
+ cmd += " --car=%s" % car
197
+ cmd += " --report-format=csv"
198
+ cmd += " --report-file=%s" % self .report_path (track , challenge , car )
199
+ cmd += " --user-tag=\" %s\" " % self .tag ()
200
+
201
+ if plugins :
202
+ cmd += " --elasticsearch-plugins=\" %s\" " % plugins
203
+ if "x-pack:security" in plugins :
204
+ cmd += " --cluster-health=yellow"
205
+ cmd += "--client-options=\" use_ssl:true,verify_certs:false,basic_auth_user:'rally',basic_auth_password:'rally-password'\" "
176
206
177
207
return cmd
178
208
@@ -187,20 +217,33 @@ def __init__(self, effective_start_date, target_host, root_dir, distribution_ver
187
217
self .pipeline = "docker"
188
218
self .distribution_version = distribution_version
189
219
190
- def runnable (self , track , challenge , car ):
220
+ def runnable (self , track , challenge , car , plugins ):
191
221
if car in ["two_nodes" , "verbose_iw" , "1gheap" ]:
192
222
return False
223
+ # no plugin installs on Docker
224
+ if plugins != "" :
225
+ return False
193
226
# cannot run "sorted" challenges - it's a 6.0+ feature
194
227
if int (self .distribution_version [0 ]) < 6 :
195
228
return "sorted" not in challenge
196
229
return True
197
230
198
- def command_line (self , track , challenge , car ):
199
- cmd = "{10} --configuration-name={8} --target-host={7} --pipeline={6} --quiet --distribution-version={0} " \
200
- "--effective-start-date \" {1}\" --track={2} --challenge={3} --car={4} --report-format=csv --report-file={5} " \
201
- "--cluster-health=yellow --user-tag=\" {9}\" " . \
202
- format (self .distribution_version , self .ts , track , challenge , car , self .report_path (track , challenge , car ), self .pipeline ,
203
- self .target_host , self .configuration_name , self .tag (), RALLY_BINARY )
231
+ def command_line (self , track , challenge , car , plugins ):
232
+ cmd = RALLY_BINARY
233
+ cmd += " --configuration-name=%s" % self .configuration_name
234
+ cmd += " --target-host=%s" % self .target_host
235
+ cmd += " --pipeline=%s" % self .pipeline
236
+ cmd += " --quiet"
237
+ cmd += " --distribution-version=%s" % self .distribution_version
238
+ cmd += " --effective-start-date \" %s\" " % self .effective_start_date
239
+ cmd += " --track=%s" % track
240
+ cmd += " --challenge=%s" % challenge
241
+ cmd += " --car=%s" % car
242
+ cmd += " --report-format=csv"
243
+ cmd += " --report-file=%s" % self .report_path (track , challenge , car )
244
+ cmd += " --user-tag=\" %s\" " % self .tag ()
245
+ # due to the possibility that x-pack is active (that depends on Rally)
246
+ cmd += " --cluster-health=yellow"
204
247
return cmd
205
248
206
249
@staticmethod
@@ -219,20 +262,28 @@ def run_rally(tracks, command, dry_run=False, system=os.system):
219
262
for combination in track ["combinations" ]:
220
263
challenge = combination ["challenge" ]
221
264
car = combination ["car" ]
222
- if command .runnable (track_name , challenge , car ):
223
- logger .info ("Running Rally on track [%s] with challenge [%s] and car [%s]" % (track_name , challenge , car ))
265
+ plugins = combination .get ("plugins" , "" )
266
+ info = race_info (track_name , challenge , car , plugins )
267
+ if command .runnable (track_name , challenge , car , plugins ):
268
+ logger .info ("Running Rally on %s" % info )
224
269
start = time .perf_counter ()
225
- if runner (command .command_line (track_name , challenge , car )):
270
+ if runner (command .command_line (track_name , challenge , car , plugins )):
226
271
rally_failure = True
227
- logger .error ("Failed to run track [%s] . Please check the logs." % track_name )
272
+ logger .error ("Failed to run %s . Please check the logs." % info )
228
273
stop = time .perf_counter ()
229
- logger .info ("Finished running on track [%s] with challenge [%s] and car [%s] in [%f] seconds." % (
230
- track_name , challenge , car , (stop - start )))
274
+ logger .info ("Finished running on %s in [%f] seconds." % (info , (stop - start )))
231
275
else :
232
- logger .info ("Skipping track [%s], challenge [%s] and car [%s] (not supported by command)." % ( track_name , challenge , car ) )
276
+ logger .info ("Skipping %s (not supported by command)." % info )
233
277
return rally_failure
234
278
235
279
280
+ def race_info (track , challenge , car , plugins ):
281
+ if plugins :
282
+ return "track [%s] with challenge [%s], car [%s] and plugins [%s]" % (track , challenge , car , plugins )
283
+ else :
284
+ return "track [%s] with challenge [%s] and car [%s]" % (track , challenge , car )
285
+
286
+
236
287
#################################################
237
288
# Reporting
238
289
#################################################
@@ -247,10 +298,29 @@ def copy_results_for_release_comparison(effective_start_date, dry_run, tag):
247
298
es = client .create_client ()
248
299
es .indices .refresh (index = "rally-results-*" )
249
300
ts = to_iso8601_short (effective_start_date )
301
+ # find all of today's results but exclude "x-pack" ones because we will not have release charts for them (x-pack has
302
+ # their own dedicated trial runs on releases)
250
303
query = {
251
304
"query" : {
252
- "term" : {
253
- "trial-timestamp" : ts
305
+ "bool" : {
306
+ "must" : [
307
+ {
308
+ "term" : {
309
+ "trial-timestamp" : {
310
+ "value" : ts
311
+ }
312
+ }
313
+ }
314
+ ],
315
+ "must_not" : [
316
+ {
317
+ "term" : {
318
+ "plugins" : {
319
+ "value" : "x-pack"
320
+ }
321
+ }
322
+ }
323
+ ]
254
324
}
255
325
}
256
326
}
@@ -347,10 +417,6 @@ def parse_args():
347
417
"trial runs" ,
348
418
required = True ,
349
419
type = lambda s : datetime .datetime .strptime (s , "%Y-%m-%d %H:%M:%S" ))
350
- parser .add_argument (
351
- "--override-src-dir" ,
352
- help = argparse .SUPPRESS ,
353
- default = None )
354
420
parser .add_argument (
355
421
"--tag" ,
356
422
help = argparse .SUPPRESS ,
@@ -440,13 +506,13 @@ def main():
440
506
logger .info ("Running adhoc benchmarks for revision [%s] against [%s]." % (args .revision , args .target_host ))
441
507
# copy data from templates directory to our dedicated output directory
442
508
env_name = sanitize (args .release )
443
- command = AdHocCommand (args .revision , start_date , args .target_host , root_dir , env_name , args .tag , args . override_src_dir )
509
+ command = AdHocCommand (args .revision , start_date , args .target_host , root_dir , env_name , args .tag )
444
510
else :
445
511
if plugins :
446
512
raise RuntimeError ("User specified plugins [%s] but this is not supported for nightly benchmarks." % plugins )
447
513
logger .info ("Running nightly benchmarks against [%s]." % args .target_host )
448
514
env_name = NightlyCommand .CONFIG_NAME
449
- command = NightlyCommand (start_date , args .target_host , root_dir , args . override_src_dir )
515
+ command = NightlyCommand (start_date , args .target_host , root_dir )
450
516
451
517
configure_rally (env_name , args .dry_run )
452
518
rally_failure = run_rally (tracks , command , args .dry_run )
0 commit comments