diff --git a/tibanna/_version.py b/tibanna/_version.py index 8348aae2..11a18bfd 100755 --- a/tibanna/_version.py +++ b/tibanna/_version.py @@ -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" diff --git a/tibanna/core.py b/tibanna/core.py index 5d5f037a..4d7c269a 100755 --- a/tibanna/core.py +++ b/tibanna/core.py @@ -158,8 +158,6 @@ 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): @@ -167,6 +165,15 @@ def run_workflow(self, input_json, sfn=None, 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: @@ -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 @@ -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,