ai4eu / generic-parallel-orchestrator

Orchestrator with support for streaming, RPC, and seamless conversion between the two, based on a queued multithreading architecture.
Apache License 2.0
0 stars 0 forks source link

generic-parallel-orchestrator

This repository has been moved to https://gitlab.eclipse.org/eclipse/graphene/generic-parallel-orchestrator

Orchestrator with support for streaming, RPC, and seamless conversion between the two, based on a queued multithreading architecture.

Enables streaming/event-based communication in addition to RPC calls. This enables many applications, including bridges to/from ROS.

This also enables cyclic topologies like control loops or multiple calls of a subcomponent (one component requires n calls of another component to compute its result).

The orchestrator is meant to run as a docker container in kubernetes where it can access other containers (=components). There is an Orchestrator Client (directory orchestrator_client) for controlling the orchestrator.

How to use

Without Docker (for development)

With Docker (for development)

In the Ai4EU Experiments Platform

The solution is created by the kubernetes-client of AI4EU Experiments platform, triggered in the platform with the button Deploy to local in each solution.

This automatically starts a POD with the orchestrator. You only need to use the client that is shipped with the solution.zip.

Orchestrator client usage:

python orchestrator_client.py [-h] [-H HOST] [-p PORT] [-e IP:PORT]
                              [-b BASEPATH]

optional arguments:
  -h, --help            show this help message and exit
  -H HOST, --host HOST  The host name or IP address of the orchestrator.
  -p PORT, --port PORT  The network port of the orchestrator.
  -e IP:PORT, --endpoint IP:PORT
                        The endpoint (combination of host and port) of the
                        orchestrator.
  -b BASEPATH, --basepath BASEPATH
                        The path where dockerinfo.json, blueprint.json, and
                        pipelineprotos.zip can be found.

Technical Description

gRPC provides four flavors of calls: https://grpc.io/docs/what-is-grpc/core-concepts/

Initially we used the first one: classical RPC calls without streaming.

Now we permit all four types.

This orchestrator does not ignore the keyword and connects in the right way to each component:

Lifecycle

Initialization can be done multiple times. Runs can be done multiple times.

RPC calls

Each RPC call that is connected to at least one link is managed by an Thread (ai4eu.othread.OrchestrationThreadBase).

Depending on stream keywords in input/output they operate as follows:

There are 2 special RPC flavors that are connected only to one component (sources/sinks):

This is used for data brokers, GUIs, sensors, webcam streams, etc. that "trigger" processing in the application.

This is used for data sinks, e.g., final nodes of a pipeline: GUIs, displays, audio output, logging, etc.

Benefits and Caveats

Benefits

The multithreaded architecture means that we do not need to analyze the topology to orchestrate. Whenever a message can be passed it will be passed.

Caveats

Every message passes through the orchestrator, so performance is less than it could be (if components would directly talk to each other). However, AI4EU Experiments is intended for experiments. For real applications, something specific needs to be implemented in any case.