Skip to content
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

CWL document resolver via GA4GH tool API #201

Merged
merged 18 commits into from
Mar 16, 2017
Merged

CWL document resolver via GA4GH tool API #201

merged 18 commits into from
Mar 16, 2017

Conversation

denis-yuen
Copy link
Member

This allows cwltool to launch tools from https://dockstore.org/ in one of two ways

cwltool --non-strict quay.io/collaboratory/dockstore-tool-bamstats:master test.json

and

# defaults to latest when a version is not specified
cwltool --non-strict quay.io/collaboratory/dockstore-tool-bamstats test.json

Grab the test.json (and input file) from https://github.com/CancerCollaboratory/dockstore-tool-bamstats

@denis-yuen
Copy link
Member Author

@tetron FYI, looks like something has gone wrong stylistically with the merge from master

@mr-c
Copy link
Member

mr-c commented Oct 3, 2016

@denis-yuen The conformance tests are failing: https://ci.commonwl.org/job/cwltool-pr-conformance/275/console

@denis-yuen
Copy link
Member Author

@mr-c Yeah, just got travis satisfied. Looks like Jenkins is next if I can figure this out.

@mr-c
Copy link
Member

mr-c commented Oct 5, 2016

Looks useful to me, shall I update the branch and merge?

@mr-c
Copy link
Member

mr-c commented Oct 5, 2016

@denis-yuen FYI, I think you have permissions to create branches on this repo directly

@denis-yuen
Copy link
Member Author

@mr-c Ah ok, thanks.
Feel free to update and merge/squash

@tetron
Copy link
Member

tetron commented Oct 14, 2016

Hi @denis-yuen can you update this PR?

@denis-yuen
Copy link
Member Author

@tetron FYI, done

@denis-yuen
Copy link
Member Author

@tetron @mr-c Hi, not sure what is the next step with this. Just give me a heads-up if more is needed on my side.

@mr-c
Copy link
Member

mr-c commented Oct 18, 2016

Hey @denis-yuen thank you for this contribution!

The documentation at the top should be added to the readme as a general section about resolving the location of referenced documents, with a link to http://www.commonwl.org/v1.0/CommandLineTool.html#Discovering_CWL_documents_on_a_local_filesystem

Specifically it must be clearly explained that the reference implementation will try to contact dockstore.org if the document can't be found locally; likewise there should be a switch to skip dockstore.org resolution for privacy preservation.

Also, cwltool/resolver.py is missing PEP 484 type signatures for the methods.

  • docs
  • opt-out switch
  • PEP 484 type signatures

@mr-c mr-c changed the title Tool resolver CWL document resolver via local filesystem, dockstore.org Oct 24, 2016
@denis-yuen
Copy link
Member Author

denis-yuen commented Oct 27, 2016

FYI @tetron , I may need you (or someone more pythony) to finish off this since my Python knowledge is lacking.
It looks like the immediate issue is related to this python/mypy#1141 . In addition, there's probably a more elegant way of passing the opt-out parameter.

@mr-c
Copy link
Member

mr-c commented Oct 27, 2016

@denis-yuen I'll fix the types for you

@mr-c
Copy link
Member

mr-c commented Nov 10, 2016

@denis-yuen A few questions:

Can you help me understand the value in a dockstore.org specific resolver when we already support any HTTP[S] IRI?

What's the benefit of typing:

cwltool --non-strict https://raw.githubusercontent.com/CancerCollaboratory/dockstore-tool-bamstats/develop/Dockstore.cwl test.json

