Hello World¶
Writing a workflow¶
First we will start with the classic Hello World example:
steps:
- echo:
in:
message: !ii Hello World
A workflow is just a list of steps. Here we just have a single step, which executes the unix echo command with the input Hello World. Workflows are written in YAML format. We will discuss the YAML syntax later, but for now just note that indentation is important. In particular, the in: tag must be indented two spaces beyond the step name (echo in this case). Similarly, all of the inputs must be indented two spaces beyond the in: tag (message in this case).
Running a workflow¶
sophios --yaml docs/tutorials/helloworld.wic --run_local --copy_output_files --quiet
That command compiles the workflow into autogenerated/, runs it locally with the configured CWL runner, and copies the primary outputs into outdir/.
On success, the final message tells you that output files should be in outdir/.
The files that were compiled (starting … finishing)
The command that was used to invoke the cwl runner
The output of the cwl runner
The location of the output metadata json file
A friendly message to look in
outdir/for your output files
For this workflow, the file outdir/helloworld/step 1 echo/stdout/stdout indeed contains Hello World.
On the other hand, if something went wrong you will see:
Failure! Please scroll up and find the FIRST error message.
(You may have to scroll up A LOT.)
For more complex workflows, the output can be VERY verbose. Hence, you may need to scroll up several pages (or more) until you find the FIRST error message. If there is not enough information printed to determine the error, try running it again without the --quiet flag.
Finally, note that to avoid recalculating intermediate steps, the runtime keeps caches in cachedir*. If you suspect that a stale artifact is involved, you can remove autogenerated/, cachedir*, outdir/, and provenance/ and then run the workflow from scratch.