Skip to content

Commit efa4217

Browse files
committed
fixes for docker-toolbox
1 parent 76cad73 commit efa4217

File tree

3 files changed

+29
-13
lines changed

3 files changed

+29
-13
lines changed

cwltool/utils.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
# no imports from cwltool allowed
44

55
import os
6+
import platform
67
import shutil
78
import stat
89
from typing import Any, Callable, Dict, List, Text, Tuple, Union
@@ -67,7 +68,10 @@ def docker_windows_path_adjust(path):
6768
if path is not None and onWindows():
6869
sp=path.split(':')
6970
if len(sp)==2:
70-
sp[0]=sp[0].capitalize() # Capitalizing windows Drive letters
71+
if platform.win32_ver()[0] < 9:
72+
sp[0]=sp[0].lower() # Docker toolbox uses lowecase windows Drive letters
73+
else:
74+
sp[0]=sp[0].capitalize() # Docker for Windows uses uppercase windows Drive letters
7175
path=':'.join(sp)
7276
path = path.replace(':', '').replace('\\', '/')
7377
return path if path[0] == '/' else '/' + path

tests/test_pack.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ def test_packed_workflow_execution(self):
105105
document_loader, avsc_names, processobj, metadata, uri = validate_document(
106106
document_loader, workflowobj, uri)
107107
packed = json.loads(print_pack(document_loader, processobj, uri, metadata))
108-
temp_packed_path = tempfile.mkstemp()[1]
108+
temp_packed_handle, temp_packed_path = tempfile.mkstemp()
109109
with open(temp_packed_path, 'w') as f:
110110
json.dump(packed, f)
111111
normal_output = StringIO()
@@ -117,6 +117,7 @@ def test_packed_workflow_execution(self):
117117
get_data(test_wf_job)],
118118
stdout=normal_output), 0)
119119
self.assertEquals(json.loads(packed_output.getvalue()), json.loads(normal_output.getvalue()))
120+
os.close(temp_packed_handle)
120121
os.remove(temp_packed_path)
121122

122123
@needs_docker
@@ -129,7 +130,7 @@ def test_preserving_namespaces(self):
129130
document_loader, workflowobj, uri)
130131
packed = json.loads(print_pack(document_loader, processobj, uri, metadata))
131132
assert "$namespaces" in packed
132-
temp_packed_path = tempfile.mkstemp()[1]
133+
temp_packed_handle, temp_packed_path = tempfile.mkstemp()
133134
with open(temp_packed_path, 'w') as f:
134135
json.dump(packed, f)
135136
normal_output = StringIO()
@@ -141,4 +142,5 @@ def test_preserving_namespaces(self):
141142
get_data(test_wf_job)],
142143
stdout=normal_output), 0)
143144
self.assertEquals(json.loads(packed_output.getvalue()), json.loads(normal_output.getvalue()))
145+
os.close(temp_packed_handle)
144146
os.remove(temp_packed_path)

windowsdoc.md

Lines changed: 20 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,19 @@
11
# Windows Compatibility
2-
cwltool is compatible with Windows. This means that you can create and run CWL
3-
workflows on Windows. On Windows, all workflows and tools are executed in
4-
[Docker Containers](https://docs.docker.com/docker-for-windows/). The default
5-
Docker Container is
2+
The CWL reference runner, cwltool, is compatible with Microsoft Windows when
3+
Docker is installed. On Windows, all CWL CommandLineTools are executed using
4+
[Docker software containers](https://docs.docker.com/docker-for-windows/). The
5+
default Docker Container is
66
[Alpine with Bash support](https://github.com/frol/docker-alpine-bash). You can
77
specify other Docker Containers for your tools and workflows using hints,
88
[requirements](http://www.commonwl.org/v1.0/CommandLineTool.html#DockerRequirement)),
99
or the `--default-container` cwltool option.
1010

1111
## Supported Windows versions
1212
* Windows 10 with native [Docker for Windows](https://docs.docker.com/docker-for-windows/).
13-
* Windows 8.1 with [Docker ToolBox](https://docs.docker.com/toolbox/toolbox_install_windows/).
14-
* Windows 7 & 8 with Docker ToolBox may work (Not tested, please let us know!).
13+
* Windows 7, 8, and 8.1 with [Docker ToolBox](https://docs.docker.com/toolbox/toolbox_install_windows/).
14+
15+
If you are using Docker Toolbox, then you must run cwltool in the Docker
16+
Quickstart Terminal.
1517

1618
## Installation
1719

@@ -26,7 +28,7 @@ Before installing cwltool, please install:
2628
* [Node.js](https://nodejs.org/en/download/) (optional, please install if your
2729
workflows or tools contain [Javascript Expressions](http://www.commonwl.org/v1.0/CommandLineTool.html#InlineJavascriptRequirement))
2830

29-
### Install using pip
31+
### Install using pip (recommended)
3032

3133
```
3234
pip install cwltool
@@ -58,18 +60,25 @@ There are two types of tests available for cwltool: unit tests and conformance t
5860

5961
### Unit tests
6062

61-
To run cwltool's unit tests, go to the cwltool repository on your system and run:
63+
To run cwltool's unit tests, run the following command:
64+
```
65+
python -m pytest --pyarg cwltool
66+
```
67+
68+
Or go to the checkout of the cwltool Git repository on your system and run:
6269

6370
```
6471
python setup.py test
6572
```
6673

74+
75+
6776
### Conformance tests
6877

69-
To run the conformance tests, follow these instructions:
78+
To run the CWL conformance tests, follow these instructions:
7079

7180
```
72-
pip install cwltest
81+
pip install cwltest mock
7382
git clone https://github.com/common-workflow-language/common-workflow-language.git
7483
cd common-workflow-language/v1.0
7584
cwltest --test conformance_test_v1.0.yaml -j 4 --tool cwltool
@@ -130,3 +139,4 @@ can't then use the `--eval-timeout` argument and set a higher timeout value.
130139
*If you still have problems with setting up and using Docker on Windows, please
131140
consult the online Docker Community. If the problem is specific to cwltool,
132141
create an [issue on cwltool](https://github.com/common-workflow-language/cwltool/issues).*
142+

0 commit comments

Comments
 (0)