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[source]

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

static to_wire(task_id: int, array_id: int, name: str, command: str, requested_resources: dict) tuple[source]

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

static kwargs_from_wire(wire_tuple: tuple) dict[source]

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[source]

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

static to_wire(task_id: int, status: str) tuple[source]

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

static kwargs_from_wire(wire_tuple: tuple) dict[source]

Get task id and status for a SwarmTask.

class core.serializers.SerializeTaskInstance[source]

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[source]

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

static kwargs_from_wire_distributor(wire_tuple: tuple) dict[source]

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[source]

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

static kwargs_from_wire_worker_node(wire_tuple: tuple) dict[source]

Retrieve the DistributorTaskInstance information from the database.

class core.serializers.SerializeTaskInstanceErrorLog[source]

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[source]

Submit the args for an SerializeTaskInstanceErrorLog object to the database.

static kwargs_from_wire(wire_tuple: tuple) dict[source]

Retrieve the SerializeTaskInstanceErrorLog information from the database.

class core.serializers.SerializeExecutorTaskInstanceErrorLog[source]

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[source]

A to_wire method.

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

static kwargs_from_wire(wire_tuple: tuple) dict[source]

Retrieve the SerializeExecutorTaskInstanceErrorLog information from the database.

class core.serializers.SerializeClientTool[source]

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

static to_wire(id: int, name: str) tuple[source]

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

static kwargs_from_wire(wire_tuple: tuple) dict[source]

Get a Tool’s information from the database.

class core.serializers.SerializeClientToolVersion[source]

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

static to_wire(id: int, tool_id: int) tuple[source]

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

static kwargs_from_wire(wire_tuple: tuple) dict[source]

Get the Tool Version information from thee database.

class core.serializers.SerializeClientTaskTemplate[source]

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

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

Submit the TaskTemplate information for transfer over http.

static kwargs_from_wire(wire_tuple: tuple) dict[source]

Convert packed wire format to kwargs for use in services.

class core.serializers.SerializeClientTaskTemplateVersion[source]

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][source]

Submit the TaskTemplateVersion information to the database.

static kwargs_from_wire(wire_tuple: tuple) Dict[source]

Get the TaskTemplateVersion info from the database.

class core.serializers.SerializeWorkflowRun[source]

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

static to_wire(id: int, workflow_id: int) tuple[source]

Submit the WorkflowRun information to the database.

static kwargs_from_wire(wire_tuple: tuple) dict[source]

Get the WorkflowRun information from the database.

class core.serializers.SerializeClusterType[source]

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

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

Submit the ClusterType information to the database.

static kwargs_from_wire(wire_tuple: tuple) dict[source]

Get the Cluster information from the database.

class core.serializers.SerializeCluster[source]

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[source]

Submit the Cluster information to the database.

static kwargs_from_wire(wire_tuple: tuple) dict[source]

Get the Cluster information from the database.

class core.serializers.SerializeQueue[source]

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

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

Submit the Queue information to the database.

static kwargs_from_wire(wire_tuple: tuple) dict[source]

Get the Queue information from the database.

class core.serializers.SerializeTaskResourceUsage[source]

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[source]

Submit the Task resource usage information to the database.

static kwargs_from_wire(wire_tuple: tuple) dict[source]

Get the Task resource usage information from the database.

class core.serializers.SerializeTaskTemplateResourceUsage[source]

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[source]

Submit the TaskTemplate resource usage information to the database.

static kwargs_from_wire(wire_tuple: tuple) dict[source]

Get the TaskTemplate resource usage information from the database.

class core.serializers.SerializeDistributorArray[source]

Serialize the data to and from the database for DistributorArray.

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

Submit the TaskTemplate resource usage information to the database.

static kwargs_from_wire(wire_tuple: tuple) dict[source]

Get the TaskTemplate resource usage information from the database.

class core.serializers.SerializeDistributorWorkflow[source]

Serialize the data to and from the database for DistributorWorkflow.

static to_wire(workflow_id: int, dag_id: int, max_concurrently_running: int) tuple[source]

Serialize the workflow metadata used in the distributor.

static kwargs_from_wire(wire_tuple: tuple) dict[source]

Deserialize the workflow metadata used in the distributor.

class core.serializers.SerializeTaskResources[source]

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[source]

Serialize the TaskResources metadata.

static kwargs_from_wire(wire_tuple: tuple) dict[source]

Deserialize the TaskResources metadata.

class core.serializers.SerializeTaskInstanceBatch[source]

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[source]

Serialize the TaskInstanceBatch metadata.

static kwargs_from_wire(wire_tuple: tuple) dict[source]

Deserialize the TaskInstanceBatch metadata.