toil 6.1.0__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.
Files changed (93) hide show
  1. toil/__init__.py +1 -232
  2. toil/batchSystems/abstractBatchSystem.py +22 -13
  3. toil/batchSystems/abstractGridEngineBatchSystem.py +59 -45
  4. toil/batchSystems/awsBatch.py +8 -8
  5. toil/batchSystems/contained_executor.py +4 -5
  6. toil/batchSystems/gridengine.py +1 -1
  7. toil/batchSystems/htcondor.py +5 -5
  8. toil/batchSystems/kubernetes.py +25 -11
  9. toil/batchSystems/local_support.py +3 -3
  10. toil/batchSystems/lsf.py +2 -2
  11. toil/batchSystems/mesos/batchSystem.py +4 -4
  12. toil/batchSystems/mesos/executor.py +3 -2
  13. toil/batchSystems/options.py +9 -0
  14. toil/batchSystems/singleMachine.py +11 -10
  15. toil/batchSystems/slurm.py +64 -22
  16. toil/batchSystems/torque.py +1 -1
  17. toil/bus.py +7 -3
  18. toil/common.py +36 -13
  19. toil/cwl/cwltoil.py +365 -312
  20. toil/deferred.py +1 -1
  21. toil/fileStores/abstractFileStore.py +17 -17
  22. toil/fileStores/cachingFileStore.py +2 -2
  23. toil/fileStores/nonCachingFileStore.py +1 -1
  24. toil/job.py +228 -60
  25. toil/jobStores/abstractJobStore.py +18 -10
  26. toil/jobStores/aws/jobStore.py +280 -218
  27. toil/jobStores/aws/utils.py +57 -29
  28. toil/jobStores/conftest.py +2 -2
  29. toil/jobStores/fileJobStore.py +2 -2
  30. toil/jobStores/googleJobStore.py +3 -4
  31. toil/leader.py +72 -24
  32. toil/lib/aws/__init__.py +26 -10
  33. toil/lib/aws/iam.py +2 -2
  34. toil/lib/aws/session.py +62 -22
  35. toil/lib/aws/utils.py +73 -37
  36. toil/lib/conversions.py +5 -1
  37. toil/lib/ec2.py +118 -69
  38. toil/lib/expando.py +1 -1
  39. toil/lib/io.py +14 -2
  40. toil/lib/misc.py +1 -3
  41. toil/lib/resources.py +55 -21
  42. toil/lib/retry.py +12 -5
  43. toil/lib/threading.py +2 -2
  44. toil/lib/throttle.py +1 -1
  45. toil/options/common.py +27 -24
  46. toil/provisioners/__init__.py +9 -3
  47. toil/provisioners/abstractProvisioner.py +9 -7
  48. toil/provisioners/aws/__init__.py +20 -15
  49. toil/provisioners/aws/awsProvisioner.py +406 -329
  50. toil/provisioners/gceProvisioner.py +2 -2
  51. toil/provisioners/node.py +13 -5
  52. toil/server/app.py +1 -1
  53. toil/statsAndLogging.py +58 -16
  54. toil/test/__init__.py +27 -12
  55. toil/test/batchSystems/batchSystemTest.py +40 -33
  56. toil/test/batchSystems/batch_system_plugin_test.py +79 -0
  57. toil/test/batchSystems/test_slurm.py +1 -1
  58. toil/test/cwl/cwlTest.py +8 -91
  59. toil/test/cwl/seqtk_seq.cwl +1 -1
  60. toil/test/docs/scriptsTest.py +10 -13
  61. toil/test/jobStores/jobStoreTest.py +33 -49
  62. toil/test/lib/aws/test_iam.py +2 -2
  63. toil/test/provisioners/aws/awsProvisionerTest.py +51 -34
  64. toil/test/provisioners/clusterTest.py +90 -8
  65. toil/test/server/serverTest.py +2 -2
  66. toil/test/src/autoDeploymentTest.py +1 -1
  67. toil/test/src/dockerCheckTest.py +2 -1
  68. toil/test/src/environmentTest.py +125 -0
  69. toil/test/src/fileStoreTest.py +1 -1
  70. toil/test/src/jobDescriptionTest.py +18 -8
  71. toil/test/src/jobTest.py +1 -1
  72. toil/test/src/realtimeLoggerTest.py +4 -0
  73. toil/test/src/workerTest.py +52 -19
  74. toil/test/utils/toilDebugTest.py +61 -3
  75. toil/test/utils/utilsTest.py +20 -18
  76. toil/test/wdl/wdltoil_test.py +24 -71
  77. toil/test/wdl/wdltoil_test_kubernetes.py +77 -0
  78. toil/toilState.py +68 -9
  79. toil/utils/toilDebugJob.py +153 -26
  80. toil/utils/toilLaunchCluster.py +12 -2
  81. toil/utils/toilRsyncCluster.py +7 -2
  82. toil/utils/toilSshCluster.py +7 -3
  83. toil/utils/toilStats.py +2 -1
  84. toil/utils/toilStatus.py +97 -51
  85. toil/version.py +10 -10
  86. toil/wdl/wdltoil.py +318 -51
  87. toil/worker.py +96 -69
  88. {toil-6.1.0.dist-info → toil-7.0.0.dist-info}/LICENSE +25 -0
  89. {toil-6.1.0.dist-info → toil-7.0.0.dist-info}/METADATA +55 -21
  90. {toil-6.1.0.dist-info → toil-7.0.0.dist-info}/RECORD +93 -90
  91. {toil-6.1.0.dist-info → toil-7.0.0.dist-info}/WHEEL +1 -1
  92. {toil-6.1.0.dist-info → toil-7.0.0.dist-info}/entry_points.txt +0 -0
  93. {toil-6.1.0.dist-info → toil-7.0.0.dist-info}/top_level.txt +0 -0