(which works today, and won't need the --non-strict once my PR is merged)
over

cwltool --non-strict quay.io/collaboratory/dockstore-tool-bamstats:master test.json

?

As an end user I'm not likely to want to type quay.io/collaboratory/dockstore-tool-bamstats:master from memory, so if we stay in the land of copy and paste then a regular URL/URI/IRI seems fine.

As a shortcut, the user's input object (which really should be YAML not JSON for readability) can include a cwl:tool entry pointing to the remote location of the tool or workflow. So maybe the docstore.org website or tool can generate a skelton input object YAML with that prefilled?

@mr-c mr-c mentioned this pull request Nov 10, 2016
@denis-yuen
Copy link
Member Author

@mr-c
Well, the alternative to quay.io/collaboratory/dockstore-tool-bamstats:master would be something more like https://dockstore.org:8443/api/ga4gh/v1/tools/quay.io/collaboratory/dockstore-tool-bamstats/versions/master/plain-CWL/descriptor. https://raw.githubusercontent.com/CancerCollaboratory/dockstore-tool-bamstats/develop/Dockstore.cwlis different in the sense that its pointing to the GitHub repo where Dockstore sources its content and is pointing at GitHub's develop rather than dockstore/quay.io's docker tag.

As for whether copy-and-paste is sufficient, I think @tetron 's intent from the original commit was that this is more meant for ease-of-use, so that someone can go to the dockstore site and copy just quay.io/collaboratory/dockstore-tool-bamstats:master rather than the long URL above.

Oh, I was not aware of that last short-cut. Could you point me to an example in the user guide or similar?

@mr-c
Copy link
Member

mr-c commented Nov 10, 2016

cwl:tool is described at http://www.commonwl.org/v1.0/CommandLineTool.html#Executing_CWL_documents_as_scripts

@mr-c
Copy link
Member

mr-c commented Nov 11, 2016

@denis-yuen To keep the code cleaner and more maintainable, and to be fair to other registries, I suggest the following:
- [ ] @mr-c adds support for resolver plugins using the cwltool.resolver entry point
- [ ] @denis-yuen and/or others implement their additional resolvers and advertise them using the cwltool.resolver entry point
- [ ] Once the above is working and tested, dependencies will be added to cwltool as named extras so that users can install them easier. Example: pip install cwltool[docstore,bioshadock]

This has been moved to #314

@mrc
Copy link

mrc commented Nov 16, 2016

I reckon I've been CC'd here by mistake, which means you might be missing a
review from someone.

On Tue, Nov 15, 2016 at 3:20 AM, Common Workflow Language project bot <
[email protected]> wrote:

Can one of the admins verify this patch?


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
#201 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/AAB7aQFNO6p5AcYUjc6Rn_Si9Wg_ESqyks5q-ZVjgaJpZM4KLedJ
.

@mr-c
Copy link
Member

mr-c commented Nov 16, 2016

@mrc Sorry, typo'd my own username :-)

@denis-yuen
Copy link
Member Author

@mr-c FYI, sounds reasonable, but it may take some time before I can get to it.

@mrc
Copy link

mrc commented Nov 16, 2016

Hehe no worries.

On Wed, Nov 16, 2016 at 12:40 AM, Michael R. Crusoe <
[email protected]> wrote:

@mrc https://github.com/mrc Sorry, typo'd my own username :-)


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
#201 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/AAB7aWbNhFY9PNhEXJqUw2rfNpnT85U0ks5q-sGIgaJpZM4KLedJ
.

Copy link
Member

@mr-c mr-c left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@tetron
Since the GA4GH tool registry API is getting more stable, is your thinking that we should just merge this w/o a resolver plugin as discussed in #201 (comment) ?

@tetron
Copy link
Member

tetron commented Mar 1, 2017

@mr-c I don't object to implementing a proper plugin framework. That would provide a much better solution to configuring the various extension points than the ad-hoc current approach. However I have limited bandwidth so my personal preference would be to go ahead and merge the feature as-is and refactor later.

Do you have any experience / opinions on plugin frameworks for Python that we can use?

README.rst Outdated
@@ -86,3 +86,16 @@ documents using absolute or relative local filesytem paths. If a relative path
is referenced and that document isn't found in the current directory then the
following locations will be searched:
http://www.commonwl.org/v1.0/CommandLineTool.html#Discovering_CWL_documents_on_a_local_filesystem

Use with Dockstore
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All references to Dockstore need to be replaced with "the GA4GH Tool Registry API"

At some point there should be a link to https://github.com/ga4gh/tool-registry-schemas#what-is-the-tool-registry-api-schema

Dockstore.org should still be mentioned as it is the default backend

cwltool/main.py Outdated
dest="enable_tool_registry", default=True)

parser.add_argument("--add-tool-registry", action="append", help="Add a tool registry to use for resolution, default %s" % tool_registries,
dest="tool_registries", default=[])
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The help text for all three of theses needs to mention what kind of tool registry; in this case it is "a GA4GH compliant tool registry"

See ga4gh/tool-registry-service-schemas#17 for a discussion on this

@mr-c
Copy link
Member

mr-c commented Mar 2, 2017

@tetron Sure, we can merge as soon as the docs and help for the new command line flags in the PR are brought up to date with the latest changes (which center the GA4GH API and use Dockstore as the exemplar default)

As for plugins, I've expanded my comment above into #314

@tetron tetron changed the title CWL document resolver via local filesystem, dockstore.org CWL tool resolver via dockstore.org Mar 2, 2017
@tetron tetron changed the title CWL tool resolver via dockstore.org CWL document resolver via GA4GH tool API Mar 2, 2017
@tetron
Copy link
Member

tetron commented Mar 15, 2017

I think this branch is well baked at this point, so I'm going to merge it at the next opportunity.

@tetron tetron merged commit d0f9d40 into common-workflow-language:master Mar 16, 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.

4 participants