@@ -66,14 +66,19 @@ def parse_args():
66
66
parser .add_argument ('-T' , '--tasks' , type = str ,
67
67
default = 'quick' ,
68
68
help = 'Subset of tasks to run (quick, full; ' +
69
- 'default: quick; or name of SV-COMP task)' )
69
+ 'default: quick; or regex of SV-COMP task(s))' )
70
+ parser .add_argument ('-B' , '--code-build' , type = str ,
71
+ default = same_dir ('codebuild.yaml' ),
72
+ help = 'Non-default CodeBuild template to use' )
70
73
71
74
args = parser .parse_args ()
75
+
72
76
assert (args .repository .startswith ('https://github.com/' ) or
73
77
args .repository .startswith ('https://git-codecommit.' ))
74
78
assert (not args .ssh_key or args .ssh_key_name )
75
79
if args .ssh_key :
76
80
assert (os .path .isfile (args .ssh_key ))
81
+ assert (os .path .isfile (args .code_build ))
77
82
78
83
return args
79
84
@@ -345,7 +350,8 @@ def prepare_ebs(session, region, az, ami):
345
350
return snapshots ['Snapshots' ][0 ]['SnapshotId' ]
346
351
347
352
348
- def build (session , repository , commit_id , bucket_name , perf_test_id ):
353
+ def build (session , repository , commit_id , bucket_name , perf_test_id ,
354
+ codebuild_file ):
349
355
# build the chosen commit in CodeBuild
350
356
logger = logging .getLogger ('perf_test' )
351
357
@@ -356,7 +362,7 @@ def build(session, repository, commit_id, bucket_name, perf_test_id):
356
362
357
363
cfn = session .resource ('cloudformation' , region_name = 'us-east-1' )
358
364
stack_name = 'perf-test-codebuild-' + perf_test_id
359
- with open (same_dir ( 'codebuild.yaml' ) ) as f :
365
+ with open (codebuild_file ) as f :
360
366
CFN_codebuild = f .read ()
361
367
stack = cfn .create_stack (
362
368
StackName = stack_name ,
@@ -479,10 +485,8 @@ def seed_queue(session, region, queue, task_set):
479
485
elif task_set == 'quick' :
480
486
tasks = ['ReachSafety-Loops' , 'ReachSafety-BitVectors' ]
481
487
else :
482
- tasks = [task_set ]
483
-
484
- for t in tasks :
485
- assert (t in set (all_tasks ))
488
+ tasks = [t for t in all_tasks if re .match ('^' + task_set + '$' , t )]
489
+ assert (tasks )
486
490
487
491
for t in tasks :
488
492
response = queue .send_messages (
@@ -492,6 +496,9 @@ def seed_queue(session, region, queue, task_set):
492
496
])
493
497
assert (not response .get ('Failed' ))
494
498
499
+ logger .info (region + ': SQS queue seeded with {} jobs' .format (
500
+ len (tasks ) * 2 ))
501
+
495
502
496
503
def run_perf_test (
497
504
session , mode , region , az , ami , instance_type , sqs_arn , sqs_url ,
@@ -568,6 +575,7 @@ def run_perf_test(
568
575
],
569
576
Capabilities = ['CAPABILITY_NAMED_IAM' ])
570
577
578
+ logger .info (region + ': Waiting for completition of ' + stack_name )
571
579
waiter = cfn .meta .client .get_waiter ('stack_create_complete' )
572
580
waiter .wait (StackName = stack_name )
573
581
asg_name = stack .outputs [0 ]['OutputValue' ]
@@ -642,7 +650,7 @@ def main():
642
650
session2 = boto3 .session .Session ()
643
651
build_future = e .submit (
644
652
build , session2 , args .repository , args .commit_id , bucket_name ,
645
- perf_test_id )
653
+ perf_test_id , args . code_build )
646
654
session3 = boto3 .session .Session ()
647
655
ebs_future = e .submit (prepare_ebs , session3 , region , az , ami )
648
656
session4 = boto3 .session .Session ()
0 commit comments