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/batchSystems/registry.py
CHANGED
|
@@ -16,7 +16,8 @@ import importlib
|
|
|
16
16
|
import logging
|
|
17
17
|
import pkgutil
|
|
18
18
|
import warnings
|
|
19
|
-
from
|
|
19
|
+
from collections.abc import Sequence
|
|
20
|
+
from typing import TYPE_CHECKING, Callable
|
|
20
21
|
|
|
21
22
|
from toil.lib.compatibility import deprecated
|
|
22
23
|
from toil.lib.memoize import memoize
|
|
@@ -30,7 +31,10 @@ logger = logging.getLogger(__name__)
|
|
|
30
31
|
# Plugin system/API
|
|
31
32
|
#####
|
|
32
33
|
|
|
33
|
-
|
|
34
|
+
|
|
35
|
+
def add_batch_system_factory(
|
|
36
|
+
key: str, class_factory: Callable[[], type["AbstractBatchSystem"]]
|
|
37
|
+
):
|
|
34
38
|
"""
|
|
35
39
|
Adds a batch system to the registry for workflow or plugin-supplied batch systems.
|
|
36
40
|
|
|
@@ -39,6 +43,7 @@ def add_batch_system_factory(key: str, class_factory: Callable[[], Type['Abstrac
|
|
|
39
43
|
_registry_keys.append(key)
|
|
40
44
|
_registry[key] = class_factory
|
|
41
45
|
|
|
46
|
+
|
|
42
47
|
def get_batch_systems() -> Sequence[str]:
|
|
43
48
|
"""
|
|
44
49
|
Get the names of all the availsble batch systems.
|
|
@@ -47,7 +52,8 @@ def get_batch_systems() -> Sequence[str]:
|
|
|
47
52
|
|
|
48
53
|
return _registry_keys
|
|
49
54
|
|
|
50
|
-
|
|
55
|
+
|
|
56
|
+
def get_batch_system(key: str) -> type["AbstractBatchSystem"]:
|
|
51
57
|
"""
|
|
52
58
|
Get a batch system class by name.
|
|
53
59
|
|
|
@@ -58,68 +64,81 @@ def get_batch_system(key: str) -> Type['AbstractBatchSystem']:
|
|
|
58
64
|
return _registry[key]()
|
|
59
65
|
|
|
60
66
|
|
|
61
|
-
DEFAULT_BATCH_SYSTEM =
|
|
67
|
+
DEFAULT_BATCH_SYSTEM = "single_machine"
|
|
62
68
|
|
|
63
69
|
#####
|
|
64
70
|
# Built-in batch systems
|
|
65
71
|
#####
|
|
66
72
|
|
|
73
|
+
|
|
67
74
|
def aws_batch_batch_system_factory():
|
|
68
75
|
from toil.batchSystems.awsBatch import AWSBatchBatchSystem
|
|
76
|
+
|
|
69
77
|
return AWSBatchBatchSystem
|
|
70
78
|
|
|
79
|
+
|
|
71
80
|
def gridengine_batch_system_factory():
|
|
72
81
|
from toil.batchSystems.gridengine import GridEngineBatchSystem
|
|
82
|
+
|
|
73
83
|
return GridEngineBatchSystem
|
|
74
84
|
|
|
75
85
|
|
|
76
86
|
def lsf_batch_system_factory():
|
|
77
87
|
from toil.batchSystems.lsf import LSFBatchSystem
|
|
88
|
+
|
|
78
89
|
return LSFBatchSystem
|
|
79
90
|
|
|
80
91
|
|
|
81
92
|
def single_machine_batch_system_factory():
|
|
82
93
|
from toil.batchSystems.singleMachine import SingleMachineBatchSystem
|
|
94
|
+
|
|
83
95
|
return SingleMachineBatchSystem
|
|
84
96
|
|
|
85
97
|
|
|
86
98
|
def mesos_batch_system_factory():
|
|
87
99
|
from toil.batchSystems.mesos.batchSystem import MesosBatchSystem
|
|
100
|
+
|
|
88
101
|
return MesosBatchSystem
|
|
89
102
|
|
|
90
103
|
|
|
91
104
|
def slurm_batch_system_factory():
|
|
92
105
|
from toil.batchSystems.slurm import SlurmBatchSystem
|
|
106
|
+
|
|
93
107
|
return SlurmBatchSystem
|
|
94
108
|
|
|
109
|
+
|
|
95
110
|
def torque_batch_system_factory():
|
|
96
111
|
from toil.batchSystems.torque import TorqueBatchSystem
|
|
112
|
+
|
|
97
113
|
return TorqueBatchSystem
|
|
98
114
|
|
|
99
115
|
|
|
100
116
|
def htcondor_batch_system_factory():
|
|
101
117
|
from toil.batchSystems.htcondor import HTCondorBatchSystem
|
|
118
|
+
|
|
102
119
|
return HTCondorBatchSystem
|
|
103
120
|
|
|
104
121
|
|
|
105
122
|
def kubernetes_batch_system_factory():
|
|
106
123
|
from toil.batchSystems.kubernetes import KubernetesBatchSystem
|
|
124
|
+
|
|
107
125
|
return KubernetesBatchSystem
|
|
108
126
|
|
|
127
|
+
|
|
109
128
|
#####
|
|
110
129
|
# Registry implementation
|
|
111
130
|
#####
|
|
112
131
|
|
|
113
|
-
_registry:
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
132
|
+
_registry: dict[str, Callable[[], type["AbstractBatchSystem"]]] = {
|
|
133
|
+
"aws_batch": aws_batch_batch_system_factory,
|
|
134
|
+
"single_machine": single_machine_batch_system_factory,
|
|
135
|
+
"grid_engine": gridengine_batch_system_factory,
|
|
136
|
+
"lsf": lsf_batch_system_factory,
|
|
137
|
+
"mesos": mesos_batch_system_factory,
|
|
138
|
+
"slurm": slurm_batch_system_factory,
|
|
139
|
+
"torque": torque_batch_system_factory,
|
|
140
|
+
"htcondor": htcondor_batch_system_factory,
|
|
141
|
+
"kubernetes": kubernetes_batch_system_factory,
|
|
123
142
|
}
|
|
124
143
|
_registry_keys = list(_registry.keys())
|
|
125
144
|
|
|
@@ -127,6 +146,7 @@ _registry_keys = list(_registry.keys())
|
|
|
127
146
|
# add_batch_system_factory()
|
|
128
147
|
_PLUGIN_NAME_PREFIX = "toil_batch_system_"
|
|
129
148
|
|
|
149
|
+
|
|
130
150
|
@memoize
|
|
131
151
|
def _load_all_plugins() -> None:
|
|
132
152
|
"""
|
|
@@ -139,6 +159,7 @@ def _load_all_plugins() -> None:
|
|
|
139
159
|
# If it is a Toil batch system plugin, import it
|
|
140
160
|
importlib.import_module(name)
|
|
141
161
|
|
|
162
|
+
|
|
142
163
|
#####
|
|
143
164
|
# Deprecated API
|
|
144
165
|
#####
|
|
@@ -155,17 +176,24 @@ def __getattr__(name):
|
|
|
155
176
|
See <https://stackoverflow.com/a/48242860>.
|
|
156
177
|
"""
|
|
157
178
|
if name == "BATCH_SYSTEM_FACTORY_REGISTRY":
|
|
158
|
-
warnings.warn(
|
|
179
|
+
warnings.warn(
|
|
180
|
+
"BATCH_SYSTEM_FACTORY_REGISTRY is deprecated; use get_batch_system() or add_batch_system_factory()",
|
|
181
|
+
DeprecationWarning,
|
|
182
|
+
)
|
|
159
183
|
return _registry
|
|
160
184
|
elif name == "BATCH_SYSTEMS":
|
|
161
|
-
warnings.warn(
|
|
185
|
+
warnings.warn(
|
|
186
|
+
"BATCH_SYSTEMS is deprecated; use get_batch_systems()", DeprecationWarning
|
|
187
|
+
)
|
|
162
188
|
return _registry_keys
|
|
163
189
|
else:
|
|
164
190
|
raise AttributeError(f"Module {__name__} ahs no attribute {name}")
|
|
165
191
|
|
|
166
192
|
|
|
167
193
|
@deprecated(new_function_name="add_batch_system_factory")
|
|
168
|
-
def addBatchSystemFactory(
|
|
194
|
+
def addBatchSystemFactory(
|
|
195
|
+
key: str, batchSystemFactory: Callable[[], type["AbstractBatchSystem"]]
|
|
196
|
+
):
|
|
169
197
|
"""
|
|
170
198
|
Deprecated method to add a batch system.
|
|
171
199
|
"""
|
|
@@ -180,7 +208,10 @@ def addBatchSystemFactory(key: str, batchSystemFactory: Callable[[], Type['Abstr
|
|
|
180
208
|
# the globals because module-level globals are their own references, so we
|
|
181
209
|
# can't touch this module's global name bindings from a client module.
|
|
182
210
|
|
|
183
|
-
|
|
211
|
+
|
|
212
|
+
def save_batch_system_plugin_state() -> (
|
|
213
|
+
tuple[list[str], dict[str, Callable[[], type["AbstractBatchSystem"]]]]
|
|
214
|
+
):
|
|
184
215
|
"""
|
|
185
216
|
Return a snapshot of the plugin registry that can be restored to remove
|
|
186
217
|
added plugins. Useful for testing the plugin system in-process with other
|
|
@@ -190,7 +221,10 @@ def save_batch_system_plugin_state() -> Tuple[List[str], Dict[str, Callable[[],
|
|
|
190
221
|
snapshot = (list(_registry_keys), dict(_registry))
|
|
191
222
|
return snapshot
|
|
192
223
|
|
|
193
|
-
|
|
224
|
+
|
|
225
|
+
def restore_batch_system_plugin_state(
|
|
226
|
+
snapshot: tuple[list[str], dict[str, Callable[[], type["AbstractBatchSystem"]]]]
|
|
227
|
+
):
|
|
194
228
|
"""
|
|
195
229
|
Restore the batch system registry state to a snapshot from
|
|
196
230
|
save_batch_system_plugin_state().
|