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

Return type

PartialStoreItem

delete()[source]

Terminates the object in the store & stops the server

Return type

None

class daemon.stores.partial.PartialPeaStore[source]

Bases: daemon.stores.partial.PartialStore

A Pea store spawned inside partial-daemon container

peapod_cls

alias of jina.peapods.peas.BasePea

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

Starts a Pea in partial-daemon

Parameters
  • args (Namespace) – namespace args for the pea/pod

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

  • kwargs – keyword args

Return type

PartialStoreItem

Returns

Item describing the Pea object

class daemon.stores.partial.PartialPodStore[source]

Bases: daemon.stores.partial.PartialPeaStore

A Pod store spawned inside partial-daemon container

peapod_cls

alias of jina.peapods.pods.Pod

async rolling_update(uses_with=None)[source]

Perform rolling_update on current Pod

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 Pod

Parameters

replicas (int) – number of replicas for the Pod

Return type

PartialStoreItem

Returns

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

rolling_update(pod_name, uses_with=None)[source]

Perform rolling_update on the Pod in current Flow

Parameters
  • pod_name (str) – Pod 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

scale(pod_name, replicas)[source]

Scale the Pod in current Flow

Parameters
  • pod_name (str) – Pod to be scaled

  • replicas (int) – number of replicas for the Pod

Return type

PartialFlowItem

Returns

Item describing the Flow object