toil 7.0.0__py3-none-any.whl → 8.1.0b1__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.
Files changed (197) hide show
  1. toil/__init__.py +124 -86
  2. toil/batchSystems/__init__.py +1 -0
  3. toil/batchSystems/abstractBatchSystem.py +137 -77
  4. toil/batchSystems/abstractGridEngineBatchSystem.py +211 -101
  5. toil/batchSystems/awsBatch.py +237 -128
  6. toil/batchSystems/cleanup_support.py +22 -16
  7. toil/batchSystems/contained_executor.py +30 -26
  8. toil/batchSystems/gridengine.py +85 -49
  9. toil/batchSystems/htcondor.py +164 -87
  10. toil/batchSystems/kubernetes.py +622 -386
  11. toil/batchSystems/local_support.py +17 -12
  12. toil/batchSystems/lsf.py +132 -79
  13. toil/batchSystems/lsfHelper.py +13 -11
  14. toil/batchSystems/mesos/__init__.py +41 -29
  15. toil/batchSystems/mesos/batchSystem.py +288 -149
  16. toil/batchSystems/mesos/executor.py +77 -49
  17. toil/batchSystems/mesos/test/__init__.py +31 -23
  18. toil/batchSystems/options.py +39 -29
  19. toil/batchSystems/registry.py +53 -19
  20. toil/batchSystems/singleMachine.py +293 -123
  21. toil/batchSystems/slurm.py +651 -155
  22. toil/batchSystems/torque.py +46 -32
  23. toil/bus.py +141 -73
  24. toil/common.py +784 -397
  25. toil/cwl/__init__.py +1 -1
  26. toil/cwl/cwltoil.py +1137 -534
  27. toil/cwl/utils.py +17 -22
  28. toil/deferred.py +62 -41
  29. toil/exceptions.py +5 -3
  30. toil/fileStores/__init__.py +5 -5
  31. toil/fileStores/abstractFileStore.py +88 -57
  32. toil/fileStores/cachingFileStore.py +711 -247
  33. toil/fileStores/nonCachingFileStore.py +113 -75
  34. toil/job.py +1031 -349
  35. toil/jobStores/abstractJobStore.py +387 -243
  36. toil/jobStores/aws/jobStore.py +772 -412
  37. toil/jobStores/aws/utils.py +161 -109
  38. toil/jobStores/conftest.py +1 -0
  39. toil/jobStores/fileJobStore.py +289 -151
  40. toil/jobStores/googleJobStore.py +137 -70
  41. toil/jobStores/utils.py +36 -15
  42. toil/leader.py +614 -269
  43. toil/lib/accelerators.py +115 -18
  44. toil/lib/aws/__init__.py +55 -28
  45. toil/lib/aws/ami.py +122 -87
  46. toil/lib/aws/iam.py +284 -108
  47. toil/lib/aws/s3.py +31 -0
  48. toil/lib/aws/session.py +204 -58
  49. toil/lib/aws/utils.py +290 -213
  50. toil/lib/bioio.py +13 -5
  51. toil/lib/compatibility.py +11 -6
  52. toil/lib/conversions.py +83 -49
  53. toil/lib/docker.py +131 -103
  54. toil/lib/dockstore.py +379 -0
  55. toil/lib/ec2.py +322 -209
  56. toil/lib/ec2nodes.py +174 -105
  57. toil/lib/encryption/_dummy.py +5 -3
  58. toil/lib/encryption/_nacl.py +10 -6
  59. toil/lib/encryption/conftest.py +1 -0
  60. toil/lib/exceptions.py +26 -7
  61. toil/lib/expando.py +4 -2
  62. toil/lib/ftp_utils.py +217 -0
  63. toil/lib/generatedEC2Lists.py +127 -19
  64. toil/lib/history.py +1271 -0
  65. toil/lib/history_submission.py +681 -0
  66. toil/lib/humanize.py +6 -2
  67. toil/lib/io.py +121 -12
  68. toil/lib/iterables.py +4 -2
  69. toil/lib/memoize.py +12 -8
  70. toil/lib/misc.py +83 -18
  71. toil/lib/objects.py +2 -2
  72. toil/lib/resources.py +19 -7
  73. toil/lib/retry.py +125 -87
  74. toil/lib/threading.py +282 -80
  75. toil/lib/throttle.py +15 -14
  76. toil/lib/trs.py +390 -0
  77. toil/lib/web.py +38 -0
  78. toil/options/common.py +850 -402
  79. toil/options/cwl.py +185 -90
  80. toil/options/runner.py +50 -0
  81. toil/options/wdl.py +70 -19
  82. toil/provisioners/__init__.py +111 -46
  83. toil/provisioners/abstractProvisioner.py +322 -157
  84. toil/provisioners/aws/__init__.py +62 -30
  85. toil/provisioners/aws/awsProvisioner.py +980 -627
  86. toil/provisioners/clusterScaler.py +541 -279
  87. toil/provisioners/gceProvisioner.py +283 -180
  88. toil/provisioners/node.py +147 -79
  89. toil/realtimeLogger.py +34 -22
  90. toil/resource.py +137 -75
  91. toil/server/app.py +127 -61
  92. toil/server/celery_app.py +3 -1
  93. toil/server/cli/wes_cwl_runner.py +84 -55
  94. toil/server/utils.py +56 -31
  95. toil/server/wes/abstract_backend.py +64 -26
  96. toil/server/wes/amazon_wes_utils.py +21 -15
  97. toil/server/wes/tasks.py +121 -63
  98. toil/server/wes/toil_backend.py +142 -107
  99. toil/server/wsgi_app.py +4 -3
  100. toil/serviceManager.py +58 -22
  101. toil/statsAndLogging.py +183 -65
  102. toil/test/__init__.py +263 -179
  103. toil/test/batchSystems/batchSystemTest.py +438 -195
  104. toil/test/batchSystems/batch_system_plugin_test.py +18 -7
  105. toil/test/batchSystems/test_gridengine.py +173 -0
  106. toil/test/batchSystems/test_lsf_helper.py +67 -58
  107. toil/test/batchSystems/test_slurm.py +265 -49
  108. toil/test/cactus/test_cactus_integration.py +20 -22
  109. toil/test/cwl/conftest.py +39 -0
  110. toil/test/cwl/cwlTest.py +375 -72
  111. toil/test/cwl/measure_default_memory.cwl +12 -0
  112. toil/test/cwl/not_run_required_input.cwl +29 -0
  113. toil/test/cwl/optional-file.cwl +18 -0
  114. toil/test/cwl/scatter_duplicate_outputs.cwl +40 -0
  115. toil/test/docs/scriptsTest.py +60 -34
  116. toil/test/jobStores/jobStoreTest.py +412 -235
  117. toil/test/lib/aws/test_iam.py +116 -48
  118. toil/test/lib/aws/test_s3.py +16 -9
  119. toil/test/lib/aws/test_utils.py +5 -6
  120. toil/test/lib/dockerTest.py +118 -141
  121. toil/test/lib/test_conversions.py +113 -115
  122. toil/test/lib/test_ec2.py +57 -49
  123. toil/test/lib/test_history.py +212 -0
  124. toil/test/lib/test_misc.py +12 -5
  125. toil/test/lib/test_trs.py +161 -0
  126. toil/test/mesos/MesosDataStructuresTest.py +23 -10
  127. toil/test/mesos/helloWorld.py +7 -6
  128. toil/test/mesos/stress.py +25 -20
  129. toil/test/options/options.py +7 -2
  130. toil/test/provisioners/aws/awsProvisionerTest.py +293 -140
  131. toil/test/provisioners/clusterScalerTest.py +440 -250
  132. toil/test/provisioners/clusterTest.py +81 -42
  133. toil/test/provisioners/gceProvisionerTest.py +174 -100
  134. toil/test/provisioners/provisionerTest.py +25 -13
  135. toil/test/provisioners/restartScript.py +5 -4
  136. toil/test/server/serverTest.py +188 -141
  137. toil/test/sort/restart_sort.py +137 -68
  138. toil/test/sort/sort.py +134 -66
  139. toil/test/sort/sortTest.py +91 -49
  140. toil/test/src/autoDeploymentTest.py +140 -100
  141. toil/test/src/busTest.py +20 -18
  142. toil/test/src/checkpointTest.py +8 -2
  143. toil/test/src/deferredFunctionTest.py +49 -35
  144. toil/test/src/dockerCheckTest.py +33 -26
  145. toil/test/src/environmentTest.py +20 -10
  146. toil/test/src/fileStoreTest.py +538 -271
  147. toil/test/src/helloWorldTest.py +7 -4
  148. toil/test/src/importExportFileTest.py +61 -31
  149. toil/test/src/jobDescriptionTest.py +32 -17
  150. toil/test/src/jobEncapsulationTest.py +2 -0
  151. toil/test/src/jobFileStoreTest.py +74 -50
  152. toil/test/src/jobServiceTest.py +187 -73
  153. toil/test/src/jobTest.py +120 -70
  154. toil/test/src/miscTests.py +19 -18
  155. toil/test/src/promisedRequirementTest.py +82 -36
  156. toil/test/src/promisesTest.py +7 -6
  157. toil/test/src/realtimeLoggerTest.py +6 -6
  158. toil/test/src/regularLogTest.py +71 -37
  159. toil/test/src/resourceTest.py +80 -49
  160. toil/test/src/restartDAGTest.py +36 -22
  161. toil/test/src/resumabilityTest.py +9 -2
  162. toil/test/src/retainTempDirTest.py +45 -14
  163. toil/test/src/systemTest.py +12 -8
  164. toil/test/src/threadingTest.py +44 -25
  165. toil/test/src/toilContextManagerTest.py +10 -7
  166. toil/test/src/userDefinedJobArgTypeTest.py +8 -5
  167. toil/test/src/workerTest.py +33 -16
  168. toil/test/utils/toilDebugTest.py +70 -58
  169. toil/test/utils/toilKillTest.py +4 -5
  170. toil/test/utils/utilsTest.py +239 -102
  171. toil/test/wdl/wdltoil_test.py +789 -148
  172. toil/test/wdl/wdltoil_test_kubernetes.py +37 -23
  173. toil/toilState.py +52 -26
  174. toil/utils/toilConfig.py +13 -4
  175. toil/utils/toilDebugFile.py +44 -27
  176. toil/utils/toilDebugJob.py +85 -25
  177. toil/utils/toilDestroyCluster.py +11 -6
  178. toil/utils/toilKill.py +8 -3
  179. toil/utils/toilLaunchCluster.py +251 -145
  180. toil/utils/toilMain.py +37 -16
  181. toil/utils/toilRsyncCluster.py +27 -14
  182. toil/utils/toilSshCluster.py +45 -22
  183. toil/utils/toilStats.py +75 -36
  184. toil/utils/toilStatus.py +226 -119
  185. toil/utils/toilUpdateEC2Instances.py +3 -1
  186. toil/version.py +6 -6
  187. toil/wdl/utils.py +5 -5
  188. toil/wdl/wdltoil.py +3528 -1053
  189. toil/worker.py +370 -149
  190. toil-8.1.0b1.dist-info/METADATA +178 -0
  191. toil-8.1.0b1.dist-info/RECORD +259 -0
  192. {toil-7.0.0.dist-info → toil-8.1.0b1.dist-info}/WHEEL +1 -1
  193. toil-7.0.0.dist-info/METADATA +0 -158
  194. toil-7.0.0.dist-info/RECORD +0 -244
  195. {toil-7.0.0.dist-info → toil-8.1.0b1.dist-info}/LICENSE +0 -0
  196. {toil-7.0.0.dist-info → toil-8.1.0b1.dist-info}/entry_points.txt +0 -0
  197. {toil-7.0.0.dist-info → toil-8.1.0b1.dist-info}/top_level.txt +0 -0
