-
Notifications
You must be signed in to change notification settings - Fork 240
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
Add support for running Dockstore page URLs and TRS IDs #5102
Conversation
One idea floated by the Dockstore team was to use the Dockstore ZIP download URLs like:
Instead of just going to the URL in the backing storage. This would let Dockstore actually mirror/host the workflow in case something happens to the backing storage. |
TRS (and dockstore specifically) is already supported in https://cwltool.readthedocs.io/en/latest/#use-with-ga4gh-tool-registry-api |
The |
@mr-c The cwltool support for TRS came up when we were talking to the Dockstore team. It probably makes sense to have the CWL side just delegate to that. Can the cwltool implementation handle upwards relative path references (or does CWL ban them)? On the WDL side we have a lot of |
It would be good to split the TRS client stuff off into its own library, since then Toil could import it without needing the The Dockstore team wanted to try extending TRS a bit to make it possible to get the path to the root workflow file within the repo that Dockstore is serving. You can already ask for But maybe once that's done it will be easy to have a tool -> well behaved root descriptor URL mapping function that's useful as a library. |
That's a good question, I haven't tested that in a TRS context. |
I've adjusted this to actually pull the workflow from Dockstore via ZIP download, instead of just asking Dockstore for a URL for the main file. To avoid dealing with temporary directory cleanup, I'm caching all the extracted ZIPs in the XDG cache directory, identified by a hash of the names and hashes of the files that Dockstore reports. (This doesn't account for a workflow changing between Dockstore reporting the files and Dockstore providing the ZIP.) I then hunt through the extracted ZIP for exactly one file with the right basename and hash to be the primary descriptor. When Dockstore grows a way to report where the primary descriptor is supposed to be inside the ZIP, I can use that instead. This should support any embedded binary files (which are only really possible in CWL since WDL |
I had to fiddle with the CWL option parsing, since Python 3.12 changed how argparse deals with positional arguments vs. arguments that might belong to workflow options. |
I've now run |
This adds support for resolving Dockstore page URLs and TRS IDs that look Dockstore-y to actual workflow file URLs.
This enables running:
Any top-level workflow URL/path starting with
https://dockstore.org/workflows/
or#workflow/
will be replaced with theurl
that Dockstore provides for the workflow's descriptor. Usually this goes to Github.There's some smart default version selection for
main
,master
, or the only available version, and:
-delimited versions are supported in the Dockstore URL or at the end of the TRS ID.This only supports Dockstore; no other TRS endpoint can be queried. This is also not general support for fetching workflow code over TRS; I couldn't find a good way to get the URL that Dockstore actually hotlinks the TRS IDs on its web pages to, which includes the path within the repo to the workflow file, which would be required for relative imports to work, so I'm only using TRS to give me a URL to then redirect to. This also does not allow workflows to reference each other by TRS ID or Dockstore URL; it only applies to the top-level command line input.
This fixes #5049. This also fixes #5050 as long as Dockstore is the only TRS registry we care about.
Changelog Entry
To be copied to the draft changelog by merger:
?
or#
, remember to quote them on the command line!Reviewer Checklist
issues/XXXX-fix-the-thing
in the Toil repo, or from an external repo.camelCase
that want to be insnake_case
.docs/running/{cliOptions,cwl,wdl}.rst
Merger Checklist