Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,8 @@ subprojects {
}

tasks.named('test') {
// Show all logs during gradle test execution
testLogging.showStandardStreams = true
finalizedBy tasks.named('jacocoTestReport', JacocoReport)
}
}
Expand Down
9 changes: 0 additions & 9 deletions containers/debezium/README.md

This file was deleted.

36 changes: 36 additions & 0 deletions containers/debezium/initialize/healthcheck.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
#!/bin/bash
set -e

# Get the list of all connectors from Debezium REST API
connectors=$(curl -s --fail --connect-timeout 2 "http://127.0.0.1:8083/connectors")

# Clean the array string and load into array
cleaned_connector_names=$(sed 's/[][]//g; s/"//g' <<< "$connectors")
IFS=',' read -r -a my_array <<< "$cleaned_connector_names"

# Check if ODSE connector is available
if [[ " ${my_array[@]} " =~ " odse-connector " ]]; then
echo "odse-connector is enabled";
else
echo "odse-connector not found. Initializing...";
curl -s --fail -X POST --header "Accept:application/json" --header "Content-Type:application/json" --data "@/kafka/healthcheck/odse_connector.json" http://localhost:8083/connectors/
fi

# Check if ODSE meta connector is available
if [[ " ${my_array[@]} " =~ " odse-meta-connector " ]]; then
echo "odse-meta-connector is enabled";
else
echo "odse-meta-connector not found. Initializing...";
curl -s --fail -X POST --header "Accept:application/json" --header "Content-Type:application/json" --data "@/kafka/healthcheck/odse_meta_connector.json" http://localhost:8083/connectors/
fi

# Check if SRTE connector is available
if [[ " ${my_array[@]} " =~ " srte-connector " ]]; then
echo "srte-connector is enabled";
else
echo "srte-connector not found. Initializing...";
curl -s --fail -X POST --header "Accept:application/json" --header "Content-Type:application/json" --data "@/kafka/healthcheck/srte_connector.json" http://localhost:8083/connectors/
fi


exit 0
19 changes: 19 additions & 0 deletions containers/kafka-connect/initialize/healthcheck.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#!/bin/bash
set -e

# Get the list of all connectors from Debezium REST API
connectors=$(curl -s --fail "http://127.0.0.1:8083/connectors")

# Clean the array string and load into array
cleaned_connector_names=$(sed 's/[][]//g; s/"//g' <<< "$connectors")
IFS=',' read -r -a my_array <<< "$cleaned_connector_names"

# Check if MSQL connector is available
if [[ " ${my_array[@]} " =~ " Kafka-Connect-SqlServer-Sink " ]]; then
echo "Kafka-Connect-SqlServer-Sink is enabled";
else
echo "Kafka-Connect-SqlServer-Sink not found. Initializing...";
curl -s --fail -X POST --header "Accept:application/json" --header "Content-Type:application/json" --data "@/kafka/healthcheck/mssql-connector.json" http://localhost:8083/connectors/
fi

exit 0
126 changes: 91 additions & 35 deletions docker-compose.yaml
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
services:
mssql:
nbs-mssql:
image: ghcr.io/cdcent/nedssdb:latest
platform: linux/amd64
container_name: nbs-mssql
environment:
- DATABASE_VERSION=6.0.18.1
- DEPLOY_ADMIN_PASSWORD=${DATABASE_PASSWORD:-PizzaIsGood33!}
Expand All @@ -13,33 +12,47 @@ services:
ports:
- 3433:1433

liquibase:
build:
dockerfile: ./liquibase-service/Dockerfile.local
environment:
- DB_USERNAME=db_deploy_admin
- DB_PASSWORD=${LIQUIBASE_USER_PASSWORD:-db_deploy_admin}
- DB_HOST=nbs-mssql
depends_on:
nbs-mssql:
condition: service_healthy

wildfly:
image: ghcr.io/cdcent/nedssdev:6.0.18.1
platform: linux/amd64
container_name: rtr-wildfly
depends_on:
- mssql
nbs-mssql:
condition: service_healthy
ports:
- "9991:9990"
- "7003:7001"
- "8788:8787"

zookeeper:
image: confluentinc/cp-zookeeper:7.3.0
hostname: rtr-zookeeper
container_name: rtr-zookeeper
ports:
- "2181:2181"
environment:
ZOOKEEPER_CLIENT_PORT: 2181
ZOOKEEPER_TICK_TIME: 2000
KAFKA_OPTS: -Dzookeeper.4lw.commands.whitelist=ruok
healthcheck:
test: echo "ruok" | nc localhost 2181 | grep imok
interval: 20s
timeout: 5s
retries: 10
start_period: 30s

kafka:
image: confluentinc/cp-kafka:7.3.0
hostname: kafka
container_name: kafka
depends_on:
- zookeeper
zookeeper:
condition: service_healthy
ports:
- "9092:9092"
environment:
Expand All @@ -53,16 +66,26 @@ services:
KAFKA_TRANSACTION_STATE_LOG_MIN_ISR: 1
KAFKA_TRANSACTION_STATE_LOG_REPLICATION_FACTOR: 1
KAFKA_ZOOKEEPER_CONNECT: "zookeeper:2181"
healthcheck:
test: kafka-topics --bootstrap-server kafka:29092 --list
interval: 15s
timeout: 10s
retries: 5

