@@ -236,11 +236,11 @@ def __init__(self, params, revision):
236
236
237
237
238
238
class ReleaseCommand (BaseCommand ):
239
- def __init__ (self , params , release_params , distribution_version , race_configs_id ):
239
+ def __init__ (self , params , release_params , distribution_version ):
240
240
self .distribution_version = distribution_version
241
241
self .release_params = release_params
242
242
self .params = ParamsFormatter (params = params + [
243
- LicenseParams (distribution_version , release_params , race_configs_id ),
243
+ LicenseParams (distribution_version , release_params ),
244
244
ConstantParam ("distribution-version" , distribution_version ),
245
245
ConstantParam ("pipeline" , "from-distribution" )
246
246
])
@@ -280,12 +280,12 @@ def runnable(self, race_config):
280
280
281
281
282
282
class DockerCommand (BaseCommand ):
283
- def __init__ (self , params , release_params , distribution_version , race_configs_id ):
283
+ def __init__ (self , params , release_params , distribution_version ):
284
284
self .pipeline = "docker"
285
285
self .distribution_version = distribution_version
286
286
287
287
docker_params = [
288
- LicenseParams (distribution_version , release_params , race_configs_id ),
288
+ LicenseParams (distribution_version , release_params ),
289
289
ConstantParam ("distribution-version" , distribution_version ),
290
290
ConstantParam ("pipeline" , "docker" )
291
291
]
@@ -395,11 +395,12 @@ class StandardParams:
395
395
"""
396
396
Extracts all parameters that are needed for all Rally invocations.
397
397
"""
398
- def __init__ (self , configuration_name , effective_start_date , runtime_jdk , user_tag_setup , test_mode = False ):
398
+ def __init__ (self , configuration_name , effective_start_date , runtime_jdk , user_tag_setup , race_configs_id = None , test_mode = False ):
399
399
self .configuration_name = configuration_name
400
400
self .effective_start_date = effective_start_date
401
401
self .runtime_jdk = runtime_jdk
402
402
self .user_tag_setup = user_tag_setup
403
+ self .race_configs_id = race_configs_id
403
404
self .test_mode = test_mode
404
405
405
406
def __call__ (self , race_config ):
@@ -411,9 +412,16 @@ def __call__(self, race_config):
411
412
"track" : race_config .track ,
412
413
"challenge" : race_config .challenge ,
413
414
"car" : race_config .car ,
414
- "client-options" : "timeout:240" ,
415
- "user-tag" : self .tags (additional_tags = {"name" : race_config .name , "setup" : self .user_tag_setup })
415
+ "client-options" : "timeout:240"
416
416
}
417
+
418
+ additional_tags = {
419
+ "name" : race_config .name ,
420
+ "setup" : self .user_tag_setup }
421
+ if self .race_configs_id :
422
+ additional_tags ["race-configs-id" ] = self .race_configs_id
423
+ params ["user-tag" ] = self .tags (additional_tags = additional_tags )
424
+
417
425
add_if_present (params , "runtime-jdk" , self .runtime_jdk )
418
426
add_if_present (params , "car-params" , race_config .car_params )
419
427
add_if_present (params , "track-params" , race_config .track_params )
@@ -434,7 +442,7 @@ class LicenseParams:
434
442
Extracts all license related parameters that affect benchmarking. Before Elasticsearch 6.3.0 x-pack is considered a plugin.
435
443
For later versions it is treated as module.
436
444
"""
437
- def __init__ (self , distribution_version , release_params = None , race_configs_id = None ):
445
+ def __init__ (self , distribution_version , release_params = None ):
438
446
if distribution_version == "master" :
439
447
self .treat_as_car = True
440
448
else :
@@ -443,7 +451,6 @@ def __init__(self, distribution_version, release_params=None, race_configs_id=No
443
451
444
452
self .distribution_version = distribution_version
445
453
self .release_params = release_params
446
- self .race_configs_id = race_configs_id
447
454
448
455
def __call__ (self , race_config ):
449
456
params = {}
@@ -491,8 +498,6 @@ def user_tags(self, x_pack, track_license):
491
498
user_tags += ["x-pack:true" ]
492
499
if self .release_params and "x-pack-components" in self .release_params :
493
500
user_tags += ["x-pack-components:{}" .format (self .release_params ["x-pack-components" ])]
494
- if self .race_configs_id :
495
- user_tags += ["race-configs-id:{}" .format (self .race_configs_id )]
496
501
return user_tags
497
502
498
503
@@ -648,6 +653,18 @@ def copy_results_for_release_comparison(effective_start_date, configuration_name
648
653
}
649
654
}
650
655
},
656
+ # also limit by environment in case of multiple night-rally jobs executed at the same time using different env
657
+ {
658
+ "term" : {
659
+ "environment" : configuration_name
660
+ }
661
+ },
662
+ # and avoid race conditions with >1 night-rally invocations on different hardware using same environment
663
+ {
664
+ "term" : {
665
+ "user-tags.race-configs-id" : race_configs_id
666
+ }
667
+ },
651
668
{
652
669
"bool" : {
653
670
"must_not" : [
@@ -681,7 +698,6 @@ def copy_results_for_release_comparison(effective_start_date, configuration_name
681
698
src ["environment" ] = "release-new"
682
699
# release benchmarks rely on `user-tags.setup` for bar charts and this depends on the license
683
700
src ["user-tags" ]["setup" ] = "bare-{}" .format (src ["user-tags" ]["license" ])
684
- src ["user-tags" ]["race-configs-id" ] = race_configs_id
685
701
release_results .append (src )
686
702
if release_results :
687
703
logger .info ("Copying %d result documents for [%s] to release environment." % (len (release_results ), ts ))
@@ -946,21 +962,23 @@ def main():
946
962
params .append (TelemetryParams (args .telemetry , args .telemetry_params ))
947
963
948
964
if common_cli_params .is_release :
949
- params .append (StandardParams (common_cli_params .configuration_name , start_date , args .runtime_jdk , common_cli_params .setup , args .test_mode ))
965
+ params .append (StandardParams (common_cli_params .configuration_name , start_date , args .runtime_jdk ,
966
+ common_cli_params .setup , common_cli_params .race_configs_id , args .test_mode ))
950
967
if common_cli_params .is_docker :
951
968
logger .info ("Running Docker release benchmarks for release [%s] against %s." % (common_cli_params .version , target_hosts ))
952
- command = DockerCommand (params , common_cli_params .release_params , common_cli_params .version , common_cli_params . race_configs_id )
969
+ command = DockerCommand (params , common_cli_params .release_params , common_cli_params .version )
953
970
else :
954
971
logger .info ("Running release benchmarks for release [%s] against %s (release tag is [%s])."
955
972
% (common_cli_params .version , target_hosts , common_cli_params .printable_release_params ))
956
- command = ReleaseCommand (params , common_cli_params .release_params , common_cli_params .version , common_cli_params . race_configs_id )
973
+ command = ReleaseCommand (params , common_cli_params .release_params , common_cli_params .version )
957
974
elif common_cli_params .is_adhoc :
958
975
logger .info ("Running adhoc benchmarks for revision [%s] against %s." % (args .revision , target_hosts ))
959
976
params .append (StandardParams (common_cli_params .configuration_name , start_date , args .runtime_jdk , common_cli_params .setup , args .test_mode ))
960
977
command = AdHocCommand (params , args .revision )
961
978
else :
962
979
logger .info ("Running nightly benchmarks against %s." % target_hosts )
963
- params .append (StandardParams (common_cli_params .configuration_name , start_date , args .runtime_jdk , common_cli_params .setup , args .test_mode ))
980
+ params .append (StandardParams (common_cli_params .configuration_name , start_date , args .runtime_jdk ,
981
+ common_cli_params .setup , common_cli_params .race_configs_id , args .test_mode ))
964
982
command = NightlyCommand (params , start_date )
965
983
966
984
rally_failure = run_rally (tracks , common_cli_params .release_params , target_hosts , command , args .dry_run , args .skip_ansible )
0 commit comments