Skip to content

Commit b6c0c17

Browse files
author
Peter Amstutz
committed
Update to advertise support for WES 1.0. Update README.
1 parent f8f12f2 commit b6c0c17

File tree

6 files changed

+181
-148
lines changed

6 files changed

+181
-148
lines changed

README.md

Lines changed: 39 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
11
# Workflow as a Service
22

3-
This provides client and server implementations of the [GA4GH Workflow
4-
Execution Service](https://github.com/ga4gh/workflow-execution-schemas) API for
5-
the Common Workflow Language.
3+
This is a client and server implementation of the [GA4GH Workflow
4+
Execution Service](https://github.com/ga4gh/workflow-execution-schemas) 1.0.0 API.
65

7-
It provides an [Arvados](https://github.com/curoverse/arvados) backend. It
6+
It provides [Arvados](https://arvados.org/) and [Toil](http://toil.ucsc-cgl.org/) backends. It
87
also works with any `cwl-runner` that supports the CWL standard command line
98
interface: http://www.commonwl.org/v1.0/CommandLineTool.html#Executing_CWL_documents_as_scripts
109

@@ -16,43 +15,66 @@ pip install wes-service
1615

1716
## Usage
1817

19-
Run a standalone server with default `cwl-runner` backend:
18+
### Client configuration
19+
20+
Command line parameter or environment variable.
21+
22+
`--host` or `WES_API_HOST`
23+
24+
The host to contact.
25+
26+
`--proto` or `WES_API_PROTO`
27+
28+
The protocol (http or https) to use.
29+
30+
`--auth` or `WES_API_AUTH`
31+
32+
Credentials. Format is 'Header: value' or just 'value'. If header name is not provided, value goes in the 'Authorization'.
33+
34+
### Get service info
2035

2136
```
22-
$ wes-server
37+
$ wes-client --info
2338
```
2439

2540
### Submit a workflow to run:
2641

27-
Note! All inputs files must be accessible from the filesystem.
42+
Attachments must be accessible from the filesystem. Workflow runners may also support http URLs or other storage systems.
2843

2944
```
30-
$ wes-client --host=localhost:8080 --proto=http --attachments="testdata/dockstore-tool-md5sum.cwl,testdata/md5sum.input" testdata/md5sum.cwl testdata/md5sum.cwl.json
45+
$ wes-client --attachments="testdata/dockstore-tool-md5sum.cwl,testdata/md5sum.input" testdata/md5sum.cwl testdata/md5sum.cwl.json
3146
```
3247

3348
### List workflows
3449

3550
```
36-
$ wes-client --proto http --host=localhost:8080 --list
51+
$ wes-client --list
3752
```
3853

3954
### Get workflow status
4055

4156
```
42-
$ wes-client --proto http --host=localhost:8080 --get <workflow-id>
57+
$ wes-client --get <run-id>
4358
```
4459

4560
### Get stderr log from workflow:
4661

4762
```
48-
$ wes-client --proto http --host=localhost:8080 --log <workflow-id>
63+
$ wes-client --log <run-id>
4964
```
5065

5166
## Server Configuration
5267

68+
### Run a standalone server with default `cwl-runner` backend:
69+
70+
```
71+
$ wes-server
72+
```
73+
5374
### Run a standalone server with Arvados backend:
5475

5576
```
77+
$ pip install arvados-cwl-runner
5678
$ wes-server --backend=wes_service.arvados_wes
5779
```
5880

@@ -63,46 +85,21 @@ $ pip install toil[all]
6385
$ wes-server --backend=wes_service.toil_wes --opt extra=--clean=never
6486
```
6587

66-
### Use a different executable with cwl_runner backend
88+
### Use alternate executable with cwl-runner backend
6789

6890
```
69-
$ pip install toil[all]
70-
$ wes-server --backend=wes_service.cwl_runner --opt runner=cwltoil --opt extra=--logLevel=CRITICAL
91+
$ pip install cwltool
92+
$ wes-server --backend=wes_service.cwl_runner --opt runner=cwltool --opt extra=--logLevel=CRITICAL
7193
```
7294

7395
### Pass parameters to cwl-runner
7496

75-
```
76-
$ wes-server --backend=wes_service.cwl_runner --opt extra=--workDir=/
77-
```
78-
79-
## Client Configuration
80-
81-
These options will be read in as defaults when running the client from the
82-
command line. The default protocol is https, to support secure communications,
83-
but the server starts using http, to ease development.
84-
85-
Set service endpoint:
86-
87-
```
88-
$ export WES_API_HOST=localhost:8080
89-
```
90-
91-
Set the value to pass in the `Authorization` header:
97+
Use "--opt" following by "key=value"
9298

9399
```
94-
$ export WES_API_AUTH=my_api_token
100+
$ wes-server --backend=wes_service.cwl_runner --opt extra=--workDir=/tmp/work
95101
```
96102

97-
Set the protocol (one of http, https)
98-
99-
```
100-
$ export WES_API_PROTO=http
101-
```
102-
103-
Then, when you call `wes-client` these defaults will be used in place of the
104-
flags, `--host`, `--auth`, and `proto` respectively.
105-
106103
## Development
107104
If you would like to develop against `workflow-service` make sure you pass the provided test and it is flake8 compliant
108105

@@ -113,7 +110,7 @@ $ virtualenv venv && source venv/bin/activate && pip install toil[all] && pip in
113110
```
114111

115112
#### Running Tests
116-
From path `workflow-service` run
113+
From path `workflow-service` run
117114

118115
```
119116
$ pytest && flake8

wes_client/util.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -234,7 +234,7 @@ def cancel(self, run_id):
234234
:param host: Port where the post request will be sent and the wes server listens at (default 8080)
235235
:return: The body of the delete result as a dictionary.
236236
"""
237-
postresult = requests.delete("%s://%s/ga4gh/wes/v1/runs/%s" % (self.proto, self.host, run_id),
237+
postresult = requests.post("%s://%s/ga4gh/wes/v1/runs/%s/cancel" % (self.proto, self.host, run_id),
238238
headers=self.auth)
239239
return wes_reponse(postresult)
240240

wes_service/arvados_wes.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ def GetServiceInfo(self):
7272
"workflow_type_versions": {
7373
"CWL": {"workflow_type_version": ["v1.0"]}
7474
},
75-
"supported_wes_versions": ["0.3.0"],
75+
"supported_wes_versions": ["0.3.0", "1.0.0"],
7676
"supported_filesystem_protocols": ["http", "https", "keep"],
7777
"workflow_engine_versions": {
7878
"arvados-cwl-runner": stderr

wes_service/cwl_runner.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -160,15 +160,19 @@ def cancel(self):
160160

161161
class CWLRunnerBackend(WESBackend):
162162
def GetServiceInfo(self):
163+
runner = self.getopt("runner", default="cwl-runner")
164+
stdout, stderr = subprocess.Popen([runner, "--version"], stderr=subprocess.PIPE).communicate()
163165
return {
164166
"workflow_type_versions": {
165167
"CWL": {"workflow_type_version": ["v1.0"]}
166168
},
167-
"supported_wes_versions": ["0.3.0"],
169+
"supported_wes_versions": ["0.3.0", "1.0.0"],
168170
"supported_filesystem_protocols": ["file", "http", "https"],
169-
"engine_versions": "cwl-runner",
171+
"workflow_engine_versions": {
172+
"cwl-runner": stderr
173+
},
170174
"system_state_counts": {},
171-
"key_values": {}
175+
"tags": {}
172176
}
173177

174178
def ListRuns(self, page_size=None, page_token=None, state_search=None):

0 commit comments

Comments
 (0)