Skip to content

Commit

Permalink
chore: Update docker compose files and Store dependency (#165)
Browse files Browse the repository at this point in the history
* chore: Bump Store version (Utxo balance snapshot, Auto recovery)

* chore: Added additional env variables

* chore: Aggregation app specific properties

* chore: Healthcheck and dependency added for postgres

* chore: Create different docker compose files to reuse
  • Loading branch information
satran004 authored Apr 15, 2024
1 parent f5f48f1 commit fbe080b
Show file tree
Hide file tree
Showing 15 changed files with 229 additions and 288 deletions.
8 changes: 3 additions & 5 deletions aggregation-app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,16 @@ plugins {

dependencies {
implementation 'org.springframework.boot:spring-boot-starter'
implementation 'org.springframework.boot:spring-boot-starter-validation'
implementation 'org.springframework.boot:spring-boot-starter-data-jpa'
implementation 'org.springframework.boot:spring-boot-starter-webflux'
implementation 'org.springframework.boot:spring-boot-configuration-processor'
implementation 'org.springframework.boot:spring-boot-starter-web'
implementation 'org.springframework.boot:spring-boot-starter-batch'
implementation 'org.springframework.boot:spring-boot-starter-actuator'

implementation(libs.yaci.store.starter)
implementation(libs.yaci.store.utxo.starter)
implementation(libs.yaci.store.account.starter)
implementation(libs.yaci.store.admin.starter)

implementation project(':components:healthcheck')
implementation project(':aggregates:account')
runtimeOnly 'org.postgresql:postgresql'

compileOnly(libs.lombok)
Expand Down
10 changes: 8 additions & 2 deletions aggregation-app/src/main/resources/application.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ spring:
out-of-order: true
datasource:
hikari:
maximum-pool-size: 30
maximum-pool-size: 50
minimum-idle: 5
jpa:
properties:
Expand Down Expand Up @@ -39,13 +39,17 @@ store:
history-cleanup-enabled: false
# 3 months
balance-cleanup-slot-count: 7889238
address-tx-amount-include-zero-amount: true
api-enabled: true
parallel-write: true
write-thread-default-batch-size: 1000
jooq-write-batch-size: 3000
write-thread-count: 5
save-address-tx-amount: true
address-tx-amount-include-zero-amount: true
utxo:
save-address: true
address-cache-enabled: true
address-cache-size: 100000
executor:
enable-parallel-processing: true
block-processing-threads: 15
Expand All @@ -54,6 +58,8 @@ store:
blocks-partition-size: 10
use-virtual-thread-for-batch-processing: false
use-virtual-thread-for-event-processing: true
admin:
api-enabled: true

ledger-sync:
healthcheck:
Expand Down
12 changes: 11 additions & 1 deletion config/application.properties
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,16 @@ store.cardano.protocol-magic=1
NETWORK=preprod

##################### Postgres DB #######################
spring.datasource.url=jdbc:postgresql://localhost:5432/ledger_sync?currentSchema=cexplorer
spring.datasource.url=jdbc:postgresql://localhost:5432/ledger_sync?currentSchema=ledger_sync
spring.datasource.username=postgres
spring.datasource.password=1


################## Aggregation App Specific Properties ###########
#store.account.initial-balance-snapshot-block=1950000

#store.account.balance-calc-job-batch-size=500
#store.account.balance-calc-job-partition-size=5

#store.admin.health-check-interval=60
#store.admin.auto-recovery-enabled=true
37 changes: 37 additions & 0 deletions docker/aggr-app-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
version: '3.9'

services:
ledger-sync-aggregation:
image: cardanofoundation/ledger-sync-aggregation:dev
container_name: ledger-sync-aggregation-${NETWORK:-mainnet}
# build:
# context: .
# dockerfile: Dockerfile
# target: aggregation
environment:
- SPRING_DATASOURCE_URL=${SPRING_DATASOURCE_URL:-jdbc:postgresql://ledger-sync-postgres:5432/ledger_sync?currentSchema=aggregation}
- SPRING_DATASOURCE_USERNAME=${SPRING_DATASOURCE_USERNAME:-cardano-master}
- SPRING_DATASOURCE_PASSWORD=${SPRING_DATASOURCE_PASSWORD:-dbpass}
- STORE_CARDANO_HOST=${STORE_CARDANO_HOST:-relays-new.cardano-mainnet.iohk.io}
- STORE_CARDANO_PORT=${STORE_CARDANO_PORT:-3001}
- STORE_CARDANO_PROTOCOLMAGIC=${STORE_CARDANO_PROTOCOLMAGIC:-764824073}
- NETWORK=${NETWORK:-mainnet}
- HEALTH_CHECK_ENABLED=${HEALTH_CHECK_ENABLED:-true}
- EVENT_TIME_THRESHOLD_IN_SECOND=${EVENT_TIME_THRESHOLD_IN_SECOND:-600}
- BLOCK_TIME_CHECK_ENABLED=${BLOCK_TIME_CHECK_ENABLED:-true}
- BLOCK_TIME_THRESHOLD_IN_SECOND=${BLOCK_TIME_THRESHOLD_IN_SECOND:-180}
- STORE_ACCOUNT_INITIALBALANCESNAPSHOTBLOCK=${STORE_ACCOUNT_INITIALBALANCESNAPSHOTBLOCK:-0}
- STORE_ACCOUNT_BALANCECALCJOBBATCHSIZE=${STORE_ACCOUNT_BALANCECALCJOBBATCHSIZE:-500}
- STORE_ACCOUNT_BALANCECALCJOBPARTITIONSIZE=${STORE_ACCOUNT_BALANCECALCJOBPARTITIONSIZE:-5}
- STORE_ADMIN_HEALTHCHECKINTERVAL=${STORE_ADMIN_HEALTHCHECKINTERVAL:-120}
- STORE_ADMIN_AUTORECOVERYENABLED=${STORE_ADMIN_AUTORECOVERYENABLED:-true}
ports:
- ${PORT:-8081}:8080
volumes:
- $PWD/logs:/app/logs

logging:
driver: "json-file"
options:
max-size: "1m"
max-file: "50"
114 changes: 0 additions & 114 deletions docker/docker-compose-aggr-and-main.yml

This file was deleted.

76 changes: 0 additions & 76 deletions docker/docker-compose-aggr.yml

This file was deleted.

32 changes: 32 additions & 0 deletions docker/docker-compose-full.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
version: '3.9'

networks:
ledger-sync-net:

services:
ledger-sync-postgres:
extends:
file: postgres-compose.yml
service: ledger-sync-postgres
networks:
- ledger-sync-net

ledger-sync:
extends:
file: main-app-compose.yml
service: ledger-sync
depends_on:
ledger-sync-postgres:
condition: service_healthy
networks:
- ledger-sync-net

ledger-sync-aggregation:
extends:
file: aggr-app-compose.yml
service: ledger-sync-aggregation
depends_on:
ledger-sync-postgres:
condition: service_healthy
networks:
- ledger-sync-net
22 changes: 22 additions & 0 deletions docker/docker-compose-monolith-aggr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
version: '3.9'

networks:
ledger-sync-net:

services:
ledger-sync-postgres:
extends:
file: postgres-compose.yml
service: ledger-sync-postgres
networks:
- ledger-sync-net

ledger-sync-aggregation:
extends:
file: aggr-app-compose.yml
service: ledger-sync-aggregation
depends_on:
ledger-sync-postgres:
condition: service_healthy
networks:
- ledger-sync-net
22 changes: 22 additions & 0 deletions docker/docker-compose-monolith-main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
version: '3.9'

networks:
ledger-sync-net:

services:
ledger-sync-postgres:
extends:
file: postgres-compose.yml
service: ledger-sync-postgres
networks:
- ledger-sync-net

ledger-sync:
extends:
file: main-app-compose.yml
service: ledger-sync
depends_on:
ledger-sync-postgres:
condition: service_healthy
networks:
- ledger-sync-net
Loading

0 comments on commit fbe080b

Please sign in to comment.