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