Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
global: allow passing options to workflow loader
Browse files Browse the repository at this point in the history
Allows setting workflow engine specific options e.g. `toplevel`
for yadage workflows.

closes #356
mvidalgarcia committed Mar 23, 2020
1 parent 758e3e9 commit 698fe43
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions reana_client/utils.py
Original file line number Diff line number Diff line change
@@ -119,20 +119,24 @@ def load_reana_spec(filepath, skip_validation=False):
_validate_reana_yaml(reana_yaml)

kwargs = {}
if reana_yaml['workflow']['type'] == 'serial':
workflow_type = reana_yaml['workflow']['type']
if workflow_type == 'serial':
kwargs['specification'] = reana_yaml['workflow'].\
get('specification')
kwargs['parameters'] = \
reana_yaml.get('inputs', {}).get('parameters', {})
kwargs['original'] = True

if 'options' in reana_yaml['workflow']:
kwargs.update(reana_yaml['workflow']['options'])

reana_yaml['workflow']['specification'] = load_workflow_spec(
reana_yaml['workflow']['type'],
workflow_type,
reana_yaml['workflow'].get('file'),
**kwargs
)

if reana_yaml['workflow']['type'] == 'cwl' and \
if workflow_type == 'cwl' and \
'inputs' in reana_yaml:
with open(reana_yaml['inputs']['parameters']['input']) as f:
reana_yaml['inputs']['parameters'] = \

0 comments on commit 698fe43

Please sign in to comment.