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

One idea to make imports more intuitive #214

Open
cjllanwarne opened this issue May 21, 2018 · 3 comments
Open

One idea to make imports more intuitive #214

cjllanwarne opened this issue May 21, 2018 · 3 comments

Comments

@cjllanwarne
Copy link
Contributor

cjllanwarne commented May 21, 2018

One thought I'd had on making imports a bit more intuitive is to allow an optional namespace field at the top of a WDL file like this:

version 1.X

namespace "bam_processing/workflows"

import "bam_processing/tasks/my_tool.wdl"

workflow xyz {
  call my_tool.tool_task { input: ... }
}

How does this help anyone? Well.... when it comes to importing one of the tricky things is to work out where import paths are relative to. Sometimes they should be "relative to where I'm running from", sometimes they should be "relative to where this WDL file is". At the moment this is left up to the engine and often the zip bundle submitted alongside the main workflow.

This suggestion is that if a WDL specifies a namespace, that allows the engine to resolve imports relative to "the directory you get if you go back to the base of the namespace". In other words if the WDL above is in a directory /path/to/bam_processing/workflows/xyz.wdl then the "base" is /path/to/ and the import can be resolved as path/to/bam_processing/tasks/my_tool.wdl


Unresolved question: import versioning

@rhpvorderman
Copy link
Contributor

rhpvorderman commented May 22, 2018

Great! This feature would be very nice.
I think it is easier that imports are relative to the file and not $PWD but it would be better if this was explicit in the WDL file itself.

This would solve numerous issues with the versioning of imports, as you can put different versions in different directories/namespaces.

@aednichols
Copy link
Contributor

@GregTD42 this may be of interest related to your recent Cromwell issue

@microbioticajon
Copy link

I would like to add my voice to this feature request too. I just ran into the the issue outlined in broadinstitute/cromwell#6441.

Within a "package" relative imports ./ and ../ work nicely but when a wdl is imported within an import it is not intuitive for the user to work out what the relative path of the bundled dependency will be.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants