core.serializers

Serializing data when going to and from the database.

Classes

SerializeDistributorTask

Serialize the data to and from the database for an DistributorTask object.

SerializeSwarmTask

Serialize the data to and from the db for a Swarm Task.

SerializeTaskInstance

Serialize the data to and from the database for an DistributorTaskInstance.

SerializeTaskInstanceErrorLog

Serialize the data to and from the database for an TaskInstanceErrorLog.

SerializeExecutorTaskInstanceErrorLog

Serialize the data to and from the database for an ExecutorTaskInstanceErrorLog.

SerializeClientTool

Serialize the data to and from the database for a Tool object.

SerializeClientToolVersion

Serialize the data to and from the database for a ToolVersion.

SerializeClientTaskTemplate

Serialize the data to and from the database for a TaskTemplate.

SerializeClientTaskTemplateVersion

Serialize the data to and from the database for a TaskTemplateVersion.

SerializeWorkflowRun

Serialize the data to and from the database for a WorkflowRun.

SerializeClusterType

Serialize the data to and from the database for a ClusterType.

SerializeCluster

Serialize the data to and from the database for a Cluster.

SerializeQueue

Serialize the data to and from the database for a Queue.

SerializeTaskResourceUsage

Serialize the data to and from the database for Task resource usage.

SerializeTaskTemplateResourceUsage

Serialize the data to and from the database for TaskTemplate resource usage.

SerializeDistributorArray

Serialize the data to and from the database for DistributorArray.

SerializeDistributorWorkflow

Serialize the data to and from the database for DistributorWorkflow.

SerializeTaskResources

Serialize the data to and from the database for Task resources.

SerializeTaskInstanceBatch

Serialize the data to and from the database for TaskInstance batch.

Module Contents

class core.serializers.SerializeDistributorTask

Serialize the data to and from the database for an DistributorTask object.

static to_wire(task_id: int, array_id: int | None, name: str, command: str, requested_resources: dict) tuple

Submitting the above args to the database for an DistributorTask object.

static kwargs_from_wire(wire_tuple: tuple) dict

Coerce types for all nullables that are cast using ast.literal_eval.

It is a potential security issue but was the only solution I could find to turning the data into json twice.

class core.serializers.SerializeSwarmTask

Serialize the data to and from the db for a Swarm Task.

static to_wire(task_id: int, status: str) tuple

Submit task id and status to the database from a SwarmTask object.

static kwargs_from_wire(wire_tuple: tuple) dict

Get task id and status for a SwarmTask.

class core.serializers.SerializeTaskInstance

Serialize the data to and from the database for an DistributorTaskInstance.

static to_wire_distributor(task_instance_id: int, task_id: int, workflow_run_id: int, workflow_id: int, status: str, distributor_id: str | None, task_resources_id: int | None = None, array_id: int | None = None, array_batch_num: int | None = None, array_step_id: int | None = None) tuple

Submit the above args for an DistributorTaskInstance object to the database.

static kwargs_from_wire_distributor(wire_tuple: tuple) dict

Retrieve the DistributorTaskInstance information from the database.

static to_wire_worker_node(task_instance_id: int, status: str, workflow_run_id: int, task_id: int, name: str, command: str, workflow_id: int, stdout_dir: str, stderr_dir: str) tuple

Submit the above args for an DistributorTaskInstance object to the database.

static kwargs_from_wire_worker_node(wire_tuple: tuple) dict

Retrieve the DistributorTaskInstance information from the database.

class core.serializers.SerializeTaskInstanceErrorLog

Serialize the data to and from the database for an TaskInstanceErrorLog.

static to_wire(task_instance_error_log_id: int, error_time: datetime.datetime, description: str) tuple

Submit the args for an SerializeTaskInstanceErrorLog object to the database.

static kwargs_from_wire(wire_tuple: tuple) dict

Retrieve the SerializeTaskInstanceErrorLog information from the database.

class core.serializers.SerializeExecutorTaskInstanceErrorLog

Serialize the data to and from the database for an ExecutorTaskInstanceErrorLog.

static to_wire(task_instance_error_log_id: int, error_time: datetime.datetime, description: str) tuple

A to_wire method.

Submit the above args for an SerializeExecutorTaskInstanceErrorLog object to the database.

static kwargs_from_wire(wire_tuple: tuple) dict

Retrieve the SerializeExecutorTaskInstanceErrorLog information from the database.

class core.serializers.SerializeClientTool

Serialize the data to and from the database for a Tool object.

static to_wire(id: int, name: str) tuple

Submit the id and name of a Tool to the database.

static kwargs_from_wire(wire_tuple: tuple) dict

Get a Tool’s information from the database.

class core.serializers.SerializeClientToolVersion

Serialize the data to and from the database for a ToolVersion.

static to_wire(id: int, tool_id: int) tuple

Submit the id and tool_id for a Tool Version to the database.

static kwargs_from_wire(wire_tuple: tuple) dict

Get the Tool Version information from thee database.

class core.serializers.SerializeClientTaskTemplate

Serialize the data to and from the database for a TaskTemplate.

static to_wire(id: int, tool_version_id: int, template_name: str) tuple

Submit the TaskTemplate information for transfer over http.

static kwargs_from_wire(wire_tuple: tuple) dict

Convert packed wire format to kwargs for use in services.

class core.serializers.SerializeClientTaskTemplateVersion

Serialize the data to and from the database for a TaskTemplateVersion.

static to_wire(task_template_version_id: int, command_template: str, node_args: List[str], task_args: List[str], op_args: List[str], id_name_map: dict, task_template_id: int) Tuple[int, str, List[str], List[str], List[str], dict, int]

Submit the TaskTemplateVersion information to the database.

static kwargs_from_wire(wire_tuple: tuple) Dict

Get the TaskTemplateVersion info from the database.

class core.serializers.SerializeWorkflowRun

Serialize the data to and from the database for a WorkflowRun.

static to_wire(id: int, workflow_id: int) tuple

Submit the WorkflowRun information to the database.

static kwargs_from_wire(wire_tuple: tuple) dict

Get the WorkflowRun information from the database.

class core.serializers.SerializeClusterType

Serialize the data to and from the database for a ClusterType.

static to_wire(id: int, name: str, package_location: str) tuple

Submit the ClusterType information to the database.

static kwargs_from_wire(wire_tuple: tuple) dict

Get the Cluster information from the database.

class core.serializers.SerializeCluster

Serialize the data to and from the database for a Cluster.

static to_wire(id: int, name: str, cluster_type_name: str, connection_parameters: str) tuple

Submit the Cluster information to the database.

static kwargs_from_wire(wire_tuple: tuple) dict

Get the Cluster information from the database.

class core.serializers.SerializeQueue

Serialize the data to and from the database for a Queue.

static to_wire(id: int, name: str, parameters: str) tuple

Submit the Queue information to the database.

static kwargs_from_wire(wire_tuple: tuple) dict

Get the Queue information from the database.

class core.serializers.SerializeTaskResourceUsage

Serialize the data to and from the database for Task resource usage.

static to_wire(num_attempts: int | None = None, nodename: str | None = None, runtime: int | None = None, memory: int | None = None) tuple

Submit the Task resource usage information to the database.

static kwargs_from_wire(wire_tuple: tuple) dict

Get the Task resource usage information from the database.

class core.serializers.SerializeTaskTemplateResourceUsage

Serialize the data to and from the database for TaskTemplate resource usage.

static to_wire(num_tasks: int | None = None, min_mem: int | None = None, max_mem: int | None = None, mean_mem: float | None = None, min_runtime: int | None = None, max_runtime: int | None = None, mean_runtime: float | None = None, median_mem: float | None = None, median_runtime: float | None = None, ci_mem: List[Any] | None = None, ci_runtime: List[Any] | None = None) tuple

Submit the TaskTemplate resource usage information to the database.

static kwargs_from_wire(wire_tuple: tuple) dict

Get the TaskTemplate resource usage information from the database.

class core.serializers.SerializeDistributorArray

Serialize the data to and from the database for DistributorArray.

static to_wire(array_id: int, max_concurrently_running: int, name: str) tuple

Submit the TaskTemplate resource usage information to the database.

static kwargs_from_wire(wire_tuple: tuple) dict

Get the TaskTemplate resource usage information from the database.

class core.serializers.SerializeDistributorWorkflow

Serialize the data to and from the database for DistributorWorkflow.

static to_wire(workflow_id: int, dag_id: int, max_concurrently_running: int) tuple

Serialize the workflow metadata used in the distributor.

static kwargs_from_wire(wire_tuple: tuple) dict

Deserialize the workflow metadata used in the distributor.

class core.serializers.SerializeTaskResources

Serialize the data to and from the database for Task resources.

static to_wire(task_resources_id: int, queue_name: str, task_resources_type_id: str, requested_resources: str) tuple

Serialize the TaskResources metadata.

static kwargs_from_wire(wire_tuple: tuple) dict

Deserialize the TaskResources metadata.

class core.serializers.SerializeTaskInstanceBatch

Serialize the data to and from the database for TaskInstance batch.

static to_wire(array_id: int, array_name: str, array_batch_num: int, task_resources_id: int, task_instance_ids: List[int]) tuple

Serialize the TaskInstanceBatch metadata.

static kwargs_from_wire(wire_tuple: tuple) dict

Deserialize the TaskInstanceBatch metadata.