@@ -61,7 +61,7 @@ for other ways to install `cwltool` with `apt` and `conda`.
6161
6262Let's use a simple workflow ` true.cwl ` with ` cwltool ` .
6363
64- ``` {literalinclude} /_includes/cwl/simplest_cwl .cwl
64+ ``` {literalinclude} /_includes/cwl/true .cwl
6565:language: cwl
6666:caption: "`true.cwl`"
6767:name: true.cwl
@@ -75,29 +75,16 @@ to pass `--validate` to the `cwltool` command:
7575% TODO: maybe figure out a way to avoid /home/kinow/ etc. in the documentation
7676% to avoid multiple user-names/directory-locations varying in the docs.
7777
78- ``` {code-block} console
78+ ``` {runcmd} cwltool --validate true.cwl
7979:name: validating-truecwl-with-cwltool
8080:caption: Validating `true.cwl` with `cwltool`.
81-
82- $ cwltool --validate true.cwl
83- INFO /home/kinow/Development/python/workspace/user_guide/venv/bin/cwltool 3.1.20220406080846
84- INFO Resolved 'true.cwl' to 'file:///tmp/true.cwl'
85- true.cwl is valid CWL.
8681```
8782
8883You can run the CWL workflow now that you know it is valid:
8984
90- ``` {code-block} console
85+ ``` {runcmd} cwltool true.cwl
9186:name: running-true.cwl-with-cwltool
9287:caption: Running `true.cwl` with `cwltool`.
93-
94- $ cwltool true.cwl
95- INFO /home/kinow/Development/python/workspace/user_guide/venv/bin/cwltool 3.1.20220406080846
96- INFO Resolved 'true.cwl' to 'file:///tmp/true.cwl'
97- INFO [job true.cwl] /tmp/f8xlh1pl$ true
98- INFO [job true.cwl] completed success
99- {}
100- INFO Final process status is success
10188```
10289
10390### cwl-runner Python module
@@ -126,56 +113,42 @@ Now you can validate and run your workflow with `cwl-runner` executable,
126113which will invoke ` cwltool ` . You should have the same results and output
127114as in the previous section.
128115
129- ``` {code-block} console
116+ ``` {runcmd} cwl-runner --validate true.cwl
130117:name: validating-true.cwl-with-cwl-runner
131118:caption: Validating `true.cwl` with `cwl-runner`.
132-
133- $ cwl-runner --validate true.cwl
134- INFO /home/kinow/Development/python/workspace/user_guide/venv/bin/cwl-runner 3.1.20220406080846
135- INFO Resolved 'true.cwl' to 'file:///tmp/true.cwl'
136- true.cwl is valid CWL.
137119```
138120
139- ``` {code-block} console
121+ ``` {runcmd} cwl-runner true.cwl
140122:name: running-true.cwl-with-cwl-runner
141123:caption: Running `true.cwl` with `cwl-runner`.
142-
143- $ cwl-runner true.cwl
144- INFO /home/kinow/Development/python/workspace/user_guide/venv/bin/cwl-runner 3.1.20220406080846
145- INFO Resolved 'true.cwl' to 'file:///tmp/true.cwl'
146- INFO [job true.cwl] /tmp/7a2gf1nh$ true
147- INFO [job true.cwl] completed success
148- {}
149- INFO Final process status is success
150124```
151125
152126Another way to execute ` cwl-runner ` is invoking the file directly. For that,
153- the first thing you need is to modify the ` true.cwl ` workflow and include
154- a special first line, a * shebang* :
127+ the first thing you need to copy ` true.cwl ` workflow into a new file
128+ ` true_shebang.cwl ` and include a special first line, a * shebang* :
155129
156- ``` {literalinclude} /_includes/cwl/simplest_cwl_shebang .cwl
130+ ``` {literalinclude} /_includes/cwl/true_shebang .cwl
157131:language: cwl
158- :name: cwltool-with-a-shebang
159- :caption: "`cwltool` with a shebang "
132+ :name: "true_shebang.cwl"
133+ :caption: "`true_shebang.cwl` "
160134```
161135
162- Now, after you make the file ` true.cwl ` executable with ` chmod u+x ` ,
163- you can execute it directly in the command-line and the program
164- specified in the shebang (` cwl-runner ` ) will be used to execute the
165- rest of the file.
136+ Now you can make the file ` true_shebang.cwl ` executable with ` chmod u+x ` .
166137
167138``` {code-block} console
168- :name: making-true.cwl-executable-and-running-it
169- :caption: Making `true.cwl` executable and running it .
139+ :name: making-true.cwl-executable
140+ :caption: Making `true.cwl` executable.
170141
171142$ chmod u+x true.cwl
172- $ ./true.cwl
173- INFO /home/kinow/Development/python/workspace/user_guide/venv/bin/cwl-runner 3.1.20220406080846
174- INFO Resolved './true.cwl' to 'file:///tmp/true.cwl'
175- INFO [job true.cwl] /tmp/jz7ups99$ true
176- INFO [job true.cwl] completed success
177- {}
178- INFO Final process status is success
143+ ```
144+
145+ And finally you can execute it directly in the command-line and the program
146+ specified in the shebang (` cwl-runner ` ) will be used to execute the
147+ rest of the file.
148+
149+ ``` {runcmd} ./true_shebang.cwl
150+ :name: running-true_shebang.cwl-with-a-shebang
151+ :caption: Running `true_shebang.cwl` with a shebang.
179152```
180153
181154``` {note}
0 commit comments