core.serializers ================ .. py:module:: core.serializers .. autoapi-nested-parse:: Serializing data when going to and from the database. Classes ------- .. autoapisummary:: core.serializers.SerializeDistributorTask core.serializers.SerializeSwarmTask core.serializers.SerializeTaskInstance core.serializers.SerializeTaskInstanceErrorLog core.serializers.SerializeExecutorTaskInstanceErrorLog core.serializers.SerializeClientTool core.serializers.SerializeClientToolVersion core.serializers.SerializeClientTaskTemplate core.serializers.SerializeClientTaskTemplateVersion core.serializers.SerializeWorkflowRun core.serializers.SerializeClusterType core.serializers.SerializeCluster core.serializers.SerializeQueue core.serializers.SerializeTaskResourceUsage core.serializers.SerializeTaskTemplateResourceUsage core.serializers.SerializeDistributorArray core.serializers.SerializeDistributorWorkflow core.serializers.SerializeTaskResources core.serializers.SerializeTaskInstanceBatch Module Contents --------------- .. py:class:: SerializeDistributorTask Serialize the data to and from the database for an DistributorTask object. .. py:method:: to_wire(task_id: int, array_id: Optional[int], name: str, command: str, requested_resources: dict) -> tuple :staticmethod: Submitting the above args to the database for an DistributorTask object. .. py:method:: kwargs_from_wire(wire_tuple: tuple) -> dict :staticmethod: 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. .. py:class:: SerializeSwarmTask Serialize the data to and from the db for a Swarm Task. .. py:method:: to_wire(task_id: int, status: str) -> tuple :staticmethod: Submit task id and status to the database from a SwarmTask object. .. py:method:: kwargs_from_wire(wire_tuple: tuple) -> dict :staticmethod: Get task id and status for a SwarmTask. .. py:class:: SerializeTaskInstance Serialize the data to and from the database for an DistributorTaskInstance. .. py:method:: to_wire_distributor(task_instance_id: int, task_id: int, workflow_run_id: int, workflow_id: int, status: str, distributor_id: Union[str, None], task_resources_id: Optional[int] = None, array_id: Optional[int] = None, array_batch_num: Optional[int] = None, array_step_id: Optional[int] = None) -> tuple :staticmethod: Submit the above args for an DistributorTaskInstance object to the database. .. py:method:: kwargs_from_wire_distributor(wire_tuple: tuple) -> dict :staticmethod: Retrieve the DistributorTaskInstance information from the database. .. py:method:: 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 :staticmethod: Submit the above args for an DistributorTaskInstance object to the database. .. py:method:: kwargs_from_wire_worker_node(wire_tuple: tuple) -> dict :staticmethod: Retrieve the DistributorTaskInstance information from the database. .. py:class:: SerializeTaskInstanceErrorLog Serialize the data to and from the database for an TaskInstanceErrorLog. .. py:method:: to_wire(task_instance_error_log_id: int, error_time: datetime.datetime, description: str) -> tuple :staticmethod: Submit the args for an SerializeTaskInstanceErrorLog object to the database. .. py:method:: kwargs_from_wire(wire_tuple: tuple) -> dict :staticmethod: Retrieve the SerializeTaskInstanceErrorLog information from the database. .. py:class:: SerializeExecutorTaskInstanceErrorLog Serialize the data to and from the database for an ExecutorTaskInstanceErrorLog. .. py:method:: to_wire(task_instance_error_log_id: int, error_time: datetime.datetime, description: str) -> tuple :staticmethod: A to_wire method. Submit the above args for an SerializeExecutorTaskInstanceErrorLog object to the database. .. py:method:: kwargs_from_wire(wire_tuple: tuple) -> dict :staticmethod: Retrieve the SerializeExecutorTaskInstanceErrorLog information from the database. .. py:class:: SerializeClientTool Serialize the data to and from the database for a Tool object. .. py:method:: to_wire(id: int, name: str) -> tuple :staticmethod: Submit the id and name of a Tool to the database. .. py:method:: kwargs_from_wire(wire_tuple: tuple) -> dict :staticmethod: Get a Tool's information from the database. .. py:class:: SerializeClientToolVersion Serialize the data to and from the database for a ToolVersion. .. py:method:: to_wire(id: int, tool_id: int) -> tuple :staticmethod: Submit the id and tool_id for a Tool Version to the database. .. py:method:: kwargs_from_wire(wire_tuple: tuple) -> dict :staticmethod: Get the Tool Version information from thee database. .. py:class:: SerializeClientTaskTemplate Serialize the data to and from the database for a TaskTemplate. .. py:method:: to_wire(id: int, tool_version_id: int, template_name: str) -> tuple :staticmethod: Submit the TaskTemplate information for transfer over http. .. py:method:: kwargs_from_wire(wire_tuple: tuple) -> dict :staticmethod: Convert packed wire format to kwargs for use in services. .. py:class:: SerializeClientTaskTemplateVersion Serialize the data to and from the database for a TaskTemplateVersion. .. py:method:: 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] :staticmethod: Submit the TaskTemplateVersion information to the database. .. py:method:: kwargs_from_wire(wire_tuple: tuple) -> Dict :staticmethod: Get the TaskTemplateVersion info from the database. .. py:class:: SerializeWorkflowRun Serialize the data to and from the database for a WorkflowRun. .. py:method:: to_wire(id: int, workflow_id: int) -> tuple :staticmethod: Submit the WorkflowRun information to the database. .. py:method:: kwargs_from_wire(wire_tuple: tuple) -> dict :staticmethod: Get the WorkflowRun information from the database. .. py:class:: SerializeClusterType Serialize the data to and from the database for a ClusterType. .. py:method:: to_wire(id: int, name: str, package_location: str) -> tuple :staticmethod: Submit the ClusterType information to the database. .. py:method:: kwargs_from_wire(wire_tuple: tuple) -> dict :staticmethod: Get the Cluster information from the database. .. py:class:: SerializeCluster Serialize the data to and from the database for a Cluster. .. py:method:: to_wire(id: int, name: str, cluster_type_name: str, connection_parameters: str) -> tuple :staticmethod: Submit the Cluster information to the database. .. py:method:: kwargs_from_wire(wire_tuple: tuple) -> dict :staticmethod: Get the Cluster information from the database. .. py:class:: SerializeQueue Serialize the data to and from the database for a Queue. .. py:method:: to_wire(id: int, name: str, parameters: str) -> tuple :staticmethod: Submit the Queue information to the database. .. py:method:: kwargs_from_wire(wire_tuple: tuple) -> dict :staticmethod: Get the Queue information from the database. .. py:class:: SerializeTaskResourceUsage Serialize the data to and from the database for Task resource usage. .. py:method:: to_wire(num_attempts: Optional[int] = None, nodename: Optional[str] = None, runtime: Optional[int] = None, memory: Optional[int] = None) -> tuple :staticmethod: Submit the Task resource usage information to the database. .. py:method:: kwargs_from_wire(wire_tuple: tuple) -> dict :staticmethod: Get the Task resource usage information from the database. .. py:class:: SerializeTaskTemplateResourceUsage Serialize the data to and from the database for TaskTemplate resource usage. .. py:method:: to_wire(num_tasks: Optional[int] = None, min_mem: Optional[int] = None, max_mem: Optional[int] = None, mean_mem: Optional[float] = None, min_runtime: Optional[int] = None, max_runtime: Optional[int] = None, mean_runtime: Optional[float] = None, median_mem: Optional[float] = None, median_runtime: Optional[float] = None, ci_mem: Optional[List[Any]] = None, ci_runtime: Optional[List[Any]] = None) -> tuple :staticmethod: Submit the TaskTemplate resource usage information to the database. .. py:method:: kwargs_from_wire(wire_tuple: tuple) -> dict :staticmethod: Get the TaskTemplate resource usage information from the database. .. py:class:: SerializeDistributorArray Serialize the data to and from the database for DistributorArray. .. py:method:: to_wire(array_id: int, max_concurrently_running: int, name: str) -> tuple :staticmethod: Submit the TaskTemplate resource usage information to the database. .. py:method:: kwargs_from_wire(wire_tuple: tuple) -> dict :staticmethod: Get the TaskTemplate resource usage information from the database. .. py:class:: SerializeDistributorWorkflow Serialize the data to and from the database for DistributorWorkflow. .. py:method:: to_wire(workflow_id: int, dag_id: int, max_concurrently_running: int) -> tuple :staticmethod: Serialize the workflow metadata used in the distributor. .. py:method:: kwargs_from_wire(wire_tuple: tuple) -> dict :staticmethod: Deserialize the workflow metadata used in the distributor. .. py:class:: SerializeTaskResources Serialize the data to and from the database for Task resources. .. py:method:: to_wire(task_resources_id: int, queue_name: str, task_resources_type_id: str, requested_resources: str) -> tuple :staticmethod: Serialize the TaskResources metadata. .. py:method:: kwargs_from_wire(wire_tuple: tuple) -> dict :staticmethod: Deserialize the TaskResources metadata. .. py:class:: SerializeTaskInstanceBatch Serialize the data to and from the database for TaskInstance batch. .. py:method:: to_wire(array_id: int, array_name: str, array_batch_num: int, task_resources_id: int, task_instance_ids: List[int]) -> tuple :staticmethod: Serialize the TaskInstanceBatch metadata. .. py:method:: kwargs_from_wire(wire_tuple: tuple) -> dict :staticmethod: Deserialize the TaskInstanceBatch metadata.