Skip to content

Commit

Permalink
Merge branch 'master' into development
Browse files Browse the repository at this point in the history
  • Loading branch information
cer committed May 12, 2020
2 parents e5c340b + 2a9a2ce commit 92b9a24
Show file tree
Hide file tree
Showing 14 changed files with 175 additions and 313 deletions.
2 changes: 2 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
mysql/*.sh text eol=lf
dynamodblocal-init/*.sh text eol=lf
10 changes: 6 additions & 4 deletions README.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -132,9 +132,11 @@ Build the services using this command:
Run the application using this command:

```
docker-compose up -d
./gradlew :composeUp
```

Note: the ':'

This can take a while.

=== Using the application
Expand All @@ -150,14 +152,14 @@ Use the services Swagger UIs to invoke the services.
You can also access the application via the `API Gateway` at `http://localhost:8087`.
However, currently it doesn't have a Swagger UI so you will have to use `curl`, for example.

Note: if the containers aren't accessible via `localhost`, you will have to use `${DOCKER_HOST_IP}` as described below.
Note: if the containers aren't accessible via `localhost` - e.g. you are using Docker Toolbox, you will have to use `${DOCKER_HOST_IP}` as described below.

=== Stopping the application

Stop the application using this command:

```
docker-compose down -v
./gradlew :composeDown
```

== Deploying the application on Kubernetes
Expand Down Expand Up @@ -193,7 +195,7 @@ You should not need to set any environment variables.
To run the application, you certainly do not.
Similarly, to do development (e.g. run tests), you typically do not need to set any environment variables.
That's because Docker containers are generally accessible (e.g. Docker for Windows/Mac) on the host via `localhost`.
However, if Docker is running elsewhere you will need to set `DOCKER_HOST_IP`.
However, if Docker is running elsewhere (e.g. you are using Docker Toolbox) you will need to set `DOCKER_HOST_IP`.

=== Quick way

Expand Down
14 changes: 10 additions & 4 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,7 @@ buildscript {
classpath "org.springframework.boot:spring-boot-gradle-plugin:${springBootVersion}"
classpath "io.spring.gradle:dependency-management-plugin:$springDependencyManagementPluginVersion"
classpath "com.avast.gradle:gradle-docker-compose-plugin:$dockerComposePluginVersion"
classpath "org.springframework.cloud:spring-cloud-contract-gradle-plugin:$springCloudContractDependenciesVersion"
classpath "com.avast.gradle:gradle-docker-compose-plugin:$dockerComposePluginVersion"
classpath "io.spring.gradle:dependency-management-plugin:$springDependencyManagementPluginVersion"
}
classpath "org.springframework.cloud:spring-cloud-contract-gradle-plugin:$springCloudContractDependenciesVersion" }

}

Expand All @@ -19,6 +16,7 @@ plugins {
}

apply plugin: WaitForMySqlPlugin
apply plugin: 'docker-compose'

subprojects {

Expand Down Expand Up @@ -56,3 +54,11 @@ task buildContracts(type: GradleBuild) {
task compileAll(type: GradleBuild) {
tasks = ["testClasses", "compileIntegrationTestJava", "compileComponentTestJava"]
}

dockerCompose {
projectName = null
removeOrphans = true
if (project.hasProperty('startedServices'))
startedServices= project.ext.startedServices.split(',')

}
121 changes: 121 additions & 0 deletions deployment/kubernetes/cdc-service/ftgo-cdc-service.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,121 @@
apiVersion: v1
kind: Service
metadata:
name: ftgo-cdc-service
spec:
ports:
- port: 8080
targetPort: 8080
selector:
svc: ftgo-cdc-service
---
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
name: ftgo-cdc-service
labels:
application: ftgo
spec:
replicas: 1
strategy:
rollingUpdate:
maxUnavailable: 0
template:
metadata:
labels:
svc: ftgo-cdc-service
spec:
containers:
- name: ftgo-cdc-service
image: eventuateio/eventuate-cdc-service:0.4.0.RELEASE
imagePullPolicy: Always
ports:
- containerPort: 8080
name: httpport
command: ["bash", "-c", "java -Dsun.net.inetaddr.ttl=30 -jar *.jar" ]
env:
- name: JAVA_OPTS
value: "-Dsun.net.inetaddr.ttl=30"
- name: EVENTUATELOCAL_KAFKA_BOOTSTRAP_SERVERS
value: ftgo-kafka:29092
- name: EVENTUATELOCAL_ZOOKEEPER_CONNECTION_STRING
value: ftgo-zookeeper:2181
- name: EVENTUATE_CDC_PIPELINE_PIPELINE1_TYPE
value: eventuate-tram
- name: EVENTUATE_CDC_PIPELINE_PIPELINE1_READER
value: reader1
- name: EVENTUATE_CDC_PIPELINE_PIPELINE1_EVENTUATEDATABASESCHEMA
value: ftgo_consumer_service
- name: EVENTUATE_CDC_PIPELINE_PIPELINE2_TYPE
value: eventuate-tram
- name: EVENTUATE_CDC_PIPELINE_PIPELINE2_READER
value: reader1
- name: EVENTUATE_CDC_PIPELINE_PIPELINE2_EVENTUATEDATABASESCHEMA
value: ftgo_order_service
- name: EVENTUATE_CDC_PIPELINE_PIPELINE3_TYPE
value: eventuate-tram
- name: EVENTUATE_CDC_PIPELINE_PIPELINE3_READER
value: reader1
- name: EVENTUATE_CDC_PIPELINE_PIPELINE3_EVENTUATEDATABASESCHEMA
value: ftgo_kitchen_service
- name: EVENTUATE_CDC_PIPELINE_PIPELINE4_TYPE
value: eventuate-tram
- name: EVENTUATE_CDC_PIPELINE_PIPELINE4_READER
value: reader1
- name: EVENTUATE_CDC_PIPELINE_PIPELINE4_EVENTUATEDATABASESCHEMA
value: ftgo_restaurant_service
- name: EVENTUATE_CDC_PIPELINE_PIPELINE5_TYPE
value: eventuate-tram
- name: EVENTUATE_CDC_PIPELINE_PIPELINE5_READER
value: reader1
- name: EVENTUATE_CDC_PIPELINE_PIPELINE5_EVENTUATEDATABASESCHEMA
value: ftgo_accounting_service
- name: EVENTUATE_CDC_PIPELINE_PIPELINE6_TYPE
value: eventuate-tram
- name: EVENTUATE_CDC_PIPELINE_PIPELINE6_READER
value: reader1
- name: EVENTUATE_CDC_PIPELINE_PIPELINE6_EVENTUATEDATABASESCHEMA
value: ftgoorderhistoryservice
- name: EVENTUATE_CDC_PIPELINE_PIPELINE7_TYPE
value: eventuate-local
- name: EVENTUATE_CDC_PIPELINE_PIPELINE7_READER
value: reader1
- name: EVENTUATE_CDC_PIPELINE_PIPELINE7_EVENTUATEDATABASESCHEMA
value: ftgo_accounting_service
- name: EVENTUATE_CDC_READER_READER1_TYPE
value: mysql-binlog
- name: EVENTUATE_CDC_READER_READER1_DATASOURCEURL
value: jdbc:mysql://ftgo-mysql:3306/eventuate
- name: EVENTUATE_CDC_READER_READER1_DATASOURCEUSERNAME
value: root
- name: EVENTUATE_CDC_READER_READER1_DATASOURCEPASSWORD
value: rootpassword
- name: EVENTUATE_CDC_READER_READER1_DATASOURCEDRIVERCLASSNAME
value: com.mysql.jdbc.Driver
- name: EVENTUATE_CDC_READER_READER1_LEADERSHIPLOCKPATH
value: /eventuate/cdc/leader/common
- name: EVENTUATE_CDC_READER_READER1_CDCDBUSERNAME
value: root
- name: EVENTUATE_CDC_READER_READER1_CDCDBPASSWORD
value: rootpassword
- name: EVENTUATE_CDC_READER_READER1_READOLDDEBEZIUMDBOFFSETSTORAGETOPIC
value: "false"
- name: EVENTUATE_CDC_READER_READER1_MYSQLBINLOGCLIENTUNIQUEID
value: "1"
- name: EVENTUATE_CDC_READER_READER1_OFFSETSTOREKEY
value: MySqlBinlog
- name: EVENTUATE_CDC_READER_READER1_OFFSETSTORAGETOPICNAME
value: db.history.common
livenessProbe:
httpGet:
path: /actuator
port: 8080
initialDelaySeconds: 60
periodSeconds: 20
readinessProbe:
httpGet:
path: /actuator
port: 8080
initialDelaySeconds: 60
periodSeconds: 20
---
75 changes: 0 additions & 75 deletions deployment/kubernetes/cdc-services/eventuate-local-cdc-service.yml

This file was deleted.

77 changes: 0 additions & 77 deletions deployment/kubernetes/cdc-services/ftgo-tram-cdc-service.yml

This file was deleted.

Loading

0 comments on commit 92b9a24

Please sign in to comment.