jina.peapods.runtimes.jinad.client

class jina.peapods.runtimes.jinad.client.DaemonClient(host, port, logger=None, timeout=5, **kwargs)[source]

Bases: object

Jina Daemon client.

Parameters
  • host (str) – the host address of jinad instance

  • port (int) – the port number of jinad instance

  • logger (Optional[JinaLogger]) – Jinalogger to log information.

  • timeout (int) – stop waiting for a response after a given number of seconds with the timeout parameter.

kind = 'pea'
property is_alive

Return True if jinad is alive at remote

Return type

bool

Returns

True if jinad is alive at remote else false

get_status(identity)[source]

Get status of the remote Pea / Pod

Parameters

identity (str) – UUID string based identity for the Pea

Raises

requests.exceptions.RequestException

Returns

json response of the remote Pea / Pod status

Return type

Dict

upload(dependencies, workspace_id=None)[source]

Upload local file dependencies to remote server by extracting from the pea_args

Parameters
  • dependencies (Sequence[str]) – file dependencies

  • workspace_id (str) – Workspace to which the files will get uploaded, defaults to None

Raises

requests.exceptions.RequestException

Returns

json response for upload

Return type

str

create(args)[source]

Create a remote Pea / Pod

Parameters

args (Namespace) – the arguments for remote Pea

Raises

requests.exceptions.RequestException

Returns

the identity of the spawned Pea / Pod

Return type

Optional[str]

async logstream(workspace_id, log_id)[source]

Websocket log stream from remote Pea / Pod

Parameters
  • workspace_id (str) – the identity of the workspace

  • log_id (str) – the identity of that Pea / Pod

delete(remote_id, **kwargs)[source]

Delete a remote pea/pod

Parameters
  • remote_id (str) – the identity of that pea/pod

  • kwargs – keyword arguments

Return type

bool

Returns

True if the deletion is successful

class jina.peapods.runtimes.jinad.client.PeaDaemonClient(host, port, logger=None, timeout=5, **kwargs)[source]

Bases: jina.peapods.runtimes.jinad.client.DaemonClient

Pea API, we might have different endpoints for peas & pods later

kind = 'pea'
class jina.peapods.runtimes.jinad.client.PodDaemonClient(host, port, logger=None, timeout=5, **kwargs)[source]

Bases: jina.peapods.runtimes.jinad.client.DaemonClient

Pod API, we might have different endpoints for peas & pods later

kind = 'pod'