
Zuul deprecated (and now removed) declaring shared queues at a pipeline level [1]. This patch fixes the syntax to make the gate work again for monasca-common. [1] https://lists.openstack.org/pipermail/openstack-discuss/2022-May/028603.html [2] https://review.opendev.org/c/openstack/monasca-common/+/874297 Change-Id: I0e591770e30c321bcc340b9dd13303259462f30a
Docker image for Monasca Thresh
This image has a containerized version of the Monasca Threshold Engine. For more information on the Monasca project, see the wiki.
Sources: monasca-thresh, monasca-docker, Dockerfile
Usage
The Threshold engine requires configured instances of MySQL, Kafka, Zookeeper, and optionally Storm monasca-api. In environments resembling the official docker-compose or Kubernetes environments, this image requires little to no configuration and can be minimally run like so:
docker run monasca/thresh:master
Environment variables
Variable | Default | Description |
---|---|---|
|
kafka:9092 | URI to Apache Kafka |
|
alarm-state-transitions, metrics,events |
Comma-separated list of topic names to check |
|
24 | Number of Kafka connection attempts |
|
5 | Seconds to wait between attempts |
|
mysql | MySQL hostname |
|
3306 | MySQL port |
|
thresh | MySQL username |
|
password | MySQL password |
|
mon | MySQL database name |
|
24 | Number of MySQL connection attempts |
|
5 | Seconds to wait between attempts |
|
zookeeper:2181 | Zookeeper URL |
|
unset | If true , run without Storm daemons |
|
24 | # of tries to verify Storm availability |
|
5 | # seconds between retry attempts |
|
unset |
If set and |
|
2 | Metric Spout threads |
|
2 | Metric Spout tasks |
|
2 | Event Spout Threads |
|
2 | Event Spout Tasks |
|
2 | Event Bolt Threads |
|
2 | Event Bolt Tasks |
|
2 | Filtering Bolt Threads |
|
2 | Filtering Bolt Tasks |
|
2 | Alarm Creation Bolt Threads |
|
2 | Alarm Creation Bolt Tasks |
|
2 | Aggregation Bolt Threads |
|
2 | Aggregation Bolt Tasks |
|
2 | Thresholding Bolt Threads |
|
2 | Thresholding Bolt Tasks |
|
1024k | JVM stack size |
Wait scripts environment variables
Variable | Default | Description |
---|---|---|
KAFKA_URI | kafka:9092 | URI to Apache Kafka |
KAFKA_WAIT_FOR_TOPICS |
alarm-state-transitions,metrics, events |
Comma-separated list of topic names to check |
KAFKA_WAIT_RETRIES | 24 | Number of kafka connection attempts |
KAFKA_WAIT_DELAY | 5 | Seconds to wait between attempts |
MYSQL_HOST | mysql | The host for MySQL |
MYSQL_PORT | 3306 | The port for MySQL |
MYSQL_USER | monapi | The MySQL username |
MYSQL_PASSWORD | password | The MySQL password |
MYSQL_DB | mon | The MySQL database name |
MYSQL_WAIT_RETRIES | 24 | Number of MySQL connection attempts |
MYSQL_WAIT_DELAY | 5 | Seconds to wait between attempts |
Building Monasca Thresh image
- Example:
-
$ ./build_image.sh <repository_version> <upper_constains_branch> <common_version>
Everything after ./build_image.sh
is optional and by
default configured to get versions from Dockerfile
.
./build_image.sh
also contain more detailed build
description.
Scripts
- start.sh
-
In this starting script provide all steps that lead to the proper service start. Including usage of wait scripts and templating of configuration files. You also could provide the ability to allow running container after service died for easier debugging.
- health_check.py
-
This file will be used for checking the status of the application.
# TODO: Test how it's working or if it's working
Running with and without Storm
The Threshold Engine can be run in two different modes, with Storm Daemons or without Storm Daemons. If run with the Storm Daemons, multiple Storm Supervisor containers can be used with more than one worker process in each. With no Storm Daemons, only a single Threshold Engine container can be run with a single worker process.
The default docker-compose.yml file is configured to run without Storm. To change docker-compose.yml to run with Storm, delete the thresh service entry and replace it with the below:
nimbus:
image: storm:1.1.1
environment:
LOGSTASH_FIELDS: "service=nimbus"
command: storm nimbus
depends_on:
- zookeeper
links:
- zookeeper
restart: unless-stopped
supervisor:
image: storm:1.1.1
environment:
LOGSTASH_FIELDS: "service=supervisor"
command: storm supervisor
depends_on:
- nimbus
- zookeeper
links:
- nimbus
- zookeeper
restart: unless-stopped
thresh-init:
image: monasca/thresh:master
environment:
NIMBUS_SEEDS: "nimbus"
WORKER_MAX_HEAP_MB: "256"
LOGSTASH_FIELDS: "service=monasca-thresh"
depends_on:
- zookeeper
- kafka
- nimbus
- supervisor