@@ -70,6 +70,14 @@ except ImportError:
70
70
  class ProxyConnectionError(BaseException): # type: ignore
71
71
  """Dummy class."""
72
72
 
73
+ class LocatorException(Exception):
74
+ """
75
+ Base exception class for all locator exceptions.
76
+ For example, job store/aws bucket exceptions where they already exist
77
+ """
78
+ def __init__(self, error_msg: str, locator: str, prefix: Optional[str]=None):
79
+ full_locator = locator if prefix is None else f"{prefix}:{locator}"
80
+ super().__init__(error_msg % full_locator)
73
81
 
74
82
  class InvalidImportExportUrlException(Exception):
75
83
  def __init__(self, url: ParseResult) -> None:
@@ -136,24 +144,24 @@ class NoSuchFileException(Exception):
136
144
  super().__init__(message)
137
145
 
138
146
 
139
- class NoSuchJobStoreException(Exception):
147
+ class NoSuchJobStoreException(LocatorException):
140
148
  """Indicates that the specified job store does not exist."""
141
- def __init__(self, locator: str):
149
+ def __init__(self, locator: str, prefix: str):
142
150
  """
143
151
  :param str locator: The location of the job store
144
152
  """
145
- super().__init__("The job store '%s' does not exist, so there is nothing to restart." % locator)
153
+ super().__init__("The job store '%s' does not exist, so there is nothing to restart.", locator, prefix)
146
154
 
147
155
 
148
- class JobStoreExistsException(Exception):
156
+ class JobStoreExistsException(LocatorException):
149
157
  """Indicates that the specified job store already exists."""
150
- def __init__(self, locator: str):
158
+ def __init__(self, locator: str, prefix: str):
151
159
  """
152
160
  :param str locator: The location of the job store
153
161
  """
154
162
  super().__init__(
155
163
  "The job store '%s' already exists. Use --restart to resume the workflow, or remove "
156
- "the job store with 'toil clean' to start the workflow from scratch." % locator)
164
+ "the job store with 'toil clean' to start the workflow from scratch.", locator, prefix)
157
165
 
158
166
 
159
167
  class AbstractJobStore(ABC):
@@ -835,7 +843,7 @@ class AbstractJobStore(ABC):
835
843
  root_job_description = self.load_root_job()
836
844
  reachable_from_root: Set[str] = set()
837
845
 
838
-
846
+
839
847
  for merged_in in root_job_description.get_chain():
840
848
  # Add the job itself and any other jobs that chained with it.
841
849
  # Keep merged-in jobs around themselves, but don't bother
@@ -845,7 +853,7 @@ class AbstractJobStore(ABC):
845
853
  for service_job_store_id in root_job_description.services:
846
854
  if haveJob(service_job_store_id):
847
855
  reachable_from_root.add(service_job_store_id)
848
-
856
+
849
857
 
850
858
  # Unprocessed means it might have successor jobs we need to add.
851
859
  unprocessed_job_descriptions = [root_job_description]
@@ -924,11 +932,11 @@ class AbstractJobStore(ABC):
924
932
  jobDescription.filesToDelete = []
925
933
  changed[0] = True
926
934
 
927
- # For a job whose command is already executed, remove jobs from the
935
+ # For a job whose body has already executed, remove jobs from the
928
936
  # stack that are already deleted. This cleans up the case that the
929
937
  # jobDescription had successors to run, but had not been updated to
930
938
  # reflect this.
931
- if jobDescription.command is None:
939
+ if not jobDescription.has_body():
932
940
 
933
941
  def stackSizeFn() -> int:
934
942
  return len(list(jobDescription.allSuccessors()))