@@ -0,0 +1,12 @@
1
+ cwlVersion: v1.2
2
+ class: CommandLineTool
3
+ inputs: []
4
+ baseCommand: ["bash", "-c", "ulimit -m"]
5
+ stdout: memory.txt
6
+ outputs:
7
+ memory:
8
+ type: string
9
+ outputBinding:
10
+ glob: memory.txt
11
+ loadContents: True
12
+ outputEval: $(self[0].contents)
@@ -0,0 +1,29 @@
1
+ # This workflow fills in a required int from an optional int, but only when the
2
+ # int is really present. But it also uses the value to compute the conditional
3
+ # task's resource requirements, so Toil can't just schedule the task and then
4
+ # check the condition.
5
+ # See <https://github.com/DataBiosphere/toil/issues/4930#issue-2297563321>
6
+ cwlVersion: v1.2
7
+ class: Workflow
8
+ requirements:
9
+ InlineJavascriptRequirement: {}
10
+ inputs:
11
+ optional_input: int?
12
+ steps:
13
+ the_step:
14
+ in:
15
+ required_input:
16
+ source: optional_input
17
+ when: $(inputs.required_input != null)
18
+ run:
19
+ cwlVersion: v1.2
20
+ class: CommandLineTool
21
+ inputs:
22
+ required_input: int
23
+ requirements:
24
+ ResourceRequirement:
25
+ coresMax: $(inputs.required_input)
26
+ baseCommand: "nproc"
27
+ outputs: []
28
+ out: []
29
+ outputs: []
@@ -0,0 +1,18 @@
1
+ #!/usr/bin/env cwl-runner
2
+ class: Workflow
3
+ cwlVersion: v1.2
4
+
5
+ inputs:
6
+ inputFile:
7
+ type: File
8
+ secondaryFiles:
9
+ - ^_old.zip?
10
+
11
+ outputs:
12
+ out_file:
13
+ type: File
14
+ outputSource:
15
+ - inputFile
16
+
17
+ steps:
18
+ []
@@ -0,0 +1,40 @@
1
+ cwlVersion: v1.2
2
+ class: Workflow
3
+ id: scatter-duplicate-outputs
4
+
5
+ inputs:
6
+ - id: toScatterOver
7
+ type: string[]
8
+ default: ['this','is','an','array','of','more','than','two','things']
9
+
10
+ steps:
11
+ echo:
12
+ run:
13
+ id: scatter
14
+ class: CommandLineTool
15
+ inputs:
16
+ s: string
17
+ baseCommand: [echo]
18
+ arguments: [ $(inputs.s)]
19
+ stdout: scatter.out
20
+ stderr: scatter.err
21
+ outputs:
22
+ out: stdout
23
+ err: stderr
24
+ in:
25
+ - id: s
26
+ source: toScatterOver
27
+ scatter:
28
+ - s
29
+ out:
30
+ - id: out
31
+ - id: err
32
+
33
+ outputs:
34
+ - id: echo_out
35
+ type: File[]
36
+ outputSource: ["echo/out"]
37
+
38
+
39
+ requirements:
40
+ - class: ScatterFeatureRequirement
@@ -4,19 +4,19 @@ import shutil
4
4
  import subprocess
