daemon.api.dependencies module

class daemon.api.dependencies.FlowDepends(workspace_id, filename)[source]

Bases: object

Validates & Sets host/port dependencies during Flow creation/update

localpath()[source]

Validates local filepath in workspace from filename. Raise 404 if filepath doesn’t exist in workspace.

Return type

Path

Returns

filepath for flow yaml

port_expose

The decorator to cache property of a class.

validate()[source]

Validates and sets arguments to be used in store

Return type

None

class daemon.api.dependencies.PeaDepends(workspace_id, pea)[source]

Bases: object

Validates & Sets host/port dependencies during Pea creation/update

property host_in

host_in for the pea/pod

Return type

str

Returns

host_in

property host_out

host_out for the pea/pod

Return type

str

Returns

host_out

ports

The decorator to cache property of a class.

validate()[source]

# TODO (deepankar): These docs would need changes after dynamic routing changes. Validates and sets arguments to be used in store DOCKER_HOST = ‘host.docker.internal’

runtime_cls: ZEDRuntime

host_in, host_out: set to DOCKER_HOST, as it would talk to gateway/other pods ports: map port_in & port_out if socket_in & socket_out are BIND.

map port_ctrl, ignore port_exppse

runtime_cls: ContainerRuntime

host_in,`host_out`: don’t change. Handled interally in jina pod ports: handled internally in ContainerRuntime

runtime_cls: ZEDRuntime
host_in, host_out: set to DOCKERHOST

host config handled interally in jina pod wouldn’t work here, as they need to talk to head/tail peas which are on DOCKER_HOST

ports: don’t map port_in & port_out as they’re always CONNECT.

map port_ctrl??, ignore port_exppse

runtime_cls: ContainerRuntime or ZEDRuntime
host_in, host_out: set to DOCKERHOST

host config handled interally in jina pod wouldn’t work here, as they need to talk to head/tail peas which are on DOCKER_HOST

ports: handled internally in ContainerRuntime

runtime_cls: ZEDRuntime (always??)

host_in, host_out: set to DOCKER_HOST, as they would talk to gateway/other pods. ports: map port_in & port_out if socket_in & socket_out are BIND.

map port_ctrl, ignore port_exppse

TODO: check the host_in/host_out for CONNECT sockets TODO: HEAD/TAIL - can uses_before or uses_after be docker://

class daemon.api.dependencies.PodDepends(workspace_id, pod)[source]

Bases: daemon.api.dependencies.PeaDepends

Validates & Sets host/port dependencies during Pod creation/update

class daemon.api.dependencies.WorkspaceDepends(id=None, files=File(None))[source]

Bases: object

Interacts with task queue to inform about workspace creation/update