daemon.stores.partial module

class daemon.stores.partial.PartialStore[source]

Bases: abc.ABC

A store spawned inside partial-daemon container

  • abstract add(\args, **kwargs*)[source]

    Add a new element to the store. This method needs to be overridden by the subclass

  • delete()[source]

    Terminates the object in the store & stops the server

    • Return type

      None

class daemon.stores.partial.PartialPodStore[source]

Bases: daemon.stores.partial.PartialStore

A Pod store spawned inside partial-daemon container

  • poddeployment_constructor(args)

    Build an implementation of a BasePod interface

    • Parameters

      args (Namespace) – deployment arguments parsed from the CLI.

      Return type

      Type[ForwardRef]

      Returns

      the created BaseDeployment

  • add(args, envs={}, \*kwargs*)[source]

    Starts a Pod in partial-daemon

    • Parameters

      • args (Namespace) – namespace args for the pod/deployment

      • envs (Optional[Dict]) – environment variables to be passed into partial pod/deployment

      • kwargs – keyword args

      Return type

      PartialStoreItem

      Returns

      Item describing the Pod object

class daemon.stores.partial.PartialDeploymentStore[source]

Bases: daemon.stores.partial.PartialPodStore

A Deployment store spawned inside partial-daemon container

  • poddeployment_constructor

    alias of jina.orchestrate.deployments.Deployment

  • async rolling_update(uses_with=None)[source]

    Perform rolling_update on current Deployment

    • Parameters

      uses_with (Optional[Dict]) – a Dictionary of arguments to restart the executor with

      Return type

      PartialStoreItem

      Returns

      Item describing the Flow object

  • async scale(replicas)[source]

    Scale the current Deployment :type replicas: int :param replicas: number of replicas for the Deployment :rtype: PartialStoreItem :return: Item describing the Flow object

class daemon.stores.partial.PartialFlowStore[source]

Bases: daemon.stores.partial.PartialStore

A Flow store spawned inside partial-daemon container

  • add(args, port_mapping=None, envs={}, \*kwargs*)[source]

    Starts a Flow in partial-daemon.

    • Parameters

      • args (Namespace) – namespace args for the flow

      • port_mapping (Optional[PortMappings]) – ports to be set

      • envs (Optional[Dict]) – environment variables to be passed into partial flow

      • kwargs – keyword args

      Return type

      PartialStoreItem

      Returns

      Item describing the Flow object

  • async rolling_update(deployment_name, uses_with=None)[source]

    Perform rolling_update on the Deployment in current Flow

    • Parameters

      • deployment_name (str) – Deployment in the Flow to be rolling updated

      • uses_with (Optional[Dict]) – a Dictionary of arguments to restart the executor with

      Return type

      PartialFlowItem

      Returns

      Item describing the Flow object

  • async scale(deployment_name, replicas)[source]

    Scale the Deployment in current Flow :type deployment_name: str :param deployment_name: Deployment to be scaled :type replicas: int :param replicas: number of replicas for the Deployment :rtype: PartialFlowItem :return: Item describing the Flow object