[WIP] RFC: symbolic import mapping #700
claymcleod
started this conversation in
Requests for Comment
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Note
This RFC is a work in progress and is currently not complete in its reasoning.
Concerns left to address.
Overview
Symbolic import mapping is proposed as a mechanism for dynamically mapping import items using a symbolic name at execution time in WDL. Here, we lay out the case that importing within WDL today is not flexible enough to support a mature package ecosystem in WDL—a desired expressed by many groups to encourage code reuse across the community. To get an idea, here's an example of what symbolic importing would look like in practice.
Motivation
Importing in WDL today is a relatively constrained operation—only local file references or references to URLs are supported during import. This leaves quite a few things to be desired.
Importing via the URL mechanism is fine for simple imports that rarely change, but that approach is far from enabling a package management ecosystem. For example,
main
/master
branch.v2.0.1
tov2.0.2
, all of those URLs in your source code need to be updated. This is unnecessary work and noise for the git commit history.main
branch right before merging. More than once this has tripped us up on the St. Jude Cloud team, and I'm sure it's affected others.The above, plus the numerous issues regarding how package management can be improved in WDL, should convince you that the current state of importing in WDL is not a solid foundation upon which to build a package management ecosystem. This begs the question, "what is the criteria for a modern package management ecosystem"?
A more ideal state
We consider the following requirements of a solid foundation upon which to build.
Specific suggestions
Note
This section specifically uses the
sprocket
engine that my team is writing as an example. This is because it's hard to make a concrete case for what a solution might look like outside of both (a) the WDL specification and (b) a concrete execution engine. That being said, none of this is binding to whatsprocket
might eventually do—just consider it as an example situation.Overview
I suggest we do the following things: all of which get their own sections below.
Introduce syntax for symbolic imports
First, let's address the relatively straightforward question of what for the imports would take. Because imports today must be enclosed in quotes, a backwards compatible change that seems sufficient would be that any non-quoted import is assumed to be a symbolic import. For example,
Next, there are a number of different ways you can structure the identifier that symbolic imports link into—particularly as it relates to conflicts in the identifiers. To start, we suggest to start with the simplest approach, which is an identifier conforming to a word pattern (
[a-zA-Z0-9_]+
). The lack of namespacing means that everything must be explicitly handled by the user.Consider a
Sprocket.toml
file that contains a dependency section like so:Effectively, we're empowering (and requiring) users to solve name conflicts themselves. The authors feel this a reasonable first step in this direction rather than, say, a complicated set of name conflict requirements.
Concretely, the following import modalities would be required (as show through examples in the fictional
Sprocket.toml
file).Notably, the specifics of how these imports would be linked in across the various execution engines is left up to the execution engine—there is no requirement from the specification other than (a) these modalities must be supported and (b) they must be clearly documented for users to be able to take advantage of.
Beta Was this translation helpful? Give feedback.
All reactions