kafka-connect:
container_name: kafka-connect
build:
dockerfile: ./containers/kafka-connect/Dockerfile
depends_on:
- kafka
- mssql
kafka:
condition: service_healthy
nbs-mssql:
condition: service_healthy
liquibase:
condition: service_completed_successfully
ports:
- 8083:8083
volumes:
- ./containers/kafka-connect/initialize/:/kafka/healthcheck/
environment:
CONNECT_BOOTSTRAP_SERVERS: "kafka:29092"
CONNECT_GROUP_ID: "cp-kafka-connect.groupId"
Expand All @@ -75,16 +98,25 @@ services:
CONNECT_KEY_CONVERTER: "org.apache.kafka.connect.json.JsonConverter"
CONNECT_VALUE_CONVERTER: "org.apache.kafka.connect.json.JsonConverter"
CONNECT_REST_ADVERTISED_HOST_NAME: "kafka-connect"
healthcheck:
test: ["CMD", "/kafka/healthcheck/healthcheck.sh"]
interval: 20s
timeout: 15s
retries: 5

debezium:
image: debezium/connect:2.4
hostname: debezium
container_name: rtr-debezium
depends_on:
- kafka
- zookeeper
kafka:
condition: service_healthy
nbs-mssql:
condition: service_healthy
liquibase:
condition: service_completed_successfully
ports:
- "8085:8083"
volumes:
- ./containers/debezium/initialize/:/kafka/healthcheck/
environment:
BOOTSTRAP_SERVERS: kafka:29092
GROUP_ID: connect-cluster
Expand All @@ -95,24 +127,17 @@ services:
OFFSET_STORAGE_FILE_FILENAME: /tmp/connect.offsets
OFFSET_FLUSH_INTERVAL_MS: 10000
PLUGIN_PATH: /kafka/connect

CONFIG_STORAGE_TOPIC: connect-configs
OFFSET_STORAGE_TOPIC: connect-offsets
STATUS_STORAGE_TOPIC: connect-status
CONFIG_STORAGE_REPLICATION_FACTOR: 1
OFFSET_STORAGE_REPLICATION_FACTOR: 1
STATUS_STORAGE_REPLICATION_FACTOR: 1

liquibase:
build:
dockerfile: ./liquibase-service/Dockerfile.local
environment:
- DB_USERNAME=db_deploy_admin
- DB_PASSWORD=${LIQUIBASE_USER_PASSWORD:-db_deploy_admin}
- DB_HOST=nbs-mssql
depends_on:
mssql:
condition: service_healthy
healthcheck:
test: ["CMD", "/kafka/healthcheck/healthcheck.sh"]
interval: 10s
timeout: 5s
retries: 5

investigation-service:
build:
Expand All @@ -123,7 +148,12 @@ services:
- DB_HOST=jdbc:sqlserver://nbs-mssql:1433;databaseName=RDB_MODERN;encrypt=true;trustServerCertificate=true;
- KAFKA_BOOTSTRAP_SERVER=kafka:29092
depends_on:
- kafka
kafka:
condition: service_healthy
nbs-mssql:
condition: service_healthy
liquibase:
condition: service_completed_successfully

ldfdata-service:
build:
Expand All @@ -134,7 +164,12 @@ services:
- DB_HOST=jdbc:sqlserver://nbs-mssql:1433;databaseName=RDB_MODERN;encrypt=true;trustServerCertificate=true;
- KAFKA_BOOTSTRAP_SERVER=kafka:29092
depends_on:
- kafka
kafka:
condition: service_healthy
nbs-mssql:
condition: service_healthy
liquibase:
condition: service_completed_successfully

observation-service:
build:
Expand All @@ -145,7 +180,12 @@ services:
- DB_HOST=jdbc:sqlserver://nbs-mssql:1433;databaseName=RDB_MODERN;encrypt=true;trustServerCertificate=true;
- KAFKA_BOOTSTRAP_SERVER=kafka:29092
depends_on:
- kafka
kafka:
condition: service_healthy
nbs-mssql:
condition: service_healthy
liquibase:
condition: service_completed_successfully

organization-service:
build:
Expand All @@ -156,7 +196,12 @@ services:
- DB_HOST=jdbc:sqlserver://nbs-mssql:1433;databaseName=RDB_MODERN;encrypt=true;trustServerCertificate=true;
- KAFKA_BOOTSTRAP_SERVER=kafka:29092
depends_on:
- kafka
kafka:
condition: service_healthy
nbs-mssql:
condition: service_healthy
liquibase:
condition: service_completed_successfully

person-service:
build:
Expand All @@ -166,8 +211,14 @@ services:
- DB_PASSWORD=person_service
- DB_HOST=jdbc:sqlserver://nbs-mssql:1433;databaseName=RDB_MODERN;encrypt=true;trustServerCertificate=true;
- KAFKA_BOOTSTRAP_SERVER=kafka:29092
- spring.kafka.consumer.maxPollIntervalMs=3000
depends_on:
- kafka
kafka:
condition: service_healthy
nbs-mssql:
condition: service_healthy
liquibase:
condition: service_completed_successfully

post-processing-service:
build:
Expand All @@ -178,4 +229,9 @@ services:
- DB_HOST=jdbc:sqlserver://nbs-mssql:1433;databaseName=RDB_MODERN;encrypt=true;trustServerCertificate=true;
- KAFKA_BOOTSTRAP_SERVER=kafka:29092
depends_on:
- kafka
kafka:
condition: service_healthy
nbs-mssql:
condition: service_healthy
liquibase:
condition: service_completed_successfully
Loading
Loading