toil.lib.dockstore¶
Contains functions for integrating Toil with UCSC Dockstore, for reporting metrics.
For basic TRS functionality for fetching workflows, see trs.py.
Attributes¶
Classes¶
Representation of the cost of running something. |
|
Dockstore metrics data for a workflow or task run. |
|
Dockstore metrics data for all the tasks in a workflow. |
Functions¶
|
Make sure the given execution ID is in Dockstore format and will be accepted by Dockstore. |
|
Pack up per-workflow metrics into a format that can be submitted to Dockstore. |
|
Pack up metrics for a single task execution in a format that can be used in a Dockstore submission. |
|
Pack up metrics for all the tasks in a workflow execution into a format that can be submitted to Dockstore. |
|
Send packed workflow and/or task metrics to Dockstore. |
|
Get the URL where a workflow metrics object (for a workflow, or for a set of tasks) can be fetched back from. |
Module Contents¶
- toil.lib.dockstore.logger¶
- toil.lib.dockstore.DEFAULT_DOCKSTORE_TOKEN = '2bff46294daddef6df185452b04db6143ea8a59f52ee3c325d3e1df418511b7d'¶
- toil.lib.dockstore.DOCKSTORE_TOKEN¶
- toil.lib.dockstore.DOCKSTORE_PLATFORM = 'TOIL'¶
- toil.lib.dockstore.ExecutionStatus¶
- class toil.lib.dockstore.Cost[source]¶
Bases:
TypedDict
Representation of the cost of running something.
- class toil.lib.dockstore.RunExecution[source]¶
Bases:
TypedDict
Dockstore metrics data for a workflow or task run.
- executionStatus: ExecutionStatus¶
Did the execution work?
- executionTime: typing_extensions.NotRequired[str]¶
Total time of the run in ISO 8601 duration format.
- class toil.lib.dockstore.TaskExecutions[source]¶
Bases:
TypedDict
Dockstore metrics data for all the tasks in a workflow.
- taskExecutions: list[RunExecution]¶
Individual executions of each task in the workflow.
- toil.lib.dockstore.ensure_valid_id(execution_id)[source]¶
Make sure the given execution ID is in Dockstore format and will be accepted by Dockstore.
Must be alphanumeric (with internal underscores allowed) and <100 characters long.
- Raises:
ValueError – if the ID is not in the right format
- Parameters:
execution_id (str)
- Return type:
None
- toil.lib.dockstore.pack_workflow_metrics(execution_id, start_time, runtime, succeeded, job_store_type=None, batch_system=None, caching=None, toil_version=None, python_version=None, platform_system=None, platform_machine=None)[source]¶
Pack up per-workflow metrics into a format that can be submitted to Dockstore.
- Parameters:
execution_id (str) – Unique ID for the workflow execution. Must be in Dockstore format.
start_time (float) – Execution start time in seconds since the Unix epoch.
rutime – Execution duration in seconds.
jobstore_type – Kind of job store used, like “file” or “aws”.
batch_system (Optional[str]) – Python class name implementing the batch system used.
caching (Optional[bool]) – Whether Toil filestore-level cahcing was used.
toil_version (Optional[str]) – Version of Toil used (without any Git hash).
python_version (Optional[str]) – Version of Python used.
platform_system (Optional[str]) – Operating system type (like “Darwin” or “Linux”).
platform_machine (Optional[str]) – Machine architecture of the leader (like “AMD64”).
runtime (float)
succeeded (bool)
job_store_type (Optional[str])
- Return type:
- toil.lib.dockstore.pack_single_task_metrics(execution_id, start_time, runtime, succeeded, job_name=None, cores=None, cpu_seconds=None, memory_bytes=None, disk_bytes=None)[source]¶
Pack up metrics for a single task execution in a format that can be used in a Dockstore submission.
- Parameters:
execution_id (str) – Unique ID for the workflow execution. Must be in Dockstore format.
start_time (float) – Execution start time in seconds since the Unix epoch.
rutime – Execution duration in seconds.
succeeded (bool) – Whether the execution succeeded.
job_name (Optional[str]) – Name of the job within the workflow.
cores (Optional[float]) – CPU cores allocated to the job.
cpu_seconds (Optional[float]) – CPU seconds consumed by the job.
memory_bytes (Optional[int]) – Memory consumed by the job in bytes.
disk_bytes (Optional[int]) – Disk space consumed by the job in bytes.
runtime (float)
- Return type:
- toil.lib.dockstore.pack_workflow_task_set_metrics(execution_id, start_time, tasks)[source]¶
Pack up metrics for all the tasks in a workflow execution into a format that can be submitted to Dockstore.
- Parameters:
execution_id (str) – Unique ID for the workflow execution. Must be in Dockstore format.
start_time (float) – Execution start time for the overall workflow execution in seconds since the Unix epoch.
tasks (list[RunExecution]) – Packed tasks from pack_single_task_metrics()
- Return type:
- toil.lib.dockstore.send_metrics(trs_workflow_id, trs_version, workflow_runs, workflow_task_sets)[source]¶
Send packed workflow and/or task metrics to Dockstore.
- Parameters:
workflow_runs (list[RunExecution]) – list of packed metrics objects for each workflow.
workflow_task_sets (list[TaskExecutions]) – list of packed metrics objects for the tasks in each workflow. Each workflow should have one entry containing all its tasks. Does not have to be the same order/set of workflows as workflow_runs.
trs_workflow_id (str)
trs_version (str)
- Raises:
requests.HTTPError – if Dockstore does not accept the metrics.
- Return type:
None