toil 6.1.0a1__py3-none-any.whl → 7.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 +1 -232
- toil/batchSystems/abstractBatchSystem.py +41 -17
- toil/batchSystems/abstractGridEngineBatchSystem.py +79 -65
- toil/batchSystems/awsBatch.py +8 -8
- toil/batchSystems/cleanup_support.py +7 -3
- toil/batchSystems/contained_executor.py +4 -5
- toil/batchSystems/gridengine.py +1 -1
- toil/batchSystems/htcondor.py +5 -5
- toil/batchSystems/kubernetes.py +25 -11
- toil/batchSystems/local_support.py +3 -3
- toil/batchSystems/lsf.py +9 -9
- toil/batchSystems/mesos/batchSystem.py +4 -4
- toil/batchSystems/mesos/executor.py +3 -2
- toil/batchSystems/options.py +9 -0
- toil/batchSystems/singleMachine.py +11 -10
- toil/batchSystems/slurm.py +129 -16
- toil/batchSystems/torque.py +1 -1
- toil/bus.py +45 -3
- toil/common.py +56 -31
- toil/cwl/cwltoil.py +442 -371
- toil/deferred.py +1 -1
- toil/exceptions.py +1 -1
- toil/fileStores/abstractFileStore.py +69 -20
- toil/fileStores/cachingFileStore.py +6 -22
- toil/fileStores/nonCachingFileStore.py +6 -15
- toil/job.py +270 -86
- toil/jobStores/abstractJobStore.py +37 -31
- toil/jobStores/aws/jobStore.py +280 -218
- toil/jobStores/aws/utils.py +60 -31
- toil/jobStores/conftest.py +2 -2
- toil/jobStores/fileJobStore.py +3 -3
- toil/jobStores/googleJobStore.py +3 -4
- toil/leader.py +89 -38
- toil/lib/aws/__init__.py +26 -10
- toil/lib/aws/iam.py +2 -2
- toil/lib/aws/session.py +62 -22
- toil/lib/aws/utils.py +73 -37
- toil/lib/conversions.py +24 -1
- toil/lib/ec2.py +118 -69
- toil/lib/expando.py +1 -1
- toil/lib/generatedEC2Lists.py +8 -8
- toil/lib/io.py +42 -4
- toil/lib/misc.py +1 -3
- toil/lib/resources.py +57 -16
- toil/lib/retry.py +12 -5
- toil/lib/threading.py +29 -14
- toil/lib/throttle.py +1 -1
- toil/options/common.py +31 -30
- toil/options/wdl.py +5 -0
- toil/provisioners/__init__.py +9 -3
- toil/provisioners/abstractProvisioner.py +12 -2
- toil/provisioners/aws/__init__.py +20 -15
- toil/provisioners/aws/awsProvisioner.py +406 -329
- toil/provisioners/gceProvisioner.py +2 -2
- toil/provisioners/node.py +13 -5
- toil/server/app.py +1 -1
- toil/statsAndLogging.py +93 -23
- toil/test/__init__.py +27 -12
- toil/test/batchSystems/batchSystemTest.py +40 -33
- toil/test/batchSystems/batch_system_plugin_test.py +79 -0
- toil/test/batchSystems/test_slurm.py +22 -7
- toil/test/cactus/__init__.py +0 -0
- toil/test/cactus/test_cactus_integration.py +58 -0
- toil/test/cwl/cwlTest.py +245 -236
- toil/test/cwl/seqtk_seq.cwl +1 -1
- toil/test/docs/scriptsTest.py +11 -14
- toil/test/jobStores/jobStoreTest.py +40 -54
- toil/test/lib/aws/test_iam.py +2 -2
- toil/test/lib/test_ec2.py +1 -1
- toil/test/options/__init__.py +13 -0
- toil/test/options/options.py +37 -0
- toil/test/provisioners/aws/awsProvisionerTest.py +51 -34
- toil/test/provisioners/clusterTest.py +99 -16
- toil/test/server/serverTest.py +2 -2
- toil/test/src/autoDeploymentTest.py +1 -1
- toil/test/src/dockerCheckTest.py +2 -1
- toil/test/src/environmentTest.py +125 -0
- toil/test/src/fileStoreTest.py +1 -1
- toil/test/src/jobDescriptionTest.py +18 -8
- toil/test/src/jobTest.py +1 -1
- toil/test/src/realtimeLoggerTest.py +4 -0
- toil/test/src/workerTest.py +52 -19
- toil/test/utils/toilDebugTest.py +62 -4
- toil/test/utils/utilsTest.py +23 -21
- toil/test/wdl/wdltoil_test.py +49 -21
- toil/test/wdl/wdltoil_test_kubernetes.py +77 -0
- toil/toilState.py +68 -9
- toil/utils/toilDebugFile.py +1 -1
- toil/utils/toilDebugJob.py +153 -26
- toil/utils/toilLaunchCluster.py +12 -2
- toil/utils/toilRsyncCluster.py +7 -2
- toil/utils/toilSshCluster.py +7 -3
- toil/utils/toilStats.py +310 -266
- toil/utils/toilStatus.py +98 -52
- toil/version.py +11 -11
- toil/wdl/wdltoil.py +644 -225
- toil/worker.py +125 -83
- {toil-6.1.0a1.dist-info → toil-7.0.0.dist-info}/LICENSE +25 -0
- toil-7.0.0.dist-info/METADATA +158 -0
- {toil-6.1.0a1.dist-info → toil-7.0.0.dist-info}/RECORD +103 -96
- {toil-6.1.0a1.dist-info → toil-7.0.0.dist-info}/WHEEL +1 -1
- toil-6.1.0a1.dist-info/METADATA +0 -125
- {toil-6.1.0a1.dist-info → toil-7.0.0.dist-info}/entry_points.txt +0 -0
- {toil-6.1.0a1.dist-info → toil-7.0.0.dist-info}/top_level.txt +0 -0
|
@@ -4,6 +4,7 @@ from queue import Queue
|
|
|
4
4
|
import pytest
|
|
5
5
|
|
|
6
6
|
import toil.batchSystems.slurm
|
|
7
|
+
from toil.batchSystems.abstractBatchSystem import BatchJobExitReason, EXIT_STATUS_UNAVAILABLE_VALUE
|
|
7
8
|
from toil.common import Config
|
|
8
9
|
from toil.lib.misc import CalledProcessErrorStderr
|
|
9
10
|
from toil.test import ToilTest
|
|
@@ -192,7 +193,7 @@ class SlurmTest(ToilTest):
|
|
|
192
193
|
|
|
193
194
|
def setUp(self):
|
|
194
195
|
self.monkeypatch = pytest.MonkeyPatch()
|
|
195
|
-
self.worker = toil.batchSystems.slurm.SlurmBatchSystem.
|
|
196
|
+
self.worker = toil.batchSystems.slurm.SlurmBatchSystem.GridEngineThread(
|
|
196
197
|
newJobsQueue=Queue(),
|
|
197
198
|
updatedJobsQueue=Queue(),
|
|
198
199
|
killQueue=Queue(),
|
|
@@ -284,7 +285,7 @@ class SlurmTest(ToilTest):
|
|
|
284
285
|
def test_getJobExitCode_job_exists(self):
|
|
285
286
|
self.monkeypatch.setattr(toil.batchSystems.slurm, "call_command", call_sacct)
|
|
286
287
|
job_id = '785023' # FAILED
|
|
287
|
-
expected_result = 127
|
|
288
|
+
expected_result = (127, BatchJobExitReason.FAILED)
|
|
288
289
|
result = self.worker.getJobExitCode(job_id)
|
|
289
290
|
assert result == expected_result, f"{result} != {expected_result}"
|
|
290
291
|
|
|
@@ -303,7 +304,7 @@ class SlurmTest(ToilTest):
|
|
|
303
304
|
self.monkeypatch.setattr(self.worker, "_getJobDetailsFromSacct", call_sacct_raises)
|
|
304
305
|
self.monkeypatch.setattr(toil.batchSystems.slurm, "call_command", call_scontrol)
|
|
305
306
|
job_id = '787204' # COMPLETED
|
|
306
|
-
expected_result = 0
|
|
307
|
+
expected_result = (0, BatchJobExitReason.FINISHED)
|
|
307
308
|
result = self.worker.getJobExitCode(job_id)
|
|
308
309
|
assert result == expected_result, f"{result} != {expected_result}"
|
|
309
310
|
|
|
@@ -329,7 +330,7 @@ class SlurmTest(ToilTest):
|
|
|
329
330
|
def test_coalesce_job_exit_codes_one_exists(self):
|
|
330
331
|
self.monkeypatch.setattr(toil.batchSystems.slurm, "call_command", call_sacct)
|
|
331
332
|
job_ids = ['785023'] # FAILED
|
|
332
|
-
expected_result = [127]
|
|
333
|
+
expected_result = [(127, BatchJobExitReason.FAILED)]
|
|
333
334
|
result = self.worker.coalesce_job_exit_codes(job_ids)
|
|
334
335
|
assert result == expected_result, f"{result} != {expected_result}"
|
|
335
336
|
|
|
@@ -347,7 +348,14 @@ class SlurmTest(ToilTest):
|
|
|
347
348
|
'789724', # RUNNING,
|
|
348
349
|
'789868', # PENDING,
|
|
349
350
|
'789869'] # COMPLETED
|
|
350
|
-
|
|
351
|
+
# RUNNING and PENDING jobs should return None
|
|
352
|
+
expected_result = [
|
|
353
|
+
(EXIT_STATUS_UNAVAILABLE_VALUE, BatchJobExitReason.KILLED),
|
|
354
|
+
(1, BatchJobExitReason.FAILED),
|
|
355
|
+
None,
|
|
356
|
+
None,
|
|
357
|
+
(0, BatchJobExitReason.FINISHED)
|
|
358
|
+
]
|
|
351
359
|
result = self.worker.coalesce_job_exit_codes(job_ids)
|
|
352
360
|
assert result == expected_result, f"{result} != {expected_result}"
|
|
353
361
|
|
|
@@ -358,7 +366,14 @@ class SlurmTest(ToilTest):
|
|
|
358
366
|
'789724', # RUNNING,
|
|
359
367
|
'999999', # Non-existent,
|
|
360
368
|
'789869'] # COMPLETED
|
|
361
|
-
|
|
369
|
+
# RUNNING job should return None
|
|
370
|
+
expected_result = [
|
|
371
|
+
(130, BatchJobExitReason.FAILED),
|
|
372
|
+
(2, BatchJobExitReason.FAILED),
|
|
373
|
+
None,
|
|
374
|
+
None,
|
|
375
|
+
(0, BatchJobExitReason.FINISHED)
|
|
376
|
+
]
|
|
362
377
|
result = self.worker.coalesce_job_exit_codes(job_ids)
|
|
363
378
|
assert result == expected_result, f"{result} != {expected_result}"
|
|
364
379
|
|
|
@@ -370,7 +385,7 @@ class SlurmTest(ToilTest):
|
|
|
370
385
|
self.monkeypatch.setattr(self.worker, "_getJobDetailsFromSacct", call_sacct_raises)
|
|
371
386
|
self.monkeypatch.setattr(toil.batchSystems.slurm, "call_command", call_scontrol)
|
|
372
387
|
job_ids = ['787204'] # COMPLETED
|
|
373
|
-
expected_result = [0]
|
|
388
|
+
expected_result = [(0, BatchJobExitReason.FINISHED)]
|
|
374
389
|
result = self.worker.coalesce_job_exit_codes(job_ids)
|
|
375
390
|
assert result == expected_result, f"{result} != {expected_result}"
|
|
376
391
|
|
|
File without changes
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import os
|
|
2
|
+
import uuid
|
|
3
|
+
|
|
4
|
+
from toil.provisioners import cluster_factory
|
|
5
|
+
from toil.test.provisioners.clusterTest import AbstractClusterTest
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
class CactusIntegrationTest(AbstractClusterTest):
|
|
9
|
+
"""
|
|
10
|
+
Run the Cactus Integration test on a Kubernetes AWS cluster
|
|
11
|
+
"""
|
|
12
|
+
|
|
13
|
+
def __init__(self, methodName):
|
|
14
|
+
super().__init__(methodName=methodName)
|
|
15
|
+
self.clusterName = "cactus-test-" + str(uuid.uuid4())
|
|
16
|
+
self.leaderNodeType = "t2.medium"
|
|
17
|
+
self.clusterType = "kubernetes"
|
|
18
|
+
|
|
19
|
+
def setUp(self):
|
|
20
|
+
super().setUp()
|
|
21
|
+
self.jobStore = f"aws:{self.awsRegion()}:cluster-{uuid.uuid4()}"
|
|
22
|
+
|
|
23
|
+
def test_cactus_integration(self):
|
|
24
|
+
# Make a cluster with worker nodes
|
|
25
|
+
self.createClusterUtil(args=["--nodeTypes=t2.xlarge", "-w=1-3"])
|
|
26
|
+
# get the leader so we know the IP address - we don't need to wait since create cluster
|
|
27
|
+
# already ensures the leader is running
|
|
28
|
+
self.cluster = cluster_factory(
|
|
29
|
+
provisioner="aws", zone=self.zone, clusterName=self.clusterName
|
|
30
|
+
)
|
|
31
|
+
self.leader = self.cluster.getLeader()
|
|
32
|
+
|
|
33
|
+
CACTUS_COMMIT_SHA = os.environ["CACTUS_COMMIT_SHA"] or "f5adf4013326322ae58ef1eccb8409b71d761583" # default cactus commit
|
|
34
|
+
|
|
35
|
+
# command to install and run cactus on the cluster
|
|
36
|
+
cactus_command = ("python -m virtualenv --system-site-packages venv && "
|
|
37
|
+
". venv/bin/activate && "
|
|
38
|
+
"git clone https://github.com/ComparativeGenomicsToolkit/cactus.git --recursive && "
|
|
39
|
+
"cd cactus && "
|
|
40
|
+
"git fetch origin && "
|
|
41
|
+
f"git checkout {CACTUS_COMMIT_SHA} && "
|
|
42
|
+
"git submodule update --init --recursive && "
|
|
43
|
+
"pip install --upgrade 'setuptools<66' pip && "
|
|
44
|
+
"pip install --upgrade . && "
|
|
45
|
+
"pip install --upgrade numpy psutil && "
|
|
46
|
+
"time cactus --batchSystem kubernetes --retryCount=3 "
|
|
47
|
+
f"--consCores 2 --binariesMode singularity --clean always {self.jobStore} "
|
|
48
|
+
"examples/evolverMammals.txt examples/evolverMammals.hal --root mr --defaultDisk 8G --logDebug")
|
|
49
|
+
|
|
50
|
+
# run cactus
|
|
51
|
+
self.sshUtil(
|
|
52
|
+
[
|
|
53
|
+
"bash",
|
|
54
|
+
"-c",
|
|
55
|
+
cactus_command
|
|
56
|
+
]
|
|
57
|
+
)
|
|
58
|
+
|