toil 8.0.0__py3-none-any.whl → 8.2.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 +4 -39
- toil/batchSystems/abstractBatchSystem.py +1 -1
- toil/batchSystems/abstractGridEngineBatchSystem.py +1 -1
- toil/batchSystems/awsBatch.py +1 -1
- toil/batchSystems/cleanup_support.py +1 -1
- toil/batchSystems/kubernetes.py +53 -7
- toil/batchSystems/local_support.py +1 -1
- toil/batchSystems/mesos/batchSystem.py +13 -8
- toil/batchSystems/mesos/test/__init__.py +3 -2
- toil/batchSystems/options.py +1 -0
- toil/batchSystems/singleMachine.py +1 -1
- toil/batchSystems/slurm.py +229 -84
- toil/bus.py +5 -3
- toil/common.py +198 -54
- toil/cwl/cwltoil.py +32 -11
- toil/job.py +110 -86
- toil/jobStores/abstractJobStore.py +24 -3
- toil/jobStores/aws/jobStore.py +46 -10
- toil/jobStores/fileJobStore.py +25 -1
- toil/jobStores/googleJobStore.py +104 -30
- toil/leader.py +9 -0
- toil/lib/accelerators.py +3 -1
- toil/lib/aws/session.py +14 -3
- toil/lib/aws/utils.py +92 -35
- toil/lib/aws/utils.py.orig +504 -0
- toil/lib/bioio.py +1 -1
- toil/lib/docker.py +252 -91
- toil/lib/dockstore.py +387 -0
- toil/lib/ec2nodes.py +3 -2
- toil/lib/exceptions.py +5 -3
- toil/lib/history.py +1345 -0
- toil/lib/history_submission.py +695 -0
- toil/lib/io.py +56 -23
- toil/lib/misc.py +25 -1
- toil/lib/resources.py +2 -1
- toil/lib/retry.py +10 -10
- toil/lib/threading.py +11 -10
- toil/lib/{integration.py → trs.py} +95 -46
- toil/lib/web.py +38 -0
- toil/options/common.py +25 -2
- toil/options/cwl.py +10 -0
- toil/options/wdl.py +11 -0
- toil/provisioners/gceProvisioner.py +4 -4
- toil/server/api_spec/LICENSE +201 -0
- toil/server/api_spec/README.rst +5 -0
- toil/server/cli/wes_cwl_runner.py +5 -4
- toil/server/utils.py +2 -3
- toil/statsAndLogging.py +35 -1
- toil/test/__init__.py +275 -115
- toil/test/batchSystems/batchSystemTest.py +227 -205
- toil/test/batchSystems/test_slurm.py +199 -2
- toil/test/cactus/pestis.tar.gz +0 -0
- toil/test/conftest.py +7 -0
- toil/test/cwl/2.fasta +11 -0
- toil/test/cwl/2.fastq +12 -0
- toil/test/cwl/conftest.py +39 -0
- toil/test/cwl/cwlTest.py +1015 -780
- toil/test/cwl/directory/directory/file.txt +15 -0
- toil/test/cwl/download_directory_file.json +4 -0
- toil/test/cwl/download_directory_s3.json +4 -0
- toil/test/cwl/download_file.json +6 -0
- toil/test/cwl/download_http.json +6 -0
- toil/test/cwl/download_https.json +6 -0
- toil/test/cwl/download_s3.json +6 -0
- toil/test/cwl/download_subdirectory_file.json +5 -0
- toil/test/cwl/download_subdirectory_s3.json +5 -0
- toil/test/cwl/empty.json +1 -0
- toil/test/cwl/mock_mpi/fake_mpi.yml +8 -0
- toil/test/cwl/mock_mpi/fake_mpi_run.py +42 -0
- toil/test/cwl/optional-file-exists.json +6 -0
- toil/test/cwl/optional-file-missing.json +6 -0
- toil/test/cwl/optional-file.cwl +18 -0
- toil/test/cwl/preemptible_expression.json +1 -0
- toil/test/cwl/revsort-job-missing.json +6 -0
- toil/test/cwl/revsort-job.json +6 -0
- toil/test/cwl/s3_secondary_file.json +16 -0
- toil/test/cwl/seqtk_seq_job.json +6 -0
- toil/test/cwl/stream.json +6 -0
- toil/test/cwl/test_filename_conflict_resolution.ms/table.dat +0 -0
- toil/test/cwl/test_filename_conflict_resolution.ms/table.f0 +0 -0
- toil/test/cwl/test_filename_conflict_resolution.ms/table.f1 +0 -0
- toil/test/cwl/test_filename_conflict_resolution.ms/table.f1i +0 -0
- toil/test/cwl/test_filename_conflict_resolution.ms/table.f2 +0 -0
- toil/test/cwl/test_filename_conflict_resolution.ms/table.f2_TSM0 +0 -0
- toil/test/cwl/test_filename_conflict_resolution.ms/table.f3 +0 -0
- toil/test/cwl/test_filename_conflict_resolution.ms/table.f3_TSM0 +0 -0
- toil/test/cwl/test_filename_conflict_resolution.ms/table.f4 +0 -0
- toil/test/cwl/test_filename_conflict_resolution.ms/table.f4_TSM0 +0 -0
- toil/test/cwl/test_filename_conflict_resolution.ms/table.f5 +0 -0
- toil/test/cwl/test_filename_conflict_resolution.ms/table.info +0 -0
- toil/test/cwl/test_filename_conflict_resolution.ms/table.lock +0 -0
- toil/test/cwl/whale.txt +16 -0
- toil/test/docs/scripts/example_alwaysfail.py +38 -0
- toil/test/docs/scripts/example_alwaysfail_with_files.wdl +33 -0
- toil/test/docs/scripts/example_cachingbenchmark.py +117 -0
- toil/test/docs/scripts/stagingExampleFiles/in.txt +1 -0
- toil/test/docs/scripts/stagingExampleFiles/out.txt +2 -0
- toil/test/docs/scripts/tutorial_arguments.py +23 -0
- toil/test/docs/scripts/tutorial_debugging.patch +12 -0
- toil/test/docs/scripts/tutorial_debugging_hangs.wdl +126 -0
- toil/test/docs/scripts/tutorial_debugging_works.wdl +129 -0
- toil/test/docs/scripts/tutorial_docker.py +20 -0
- toil/test/docs/scripts/tutorial_dynamic.py +24 -0
- toil/test/docs/scripts/tutorial_encapsulation.py +28 -0
- toil/test/docs/scripts/tutorial_encapsulation2.py +29 -0
- toil/test/docs/scripts/tutorial_helloworld.py +15 -0
- toil/test/docs/scripts/tutorial_invokeworkflow.py +27 -0
- toil/test/docs/scripts/tutorial_invokeworkflow2.py +30 -0
- toil/test/docs/scripts/tutorial_jobfunctions.py +22 -0
- toil/test/docs/scripts/tutorial_managing.py +29 -0
- toil/test/docs/scripts/tutorial_managing2.py +56 -0
- toil/test/docs/scripts/tutorial_multiplejobs.py +25 -0
- toil/test/docs/scripts/tutorial_multiplejobs2.py +21 -0
- toil/test/docs/scripts/tutorial_multiplejobs3.py +22 -0
- toil/test/docs/scripts/tutorial_promises.py +25 -0
- toil/test/docs/scripts/tutorial_promises2.py +30 -0
- toil/test/docs/scripts/tutorial_quickstart.py +22 -0
- toil/test/docs/scripts/tutorial_requirements.py +44 -0
- toil/test/docs/scripts/tutorial_services.py +45 -0
- toil/test/docs/scripts/tutorial_staging.py +45 -0
- toil/test/docs/scripts/tutorial_stats.py +64 -0
- toil/test/lib/aws/test_iam.py +3 -1
- toil/test/lib/dockerTest.py +205 -122
- toil/test/lib/test_history.py +236 -0
- toil/test/lib/test_trs.py +161 -0
- toil/test/provisioners/aws/awsProvisionerTest.py +12 -9
- toil/test/provisioners/clusterTest.py +4 -4
- toil/test/provisioners/gceProvisionerTest.py +16 -14
- toil/test/sort/sort.py +4 -1
- toil/test/src/busTest.py +17 -17
- toil/test/src/deferredFunctionTest.py +145 -132
- toil/test/src/importExportFileTest.py +71 -63
- toil/test/src/jobEncapsulationTest.py +27 -28
- toil/test/src/jobServiceTest.py +149 -133
- toil/test/src/jobTest.py +219 -211
- toil/test/src/miscTests.py +66 -60
- toil/test/src/promisedRequirementTest.py +163 -169
- toil/test/src/regularLogTest.py +24 -24
- toil/test/src/resourceTest.py +82 -76
- toil/test/src/restartDAGTest.py +51 -47
- toil/test/src/resumabilityTest.py +24 -19
- toil/test/src/retainTempDirTest.py +60 -57
- toil/test/src/systemTest.py +17 -13
- toil/test/src/threadingTest.py +29 -32
- toil/test/utils/ABCWorkflowDebug/B_file.txt +1 -0
- toil/test/utils/ABCWorkflowDebug/debugWorkflow.py +204 -0
- toil/test/utils/ABCWorkflowDebug/mkFile.py +16 -0
- toil/test/utils/ABCWorkflowDebug/sleep.cwl +12 -0
- toil/test/utils/ABCWorkflowDebug/sleep.yaml +1 -0
- toil/test/utils/toilDebugTest.py +117 -102
- toil/test/utils/toilKillTest.py +54 -53
- toil/test/utils/utilsTest.py +303 -229
- toil/test/wdl/lint_error.wdl +9 -0
- toil/test/wdl/md5sum/empty_file.json +1 -0
- toil/test/wdl/md5sum/md5sum-gs.json +1 -0
- toil/test/wdl/md5sum/md5sum.1.0.wdl +32 -0
- toil/test/wdl/md5sum/md5sum.input +1 -0
- toil/test/wdl/md5sum/md5sum.json +1 -0
- toil/test/wdl/md5sum/md5sum.wdl +25 -0
- toil/test/wdl/miniwdl_self_test/inputs-namespaced.json +1 -0
- toil/test/wdl/miniwdl_self_test/inputs.json +1 -0
- toil/test/wdl/miniwdl_self_test/self_test.wdl +40 -0
- toil/test/wdl/standard_library/as_map.json +16 -0
- toil/test/wdl/standard_library/as_map_as_input.wdl +23 -0
- toil/test/wdl/standard_library/as_pairs.json +7 -0
- toil/test/wdl/standard_library/as_pairs_as_input.wdl +23 -0
- toil/test/wdl/standard_library/ceil.json +3 -0
- toil/test/wdl/standard_library/ceil_as_command.wdl +16 -0
- toil/test/wdl/standard_library/ceil_as_input.wdl +16 -0
- toil/test/wdl/standard_library/collect_by_key.json +1 -0
- toil/test/wdl/standard_library/collect_by_key_as_input.wdl +23 -0
- toil/test/wdl/standard_library/cross.json +11 -0
- toil/test/wdl/standard_library/cross_as_input.wdl +19 -0
- toil/test/wdl/standard_library/flatten.json +7 -0
- toil/test/wdl/standard_library/flatten_as_input.wdl +18 -0
- toil/test/wdl/standard_library/floor.json +3 -0
- toil/test/wdl/standard_library/floor_as_command.wdl +16 -0
- toil/test/wdl/standard_library/floor_as_input.wdl +16 -0
- toil/test/wdl/standard_library/keys.json +8 -0
- toil/test/wdl/standard_library/keys_as_input.wdl +24 -0
- toil/test/wdl/standard_library/length.json +7 -0
- toil/test/wdl/standard_library/length_as_input.wdl +16 -0
- toil/test/wdl/standard_library/length_as_input_with_map.json +7 -0
- toil/test/wdl/standard_library/length_as_input_with_map.wdl +17 -0
- toil/test/wdl/standard_library/length_invalid.json +3 -0
- toil/test/wdl/standard_library/range.json +3 -0
- toil/test/wdl/standard_library/range_0.json +3 -0
- toil/test/wdl/standard_library/range_as_input.wdl +17 -0
- toil/test/wdl/standard_library/range_invalid.json +3 -0
- toil/test/wdl/standard_library/read_boolean.json +3 -0
- toil/test/wdl/standard_library/read_boolean_as_command.wdl +17 -0
- toil/test/wdl/standard_library/read_float.json +3 -0
- toil/test/wdl/standard_library/read_float_as_command.wdl +17 -0
- toil/test/wdl/standard_library/read_int.json +3 -0
- toil/test/wdl/standard_library/read_int_as_command.wdl +17 -0
- toil/test/wdl/standard_library/read_json.json +3 -0
- toil/test/wdl/standard_library/read_json_as_output.wdl +31 -0
- toil/test/wdl/standard_library/read_lines.json +3 -0
- toil/test/wdl/standard_library/read_lines_as_output.wdl +31 -0
- toil/test/wdl/standard_library/read_map.json +3 -0
- toil/test/wdl/standard_library/read_map_as_output.wdl +31 -0
- toil/test/wdl/standard_library/read_string.json +3 -0
- toil/test/wdl/standard_library/read_string_as_command.wdl +17 -0
- toil/test/wdl/standard_library/read_tsv.json +3 -0
- toil/test/wdl/standard_library/read_tsv_as_output.wdl +31 -0
- toil/test/wdl/standard_library/round.json +3 -0
- toil/test/wdl/standard_library/round_as_command.wdl +16 -0
- toil/test/wdl/standard_library/round_as_input.wdl +16 -0
- toil/test/wdl/standard_library/size.json +3 -0
- toil/test/wdl/standard_library/size_as_command.wdl +17 -0
- toil/test/wdl/standard_library/size_as_output.wdl +36 -0
- toil/test/wdl/standard_library/stderr.json +3 -0
- toil/test/wdl/standard_library/stderr_as_output.wdl +30 -0
- toil/test/wdl/standard_library/stdout.json +3 -0
- toil/test/wdl/standard_library/stdout_as_output.wdl +30 -0
- toil/test/wdl/standard_library/sub.json +3 -0
- toil/test/wdl/standard_library/sub_as_input.wdl +17 -0
- toil/test/wdl/standard_library/sub_as_input_with_file.wdl +17 -0
- toil/test/wdl/standard_library/transpose.json +6 -0
- toil/test/wdl/standard_library/transpose_as_input.wdl +18 -0
- toil/test/wdl/standard_library/write_json.json +6 -0
- toil/test/wdl/standard_library/write_json_as_command.wdl +17 -0
- toil/test/wdl/standard_library/write_lines.json +7 -0
- toil/test/wdl/standard_library/write_lines_as_command.wdl +17 -0
- toil/test/wdl/standard_library/write_map.json +6 -0
- toil/test/wdl/standard_library/write_map_as_command.wdl +17 -0
- toil/test/wdl/standard_library/write_tsv.json +6 -0
- toil/test/wdl/standard_library/write_tsv_as_command.wdl +17 -0
- toil/test/wdl/standard_library/zip.json +12 -0
- toil/test/wdl/standard_library/zip_as_input.wdl +19 -0
- toil/test/wdl/test.csv +3 -0
- toil/test/wdl/test.tsv +3 -0
- toil/test/wdl/testfiles/croo.wdl +38 -0
- toil/test/wdl/testfiles/drop_files.wdl +62 -0
- toil/test/wdl/testfiles/drop_files_subworkflow.wdl +13 -0
- toil/test/wdl/testfiles/empty.txt +0 -0
- toil/test/wdl/testfiles/not_enough_outputs.wdl +33 -0
- toil/test/wdl/testfiles/random.wdl +66 -0
- toil/test/wdl/testfiles/string_file_coercion.json +1 -0
- toil/test/wdl/testfiles/string_file_coercion.wdl +35 -0
- toil/test/wdl/testfiles/test.json +4 -0
- toil/test/wdl/testfiles/test_boolean.txt +1 -0
- toil/test/wdl/testfiles/test_float.txt +1 -0
- toil/test/wdl/testfiles/test_int.txt +1 -0
- toil/test/wdl/testfiles/test_lines.txt +5 -0
- toil/test/wdl/testfiles/test_map.txt +2 -0
- toil/test/wdl/testfiles/test_string.txt +1 -0
- toil/test/wdl/testfiles/url_to_file.wdl +13 -0
- toil/test/wdl/testfiles/url_to_optional_file.wdl +13 -0
- toil/test/wdl/testfiles/vocab.json +1 -0
- toil/test/wdl/testfiles/vocab.wdl +66 -0
- toil/test/wdl/testfiles/wait.wdl +34 -0
- toil/test/wdl/wdl_specification/type_pair.json +23 -0
- toil/test/wdl/wdl_specification/type_pair_basic.wdl +36 -0
- toil/test/wdl/wdl_specification/type_pair_with_files.wdl +36 -0
- toil/test/wdl/wdl_specification/v1_spec.json +1 -0
- toil/test/wdl/wdl_specification/v1_spec_declaration.wdl +39 -0
- toil/test/wdl/wdltoil_test.py +681 -408
- toil/test/wdl/wdltoil_test_kubernetes.py +2 -2
- toil/version.py +10 -10
- toil/wdl/wdltoil.py +350 -123
- toil/worker.py +113 -33
- {toil-8.0.0.dist-info → toil-8.2.0.dist-info}/METADATA +13 -7
- toil-8.2.0.dist-info/RECORD +439 -0
- {toil-8.0.0.dist-info → toil-8.2.0.dist-info}/WHEEL +1 -1
- toil/test/lib/test_integration.py +0 -104
- toil-8.0.0.dist-info/RECORD +0 -253
- {toil-8.0.0.dist-info → toil-8.2.0.dist-info}/entry_points.txt +0 -0
- {toil-8.0.0.dist-info → toil-8.2.0.dist-info/licenses}/LICENSE +0 -0
- {toil-8.0.0.dist-info → toil-8.2.0.dist-info}/top_level.txt +0 -0
toil/worker.py
CHANGED
|
@@ -11,6 +11,7 @@
|
|
|
11
11
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
12
12
|
# See the License for the specific language governing permissions and
|
|
13
13
|
# limitations under the License.
|
|
14
|
+
import atexit
|
|
14
15
|
import base64
|
|
15
16
|
import copy
|
|
16
17
|
import json
|
|
@@ -22,7 +23,9 @@ import shutil
|
|
|
22
23
|
import signal
|
|
23
24
|
import socket
|
|
24
25
|
import stat
|
|
26
|
+
import subprocess
|
|
25
27
|
import sys
|
|
28
|
+
import threading
|
|
26
29
|
import time
|
|
27
30
|
import traceback
|
|
28
31
|
from collections.abc import Iterator
|
|
@@ -59,7 +62,6 @@ class StatsDict(MagicExpando):
|
|
|
59
62
|
|
|
60
63
|
jobs: list[MagicExpando]
|
|
61
64
|
|
|
62
|
-
|
|
63
65
|
def nextChainable(
|
|
64
66
|
predecessor: JobDescription, job_store: AbstractJobStore, config: Config
|
|
65
67
|
) -> Optional[JobDescription]:
|
|
@@ -165,6 +167,85 @@ def nextChainable(
|
|
|
165
167
|
# Made it through! This job is chainable.
|
|
166
168
|
return successor
|
|
167
169
|
|
|
170
|
+
def unstick_worker(interval: float = 120, timeout: float = 120) -> None:
|
|
171
|
+
"""
|
|
172
|
+
Thread function that tries to prevent the process from getting stuck.
|
|
173
|
+
|
|
174
|
+
Meant to be used as a daemon thread: does not have a shutdown signal but
|
|
175
|
+
cleans up on exit.
|
|
176
|
+
|
|
177
|
+
:param interval: Try to unstick the process at intervals of this many
|
|
178
|
+
seconds.
|
|
179
|
+
:param timeout: Stop child processes that take longer than this many
|
|
180
|
+
seconds to finish.
|
|
181
|
+
"""
|
|
182
|
+
|
|
183
|
+
# We've observed Toil getting stuck reading the job from the job store,
|
|
184
|
+
# either due to a problem with the FileJobStore or with local temp storage,
|
|
185
|
+
# but then get unstuck as soon as someone logged in and ran lsof on the
|
|
186
|
+
# Toil process. So we make sure to do that to ourselves every once in a
|
|
187
|
+
# while as long as the worker is running.
|
|
188
|
+
|
|
189
|
+
# Figure out our process ID
|
|
190
|
+
pid = os.getpid()
|
|
191
|
+
|
|
192
|
+
child: Optional[subprocess.Popen[bytes]] = None
|
|
193
|
+
|
|
194
|
+
def clean_up_child() -> None:
|
|
195
|
+
"""
|
|
196
|
+
Cleanup function to run at daemon thread shutdown when the main thread
|
|
197
|
+
terminates without shutting us down.
|
|
198
|
+
|
|
199
|
+
Also used to kill the child process if it takes too long.
|
|
200
|
+
"""
|
|
201
|
+
if child is not None:
|
|
202
|
+
# Kill the child immediately if it is running
|
|
203
|
+
child.kill()
|
|
204
|
+
try:
|
|
205
|
+
# Wait one last time to try and reap the child process
|
|
206
|
+
child.wait(timeout=5)
|
|
207
|
+
except subprocess.TimeoutExpired:
|
|
208
|
+
pass
|
|
209
|
+
|
|
210
|
+
atexit.register(clean_up_child)
|
|
211
|
+
|
|
212
|
+
# TODO: If we handle daemon thread shutdown just fine, why do we bother
|
|
213
|
+
# with all the event stuff? Why not cut it?
|
|
214
|
+
|
|
215
|
+
# Wait the interval before trying the first unstick
|
|
216
|
+
time.sleep(interval)
|
|
217
|
+
|
|
218
|
+
while True:
|
|
219
|
+
# Run an lsof on our PID, which has been observed to unstick reads.
|
|
220
|
+
#
|
|
221
|
+
# We rely on the thread being able to go away and atexit() hooks
|
|
222
|
+
# happening in the middle of a wait with a timeout.
|
|
223
|
+
#
|
|
224
|
+
# We also want to handle the case where the child process gets so
|
|
225
|
+
# gummed up that it can't exit when killed.
|
|
226
|
+
|
|
227
|
+
# Preserve errors form child process but not output
|
|
228
|
+
child = subprocess.Popen(
|
|
229
|
+
["lsof", "-p", str(pid)],
|
|
230
|
+
stdin=subprocess.DEVNULL,
|
|
231
|
+
stdout=subprocess.DEVNULL,
|
|
232
|
+
)
|
|
233
|
+
try:
|
|
234
|
+
child.wait(timeout=timeout)
|
|
235
|
+
except subprocess.TimeoutExpired:
|
|
236
|
+
logger.warning("Running lsof took too long!")
|
|
237
|
+
clean_up_child()
|
|
238
|
+
if child.returncode is None:
|
|
239
|
+
# Kill didn't take
|
|
240
|
+
logger.warning("Could not promptly kill child process: %s", child.pid)
|
|
241
|
+
|
|
242
|
+
if child.returncode != 0:
|
|
243
|
+
# Something went wrong, which is suspicious. Either it failed or it
|
|
244
|
+
# timed out and could not be killed promptly.
|
|
245
|
+
logger.warning("Could not list open files on ourselves. Return code: %s", child.returncode)
|
|
246
|
+
|
|
247
|
+
# Wait the interval.
|
|
248
|
+
time.sleep(interval)
|
|
168
249
|
|
|
169
250
|
def workerScript(
|
|
170
251
|
job_store: AbstractJobStore,
|
|
@@ -240,6 +321,13 @@ def workerScript(
|
|
|
240
321
|
# We don't need to reap the child. Either it kills us, or we finish
|
|
241
322
|
# before it does. Either way, init will have to clean it up for us.
|
|
242
323
|
|
|
324
|
+
##########################################
|
|
325
|
+
# Create the worker unsticker
|
|
326
|
+
##########################################
|
|
327
|
+
unstick_thread = threading.Thread(target=unstick_worker, args=())
|
|
328
|
+
unstick_thread.daemon = True
|
|
329
|
+
unstick_thread.start()
|
|
330
|
+
|
|
243
331
|
##########################################
|
|
244
332
|
# Load the environment for the job
|
|
245
333
|
##########################################
|
|
@@ -443,13 +531,12 @@ def workerScript(
|
|
|
443
531
|
)
|
|
444
532
|
|
|
445
533
|
##########################################
|
|
446
|
-
# Setup the stats
|
|
534
|
+
# Setup the stats
|
|
447
535
|
##########################################
|
|
448
536
|
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
startClock = ResourceMonitor.get_total_cpu_time()
|
|
537
|
+
# Remember the cores from the first job, which is how many we have reserved for us.
|
|
538
|
+
statsDict.workers.requested_cores = jobDesc.cores
|
|
539
|
+
startClock = ResourceMonitor.get_total_cpu_time()
|
|
453
540
|
|
|
454
541
|
startTime = time.time()
|
|
455
542
|
while True:
|
|
@@ -483,7 +570,7 @@ def workerScript(
|
|
|
483
570
|
)
|
|
484
571
|
try:
|
|
485
572
|
with job._executor(
|
|
486
|
-
stats=statsDict
|
|
573
|
+
stats=statsDict, fileStore=fileStore
|
|
487
574
|
):
|
|
488
575
|
with deferredFunctionManager.open() as defer:
|
|
489
576
|
with fileStore.open(job):
|
|
@@ -594,22 +681,21 @@ def workerScript(
|
|
|
594
681
|
##########################################
|
|
595
682
|
# Finish up the stats
|
|
596
683
|
##########################################
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
statsDict.workers.jobs_run = len(statsDict.jobs)
|
|
684
|
+
totalCPUTime, totalMemoryUsage = (
|
|
685
|
+
ResourceMonitor.get_total_cpu_time_and_memory_usage()
|
|
686
|
+
)
|
|
687
|
+
statsDict.workers.time = str(time.time() - startTime)
|
|
688
|
+
statsDict.workers.clock = str(totalCPUTime - startClock)
|
|
689
|
+
statsDict.workers.memory = str(totalMemoryUsage)
|
|
690
|
+
# Say the worker used the max disk we saw from any job
|
|
691
|
+
max_bytes = 0
|
|
692
|
+
for job_stats in statsDict.jobs:
|
|
693
|
+
if "disk" in job_stats:
|
|
694
|
+
max_bytes = max(max_bytes, int(job_stats.disk))
|
|
695
|
+
statsDict.workers.disk = str(max_bytes)
|
|
696
|
+
# Count the jobs executed.
|
|
697
|
+
# TODO: toil stats could compute this but its parser is too general to hook into simply.
|
|
698
|
+
statsDict.workers.jobs_run = len(statsDict.jobs)
|
|
613
699
|
|
|
614
700
|
# log the worker log path here so that if the file is truncated the path can still be found
|
|
615
701
|
if redirect_output_to_log_file:
|
|
@@ -767,16 +853,10 @@ def workerScript(
|
|
|
767
853
|
statsDict.logs.names = [names.stats_name for names in jobDesc.get_chain()]
|
|
768
854
|
statsDict.logs.messages = logMessages
|
|
769
855
|
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
or statsDict.workers.logging_user_streams
|
|
775
|
-
):
|
|
776
|
-
# We have stats/logging to report back.
|
|
777
|
-
# We report even if the job attempt failed.
|
|
778
|
-
# TODO: Will that upset analysis of the stats?
|
|
779
|
-
job_store.write_logs(json.dumps(statsDict, ensure_ascii=True))
|
|
856
|
+
# We have stats/logging to report back.
|
|
857
|
+
# We report even if the job attempt failed.
|
|
858
|
+
# TODO: Will that upset analysis of the stats?
|
|
859
|
+
job_store.write_logs(json.dumps(statsDict, ensure_ascii=True))
|
|
780
860
|
|
|
781
861
|
# Remove the temp dir
|
|
782
862
|
cleanUp = config.cleanWorkDir
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
Metadata-Version: 2.
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
2
|
Name: toil
|
|
3
|
-
Version: 8.
|
|
3
|
+
Version: 8.2.0
|
|
4
4
|
Summary: Pipeline management software for clusters.
|
|
5
5
|
Home-page: https://github.com/DataBiosphere/toil
|
|
6
6
|
Author: Benedict Paten and the Toil community
|
|
@@ -37,7 +37,7 @@ Requires-Dist: requests<=2.31.0
|
|
|
37
37
|
Requires-Dist: docker<8,>=6.1.0
|
|
38
38
|
Requires-Dist: urllib3<3,>=1.26.0
|
|
39
39
|
Requires-Dist: python-dateutil
|
|
40
|
-
Requires-Dist: psutil<
|
|
40
|
+
Requires-Dist: psutil<8,>=6.1.0
|
|
41
41
|
Requires-Dist: PyPubSub<5,>=4.0.3
|
|
42
42
|
Requires-Dist: addict<2.5,>=2.2.1
|
|
43
43
|
Requires-Dist: backports.zoneinfo[tzdata]; python_version < "3.9"
|
|
@@ -47,6 +47,7 @@ Requires-Dist: ruamel.yaml>=0.15
|
|
|
47
47
|
Requires-Dist: pyyaml<7,>=6
|
|
48
48
|
Requires-Dist: typing-extensions<5,>=4.6.2
|
|
49
49
|
Requires-Dist: coloredlogs<16,>=15
|
|
50
|
+
Requires-Dist: prompt_toolkit<4,>=3.0
|
|
50
51
|
Provides-Extra: aws
|
|
51
52
|
Requires-Dist: boto3-stubs[autoscaling,boto3,ec2,iam,s3,sdb,sts]<2,>=1.28.3.post2; extra == "aws"
|
|
52
53
|
Requires-Dist: mypy-boto3-iam<2,>=1.28.3.post2; extra == "aws"
|
|
@@ -81,9 +82,9 @@ Requires-Dist: wdlparse==0.1.0; extra == "wdl"
|
|
|
81
82
|
Requires-Dist: graphlib-backport==1.0; python_version < "3.9" and extra == "wdl"
|
|
82
83
|
Provides-Extra: server
|
|
83
84
|
Requires-Dist: connexion[swagger-ui]<4,>=2.10.0; extra == "server"
|
|
84
|
-
Requires-Dist: flask<
|
|
85
|
+
Requires-Dist: flask<2.3,>=2.0; extra == "server"
|
|
85
86
|
Requires-Dist: werkzeug<4,>=2.0; extra == "server"
|
|
86
|
-
Requires-Dist: flask-cors==5.0.
|
|
87
|
+
Requires-Dist: flask-cors==5.0.1; extra == "server"
|
|
87
88
|
Requires-Dist: gunicorn==23.0.0; extra == "server"
|
|
88
89
|
Requires-Dist: celery<6,>=5.1.0; extra == "server"
|
|
89
90
|
Requires-Dist: wes-service<5,>=4.0.0; extra == "server"
|
|
@@ -120,9 +121,9 @@ Requires-Dist: miniwdl==1.12.1; extra == "all"
|
|
|
120
121
|
Requires-Dist: wdlparse==0.1.0; extra == "all"
|
|
121
122
|
Requires-Dist: graphlib-backport==1.0; python_version < "3.9" and extra == "all"
|
|
122
123
|
Requires-Dist: connexion[swagger-ui]<4,>=2.10.0; extra == "all"
|
|
123
|
-
Requires-Dist: flask<
|
|
124
|
+
Requires-Dist: flask<2.3,>=2.0; extra == "all"
|
|
124
125
|
Requires-Dist: werkzeug<4,>=2.0; extra == "all"
|
|
125
|
-
Requires-Dist: flask-cors==5.0.
|
|
126
|
+
Requires-Dist: flask-cors==5.0.1; extra == "all"
|
|
126
127
|
Requires-Dist: gunicorn==23.0.0; extra == "all"
|
|
127
128
|
Requires-Dist: celery<6,>=5.1.0; extra == "all"
|
|
128
129
|
Requires-Dist: wes-service<5,>=4.0.0; extra == "all"
|
|
@@ -135,11 +136,16 @@ Dynamic: description
|
|
|
135
136
|
Dynamic: description-content-type
|
|
136
137
|
Dynamic: home-page
|
|
137
138
|
Dynamic: license
|
|
139
|
+
Dynamic: license-file
|
|
138
140
|
Dynamic: provides-extra
|
|
139
141
|
Dynamic: requires-dist
|
|
140
142
|
Dynamic: requires-python
|
|
141
143
|
Dynamic: summary
|
|
142
144
|
|
|
145
|
+
.. image:: https://flat.badgen.net/https/ucsc-ci.com/api/v4/projects/3/jobs/artifacts/master/raw/badges1.2/required.json%3Fjob=cwl_badge?icon=commonwl&label=CWL%201.2%20Conformance
|
|
146
|
+
:alt: Toil CWL 1.2 Conformance Badge
|
|
147
|
+
:target: https://github.com/common-workflow-language/cwl-v1.2/blob/main/CONFORMANCE_TESTS.md
|
|
148
|
+
|
|
143
149
|
.. image:: https://badges.gitter.im/bd2k-genomics-toil/Lobby.svg
|
|
144
150
|
:alt: Join the chat at https://gitter.im/bd2k-genomics-toil/Lobby
|
|
145
151
|
:target: https://gitter.im/bd2k-genomics-toil/Lobby?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge
|