Skip to content

Update 14-runtime.md #144

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
Aug 2, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 26 additions & 2 deletions _episodes/14-runtime.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,17 @@ To generate such files we can use the `InitialWorkDirRequirement`.
~~~
{: .source}

Any [expressions](../13-expressions/index.html) like `$(inputs.message)` are expanded by the CWL engine before creating the file; here inserting the value at the input `message`.
Any [expressions](../13-expressions/index.html) like `$(inputs.message)` are
expanded by the CWL engine before creating the file;
here inserting the value at the input `message`.

> **Tip:** The _CWL expressions_ are independent of any _shell variables_ used later during command line tool invocation. That means that any genuine need for the character `$` should be **escaped** with `\`, for instance `\${PREFIX}` above is expanded to `${PREFIX}` in the generated file to be evaluated by the shell script instead of the CWL engine.
> ## Tip
> The _CWL expressions_ are independent of any _shell variables_
used later during command line tool invocation. That means that any genuine
need for the character `$` must be **escaped** with `\`,
for instance `\${PREFIX}` above is expanded to `${PREFIX}` in the generated file
to be evaluated by the shell script instead of the CWL engine.
{: .callout}

To test the above CWL tool use this job to provide the input value `message`:

Expand All @@ -39,6 +47,22 @@ To test the above CWL tool use this job to provide the input value `message`:
~~~
{: .source}

Before we run this, lets look at each step in a little more detail.
The base command `baseCommand: ["sh", "example.sh"]`
will execute the command `sh example.sh`.
This will run the file we create in the shell.

`InitialWorkDirRequirement` requires a `listing`.
As the `listing` is a YAML array we need a `-` on the first line of
each element of the array, in this case we have just one element.
`entryname:` can have any value,
but it must match what was specified in the `baseCommand`.
The final part is `entry:`, this is followed by `|-`
which is YAML quoting syntax, and means that you are using a multiline string
(without it we would need to write the whole script on one line).
(see the [YAML Guide]({{ page.root }}{% link _extras/yaml.md %}#maps)
for more about the formating)

Now invoke `cwl-runner` with the tool wrapper and the input object on the
command line:

Expand Down