5
5
  import sys
6
6
  import unittest
7
- import pytest
8
7
 
9
- from typing import List
8
+ import pytest
10
9
 
11
- pkg_root = os.path.abspath(os.path.join(os.path.dirname(__file__), '..')) # noqa
10
+ pkg_root = os.path.abspath(os.path.join(os.path.dirname(__file__), "..")) # noqa
12
11
  sys.path.insert(0, pkg_root) # noqa
13
12
 
14
- from toil.test import ToilTest, needs_cwl, needs_docker
13
+ from toil.test import ToilTest, needs_docker
15
14
  from toil.version import python
16
15
 
17
16
 
18
17
  class ToilDocumentationTest(ToilTest):
19
18
  """Tests for scripts in the toil tutorials."""
19
+
20
20
  @classmethod
21
21
  def setUpClass(cls):
22
22
  super(ToilTest, cls).setUpClass()
@@ -25,7 +25,7 @@ class ToilDocumentationTest(ToilTest):
25
25
  def tearDown(self) -> None:
26
26
  super(ToilTest, self).tearDown()
27
27
 
28
- jobstores = ['/mnt/ephemeral/workspace/toil-pull-requests/toilWorkflowRun']
28
+ jobstores = ["/mnt/ephemeral/workspace/toil-pull-requests/toilWorkflowRun"]
29
29
  for jobstore in jobstores:
