@@ -1038,7 +1038,7 @@ def plot_metrics(self, job_id, sfn=None, directory='.', open_browser=True, force
1038
1038
if open_browser :
1039
1039
webbrowser .open (METRICS_URL (log_bucket , job_id ))
1040
1040
1041
- def cost_estimate (self , job_id , update_tsv = False ):
1041
+ def cost_estimate (self , job_id , update_tsv = False , force = False ):
1042
1042
postrunjsonstr = self .log (job_id = job_id , postrunjson = True )
1043
1043
if not postrunjsonstr :
1044
1044
logger .info ("Cost estimation error: postrunjson not found" )
@@ -1047,12 +1047,13 @@ def cost_estimate(self, job_id, update_tsv=False):
1047
1047
postrunjson = AwsemPostRunJson (** postrunjsonobj )
1048
1048
log_bucket = postrunjson .config .log_bucket
1049
1049
1050
- # We return the real cost, if it is availble, but don't automatically update the Cost row in the tsv
1051
- precise_cost = self .cost (job_id , update_tsv = False )
1052
- if (precise_cost and precise_cost > 0.0 ):
1053
- if update_tsv :
1054
- update_cost_estimate_in_tsv (log_bucket , job_id , precise_cost , cost_estimate_type = "actual cost" )
1055
- return precise_cost , "actual cost"
1050
+ # We return the real cost, if it is available, but don't automatically update the Cost row in the tsv
1051
+ if not force :
1052
+ precise_cost = self .cost (job_id , update_tsv = False )
1053
+ if (precise_cost and precise_cost > 0.0 ):
1054
+ if update_tsv :
1055
+ update_cost_estimate_in_tsv (log_bucket , job_id , precise_cost , cost_estimate_type = "actual cost" )
1056
+ return precise_cost , "actual cost"
1056
1057
1057
1058
# awsf_image was added in 1.0.0. We use that to get the correct ebs root type
1058
1059
ebs_root_type = 'gp3' if 'awsf_image' in postrunjsonobj ['config' ] else 'gp2'
0 commit comments