diff --git a/firecloud/api.py b/firecloud/api.py index 53d7bf9..6803188 100755 --- a/firecloud/api.py +++ b/firecloud/api.py @@ -1191,7 +1191,8 @@ def create_submission(wnamespace, workspace, cnamespace, config, entity=None, etype=None, expression=None, use_callcache=True, delete_intermediate_output_files=False, use_reference_disks=False, memory_retry_multiplier=0, - workflow_failure_mode="", user_comment=""): + per_workflow_cost_cap=None, workflow_failure_mode="", + user_comment=""): """Submit job in FireCloud workspace. Args: @@ -1218,6 +1219,8 @@ def create_submission(wnamespace, workspace, cnamespace, config, Cromwell docs (https://cromwell.readthedocs.io/en/develop/cromwell_features/RetryWithMoreMemory) for more information + per_workflow_cost_cap (float): A cost threshold in USD to apply to individual + workflows. When the estimated cost is exceeded, the workflow is terminated. workflow_failure_mode (str): What happens after a task fails. Choose from ContinueWhilePossible and NoNewCalls. Defaults to NoNewCalls if not specified. See Cromwell docs @@ -1254,6 +1257,9 @@ def create_submission(wnamespace, workspace, cnamespace, config, if memory_retry_multiplier: body['memoryRetryMultiplier'] = memory_retry_multiplier + + if per_workflow_cost_cap: + body['perWorkflowCostCap'] = per_workflow_cost_cap if workflow_failure_mode: body['workflowFailureMode'] = workflow_failure_mode diff --git a/firecloud/fiss.py b/firecloud/fiss.py index 6b63a25..f185d0a 100644 --- a/firecloud/fiss.py +++ b/firecloud/fiss.py @@ -602,8 +602,8 @@ def config_start(args): args.config, args.entity, args.entity_type, args.expression, cache, args.delete_intermediates, args.ref_disks, - args.mem_retry_multiplier, args.failure_mode, - args.user_comment) + args.mem_retry_multiplier, args.per_workflow_cost_cap, + args.failure_mode, args.user_comment) fapi._check_response_code(r, 201) id = r.json()['submissionId'] @@ -2805,6 +2805,10 @@ def main(argv=None): 'this amount. See Cromwell docs ' + '(https://cromwell.readthedocs.io/en/develop/cromwell_features/RetryWithMoreMemory)' + ' for more information.') + subp.add_argument('-P', '--per_workflow_cost_cap', type=float, + help='A cost threshold in USD to apply to individual ' + + 'workflows. When the estimated cost is exceeded, the ' + + 'workflow is terminated.') subp.add_argument('-f', '--failure_mode', choices=['NoNewCalls', 'ContinueWhilePossible'], help='What happens after a task fails. Defaults to ' +