30
30
  if os.path.exists(jobstore):
31
31
  shutil.rmtree(jobstore)
@@ -33,19 +33,24 @@ class ToilDocumentationTest(ToilTest):
33
33
  unittest.TestCase.tearDown(self)
34
34
 
35
35
  """Just check the exit code"""
36
- def checkExitCode(self, script, extra_args: List[str] = []):
36
+
37
+ def checkExitCode(self, script, extra_args: list[str] = []):
37
38
  program = os.path.join(self.directory, "scripts", script)
38
- process = subprocess.Popen([python, program, "file:my-jobstore", "--clean=always"] + extra_args,
39
- stdout=subprocess.PIPE, stderr=subprocess.PIPE)
39
+ process = subprocess.Popen(
40
+ [python, program, "file:my-jobstore", "--clean=always"] + extra_args,
41
+ stdout=subprocess.PIPE,
42
+ stderr=subprocess.PIPE,
43
+ )
40
44
  stdout, stderr = process.communicate()
41
45
  if isinstance(stdout, bytes):
42
- stdout = stdout.decode('utf-8')
43
- stderr = stderr.decode('utf-8')
46
+ stdout = stdout.decode("utf-8")
47
+ stderr = stderr.decode("utf-8")
44
48
  if not process.returncode == 0:
