Skip to content

Commit

Permalink
Merge branch 'development' of github.com:eventuate-tram/eventuate-tra…
Browse files Browse the repository at this point in the history
…m-examples-customers-and-orders into development
  • Loading branch information
cer committed May 20, 2020
2 parents 44f7f92 + 224331a commit 574a434
Show file tree
Hide file tree
Showing 6 changed files with 119 additions and 11 deletions.
1 change: 1 addition & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ jobs:
command: |
./.circleci/upgrade-docker-compose.sh
. ./.circleci/setenv-circle-ci.sh
. ./.circleci/stop-and-remove-containers.sh
./gradlew testClasses
./mvnw package test-compile -DskipTests
- save_cache:
Expand Down
9 changes: 9 additions & 0 deletions .circleci/stop-and-remove-containers.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#! /bin/bash -e

CONTAINER_IDS=$(docker ps -a -q)

for id in $CONTAINER_IDS ; do
docker stop $id
docker rm $id
done

7 changes: 2 additions & 5 deletions build-and-test-snapshots.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,9 @@

set -e

dockerall="./gradlew mysqlbinlogCompose"
dockerinfrastructure="./gradlew mysqlbinloginfrastructureCompose"
dockertextsearch="./gradlew mysqlbinlogwithorderhistorytextsearchserviceCompose"
dockerall="./gradlew mysqlbinlogtextsearchCompose"
dockerinfrastructure="./gradlew mysqlbinloginfrastructuretextsearchCompose"

${dockertextsearch}Down
${dockerall}Down
${dockerinfrastructure}Up

Expand All @@ -16,5 +14,4 @@ ${dockerall}Up

./gradlew :snapshot-tests:cleanTest :snapshot-tests:test

${dockertextsearch}Down
${dockerall}Down
17 changes: 11 additions & 6 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -40,22 +40,27 @@ dockerCompose {
useComposeFiles = ["docker-compose-mysql-binlog.yml"]
}

mysqlbinloginfrastructure {
projectName = null
useComposeFiles = ["docker-compose-mysql-binlog.yml"]
startedServices = ["cdcservice", "zipkin"]
}

mysqlbinlogwithjmeter {
projectName = null
useComposeFiles = ["docker-compose-mysql-binlog.yml", "docker-compose-jmeter-service.yml"]
startedServices = ["jmeterservice", "customerservice"]
}

