10. Initialization
10.1. What is initialization?
Before ArmoniK can serve requests, its backing stores must be set up: database collections must exist and be indexed, queue infrastructure must be ready, and initial data such as partitions and authentication entries must be present. This setup phase is called initialization.
Initialization is performed by the control plane at startup. Four flags in the InitServices
configuration section control which parts are initialized and whether the control plane exits once
initialization is complete.
10.2. Initialization flags
Flag |
Default |
Description |
|---|---|---|
|
|
Creates database collections and indexes, then inserts the configured partitions and authentication data. |
|
|
Initializes the object storage backend (buckets, paths, or equivalent). |
|
|
Initializes the queue infrastructure (queues, channels, or equivalent). |
|
|
When |
Each flag can be set independently via environment variables:
InitServices__InitDatabase=true
InitServices__InitObjectStorage=true
InitServices__InitQueue=true
InitServices__StopAfterInit=false
10.3. What gets initialized
10.3.1. Database
When InitDatabase is enabled, the control plane:
Creates the necessary collections if they do not already exist.
Creates indexes on those collections.
Upserts the initial data provided in the configuration: partitions and authentication entries (users, roles, and certificates).
Refer to Partitions and Authentication for details on how to supply this data via environment variables.
10.3.2. Object storage and queue
When InitObjectStorage or InitQueue are enabled, the control plane prepares the respective
backends according to the adaptor in use. The exact operations depend on the adaptor (e.g.
creating S3 buckets, AMQP queues, etc.).
10.4. Recommended deployment pattern
The recommended approach is to separate initialization from normal operation by running the control plane once in init-then-quit mode before starting it (and the agents) for regular use.
10.4.1. Step 1 — Initialize
Run the control plane with all init flags enabled and StopAfterInit=true. It will set up all
backing stores, insert initial data, and exit.
InitServices__InitDatabase=true
InitServices__InitObjectStorage=true
InitServices__InitQueue=true
InitServices__StopAfterInit=true
10.4.2. Step 2 — Run normally
Start the control plane and agents with initialization disabled. They connect to the already initialized backing stores and begin serving requests immediately.
InitServices__InitDatabase=false
InitServices__InitObjectStorage=false
InitServices__InitQueue=false
InitServices__StopAfterInit=false
NOTE : Disabling initialization in normal operation reduces startup time and avoids any risk of accidentally modifying backing store structure or data during a restart.