-
Notifications
You must be signed in to change notification settings - Fork 247
Add --runDir option; make --workDir/--coordinationDir create-if-missing (#5516) #5560
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
c0b50ec
422b251
0b37e2f
3255854
6e76eba
a62076f
b13080e
6e8f230
53c262c
c5ae340
de58bc2
bb9954d
b6f3473
16565c1
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -34,6 +34,9 @@ | |
| BatchJobExitReason, | ||
| UpdatedBatchJobInfo, | ||
| ) | ||
| from toil.batchSystems.abstractGridEngineBatchSystem import ( | ||
| AbstractGridEngineBatchSystem, | ||
| ) | ||
| from toil.bus import ( | ||
| JobCompletedMessage, | ||
| JobFailedMessage, | ||
|
|
@@ -262,6 +265,16 @@ def run(self) -> Any: | |
|
|
||
| :return: The return value of the root job's run function. | ||
| """ | ||
|
|
||
| if isinstance(self.batchSystem, AbstractGridEngineBatchSystem): | ||
| # The batch system isn't available yet when Toil logs the other | ||
| # resolved run paths (see Toil._log_resolved_paths), so log this | ||
| # one here instead, now that it exists. Only grid batch systems | ||
| # actually write their own logs to this directory. | ||
| logger.info( | ||
| "Resolved batch logs dir: %s", self.batchSystem.get_batch_logs_dir() | ||
| ) | ||
|
Comment on lines
+269
to
+276
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We could leave it like this, but it would be nicer if, if only some batch systems use a batch logs directory, we exposed that in the batch system API itself (maybe by making |
||
|
|
||
| self.jobStore.write_kill_flag(kill=False) | ||
|
|
||
| with enlighten.get_manager( | ||
|
|
@@ -1593,19 +1606,21 @@ def process_finished_job_description( | |
| # If the batch system returned a non-zero exit code then the worker | ||
| # is assumed not to have captured the failure of the job, so we | ||
| # reduce the try count here. | ||
| if replacement_job.logJobStoreFileID is None: | ||
| logger.warning( | ||
| "No log file is present, despite job failing: %s", | ||
| replacement_job, | ||
| ) | ||
|
|
||
| if batch_system_id is not None: | ||
| # Search for the batch system's own logs first, so the | ||
| # "no log file" warning below is only shown when Toil | ||
| # genuinely found nothing, and can say so specifically. | ||
| found_batch_system_log = False | ||
| if ( | ||
| isinstance(self.batchSystem, AbstractGridEngineBatchSystem) | ||
| and batch_system_id is not None | ||
| ): | ||
| # Look for any standard output/error files created by the batch system. | ||
| # They will only appear if the batch system actually supports | ||
| # returning logs to the machine that submitted jobs, or if | ||
| # --workDir / TOIL_WORKDIR is on a shared file system. | ||
| # They live directly in the Toil work directory because that is | ||
| # guaranteed to exist on the leader and workers. | ||
| # They live in --batchLogsDir, or the Toil work directory | ||
| # if that isn't set. | ||
| file_list = glob.glob( | ||
| self.batchSystem.format_std_out_err_glob(batch_system_id) | ||
| ) | ||
|
|
@@ -1620,6 +1635,7 @@ def process_finished_job_description( | |
| else: | ||
| with log_stream: | ||
| if os.path.getsize(log_file) > 0: | ||
| found_batch_system_log = True | ||
| StatsAndLogging.logWithFormatting( | ||
| f'Log from job "{job_store_id}"', | ||
| log_stream, | ||
|
|
@@ -1655,6 +1671,27 @@ def process_finished_job_description( | |
| % log_file | ||
| ) | ||
|
|
||
| if ( | ||
| replacement_job.logJobStoreFileID is None | ||
| and not found_batch_system_log | ||
| ): | ||
| # Alert the user that the worker failed to report in | ||
| # like it was supposed to. Only mention batch system | ||
| # logs for batch systems that actually use them. | ||
| if isinstance(self.batchSystem, AbstractGridEngineBatchSystem): | ||
| logger.warning( | ||
| "No log file is present, despite job failing: %s. " | ||
| "Toil looked for the batch system's own logs " | ||
| "(see --batchLogsDir) but found none; check the " | ||
| "batch system's own tools or logs directly.", | ||
| replacement_job, | ||
| ) | ||
| else: | ||
| logger.warning( | ||
| "No log file is present, despite job failing: %s.", | ||
| replacement_job, | ||
| ) | ||
|
|
||
| # Tell the job to reset itself after a failure. | ||
| # It needs to know the failure reason if available; some are handled specially. | ||
| replacement_job.setupJobAfterFailure( | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.