toil.worker

Module Contents

Classes

StatsDict

Subclass of MagicExpando for type-checking purposes.

Functions

nextChainable(predecessor, job_store, config)

Returns the next chainable job's JobDescription after the given predecessor

workerScript(job_store, config, job_name, job_store_id)

Worker process script, runs a job.

parse_args(args)

Parse command-line arguments to the worker.

in_contexts(contexts)

Unpickle and enter all the pickled, base64-encoded context managers in the

main([argv])

Attributes

logger

toil.worker.logger
class toil.worker.StatsDict(*args, **kwargs)[source]

Bases: toil.lib.expando.MagicExpando

Subclass of MagicExpando for type-checking purposes.

jobs: List[toil.lib.expando.MagicExpando]
toil.worker.nextChainable(predecessor, job_store, config)[source]

Returns the next chainable job’s JobDescription after the given predecessor JobDescription, if one exists, or None if the chain must terminate.

Parameters:
Return type:

Optional[toil.job.JobDescription]

toil.worker.workerScript(job_store, config, job_name, job_store_id, redirect_output_to_log_file=True, local_worker_temp_dir=None, debug_flags=None)[source]

Worker process script, runs a job.

Parameters:
  • job_store (toil.jobStores.abstractJobStore.AbstractJobStore) – The JobStore to fetch JobDescriptions from.

  • config (toil.common.Config) – The configuration for the current run.

  • job_name (str) – The “job name” (a user friendly name) of the job to be run

  • job_store_id (str) – The job store ID of the job to be run

  • redirect_output_to_log_file (bool) – If False, log directly to the console instead of capturing job output.

  • local_worker_temp_dir (Optional[str]) – The directory for the worker to work in. May be recursively removed after the job runs.

  • debug_flags (Optional[Set[str]]) – Flags to set on each job before running it.

Return int:

1 if a job failed, or 0 if all jobs succeeded

Return type:

int

toil.worker.parse_args(args)[source]

Parse command-line arguments to the worker.

Parameters:

args (List[str])

Return type:

Any

toil.worker.in_contexts(contexts)[source]

Unpickle and enter all the pickled, base64-encoded context managers in the given list. Then do the body, then leave them all.

Parameters:

contexts (List[str])

Return type:

Iterator[None]

toil.worker.main(argv=None)[source]
Parameters:

argv (Optional[List[str]])

Return type:

None