toil 6.1.0a1__py3-none-any.whl → 8.0.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- toil/__init__.py +122 -315
- toil/batchSystems/__init__.py +1 -0
- toil/batchSystems/abstractBatchSystem.py +173 -89
- toil/batchSystems/abstractGridEngineBatchSystem.py +272 -148
- toil/batchSystems/awsBatch.py +244 -135
- toil/batchSystems/cleanup_support.py +26 -16
- toil/batchSystems/contained_executor.py +31 -28
- toil/batchSystems/gridengine.py +86 -50
- toil/batchSystems/htcondor.py +166 -89
- toil/batchSystems/kubernetes.py +632 -382
- toil/batchSystems/local_support.py +20 -15
- toil/batchSystems/lsf.py +134 -81
- toil/batchSystems/lsfHelper.py +13 -11
- toil/batchSystems/mesos/__init__.py +41 -29
- toil/batchSystems/mesos/batchSystem.py +290 -151
- toil/batchSystems/mesos/executor.py +79 -50
- toil/batchSystems/mesos/test/__init__.py +31 -23
- toil/batchSystems/options.py +46 -28
- toil/batchSystems/registry.py +53 -19
- toil/batchSystems/singleMachine.py +296 -125
- toil/batchSystems/slurm.py +603 -138
- toil/batchSystems/torque.py +47 -33
- toil/bus.py +186 -76
- toil/common.py +664 -368
- toil/cwl/__init__.py +1 -1
- toil/cwl/cwltoil.py +1136 -483
- toil/cwl/utils.py +17 -22
- toil/deferred.py +63 -42
- toil/exceptions.py +5 -3
- toil/fileStores/__init__.py +5 -5
- toil/fileStores/abstractFileStore.py +140 -60
- toil/fileStores/cachingFileStore.py +717 -269
- toil/fileStores/nonCachingFileStore.py +116 -87
- toil/job.py +1225 -368
- toil/jobStores/abstractJobStore.py +416 -266
- toil/jobStores/aws/jobStore.py +863 -477
- toil/jobStores/aws/utils.py +201 -120
- toil/jobStores/conftest.py +3 -2
- toil/jobStores/fileJobStore.py +292 -154
- toil/jobStores/googleJobStore.py +140 -74
- toil/jobStores/utils.py +36 -15
- toil/leader.py +668 -272
- toil/lib/accelerators.py +115 -18
- toil/lib/aws/__init__.py +74 -31
- toil/lib/aws/ami.py +122 -87
- toil/lib/aws/iam.py +284 -108
- toil/lib/aws/s3.py +31 -0
- toil/lib/aws/session.py +214 -39
- toil/lib/aws/utils.py +287 -231
- toil/lib/bioio.py +13 -5
- toil/lib/compatibility.py +11 -6
- toil/lib/conversions.py +104 -47
- toil/lib/docker.py +131 -103
- toil/lib/ec2.py +361 -199
- toil/lib/ec2nodes.py +174 -106
- toil/lib/encryption/_dummy.py +5 -3
- toil/lib/encryption/_nacl.py +10 -6
- toil/lib/encryption/conftest.py +1 -0
- toil/lib/exceptions.py +26 -7
- toil/lib/expando.py +5 -3
- toil/lib/ftp_utils.py +217 -0
- toil/lib/generatedEC2Lists.py +127 -19
- toil/lib/humanize.py +6 -2
- toil/lib/integration.py +341 -0
- toil/lib/io.py +141 -15
- toil/lib/iterables.py +4 -2
- toil/lib/memoize.py +12 -8
- toil/lib/misc.py +66 -21
- toil/lib/objects.py +2 -2
- toil/lib/resources.py +68 -15
- toil/lib/retry.py +126 -81
- toil/lib/threading.py +299 -82
- toil/lib/throttle.py +16 -15
- toil/options/common.py +843 -409
- toil/options/cwl.py +175 -90
- toil/options/runner.py +50 -0
- toil/options/wdl.py +73 -17
- toil/provisioners/__init__.py +117 -46
- toil/provisioners/abstractProvisioner.py +332 -157
- toil/provisioners/aws/__init__.py +70 -33
- toil/provisioners/aws/awsProvisioner.py +1145 -715
- toil/provisioners/clusterScaler.py +541 -279
- toil/provisioners/gceProvisioner.py +282 -179
- toil/provisioners/node.py +155 -79
- toil/realtimeLogger.py +34 -22
- toil/resource.py +137 -75
- toil/server/app.py +128 -62
- toil/server/celery_app.py +3 -1
- toil/server/cli/wes_cwl_runner.py +82 -53
- toil/server/utils.py +54 -28
- toil/server/wes/abstract_backend.py +64 -26
- toil/server/wes/amazon_wes_utils.py +21 -15
- toil/server/wes/tasks.py +121 -63
- toil/server/wes/toil_backend.py +142 -107
- toil/server/wsgi_app.py +4 -3
- toil/serviceManager.py +58 -22
- toil/statsAndLogging.py +224 -70
- toil/test/__init__.py +282 -183
- toil/test/batchSystems/batchSystemTest.py +460 -210
- toil/test/batchSystems/batch_system_plugin_test.py +90 -0
- toil/test/batchSystems/test_gridengine.py +173 -0
- toil/test/batchSystems/test_lsf_helper.py +67 -58
- toil/test/batchSystems/test_slurm.py +110 -49
- toil/test/cactus/__init__.py +0 -0
- toil/test/cactus/test_cactus_integration.py +56 -0
- toil/test/cwl/cwlTest.py +496 -287
- toil/test/cwl/measure_default_memory.cwl +12 -0
- toil/test/cwl/not_run_required_input.cwl +29 -0
- toil/test/cwl/scatter_duplicate_outputs.cwl +40 -0
- toil/test/cwl/seqtk_seq.cwl +1 -1
- toil/test/docs/scriptsTest.py +69 -46
- toil/test/jobStores/jobStoreTest.py +427 -264
- toil/test/lib/aws/test_iam.py +118 -50
- toil/test/lib/aws/test_s3.py +16 -9
- toil/test/lib/aws/test_utils.py +5 -6
- toil/test/lib/dockerTest.py +118 -141
- toil/test/lib/test_conversions.py +113 -115
- toil/test/lib/test_ec2.py +58 -50
- toil/test/lib/test_integration.py +104 -0
- toil/test/lib/test_misc.py +12 -5
- toil/test/mesos/MesosDataStructuresTest.py +23 -10
- toil/test/mesos/helloWorld.py +7 -6
- toil/test/mesos/stress.py +25 -20
- toil/test/options/__init__.py +13 -0
- toil/test/options/options.py +42 -0
- toil/test/provisioners/aws/awsProvisionerTest.py +320 -150
- toil/test/provisioners/clusterScalerTest.py +440 -250
- toil/test/provisioners/clusterTest.py +166 -44
- toil/test/provisioners/gceProvisionerTest.py +174 -100
- toil/test/provisioners/provisionerTest.py +25 -13
- toil/test/provisioners/restartScript.py +5 -4
- toil/test/server/serverTest.py +188 -141
- toil/test/sort/restart_sort.py +137 -68
- toil/test/sort/sort.py +134 -66
- toil/test/sort/sortTest.py +91 -49
- toil/test/src/autoDeploymentTest.py +141 -101
- toil/test/src/busTest.py +20 -18
- toil/test/src/checkpointTest.py +8 -2
- toil/test/src/deferredFunctionTest.py +49 -35
- toil/test/src/dockerCheckTest.py +32 -24
- toil/test/src/environmentTest.py +135 -0
- toil/test/src/fileStoreTest.py +539 -272
- toil/test/src/helloWorldTest.py +7 -4
- toil/test/src/importExportFileTest.py +61 -31
- toil/test/src/jobDescriptionTest.py +46 -21
- toil/test/src/jobEncapsulationTest.py +2 -0
- toil/test/src/jobFileStoreTest.py +74 -50
- toil/test/src/jobServiceTest.py +187 -73
- toil/test/src/jobTest.py +121 -71
- toil/test/src/miscTests.py +19 -18
- toil/test/src/promisedRequirementTest.py +82 -36
- toil/test/src/promisesTest.py +7 -6
- toil/test/src/realtimeLoggerTest.py +10 -6
- toil/test/src/regularLogTest.py +71 -37
- toil/test/src/resourceTest.py +80 -49
- toil/test/src/restartDAGTest.py +36 -22
- toil/test/src/resumabilityTest.py +9 -2
- toil/test/src/retainTempDirTest.py +45 -14
- toil/test/src/systemTest.py +12 -8
- toil/test/src/threadingTest.py +44 -25
- toil/test/src/toilContextManagerTest.py +10 -7
- toil/test/src/userDefinedJobArgTypeTest.py +8 -5
- toil/test/src/workerTest.py +73 -23
- toil/test/utils/toilDebugTest.py +103 -33
- toil/test/utils/toilKillTest.py +4 -5
- toil/test/utils/utilsTest.py +245 -106
- toil/test/wdl/wdltoil_test.py +818 -149
- toil/test/wdl/wdltoil_test_kubernetes.py +91 -0
- toil/toilState.py +120 -35
- toil/utils/toilConfig.py +13 -4
- toil/utils/toilDebugFile.py +44 -27
- toil/utils/toilDebugJob.py +214 -27
- toil/utils/toilDestroyCluster.py +11 -6
- toil/utils/toilKill.py +8 -3
- toil/utils/toilLaunchCluster.py +256 -140
- toil/utils/toilMain.py +37 -16
- toil/utils/toilRsyncCluster.py +32 -14
- toil/utils/toilSshCluster.py +49 -22
- toil/utils/toilStats.py +356 -273
- toil/utils/toilStatus.py +292 -139
- toil/utils/toilUpdateEC2Instances.py +3 -1
- toil/version.py +12 -12
- toil/wdl/utils.py +5 -5
- toil/wdl/wdltoil.py +3913 -1033
- toil/worker.py +367 -184
- {toil-6.1.0a1.dist-info → toil-8.0.0.dist-info}/LICENSE +25 -0
- toil-8.0.0.dist-info/METADATA +173 -0
- toil-8.0.0.dist-info/RECORD +253 -0
- {toil-6.1.0a1.dist-info → toil-8.0.0.dist-info}/WHEEL +1 -1
- toil-6.1.0a1.dist-info/METADATA +0 -125
- toil-6.1.0a1.dist-info/RECORD +0 -237
- {toil-6.1.0a1.dist-info → toil-8.0.0.dist-info}/entry_points.txt +0 -0
- {toil-6.1.0a1.dist-info → toil-8.0.0.dist-info}/top_level.txt +0 -0
toil/options/cwl.py
CHANGED
|
@@ -15,45 +15,66 @@ def add_cwl_options(parser: ArgumentParser, suppress: bool = True) -> None:
|
|
|
15
15
|
:return: None
|
|
16
16
|
"""
|
|
17
17
|
suppress_help = SUPPRESS if suppress else None
|
|
18
|
+
|
|
19
|
+
# These are options that we have to match cwltool
|
|
20
|
+
# TODO: Are there still any Toil-specific options in here?
|
|
18
21
|
parser.add_argument("--not-strict", action="store_true", help=suppress_help)
|
|
19
22
|
parser.add_argument(
|
|
20
23
|
"--enable-dev",
|
|
21
24
|
action="store_true",
|
|
22
|
-
help=suppress_help
|
|
25
|
+
help=suppress_help
|
|
26
|
+
or suppress_help
|
|
27
|
+
or "Enable loading and running development versions of CWL",
|
|
23
28
|
)
|
|
24
29
|
parser.add_argument(
|
|
25
30
|
"--enable-ext",
|
|
26
31
|
action="store_true",
|
|
27
|
-
help=suppress_help
|
|
32
|
+
help=suppress_help
|
|
33
|
+
or "Enable loading and running 'cwltool:' extensions to the CWL standards.",
|
|
28
34
|
default=False,
|
|
29
35
|
)
|
|
30
|
-
parser.add_argument(
|
|
31
|
-
|
|
36
|
+
parser.add_argument(
|
|
37
|
+
"--quiet", dest="quiet", action="store_true", default=False, help=suppress_help
|
|
38
|
+
)
|
|
39
|
+
parser.add_argument(
|
|
40
|
+
"--basedir", type=str, help=suppress_help
|
|
41
|
+
) # TODO: Might be hard-coded?
|
|
32
42
|
parser.add_argument("--outdir", type=str, default=None, help=suppress_help)
|
|
33
|
-
parser.add_argument(
|
|
34
|
-
|
|
43
|
+
parser.add_argument(
|
|
44
|
+
"--version",
|
|
45
|
+
action="version",
|
|
46
|
+
version=baseVersion,
|
|
47
|
+
help=suppress_help or "show program's version number and exit",
|
|
48
|
+
)
|
|
35
49
|
parser.add_argument(
|
|
36
50
|
"--log-dir",
|
|
37
51
|
type=str,
|
|
38
52
|
default="",
|
|
39
|
-
help=suppress_help
|
|
53
|
+
help=suppress_help
|
|
54
|
+
or "Log your tools stdout/stderr to this location outside of container",
|
|
40
55
|
)
|
|
41
56
|
# this is as a result of suppressed help statements not working well with mutually_exclusive_groups, which will
|
|
42
57
|
# cause an assertion error
|
|
43
58
|
# https://github.com/python/cpython/issues/62090
|
|
44
|
-
dockergroup =
|
|
59
|
+
dockergroup = (
|
|
60
|
+
parser.add_mutually_exclusive_group()
|
|
61
|
+
if not suppress_help
|
|
62
|
+
else parser.add_argument_group()
|
|
63
|
+
)
|
|
45
64
|
dockergroup.add_argument(
|
|
46
65
|
"--user-space-docker-cmd",
|
|
47
|
-
help=suppress_help
|
|
48
|
-
|
|
66
|
+
help=suppress_help
|
|
67
|
+
or "(Linux/OS X only) Specify a user space docker command (like "
|
|
68
|
+
"udocker or dx-docker) that will be used to call 'pull' and 'run'",
|
|
49
69
|
)
|
|
50
70
|
dockergroup.add_argument(
|
|
51
71
|
"--singularity",
|
|
52
72
|
action="store_true",
|
|
53
73
|
default=False,
|
|
54
|
-
help=suppress_help
|
|
55
|
-
|
|
56
|
-
|
|
74
|
+
help=suppress_help
|
|
75
|
+
or "Use Singularity runtime for running containers. "
|
|
76
|
+
"Requires Singularity v2.6.1+ and Linux with kernel version v3.18+ or "
|
|
77
|
+
"with overlayfs support backported.",
|
|
57
78
|
)
|
|
58
79
|
dockergroup.add_argument(
|
|
59
80
|
"--podman",
|
|
@@ -64,21 +85,23 @@ def add_cwl_options(parser: ArgumentParser, suppress: bool = True) -> None:
|
|
|
64
85
|
dockergroup.add_argument(
|
|
65
86
|
"--no-container",
|
|
66
87
|
action="store_true",
|
|
67
|
-
help=suppress_help
|
|
68
|
-
|
|
69
|
-
|
|
88
|
+
help=suppress_help
|
|
89
|
+
or "Do not execute jobs in a "
|
|
90
|
+
"Docker container, even when `DockerRequirement` "
|
|
91
|
+
"is specified under `hints`.",
|
|
70
92
|
)
|
|
71
93
|
dockergroup.add_argument(
|
|
72
94
|
"--leave-container",
|
|
73
95
|
action="store_false",
|
|
74
96
|
default=True,
|
|
75
|
-
help=suppress_help
|
|
97
|
+
help=suppress_help
|
|
98
|
+
or "Do not delete Docker container used by jobs after they exit",
|
|
76
99
|
dest="rm_container",
|
|
77
100
|
)
|
|
78
|
-
|
|
79
|
-
extra_dockergroup.add_argument(
|
|
101
|
+
parser.add_argument(
|
|
80
102
|
"--custom-net",
|
|
81
|
-
help=suppress_help
|
|
103
|
+
help=suppress_help
|
|
104
|
+
or "Specify docker network name to pass to docker run command",
|
|
82
105
|
)
|
|
83
106
|
cidgroup = parser.add_argument_group(
|
|
84
107
|
"Options for recording the Docker container identifier into a file."
|
|
@@ -95,7 +118,8 @@ def add_cwl_options(parser: ArgumentParser, suppress: bool = True) -> None:
|
|
|
95
118
|
cidgroup.add_argument(
|
|
96
119
|
"--cidfile-dir",
|
|
97
120
|
type=str,
|
|
98
|
-
help=suppress_help
|
|
121
|
+
help=suppress_help
|
|
122
|
+
or "Store the Docker container ID into a file in the specified directory.",
|
|
99
123
|
default=None,
|
|
100
124
|
dest="cidfile_dir",
|
|
101
125
|
)
|
|
@@ -103,19 +127,28 @@ def add_cwl_options(parser: ArgumentParser, suppress: bool = True) -> None:
|
|
|
103
127
|
cidgroup.add_argument(
|
|
104
128
|
"--cidfile-prefix",
|
|
105
129
|
type=str,
|
|
106
|
-
help=suppress_help
|
|
107
|
-
|
|
108
|
-
|
|
130
|
+
help=suppress_help
|
|
131
|
+
or "Specify a prefix to the container ID filename. "
|
|
132
|
+
"Final file name will be followed by a timestamp. "
|
|
133
|
+
"The default is no prefix.",
|
|
109
134
|
default=None,
|
|
110
135
|
dest="cidfile_prefix",
|
|
111
136
|
)
|
|
112
137
|
|
|
138
|
+
parser.add_argument(
|
|
139
|
+
"--no-prepull",
|
|
140
|
+
action="store_true",
|
|
141
|
+
default=False,
|
|
142
|
+
help=suppress_help
|
|
143
|
+
or "Do not prepull the container prior to running the workflow",
|
|
144
|
+
)
|
|
145
|
+
|
|
113
146
|
parser.add_argument(
|
|
114
147
|
"--preserve-environment",
|
|
115
148
|
type=str,
|
|
116
149
|
nargs="+",
|
|
117
|
-
help=suppress_help
|
|
118
|
-
|
|
150
|
+
help=suppress_help
|
|
151
|
+
or "Preserve specified environment variables when running" " CommandLineTools",
|
|
119
152
|
metavar=("VAR1 VAR2"),
|
|
120
153
|
default=("PATH",),
|
|
121
154
|
dest="preserve_environment",
|
|
@@ -123,19 +156,29 @@ def add_cwl_options(parser: ArgumentParser, suppress: bool = True) -> None:
|
|
|
123
156
|
parser.add_argument(
|
|
124
157
|
"--preserve-entire-environment",
|
|
125
158
|
action="store_true",
|
|
126
|
-
help=suppress_help
|
|
159
|
+
help=suppress_help
|
|
160
|
+
or "Preserve all environment variable when running CommandLineTools.",
|
|
127
161
|
default=False,
|
|
128
162
|
dest="preserve_entire_environment",
|
|
129
163
|
)
|
|
130
164
|
parser.add_argument(
|
|
131
|
-
"--
|
|
132
|
-
|
|
133
|
-
|
|
165
|
+
"--beta-dependency-resolvers-configuration", default=None, help=suppress_help
|
|
166
|
+
)
|
|
167
|
+
parser.add_argument(
|
|
168
|
+
"--beta-dependencies-directory", default=None, help=suppress_help
|
|
169
|
+
)
|
|
170
|
+
parser.add_argument(
|
|
171
|
+
"--beta-use-biocontainers",
|
|
172
|
+
default=None,
|
|
173
|
+
action="store_true",
|
|
174
|
+
help=suppress_help,
|
|
175
|
+
)
|
|
176
|
+
parser.add_argument(
|
|
177
|
+
"--beta-conda-dependencies",
|
|
178
|
+
default=None,
|
|
179
|
+
action="store_true",
|
|
180
|
+
help=suppress_help,
|
|
134
181
|
)
|
|
135
|
-
parser.add_argument("--beta-dependency-resolvers-configuration", default=None, help=suppress_help)
|
|
136
|
-
parser.add_argument("--beta-dependencies-directory", default=None, help=suppress_help)
|
|
137
|
-
parser.add_argument("--beta-use-biocontainers", default=None, action="store_true", help=suppress_help)
|
|
138
|
-
parser.add_argument("--beta-conda-dependencies", default=None, action="store_true", help=suppress_help)
|
|
139
182
|
parser.add_argument(
|
|
140
183
|
"--tmpdir-prefix",
|
|
141
184
|
type=str,
|
|
@@ -170,32 +213,35 @@ def add_cwl_options(parser: ArgumentParser, suppress: bool = True) -> None:
|
|
|
170
213
|
parser.add_argument(
|
|
171
214
|
"--strict-memory-limit",
|
|
172
215
|
action="store_true",
|
|
173
|
-
help=suppress_help
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
216
|
+
help=suppress_help
|
|
217
|
+
or "When running with "
|
|
218
|
+
"software containers and the Docker engine, pass either the "
|
|
219
|
+
"calculated memory allocation from ResourceRequirements or the "
|
|
220
|
+
"default of 1 gigabyte to Docker's --memory option.",
|
|
177
221
|
)
|
|
178
222
|
parser.add_argument(
|
|
179
223
|
"--strict-cpu-limit",
|
|
180
224
|
action="store_true",
|
|
181
|
-
help=suppress_help
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
225
|
+
help=suppress_help
|
|
226
|
+
or "When running with "
|
|
227
|
+
"software containers and the Docker engine, pass either the "
|
|
228
|
+
"calculated cpu allocation from ResourceRequirements or the "
|
|
229
|
+
"default of 1 core to Docker's --cpu option. "
|
|
230
|
+
"Requires docker version >= v1.13.",
|
|
186
231
|
)
|
|
187
232
|
parser.add_argument(
|
|
188
233
|
"--relax-path-checks",
|
|
189
234
|
action="store_true",
|
|
190
235
|
default=False,
|
|
191
|
-
help=suppress_help
|
|
192
|
-
|
|
236
|
+
help=suppress_help
|
|
237
|
+
or "Relax requirements on path names to permit " "spaces and hash characters.",
|
|
193
238
|
dest="relax_path_checks",
|
|
194
239
|
)
|
|
195
240
|
parser.add_argument(
|
|
196
241
|
"--default-container",
|
|
197
|
-
help=suppress_help
|
|
198
|
-
|
|
242
|
+
help=suppress_help
|
|
243
|
+
or "Specify a default docker container that will be "
|
|
244
|
+
"used if the workflow fails to specify one.",
|
|
199
245
|
)
|
|
200
246
|
parser.add_argument(
|
|
201
247
|
"--disable-validate",
|
|
@@ -212,7 +258,11 @@ def add_cwl_options(parser: ArgumentParser, suppress: bool = True) -> None:
|
|
|
212
258
|
help=suppress_help or SUPPRESS,
|
|
213
259
|
)
|
|
214
260
|
# same workaround as dockergroup
|
|
215
|
-
checkgroup =
|
|
261
|
+
checkgroup = (
|
|
262
|
+
parser.add_mutually_exclusive_group()
|
|
263
|
+
if not suppress_help
|
|
264
|
+
else parser.add_argument_group()
|
|
265
|
+
)
|
|
216
266
|
checkgroup.add_argument(
|
|
217
267
|
"--compute-checksum",
|
|
218
268
|
action="store_true",
|
|
@@ -223,14 +273,16 @@ def add_cwl_options(parser: ArgumentParser, suppress: bool = True) -> None:
|
|
|
223
273
|
checkgroup.add_argument(
|
|
224
274
|
"--no-compute-checksum",
|
|
225
275
|
action="store_false",
|
|
226
|
-
help=suppress_help
|
|
276
|
+
help=suppress_help
|
|
277
|
+
or "Do not compute checksum of contents while collecting outputs",
|
|
227
278
|
dest="compute_checksum",
|
|
228
279
|
)
|
|
229
280
|
|
|
230
281
|
parser.add_argument(
|
|
231
282
|
"--eval-timeout",
|
|
232
|
-
help=suppress_help
|
|
233
|
-
|
|
283
|
+
help=suppress_help
|
|
284
|
+
or "Time to wait for a Javascript expression to evaluate before giving "
|
|
285
|
+
"an error, default 20s.",
|
|
234
286
|
type=float,
|
|
235
287
|
default=20,
|
|
236
288
|
)
|
|
@@ -245,34 +297,11 @@ def add_cwl_options(parser: ArgumentParser, suppress: bool = True) -> None:
|
|
|
245
297
|
"--mpi-config-file",
|
|
246
298
|
type=str,
|
|
247
299
|
default=None,
|
|
248
|
-
help=suppress_help
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
parser.add_argument(
|
|
254
|
-
"--bypass-file-store",
|
|
255
|
-
action="store_true",
|
|
256
|
-
default=False,
|
|
257
|
-
help=suppress_help or "Do not use Toil's file store and assume all "
|
|
258
|
-
"paths are accessible in place from all nodes.",
|
|
259
|
-
dest="bypass_file_store",
|
|
260
|
-
)
|
|
261
|
-
parser.add_argument(
|
|
262
|
-
"--reference-inputs",
|
|
263
|
-
action="store_true",
|
|
264
|
-
default=False,
|
|
265
|
-
help=suppress_help or "Do not copy remote inputs into Toil's file "
|
|
266
|
-
"store and assume they are accessible in place from "
|
|
267
|
-
"all nodes.",
|
|
268
|
-
dest="reference_inputs",
|
|
269
|
-
)
|
|
270
|
-
parser.add_argument(
|
|
271
|
-
"--disable-streaming",
|
|
272
|
-
action="store_true",
|
|
273
|
-
default=False,
|
|
274
|
-
help=suppress_help or "Disable file streaming for files that have 'streamable' flag True",
|
|
275
|
-
dest="disable_streaming",
|
|
300
|
+
help=suppress_help
|
|
301
|
+
or "Platform specific configuration for MPI (parallel "
|
|
302
|
+
"launcher, its flag etc). See the cwltool README "
|
|
303
|
+
"section 'Running MPI-based tools' for details of the format: "
|
|
304
|
+
"https://github.com/common-workflow-language/cwltool#running-mpi-based-tools-that-need-to-be-launched",
|
|
276
305
|
)
|
|
277
306
|
|
|
278
307
|
provgroup = parser.add_argument_group(
|
|
@@ -280,9 +309,10 @@ def add_cwl_options(parser: ArgumentParser, suppress: bool = True) -> None:
|
|
|
280
309
|
)
|
|
281
310
|
provgroup.add_argument(
|
|
282
311
|
"--provenance",
|
|
283
|
-
help=suppress_help
|
|
284
|
-
|
|
285
|
-
|
|
312
|
+
help=suppress_help
|
|
313
|
+
or "Save provenance to specified folder as a "
|
|
314
|
+
"Research Object that captures and aggregates "
|
|
315
|
+
"workflow execution and data products.",
|
|
286
316
|
type=str,
|
|
287
317
|
)
|
|
288
318
|
|
|
@@ -316,21 +346,76 @@ def add_cwl_options(parser: ArgumentParser, suppress: bool = True) -> None:
|
|
|
316
346
|
)
|
|
317
347
|
provgroup.add_argument(
|
|
318
348
|
"--orcid",
|
|
319
|
-
help=suppress_help
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
349
|
+
help=suppress_help
|
|
350
|
+
or "Record user ORCID identifier as part of "
|
|
351
|
+
"provenance, e.g. https://orcid.org/0000-0002-1825-0097 "
|
|
352
|
+
"or 0000-0002-1825-0097. Alternatively the environment variable "
|
|
353
|
+
"ORCID may be set.",
|
|
323
354
|
dest="orcid",
|
|
324
355
|
default=os.environ.get("ORCID", ""),
|
|
325
356
|
type=str,
|
|
326
357
|
)
|
|
327
358
|
provgroup.add_argument(
|
|
328
359
|
"--full-name",
|
|
329
|
-
help=suppress_help
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
360
|
+
help=suppress_help
|
|
361
|
+
or "Record full name of user as part of provenance, "
|
|
362
|
+
"e.g. Josiah Carberry. You may need to use shell quotes to preserve "
|
|
363
|
+
"spaces. Alternatively the environment variable CWL_FULL_NAME may "
|
|
364
|
+
"be set.",
|
|
333
365
|
dest="cwl_full_name",
|
|
334
366
|
default=os.environ.get("CWL_FULL_NAME", ""),
|
|
335
367
|
type=str,
|
|
336
368
|
)
|
|
369
|
+
|
|
370
|
+
# These are Toil-specific options
|
|
371
|
+
parser.add_argument(
|
|
372
|
+
"--bypass-file-store",
|
|
373
|
+
action="store_true",
|
|
374
|
+
default=False,
|
|
375
|
+
help=suppress_help
|
|
376
|
+
or "Do not use Toil's file store and assume all "
|
|
377
|
+
"paths are accessible in place from all nodes.",
|
|
378
|
+
dest="bypass_file_store",
|
|
379
|
+
)
|
|
380
|
+
parser.add_argument(
|
|
381
|
+
"--reference-inputs",
|
|
382
|
+
action="store_true",
|
|
383
|
+
default=False,
|
|
384
|
+
help=suppress_help
|
|
385
|
+
or "Do not copy remote inputs into Toil's file "
|
|
386
|
+
"store and assume they are accessible in place from "
|
|
387
|
+
"all nodes.",
|
|
388
|
+
dest="reference_inputs",
|
|
389
|
+
)
|
|
390
|
+
parser.add_argument(
|
|
391
|
+
"--disable-streaming",
|
|
392
|
+
action="store_true",
|
|
393
|
+
default=False,
|
|
394
|
+
help=suppress_help
|
|
395
|
+
or "Disable file streaming for files that have 'streamable' flag True.",
|
|
396
|
+
dest="disable_streaming",
|
|
397
|
+
)
|
|
398
|
+
ram_group = (
|
|
399
|
+
parser.add_mutually_exclusive_group()
|
|
400
|
+
if not suppress_help
|
|
401
|
+
else parser.add_argument_group()
|
|
402
|
+
)
|
|
403
|
+
ram_group.add_argument(
|
|
404
|
+
"--cwl-default-ram",
|
|
405
|
+
action="store_true",
|
|
406
|
+
default=True,
|
|
407
|
+
help=suppress_help or "Apply CWL specification default ramMin.",
|
|
408
|
+
dest="cwl_default_ram",
|
|
409
|
+
)
|
|
410
|
+
ram_group.add_argument(
|
|
411
|
+
"--no-cwl-default-ram",
|
|
412
|
+
action="store_false",
|
|
413
|
+
help=suppress_help
|
|
414
|
+
or "Do not apply CWL specification default ramMin, so that Toil --defaultMemory applies.",
|
|
415
|
+
dest="cwl_default_ram",
|
|
416
|
+
)
|
|
417
|
+
parser.add_argument(
|
|
418
|
+
"--destBucket",
|
|
419
|
+
type=str,
|
|
420
|
+
help=suppress_help or "Specify a cloud bucket endpoint for output files.",
|
|
421
|
+
)
|
toil/options/runner.py
ADDED
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
from argparse import ArgumentParser
|
|
2
|
+
|
|
3
|
+
from toil.lib.conversions import human2bytes
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
def add_runner_options(
|
|
7
|
+
parser: ArgumentParser, cwl: bool = False, wdl: bool = False
|
|
8
|
+
) -> None:
|
|
9
|
+
"""
|
|
10
|
+
Add to the WDL or CWL runners options that are shared or the same between runners
|
|
11
|
+
:param parser: parser to add arguments to
|
|
12
|
+
:param cwl: bool
|
|
13
|
+
:param wdl: bool
|
|
14
|
+
:return: None
|
|
15
|
+
"""
|
|
16
|
+
# This function should be constructed so that even when wdl and cwl are false, the "default" options are still added
|
|
17
|
+
run_imports_on_workers_arguments = ["--runImportsOnWorkers"]
|
|
18
|
+
if cwl:
|
|
19
|
+
run_imports_on_workers_arguments.append("--run-imports-on-workers")
|
|
20
|
+
parser.add_argument(
|
|
21
|
+
*run_imports_on_workers_arguments,
|
|
22
|
+
action="store_true",
|
|
23
|
+
default=False,
|
|
24
|
+
dest="run_imports_on_workers",
|
|
25
|
+
help="Run the file imports on a worker instead of the leader. This is useful if the leader is not optimized for high network performance. "
|
|
26
|
+
"If set to true, the argument --importWorkersDisk must also be set."
|
|
27
|
+
)
|
|
28
|
+
import_workers_threshold_argument = ["--importWorkersThreshold"]
|
|
29
|
+
if cwl:
|
|
30
|
+
import_workers_threshold_argument.append("--import-workers-threshold")
|
|
31
|
+
parser.add_argument(
|
|
32
|
+
*import_workers_threshold_argument,
|
|
33
|
+
dest="import_workers_threshold",
|
|
34
|
+
type=lambda x: human2bytes(str(x)),
|
|
35
|
+
default="1 GiB",
|
|
36
|
+
help="Specify the file size threshold that determines how many files go into a batched import. As many files will go into a batch import job until this threshold "
|
|
37
|
+
"is reached. This should be set in conjunction with the argument --runImportsOnWorkers."
|
|
38
|
+
)
|
|
39
|
+
import_workers_disk_argument = ["--importWorkersDisk"]
|
|
40
|
+
if cwl:
|
|
41
|
+
import_workers_disk_argument.append("--import-workers-disk")
|
|
42
|
+
parser.add_argument(
|
|
43
|
+
*import_workers_disk_argument,
|
|
44
|
+
dest="import_workers_disk",
|
|
45
|
+
type=lambda x: human2bytes(str(x)),
|
|
46
|
+
default="1 MiB",
|
|
47
|
+
help="Specify the disk size each import worker will get. This may be necessary when file streaming is not possible. For example, downloading from AWS to a GCE "
|
|
48
|
+
"job store. If specified, this should be set to the largest file size of all files to import. This should be set in conjunction with the arguments "
|
|
49
|
+
"--runImportsOnWorkers and --importWorkersThreshold."
|
|
50
|
+
)
|
toil/options/wdl.py
CHANGED
|
@@ -2,6 +2,8 @@ from argparse import ArgumentParser
|
|
|
2
2
|
|
|
3
3
|
from configargparse import SUPPRESS
|
|
4
4
|
|
|
5
|
+
from toil.lib.conversions import strtobool
|
|
6
|
+
|
|
5
7
|
|
|
6
8
|
def add_wdl_options(parser: ArgumentParser, suppress: bool = True) -> None:
|
|
7
9
|
"""
|
|
@@ -13,20 +15,74 @@ def add_wdl_options(parser: ArgumentParser, suppress: bool = True) -> None:
|
|
|
13
15
|
suppress_help = SUPPRESS if suppress else None
|
|
14
16
|
# include arg names without a wdl specifier if suppress is False
|
|
15
17
|
# this is to avoid possible duplicate options in custom toil scripts, ex outputFile can be a common argument name
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
18
|
+
# TODO: Why do we even need them at all in other Toil scripts? Do we have to worry about dest= collisions?
|
|
19
|
+
# TODO: Can the better option name be first?
|
|
20
|
+
output_dialect_arguments = ["--wdlOutputDialect"] + (
|
|
21
|
+
["--outputDialect"] if not suppress else []
|
|
22
|
+
)
|
|
23
|
+
parser.add_argument(
|
|
24
|
+
*output_dialect_arguments,
|
|
25
|
+
dest="output_dialect",
|
|
26
|
+
type=str,
|
|
27
|
+
default="cromwell",
|
|
28
|
+
choices=["cromwell", "miniwdl"],
|
|
29
|
+
help=suppress_help
|
|
30
|
+
or (
|
|
31
|
+
"JSON output format dialect. 'cromwell' just returns the workflow's "
|
|
32
|
+
"output values as JSON, while 'miniwdl' nests that under an 'outputs' "
|
|
33
|
+
"key, and includes a 'dir' key where files are written."
|
|
34
|
+
)
|
|
35
|
+
)
|
|
36
|
+
output_directory_arguments = ["--wdlOutputDirectory"] + (
|
|
37
|
+
["--outputDirectory", "-o"] if not suppress else []
|
|
38
|
+
)
|
|
39
|
+
parser.add_argument(
|
|
40
|
+
*output_directory_arguments,
|
|
41
|
+
dest="output_directory",
|
|
42
|
+
type=str,
|
|
43
|
+
default=None,
|
|
44
|
+
help=suppress_help
|
|
45
|
+
or (
|
|
46
|
+
"Directory or URI prefix to save output files at. By default a new directory is created "
|
|
47
|
+
"in the current directory."
|
|
48
|
+
)
|
|
49
|
+
)
|
|
50
|
+
output_file_arguments = ["--wdlOutputFile"] + (
|
|
51
|
+
["--outputFile", "-m"] if not suppress else []
|
|
52
|
+
)
|
|
53
|
+
parser.add_argument(
|
|
54
|
+
*output_file_arguments,
|
|
55
|
+
dest="output_file",
|
|
56
|
+
type=str,
|
|
57
|
+
default=None,
|
|
58
|
+
help=suppress_help or "File or URI to save output JSON to."
|
|
59
|
+
)
|
|
60
|
+
reference_inputs_arguments = ["--wdlReferenceInputs"] + (
|
|
61
|
+
["--referenceInputs"] if not suppress else []
|
|
62
|
+
)
|
|
63
|
+
parser.add_argument(
|
|
64
|
+
*reference_inputs_arguments,
|
|
65
|
+
dest="reference_inputs",
|
|
66
|
+
type=strtobool,
|
|
67
|
+
default=False,
|
|
68
|
+
help=suppress_help or "Pass input files by URL"
|
|
69
|
+
)
|
|
70
|
+
container_arguments = ["--wdlContainer"] + (["--container"] if not suppress else [])
|
|
71
|
+
parser.add_argument(
|
|
72
|
+
*container_arguments,
|
|
73
|
+
dest="container",
|
|
74
|
+
type=str,
|
|
75
|
+
choices=["singularity", "docker", "auto"],
|
|
76
|
+
default="auto",
|
|
77
|
+
help=suppress_help or "Container engine to use to run WDL tasks"
|
|
78
|
+
)
|
|
79
|
+
all_call_outputs_arguments = ["--wdlAllCallOutputs"] + (
|
|
80
|
+
["--allCallOutputs"] if not suppress else []
|
|
81
|
+
)
|
|
82
|
+
parser.add_argument(
|
|
83
|
+
*all_call_outputs_arguments,
|
|
84
|
+
dest="all_call_outputs",
|
|
85
|
+
type=strtobool,
|
|
86
|
+
default=None,
|
|
87
|
+
help=suppress_help or "Keep and return all call outputs as workflow outputs"
|
|
88
|
+
)
|