mysqlbinlogwithorderhistorytextsearchservice {
mysqlbinlogtextsearch {
projectName = null
useComposeFiles = ["docker-compose-mysql-binlog.yml", "docker-compose-snapshots-mysql-binlog.yml"]
startedServices = ["elasticsearch", "orderhistorytextsearchservice"]
useComposeFiles = ["docker-compose-snapshots-mysql-binlog.yml"]
}

mysqlbinloginfrastructure {
mysqlbinloginfrastructuretextsearch {
projectName = null
useComposeFiles = ["docker-compose-mysql-binlog.yml"]
startedServices = ["cdcservice", "zipkin"]
useComposeFiles = ["docker-compose-snapshots-mysql-binlog.yml"]
startedServices = ["cdcservice"]
}

postgrespolling {
Expand Down
95 changes: 95 additions & 0 deletions docker-compose-snapshots-mysql-binlog.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,100 @@
version: '3'
services:
orderservice:
build:
context: ./order-service/
image: eventuateexamples/eventuate-tram-examples-customers-and-orders-order-service
ports:
- "8081:8080"
depends_on:
- mysql
- kafka
- zookeeper
- cdcservice
environment:
SPRING_DATASOURCE_URL: jdbc:mysql://mysql/eventuate
SPRING_DATASOURCE_USERNAME: mysqluser
SPRING_DATASOURCE_PASSWORD: mysqlpw
SPRING_DATASOURCE_DRIVER_CLASS_NAME: com.mysql.jdbc.Driver
EVENTUATELOCAL_KAFKA_BOOTSTRAP_SERVERS: kafka:29092
EVENTUATELOCAL_ZOOKEEPER_CONNECTION_STRING: zookeeper:2181
CDC_SERVICE_URL: http://cdcservice:8080

customerservice:
build:
context: ./customer-service/
image: eventuateexamples/eventuate-tram-examples-customers-and-orders-customer-service
ports:
- "8082:8080"
depends_on:
- mysql
- kafka
- zookeeper
- cdcservice
environment:
SPRING_DATASOURCE_URL: jdbc:mysql://mysql/eventuate
SPRING_DATASOURCE_USERNAME: mysqluser
SPRING_DATASOURCE_PASSWORD: mysqlpw
SPRING_DATASOURCE_DRIVER_CLASS_NAME: com.mysql.jdbc.Driver
EVENTUATELOCAL_KAFKA_BOOTSTRAP_SERVERS: kafka:29092
EVENTUATELOCAL_ZOOKEEPER_CONNECTION_STRING: zookeeper:2181
CDC_SERVICE_URL: http://cdcservice:8080

zookeeper:
image: confluentinc/cp-zookeeper:5.2.4
ports:
- 2181:2181
environment:
ZOOKEEPER_CLIENT_PORT: 2181

kafka:
image: "confluentinc/cp-kafka:5.2.4"
ports:
- 9092:9092
- 29092:29092
depends_on:
- zookeeper
environment:
KAFKA_LISTENERS: LC://kafka:29092,LX://kafka:9092
KAFKA_ADVERTISED_LISTENERS: LC://kafka:29092,LX://${DOCKER_HOST_IP:-localhost}:9092
KAFKA_LISTENER_SECURITY_PROTOCOL_MAP: LC:PLAINTEXT,LX:PLAINTEXT
KAFKA_INTER_BROKER_LISTENER_NAME: LC
KAFKA_ZOOKEEPER_CONNECT: zookeeper:2181
KAFKA_OFFSETS_TOPIC_REPLICATION_FACTOR: 1


mysql:
image: eventuateio/eventuate-mysql:$EVENTUATE_COMMON_VERSION
ports:
- 3306:3306
environment:
- MYSQL_ROOT_PASSWORD=rootpassword
- MYSQL_USER=mysqluser
- MYSQL_PASSWORD=mysqlpw

cdcservice:
image: eventuateio/eventuate-cdc-service:$EVENTUATE_CDC_VERSION
ports:
- "8099:8080"
depends_on:
- mysql
- kafka
- zookeeper
environment:
SPRING_DATASOURCE_URL: jdbc:mysql://mysql/eventuate
SPRING_DATASOURCE_USERNAME: mysqluser
SPRING_DATASOURCE_PASSWORD: mysqlpw
SPRING_DATASOURCE_DRIVER_CLASS_NAME: com.mysql.jdbc.Driver
EVENTUATELOCAL_KAFKA_BOOTSTRAP_SERVERS: kafka:29092
EVENTUATELOCAL_ZOOKEEPER_CONNECTION_STRING: zookeeper:2181
EVENTUATELOCAL_CDC_DB_USER_NAME: root
EVENTUATELOCAL_CDC_DB_PASSWORD: rootpassword
EVENTUATELOCAL_CDC_READER_NAME: MySqlReader
EVENTUATELOCAL_CDC_OFFSET_STORE_KEY: MySqlBinlog
EVENTUATELOCAL_CDC_MYSQL_BINLOG_CLIENT_UNIQUE_ID: 1234567890
EVENTUATELOCAL_CDC_READ_OLD_DEBEZIUM_DB_OFFSET_STORAGE_TOPIC: "false"
EVENTUATE_CDC_KAFKA_ENABLE_BATCH_PROCESSING: ${EVENTUATE_CDC_KAFKA_ENABLE_BATCH_PROCESSING}

orderhistorytextsearchservice:
build: ./order-history-text-search-service/
ports:
Expand Down
1 change: 1 addition & 0 deletions jmeter-service/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
FROM openjdk:8u252-slim-buster
RUN apt-get update && apt-get install -y wget
RUN wget -q -O - http://mirror.linux-ia64.org/apache//jmeter/binaries/apache-jmeter-5.2.1.tgz | tar -xzf - -C /usr/local
RUN mkdir /usr/local/plans
RUN mkdir /usr/local/results
Expand Down

0 comments on commit 574a434

Please sign in to comment.