Skip to content

Avoid parse already parsed Workflows in update.py #168

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Jul 17, 2017

Conversation

alexbarrera
Copy link
Contributor

When cwltool tries to update a workflow that includes more than once the
same subworkflow an exception is raised. This is a product of the updating
procedure where workflows are passed by reference in the document. Once
a workflow has been updated, it should not be processed again -otherwise
expected keys will be missed.

This is a hacky fix that I do not expect to be merged because it does not cover all use cases of the update.py script, but I thought it would be a good way to draft a possible solution. To test the problem, try running cwltool/cwl-runner with any DukeGCB top level pipelines with-control like this one.

Try:

cwl-runner --debug https://raw.githubusercontent.com/Duke-GCB/GGR-cwl/master/ChIP-seq_pipeline/pipeline-se-narrow-with-control.cwl

Which produces the following error:

/Users/abarrera/miniconda2/envs/cwl10/bin/cwltool 1.0.20160726135535
I'm sorry, I couldn't load this CWL file.  The error was:
Traceback (most recent call last):
  File "/Users/abarrera/miniconda2/envs/cwl10/lib/python2.7/site-packages/cwltool/main.py", line 638, in main
    preprocess_only=args.print_pre or args.pack)
  File "/Users/abarrera/miniconda2/envs/cwl10/lib/python2.7/site-packages/cwltool/load_tool.py", line 130, in validate_document
    processobj, document_loader, fileuri, enable_dev, metadata)
  File "/Users/abarrera/miniconda2/envs/cwl10/lib/python2.7/site-packages/cwltool/update.py", line 503, in update
    (cdoc, version) = nextupdate(cdoc, loader, baseuri)
  File "/Users/abarrera/miniconda2/envs/cwl10/lib/python2.7/site-packages/cwltool/update.py", line 358, in draft3toDraft4dev1
    return (_draft3toDraft4dev1(doc, loader, baseuri), "draft-4.dev1")
  File "/Users/abarrera/miniconda2/envs/cwl10/lib/python2.7/site-packages/cwltool/update.py", line 349, in _draft3toDraft4dev1
    doc[key] = _draft3toDraft4dev1(value, loader, baseuri)
  File "/Users/abarrera/miniconda2/envs/cwl10/lib/python2.7/site-packages/cwltool/update.py", line 351, in _draft3toDraft4dev1
    doc = [_draft3toDraft4dev1(item, loader, baseuri) for item in doc]
  File "/Users/abarrera/miniconda2/envs/cwl10/lib/python2.7/site-packages/cwltool/update.py", line 349, in _draft3toDraft4dev1
    doc[key] = _draft3toDraft4dev1(value, loader, baseuri)
  File "/Users/abarrera/miniconda2/envs/cwl10/lib/python2.7/site-packages/cwltool/update.py", line 333, in _draft3toDraft4dev1
    step["in"] = step["inputs"]
KeyError: 'inputs'

@cwl-bot
Copy link

cwl-bot commented Nov 15, 2016

Can one of the admins verify this patch?

@mr-c
Copy link
Member

mr-c commented Jul 17, 2017

Jenkins, add to testlist

When cwltool tries to update a workflow that includes more than once the
same subworkflow an exception is raised. This is a product of the updating
procedure where workflows are passed by reference in the document. Once
a workflow has been updated, it should not be processed again.
@mr-c
Copy link
Member

mr-c commented Jul 17, 2017

Hey @alexbarrera can you give me ("the maintainers)" permission to update your PR?

@alexbarrera
Copy link
Contributor Author

@mr-c done. Thanks for looking into this!

@mr-c
Copy link
Member

mr-c commented Jul 17, 2017

@alexbarrera You are very welcome. FYI: I've rebased the branch and I'm likely to merge it

@mr-c mr-c merged commit 0018e53 into common-workflow-language:master Jul 17, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants