@@ -39,7 +39,10 @@ like `venv` or `conda`. The following commands will create and activate a Python
39
39
virtual environment using the ` venv ` module, and install ` cwltool ` in that
40
40
environment:
41
41
42
- ``` bash
42
+ ``` {code-block} console
43
+ :name: installing-cwltool-with-pip-and-venv
44
+ :caption: Installing `cwltool` with `pip` and `venv`.
45
+
43
46
$ python -m venv venv
44
47
$ source venv/bin/activate
45
48
$ (venv) pip install cwltool
@@ -54,15 +57,22 @@ Let's use a simple workflow `true.cwl` with `cwltool`.
54
57
55
58
``` {literalinclude} /_includes/cwl/simplest_cwl.cwl
56
59
:language: cwl
60
+ :caption: "`true.cwl`"
61
+ :name: truecwl-file
57
62
```
58
- <p class =" text-center text-muted mt-n2 " >true.cwl</p >
59
63
60
- First you can validate the CWL document:
64
+ The ` cwltool ` command has an option to validate CWL workflows. It will parse the
65
+ CWL workflow, look for syntax errors, and verify that the workflow is compliant
66
+ with the CWL specification, without running the workflow. To use it you just need
67
+ to pass ` --validate ` to the ` cwltool ` command:
61
68
62
69
% TODO: maybe figure out a way to avoid /home/kinow/ etc. in the documentation
63
70
% to avoid multiple user-names/directory-locations varying in the docs.
64
71
65
- ``` bash
72
+ ``` {code-block} console
73
+ :name: validating-truecwl-with-cwltool
74
+ :caption: Validating `true.cwl` with `cwltool`.
75
+
66
76
$ cwltool --validate true.cwl
67
77
INFO /home/kinow/Development/python/workspace/user_guide/venv/bin/cwltool 3.1.20220406080846
68
78
INFO Resolved 'true.cwl' to 'file:///tmp/true.cwl'
@@ -71,7 +81,10 @@ true.cwl is valid CWL.
71
81
72
82
You can run the CWL workflow now that you know it is valid:
73
83
74
- ``` bash
84
+ ``` {code-block} console
85
+ :name: running-truecwl-with-cwltool
86
+ :caption: Running `true.cwl` with `cwltool`.
87
+
75
88
$ cwltool true.cwl
76
89
INFO /home/kinow/Development/python/workspace/user_guide/venv/bin/cwltool 3.1.20220406080846
77
90
INFO Resolved 'true.cwl' to 'file:///tmp/true.cwl'
@@ -81,7 +94,7 @@ INFO [job true.cwl] completed success
81
94
INFO Final process status is success
82
95
```
83
96
84
- ### cwl-runner
97
+ ### cwl-runner Python module
85
98
86
99
` cwl-runner ` is an implementation agnostic alias for CWL Runners.
87
100
Users can invoke ` cwl-runner ` instead of invoking a CWL runner like ` cwltool `
@@ -93,7 +106,10 @@ The CWL community publishes a Python module with the same name,
93
106
the rest of this user guide. You can use ` pip ` to install the ` cwl-runner `
94
107
Python module:
95
108
96
- ``` bash
109
+ ``` {code-block} console
110
+ :name: installing-cwlrunner-with-pip
111
+ :caption: Installing `cwl-runner` with `pip`.
112
+
97
113
$ pip install cwl-runner
98
114
```
99
115
@@ -104,14 +120,20 @@ Now you can validate and run your workflow with `cwl-runner` executable,
104
120
which will invoke ` cwltool ` . You should have the same results and output
105
121
as in the previous section.
106
122
107
- ``` bash
123
+ ``` {code-block} console
124
+ :name: validating-truecwl-with-cwl-runner
125
+ :caption: Validating `true.cwl` with `cwl-runner`.
126
+
108
127
$ cwl-runner --validate true.cwl
109
128
INFO /home/kinow/Development/python/workspace/user_guide/venv/bin/cwl-runner 3.1.20220406080846
110
129
INFO Resolved 'true.cwl' to 'file:///tmp/true.cwl'
111
130
true.cwl is valid CWL.
112
131
```
113
132
114
- ``` bash
133
+ ``` {code-block} console
134
+ :name: running-truecwl-with-cwl-runner
135
+ :caption: Running `true.cwl` with `cwl-runner`.
136
+
115
137
$ cwl-runner true.cwl
116
138
INFO /home/kinow/Development/python/workspace/user_guide/venv/bin/cwl-runner 3.1.20220406080846
117
139
INFO Resolved 'true.cwl' to 'file:///tmp/true.cwl'
@@ -127,15 +149,19 @@ a special first line, a *shebang*:
127
149
128
150
``` {literalinclude} /_includes/cwl/simplest_cwl_shebang.cwl
129
151
:language: cwl
152
+ :name: cwltool-with-a-shebang
153
+ :caption: "`cwltool` with a shebang"
130
154
```
131
- <p class =" text-center text-muted mt-n2 " >true.cwl</p >
132
155
133
156
Now, after you make the file ` true.cwl ` executable with ` chmod u+x ` ,
134
157
you can execute it directly in the command-line and the program
135
158
specified in the shebang (` cwl-runner ` ) will be used to execute the
136
159
rest of the file.
137
160
138
- ``` bash
161
+ ``` {code-block} console
162
+ :name: making-truecwl-executable-and-running-it
163
+ :caption: Making `true.cwl` executable and running it.
164
+
139
165
$ chmod u+x true.cwl
140
166
$ ./true.cwl
141
167
INFO /home/kinow/Development/python/workspace/user_guide/venv/bin/cwl-runner 3.1.20220406080846
0 commit comments