45
49
  raise RuntimeError(stderr)
46
- return stdout + ' ' + stderr
50
+ return stdout + " " + stderr
47
51
 
48
52
  """Check the exit code and the output"""
53
+
49
54
  def checkExpectedOut(self, script, expectedOutput):
50
55
  outerr = self.checkExitCode(script)
51
56
 
@@ -54,6 +59,7 @@ class ToilDocumentationTest(ToilTest):
54
59
  self.assertGreater(index, -1, f"Expected:\n{expectedOutput}\nOutput:\n{outerr}")
55
60
 
56
61
  """Check the exit code and look for a pattern"""
62
+
57
63
  def checkExpectedPattern(self, script, expectedPattern):
58
64
  outerr = self.checkExitCode(script)
59
65
 
@@ -77,16 +83,24 @@ class ToilDocumentationTest(ToilTest):
77
83
  self.checkExitCode("tutorial_encapsulation2.py")
78
84
 
79
85
  def testHelloworld(self):
80
- self.checkExpectedOut("tutorial_helloworld.py", "Hello, world!, here's a message: You did it!\n")
86
+ self.checkExpectedOut(
87
+ "tutorial_helloworld.py", "Hello, world!, here's a message: You did it!\n"
88
+ )
81
89
 
82
90
  def testInvokeworkflow(self):
83
- self.checkExpectedOut("tutorial_invokeworkflow.py", "Hello, world!, here's a message: Woot\n")
91
+ self.checkExpectedOut(
92
+ "tutorial_invokeworkflow.py", "Hello, world!, here's a message: Woot\n"
93
+ )
84
94
 
85
95
  def testInvokeworkflow2(self):
86
- self.checkExpectedOut("tutorial_invokeworkflow2.py", "Hello, world!, I have a message: Woot!\n")
96
+ self.checkExpectedOut(
97
+ "tutorial_invokeworkflow2.py", "Hello, world!, I have a message: Woot!\n"
98
+ )
87
99
 
88
100
  def testJobFunctions(self):
89
- self.checkExpectedOut("tutorial_jobfunctions.py", "Hello world, I have a message: Woot!\n")
101
+ self.checkExpectedOut(
102
+ "tutorial_jobfunctions.py", "Hello world, I have a message: Woot!\n"
103
+ )
90
104
 
