Skip to content

Commit

Permalink
Merge pull request #338 from 4dn-dcic/access_block
Browse files Browse the repository at this point in the history
return execArn for run_workflow
  • Loading branch information
SooLee authored May 19, 2021
2 parents c666d6c + 4cb5667 commit 3991dd7
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 6 deletions.
2 changes: 1 addition & 1 deletion tibanna/_version.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
"""Version information."""

# The following line *must* be the last in the module, exactly as formatted:
__version__ = "1.2.6"
__version__ = "1.2.7"
15 changes: 10 additions & 5 deletions tibanna/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -158,15 +158,22 @@ def run_workflow(self, input_json, sfn=None,
input_json is either a dict or a file
accession is unique name that we be part of run id
'''
if not jobid:
jobid = create_jobid()
if isinstance(input_json, dict):
data = copy.deepcopy(input_json)
elif isinstance(input_json, str) and os.path.exists(input_json):
with open(input_json) as input_file:
data = json.load(input_file)
else:
raise Exception("input json must be either a file or a dictionary")
# jobid can be specified through run_workflow option (priority),
# or in input_json
if not jobid:
if 'jobid' in data:
jobid = data['jobid']
else:
jobid = create_jobid()
data['jobid'] = jobid

if not sfn:
sfn = self.default_stepfunction_name
if not env:
Expand All @@ -189,8 +196,6 @@ def run_workflow(self, input_json, sfn=None,
# calculate what the url will be
url = "%s%s" % (base_url, arn)
data[_tibanna]['url'] = url
# add jobid
data['jobid'] = jobid
if 'args' in data: # unicorn-only
unicorn_input = UnicornInput(data)
args = unicorn_input.args
Expand Down Expand Up @@ -223,7 +228,7 @@ def run_workflow(self, input_json, sfn=None,
"aws_region": AWS_REGION
}
costupdater_input = json.dumps(costupdater_input)
response = client.start_execution(
costupdater_response = client.start_execution(
stateMachineArn=STEP_FUNCTION_ARN(sfn + "_costupdater"),
name=run_name,
input=costupdater_input,
Expand Down

0 comments on commit 3991dd7

Please sign in to comment.