netunicorn.base.deployment.Deployment

class Deployment(node, pipeline, keep_alive_timeout_minutes=10, cleanup=True)[source]

Bases: object

Single deployment of an execution graph on a node.

Parameters:
  • node (Node) – Node to deploy execution graph on

  • pipeline (ExecutionGraph) – pipeline (execution graph) to deploy

  • keep_alive_timeout_minutes (int, default: 10) – time to wait for executor update before timeout

  • cleanup (bool, default: True) – whether to remove artifacts (e.g., Docker image and containers) after execution

Attributes

node

Node to deploy execution graph on

prepared

if False, deployment is not prepared yet or failed during preparation

executor_id

ID of executor on node

error

if deployment failed, this field contains error

execution_graph

Serialized ExecutionGraph to be deployed

environment_definition

Environment definition to use for deployment

keep_alive_timeout_minutes

time to wait for executor update before timeout

cleanup

if True, corresponding artifacts (Docker image and containers) will be removed after execution

Methods

from_json

Create Deployment from JSON representation

node: Node[source]

Node to deploy execution graph on

prepared: bool[source]

if False, deployment is not prepared yet or failed during preparation

executor_id: str[source]

ID of executor on node

error: Optional[Exception][source]

if deployment failed, this field contains error

environment_definition: EnvironmentDefinition[source]

Environment definition to use for deployment

keep_alive_timeout_minutes: int[source]

time to wait for executor update before timeout

cleanup: bool[source]

if True, corresponding artifacts (Docker image and containers) will be removed after execution

execution_graph: bytes[source]

Serialized ExecutionGraph to be deployed

classmethod from_json(data)[source]

Create Deployment from JSON representation

Parameters:

data (DeploymentRepresentation) – JSON representation of Deployment

Returns:

Deployment – Deserialized Deployment