91
105
  def testManaging(self):
92
106
  self.checkExitCode("tutorial_managing.py")
@@ -95,39 +109,51 @@ class ToilDocumentationTest(ToilTest):
95
109
  self.checkExitCode("tutorial_managing2.py")
96
110
 
97
111
  def testMultiplejobs(self):
98
- self.checkExpectedPattern("tutorial_multiplejobs.py",
99
- "Hello world, I have a message: first.*Hello world, I have a message: "
100
- "second or third.*Hello world, I have a message: second or third.*Hello world,"
101
- " I have a message: last")
112
+ self.checkExpectedPattern(
113
+ "tutorial_multiplejobs.py",
114
+ "Hello world, I have a message: first.*Hello world, I have a message: "
115
+ "second or third.*Hello world, I have a message: second or third.*Hello world,"
116
+ " I have a message: last",
117
+ )
102
118
 
103
119
  def testMultiplejobs2(self):
104
- self.checkExpectedPattern("tutorial_multiplejobs2.py",
105
- "Hello world, I have a message: first.*Hello world, I have a message: "
106
- "second or third.*Hello world, I have a message: second or third.*Hello world,"
107
- " I have a message: last")
120
+ self.checkExpectedPattern(
121
+ "tutorial_multiplejobs2.py",
122
+ "Hello world, I have a message: first.*Hello world, I have a message: "
123
+ "second or third.*Hello world, I have a message: second or third.*Hello world,"
124
+ " I have a message: last",
125
+ )
108
126
 
109
127
  def testMultiplejobs3(self):
110
- self.checkExpectedPattern("tutorial_multiplejobs3.py",
111
- "Hello world, I have a message: first.*Hello world, I have a message: "
112
- "second or third.*Hello world, I have a message: second or third.*Hello world,"
113
- " I have a message: last")
128
+ self.checkExpectedPattern(
129
+ "tutorial_multiplejobs3.py",
130
+ "Hello world, I have a message: first.*Hello world, I have a message: "
131
+ "second or third.*Hello world, I have a message: second or third.*Hello world,"
132
+ " I have a message: last",
133
+ )
114
134
 
115
135
  @pytest.mark.timeout(1200)
116
136
  def testPromises2(self):
117
- self.checkExpectedOut("tutorial_promises2.py",
118
- "['00000', '00001', '00010', '00011', '00100', '00101', '00110', '00111',"
119
- " '01000', '01001', '01010', '01011', '01100', '01101', '01110', '01111',"
120
- " '10000', '10001', '10010', '10011', '10100', '10101', '10110', '10111',"
121
- " '11000', '11001', '11010', '11011', '11100', '11101', '11110', '11111']")
137
+ self.checkExpectedOut(
138
+ "tutorial_promises2.py",
139
+ "['00000', '00001', '00010', '00011', '00100', '00101', '00110', '00111',"
140
+ " '01000', '01001', '01010', '01011', '01100', '01101', '01110', '01111',"
141
+ " '10000', '10001', '10010', '10011', '10100', '10101', '10110', '10111',"
142
+ " '11000', '11001', '11010', '11011', '11100', '11101', '11110', '11111']",
143
+ )
122
144
 
123
145
  def testQuickstart(self):
124
- self.checkExpectedOut("tutorial_quickstart.py", "Hello, world!, here's a message: Woot\n")
146
+ self.checkExpectedOut(
147
+ "tutorial_quickstart.py", "Hello, world!, here's a message: Woot\n"
148
+ )
125
149
 
126
150
  def testRequirements(self):
127
151
  self.checkExitCode("tutorial_requirements.py")
128
152
 
129
153
  def testArguments(self):
130
- self.checkExpectedOut("tutorial_arguments.py", "Hello, world!, here's a message: Woot")
154
+ self.checkExpectedOut(
155
+ "tutorial_arguments.py", "Hello, world!, here's a message: Woot"
156
+ )
131
157
 
132
158
  @needs_docker
133
159
  def testDocker(self):