The main configuration file - isa-group/BOTICA GitHub Wiki

Contents

  1. Overview
  2. Docker top-level element
    1. host
  3. Broker top-level element
    1. type
    2. RabbitMQ configuration properties
  4. Bots top-level element
  5. Bot type object
    1. image
    2. mount
    3. publish
    4. lifecycle
    5. instances
      1. lifecycle
      2. environment

Overview

[!NOTE] BOTICA currently supports both YAML and JSON configuration file formats. This page shows the BOTICA configuration file specification in YAML, which is recommended, although a JSON configuration file would follow this same specification.

You can see the full example configuration files here:

Docker top-level element

The top-level docker property allows configuring the docker host URI.

host

host specifies the docker URI to connect to for deploying the infrastructure. If missing, the default URI for the running OS is chosen.

docker:
  host: "unix:///var/run/docker.sock"

Defaults:

  • Unix: unix:///var/run/docker.sock
  • Windows: npipe:////./pipe/docker_engine

Broker top-level element

The top-level broker property specifies the broker type and configuration to use.

type

type specifies the broker technology to use. The only broker supported currently is rabbitmq.

broker:
  type: rabbitmq

The remaining broker properties vary depending on the broker technology selected.

[!NOTE] The broker instance is provided and deployed by BOTICA: your system does not need to have a running broker instance, and the configuration (authentication, port...) doesn't have to (and, in case of port, should not) match them.

RabbitMQ configuration properties

username

The username used for the broker authentication.

username: "username"

password

The password used for the broker authentication.

password: "password"

port

The port to expose the provided broker instance to your host system. Defaults to 5672.

port: 5672

Bots top-level element

The top-level bots property contains all the bot type objects providing their configurations to launch BOTICA.

bots:
  bot_1: {...}
  bot_2: {...}
  bot_3: {...}

Bot type object

image

The container image of the bot type.

bots:
  bot_name:
    image: "container_image"

mount

The list of the directories or files from the host system to mount on the file systems of the containers of the bot type. Every mount element specifies the source (on the host file system) and the target (on the container file system) of the directory or file. If source does not exist on the host file system and createHostPath is true (defaults to false), an empty directory will be created.

bots:
  bot_name:
    mount:
      - source: "path/to/host/file.extension"
        target: "path/to/container/file.extension"
      - source: "path/to/host/directory"
        target: "path/to/container/directory"
        createHostPath: true

publish

The publish configuration for the bot type. If your bot type does not publish any messages, you can skip this section.

bots:
  bot_name:
    publish:
      key: "publish_key"
      order: "publish_order"

key

The key of the message that the bot will send after completing its job.

order

The order that the bot will execute after completing its job.

lifecycle

lifecycle specifies how the instaces of this bot type will behave: when they will run and how.

type

The type of the lifecycle. Supported values:

  • proactive: the bot will run every period seconds after initialDelay seconds:
bots:
  bot_name:
    lifecycle: 
      type: proactive
      initialDelay: 10 # defaults to 0
      period: 60 # defaults to 1

If period is set to -1, the action will execute once. The bot will then automatically shut down if there are no active user threads remaining.

  • reactive: the bot will run when it receives a message with the given order to one of the specified keys.
bots:
  bot_name:
    lifecycle: 
      type: reactive
      keys: [ "subscribe_key" ]
      order: "subscribe_order"
  • unmanaged: the image is not a botica bot and manages its own lifecycle. The director will not try to communicate with this container, but it will be connected to the same network as the other bots.
bots:
  bot_name:
    lifecycle: 
      type: unmanaged

instances

The instances of this bot type that BOTICA will deploy.

bots:
  bot_name:
    instances:
      bot_1:
        environment:
          - KEY=VALUE
      bot_2:
        lifecycle:
          type: proactive
          initialDelay: 30
          period: 30
        environment:
          - KEY=VALUE
      bot_3: { }
      bot_4: { }

lifecycle

Option to override the lifecycle configuration of the bot's type.

environment

The list of the environment variables to pass to the bot's container.