@@ -67,13 +67,18 @@ def parse_args():
67
67
default = 'quick' ,
68
68
help = 'Subset of tasks to run (quick, full; ' +
69
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 ,
@@ -569,6 +575,7 @@ def run_perf_test(
569
575
],
570
576
Capabilities = ['CAPABILITY_NAMED_IAM' ])
571
577
578
+ logger .info (region + ': Waiting for completition of ' + stack_name )
572
579
waiter = cfn .meta .client .get_waiter ('stack_create_complete' )
573
580
waiter .wait (StackName = stack_name )
574
581
asg_name = stack .outputs [0 ]['OutputValue' ]
@@ -643,7 +650,7 @@ def main():
643
650
session2 = boto3 .session .Session ()
644
651
build_future = e .submit (
645
652
build , session2 , args .repository , args .commit_id , bucket_name ,
646
- perf_test_id )
653
+ perf_test_id , args . code_build )
647
654
session3 = boto3 .session .Session ()
648
655
ebs_future = e .submit (prepare_ebs , session3 , region , az , ami )
649
656
session4 = boto3 .session .Session ()
0 commit comments