Skip to content

Commit

Permalink
Issue 18.
Browse files Browse the repository at this point in the history
  • Loading branch information
chainhead committed Aug 12, 2023
1 parent 996f989 commit 1e6652d
Show file tree
Hide file tree
Showing 10 changed files with 35 additions and 54 deletions.
9 changes: 3 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@ This repository has instructions to launch the Maintenace Mitra application.

- [Introduction](#introduction)
- [Quick start](#quick-start)
- [Configuration](#configuration)
- [Limits](#limits)
- [Limits](#limits)

## Quick start

Expand All @@ -28,8 +27,6 @@ docker compose --env-file launch.env up -d

If the `/data` end-point is receiving data, then the dashboard will be live at [`http://localhost:1881/ui`](http://localhost:1881/ui). The `port` number is based on the configuration `UI_PORT` in `conf/dashboard.env`.

## Configuration
## Limits

The `limits` applications should be configured to generate alerts. While the configuration parameters exist for other applications - see [`conf`](./launch/conf/) - they should not be changed. Therefore, the documentation is purposely omitted.

### Limits
The `limits` application should be configured to generate alerts.
9 changes: 0 additions & 9 deletions launch/conf/alarms.env
Original file line number Diff line number Diff line change
@@ -1,13 +1,4 @@
# Must change - Application
MACHINE_ID=m001
MACHINE_DATA_TOPIC=m001_data
MACHINE_ALARMS_TOPIC=m001_alarms
# Must change - Quarkus
QUARKUS_KAFKA_STREAMS_APPLICATION_ID=M001_ALARMS
QUARKUS_KAFKA_STREAMS_CLIENT_ID=M001_ALARMS
QUARKUS_KAFKA_STREAMS_TOPICS=m001_data,m001_alarms
# Do not change
QUARKUS_KAFKA_STREAMS_BOOTSTRAP_SERVERS=broker:29093
QUARKUS_KAFKA_STREAMS_SECURITY_PROTOCOL=SASL_PLAINTEXT
QUARKUS_KAFKA_STREAMS_SASL_MECHANISM=PLAIN
QUARKUS_KAFKA_STREAMS_SASL_JAAS_CONFIG=org.apache.kafka.common.security.plain.PlainLoginModule required username="alice" password="alice-secret";
6 changes: 0 additions & 6 deletions launch/conf/alerts.env
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,7 @@
MACHINE_ID=m001
MACHINE_DATA_TOPIC=m001_data
MACHINE_LIMITS_TOPIC=m001_limits
MACHINE_ALERTS_TOPIC=m001_alerts
# Must change - Quarkus
QUARKUS_KAFKA_STREAMS_APPLICATION_ID=M001_ALERTS
QUARKUS_KAFKA_STREAMS_CLIENT_ID=M001_ALERTS
QUARKUS_KAFKA_STREAMS_TOPICS=m001_data,m001_alerts,m001_limits
# Do not change
QUARKUS_KAFKA_STREAMS_BOOTSTRAP_SERVERS=broker:29093
QUARKUS_KAFKA_STREAMS_SECURITY_PROTOCOL=SASL_PLAINTEXT
QUARKUS_KAFKA_STREAMS_SASL_MECHANISM=PLAIN
QUARKUS_KAFKA_STREAMS_SASL_JAAS_CONFIG=org.apache.kafka.common.security.plain.PlainLoginModule required username="alice" password="alice-secret";
14 changes: 14 additions & 0 deletions launch/conf/common.env
Original file line number Diff line number Diff line change
@@ -1 +1,15 @@
# Application
MACHINE_ID=m001
MACHINE_DATA_TOPIC=m001_data
MACHINE_ALARMS_TOPIC=m001_alarms
MACHINE_ALERTS_TOPIC=m001_alerts
MACHINE_EVENTS_TOPIC=m001_events
# Quarkus, Kafka
QUARKUS_KAFKA_STREAMS_BOOTSTRAP_SERVERS=broker:29093
QUARKUS_KAFKA_STREAMS_SECURITY_PROTOCOL=SASL_PLAINTEXT
QUARKUS_KAFKA_STREAMS_SASL_MECHANISM=PLAIN
QUARKUS_KAFKA_STREAMS_SASL_JAAS_CONFIG=org.apache.kafka.common.security.plain.PlainLoginModule required username="alice" password="alice-secret";
# NodeJs
KAFKA_BROKER=broker:29093
# General
TZ="Asia/Kolkata"
5 changes: 2 additions & 3 deletions launch/conf/limits.env
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,8 @@ MACHINE_LIMITS_TOPIC=m001_limits
# May change
GRACE_TIME=10000
# Do not change
KAFKA_BROKER=broker:29093
APP_ID=LIMITS
GROUP_ID=LIMITS
APP_ID=M001_LIMITS
GROUP_ID=M001_LIMITS
PORT=8080
FREQUENCY=5000
INITIAL_DELAY=10000
6 changes: 0 additions & 6 deletions launch/conf/merger.env
Original file line number Diff line number Diff line change
@@ -1,12 +1,6 @@
# Must change - Application
MACHINE_ALL_TOPICS=m001_alerts,m001_alarms
MACHINE_EVENTS_TOPIC=m001_events
# Must change - Quarkus
QUARKUS_KAFKA_STREAMS_APPLICATION_ID=M001_MERGER
QUARKUS_KAFKA_STREAMS_CLIENT_ID=M001_MERGER
QUARKUS_KAFKA_STREAMS_TOPICS=m001_alerts,m001_alarms,m001_events
# Do not change
QUARKUS_KAFKA_STREAMS_BOOTSTRAP_SERVERS=broker:29093
QUARKUS_KAFKA_STREAMS_SECURITY_PROTOCOL=SASL_PLAINTEXT
QUARKUS_KAFKA_STREAMS_SASL_MECHANISM=PLAIN
QUARKUS_KAFKA_STREAMS_SASL_JAAS_CONFIG=org.apache.kafka.common.security.plain.PlainLoginModule required username="alice" password="alice-secret";
3 changes: 1 addition & 2 deletions launch/conf/payload.env
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@ MACHINE_DATA_TOPIC=m001_data
# May change
GRACE_TIME=10000
# Do not change
KAFKA_BROKER=broker:29093
APP_ID=M001
APP_ID=M001_PAYLOAD
PORT=8080
FREQUENCY=5000
INITIAL_DELAY=10000
3 changes: 1 addition & 2 deletions launch/conf/streamer.env
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
# Must change
MACHINE_EVENTS_TOPIC=m001_events
CLIENT_ID=M001_STREAMER_
GROUP_ID=M001_STREAMER
# Do not change
QUARKUS_HTTP_HOST=localhost
QUARKUS_HTTP_PORT=8080
QUARKUS_HTTP_CORS=true
QUARKUS_HTTP_CORS_ORIGINS=localhost
#
# Do not change
KAFKA_BOOTSTRAP_SERVERS=broker:29093
KAFKA_SECURITY_PROTOCOL=SASL_PLAINTEXT
KAFKA_SASL_MECHANISM=PLAIN
Expand Down
27 changes: 9 additions & 18 deletions launch/docker-compose.yaml
Original file line number Diff line number Diff line change
@@ -1,20 +1,9 @@
version: '3.5'

services:
registry:
container_name: mitra-registry
image: ${CONTAINER_REGISTRY}/${CONTAINER_REPOSITORY}/registry:${REGISTRY_TAG:-latest}
ports:
- 5000:5000
networks:
- core
restart: always

zookeeper:
container_name: mitra-zookeeper
image: ${CONTAINER_REGISTRY}/${CONTAINER_REPOSITORY}/zookeeper:${ZOOKEEPER_TAG:-latest}
depends_on:
- registry
ports:
- "2181:2181"
env_file:
Expand All @@ -27,7 +16,6 @@ services:
container_name: mitra-broker
image: ${CONTAINER_REGISTRY}/${CONTAINER_REPOSITORY}/kafka:${KAFKA_TAG:-latest}
depends_on:
- registry
- zookeeper
ports:
- "29093:29093"
Expand All @@ -38,8 +26,8 @@ services:
restart: always

init:
container_name: mitra-init
image: confluentinc/cp-kafka:7.2.2
container_name: mitra-init-${MACHINE_ID:-M001}
image: ${CONTAINER_REGISTRY}/${CONTAINER_REPOSITORY}/kafka:${KAFKA_TAG:-latest}
depends_on:
- broker
entrypoint: [ '/bin/sh', '-c' ]
Expand Down Expand Up @@ -94,7 +82,7 @@ services:
container_name: mitra-alarms-${MACHINE_ID:-M001}
image: ${CONTAINER_REGISTRY}/${CONTAINER_REPOSITORY}/alarms:${ALARMS_TAG:-latest}
depends_on:
- init
- payload
env_file:
- ./conf/common.env
- ./conf/alarms.env
Expand All @@ -111,7 +99,7 @@ services:
container_name: mitra-alerts-${MACHINE_ID:-M001}
image: ${CONTAINER_REGISTRY}/${CONTAINER_REPOSITORY}/alerts:${ALERTS_TAG:-latest}
depends_on:
- init
- payload
env_file:
- ./conf/common.env
- ./conf/alerts.env
Expand All @@ -128,7 +116,8 @@ services:
container_name: mitra-merger-${MACHINE_ID:-M001}
image: ${CONTAINER_REGISTRY}/${CONTAINER_REPOSITORY}/merger:${MERGER_TAG:-latest}
depends_on:
- init
- alarms
- alerts
env_file:
- ./conf/common.env
- ./conf/merger.env
Expand All @@ -145,7 +134,7 @@ services:
container_name: mitra-streamer-${MACHINE_ID:-M001}
image: ${CONTAINER_REGISTRY}/${CONTAINER_REPOSITORY}/streamer:${STREAMER_TAG:-latest}
depends_on:
- init
- merger
env_file:
- ./conf/common.env
- ./conf/streamer.env
Expand All @@ -163,6 +152,8 @@ services:
dashboard:
container_name: mitra-dashboard-${MACHINE_ID:-M001}
image: ${CONTAINER_REGISTRY}/${CONTAINER_REPOSITORY}/dashboard:${DASHBOARD_TAG:-latest}
depends_on:
- streamer
env_file:
- ./conf/common.env
- ./conf/dashboard.env
Expand Down
7 changes: 5 additions & 2 deletions launch/launch.env
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
# Do not change !
COMPOSE_PROJECT_NAME=mitra
# May change !
MACHINE_ID=M001
EVENTS_PORT=8080
UI_PORT=1881

# Do not change !
COMPOSE_PROJECT_NAME=mitra
PROXY_REGISTRY=registry
CONTAINER_REGISTRY=ghcr.io
CONTAINER_REPOSITORY=nsubrahm
#PAYLOAD_TAG=
Expand Down

0 comments on commit 1e6652d

Please sign in to comment.