jina.orchestrate.pods package

Submodules

Module contents

class jina.orchestrate.pods.BasePod(args)[source]

Bases: abc.ABC

BasePod is an interface from which all the classes managing the lifetime of a Runtime inside a local process, container or in a remote JinaD instance (to come) must inherit.

It exposes the required APIs so that the BasePod can be handled by the cli api as a context manager or by a Deployment.

What makes a BasePod a BasePod is that it manages the lifecycle of a Runtime (gateway or not gateway)

  • close()[source]

    Close the Pod

    This method makes sure that the Process/thread is properly finished and its resources properly released

    • Return type

      None

  • wait_start_success()[source]

    Block until all pods starts successfully.

    If not success, it will raise an error hoping the outer function to catch it

  • async async_wait_start_success()[source]

    Wait for the Pod to start successfully in a non-blocking manner

  • property role: jina.enums.PodRoleType

    Get the role of this pod in a deployment .. #noqa: DAR201

  • abstract start()[source]

    Start the BasePod. This method calls start() in threading.Thread or multiprocesssing.Process. .. #noqa: DAR201

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

    Joins the BasePod. Wait for the BasePod to properly terminate

    • Parameters

      • args – extra positional arguments

      • kwargs – extra keyword arguments

class jina.orchestrate.pods.Pod(args)[source]

Bases: jina.orchestrate.pods.BasePod

Pod is a thread/process- container of BaseRuntime. It leverages threading.Thread or multiprocessing.Process to manage the lifecycle of a BaseRuntime object in a robust way.

A Pod must be equipped with a proper Runtime class to work.

  • start()[source]

    Start the Pod. This method calls start() in threading.Thread or multiprocesssing.Process. .. #noqa: DAR201

  • join(\args, **kwargs*)[source]

    Joins the Pod. This method calls join() in threading.Thread or multiprocesssing.Process.

    • Parameters

      • args – extra positional arguments to pass to join

      • kwargs – extra keyword arguments to pass to join