This block API will likely change in future versions.
This is a special block which allows to offload computation to a Docker container.
Messages are sent and received to/from the container via AMQP.
Containers allow implementing and deploying algorithms with a language-agnostic approach. However a Python SDK is available as a replacement to AMQP connection and JSON SerDes code.
Most of the times containers can be avoided and simple messages transformation and filtering can be achieved using Lua 5.2 scripting blocks.
image: Docker container image (required, string)
type: Container type, either
image_pull_secrets: The secrets used to pull images from private registries (optional, array of strings)
Docker container image.
This block property is going to be removed in favor of implicit configuration.
According to container type a container is used as an AMQP producer, cosumer or as a middle processing block.
A list of names of Kubernetes secrets that will be used to pull the image. This is required only if the image is pulled from a private registry. The secrets must be already existing and must live in the same namespace where Astarte Flow is deployed.
For more information on creating them, please read the relevant Kubernetes documentation
Accepted Input Messages
Input messages are consumed only from
For those types of containers accepted input messages type and format depends on their implementation.
An output message is produced only from
For those types of containers the output message format depends on their implementation.
The following example uses a container (pulled from
"example/test") and declares it as producer
and consumer, wich consumes messages produced by any_producer_block and feeds into
any_producer_block | container .image("example/test") .type("producer_consumer") | any_consumer_block