toil.server.wes.abstract_backend¶
Attributes¶
Exceptions¶
Raised when the requested workflow version is not implemented. |
|
Raised when the request is malformed. |
|
Raised when the requested run ID is not found. |
|
Raised when the requested workflow is not in the expected state. |
|
Raised when the request is forbidden. |
|
Raised when an internal error occurred during the execution of the workflow. |
Classes¶
A class to represent a GA4GH Workflow Execution Service (WES) API backend. |
Functions¶
|
Make a temporary directory like tempfile.mkdtemp, but with relaxed permissions. |
|
This decorator catches errors from the wrapped function and returns a JSON |
Module Contents¶
- toil.server.wes.abstract_backend.mkdtemp(suffix=None, prefix=None, dir=None)¶
Make a temporary directory like tempfile.mkdtemp, but with relaxed permissions.
The permissions on the directory will be 711 instead of 700, allowing the group and all other users to traverse the directory. This is necessary if the directory is on NFS and the Docker daemon would like to mount it or a file inside it into a container, because on NFS even the Docker daemon appears bound by the file permissions.
See <https://github.com/DataBiosphere/toil/issues/4644>, and <https://stackoverflow.com/a/67928880> which talks about a similar problem but in the context of user namespaces.
- toil.server.wes.abstract_backend.logger¶
- toil.server.wes.abstract_backend.TaskLog¶
- exception toil.server.wes.abstract_backend.VersionNotImplementedException(wf_type, version=None, supported_versions=None)¶
Bases:
ExceptionRaised when the requested workflow version is not implemented.
- exception toil.server.wes.abstract_backend.MalformedRequestException(message)¶
Bases:
ExceptionRaised when the request is malformed.
- Parameters:
message (str)
- exception toil.server.wes.abstract_backend.WorkflowNotFoundException¶
Bases:
ExceptionRaised when the requested run ID is not found.
- exception toil.server.wes.abstract_backend.WorkflowConflictException(run_id)¶
Bases:
ExceptionRaised when the requested workflow is not in the expected state.
- Parameters:
run_id (str)
- exception toil.server.wes.abstract_backend.OperationForbidden(message)¶
Bases:
ExceptionRaised when the request is forbidden.
- Parameters:
message (str)
- exception toil.server.wes.abstract_backend.WorkflowExecutionException(message)¶
Bases:
ExceptionRaised when an internal error occurred during the execution of the workflow.
- Parameters:
message (str)
- toil.server.wes.abstract_backend.handle_errors(func)¶
This decorator catches errors from the wrapped function and returns a JSON formatted error message with the appropriate status code defined by the GA4GH WES spec.
- Parameters:
func (Callable[Ellipsis, Any])
- Return type:
Callable[Ellipsis, Any]
- class toil.server.wes.abstract_backend.WESBackend(options)¶
A class to represent a GA4GH Workflow Execution Service (WES) API backend. Intended to be inherited. Subclasses should implement all abstract methods to handle user requests when they hit different endpoints.
- Parameters:
options (List[str])
- resolve_operation_id(operation_id)¶
Map an operationId defined in the OpenAPI or swagger yaml file to a function.
- Parameters:
operation_id (str) – The operation ID defined in the specification.
- Returns:
A function that should be called when the given endpoint is reached.
- Return type:
Any
- abstract get_service_info()¶
Get information about the Workflow Execution Service.
GET /service-info
- Return type:
Dict[str, Any]
- abstract list_runs(page_size=None, page_token=None)¶
List the workflow runs.
GET /runs
- abstract run_workflow()¶
Run a workflow. This endpoint creates a new workflow run and returns a RunId to monitor its progress.
POST /runs
- abstract get_run_log(run_id)¶
Get detailed info about a workflow run.
GET /runs/{run_id}
- abstract cancel_run(run_id)¶
Cancel a running workflow.
POST /runs/{run_id}/cancel
- abstract get_run_status(run_id)¶
Get quick status info about a workflow run, returning a simple result with the overall state of the workflow run.
GET /runs/{run_id}/status
- static log_for_run(run_id, message)¶
- collect_attachments(run_id, temp_dir)¶
Collect attachments from the current request by staging uploaded files to temp_dir, and return the temp_dir and parsed body of the request.