Skip to content

Commit f3ce1a2

Browse files
authored
RA-87 fix docker compose build (#160)
2 parents 41dbe04 + 0453704 commit f3ce1a2

39 files changed

+274
-528
lines changed

.env.IntegrationTest

Lines changed: 60 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -1,82 +1,83 @@
1+
## Main variables
12
LOG=INFO
2-
NETWORK="devkit" # devkit, mainnet, testnet, preprod
3+
NETWORK=devkit
34
PROTOCOL_MAGIC=42
45

5-
#common env
6-
DB_ADMIN_USER_NAME="rosetta_db_admin"
7-
DB_ADMIN_USER_SECRET="weakpwd#123_d"
6+
## Postgres image
7+
DB_IMAGE_NAME=postgres
8+
DB_IMAGE_TAG=latest
89

9-
# Postgres variables
10-
DB_IMAGE_NAME="postgres"
11-
DB_IMAGE_TAG="latest"
12-
DB_NAME="rosetta-java"
13-
DB_HOST="db" # Service name in docker-compose or local db
14-
DB_PORT="5432"
10+
## Yaci image
11+
YACI_VERSION=0.0.20-beta1
12+
13+
## Postgres variables
14+
DB_NAME=rosetta-java
15+
DB_USER=rosetta_db_admin
16+
DB_SECRET=weakpwd#123_d
17+
DB_HOST=db
18+
# Service name in docker-compose or local db
19+
DB_PORT=5432
1520
DB_SCHEMA=${NETWORK}
16-
DB_PATH="data"
17-
UPDATE_GENESIS_BLOCK_QUERY="UPDATE preprod.block SET number = 0 WHERE number = -1; UPDATE preprod.block SET prev_hash = 'Genesis' WHERE number = 1"
21+
DB_PATH=/data
22+
UPDATE_GENESIS_BLOCK_QUERY="UPDATE devkit.block SET number = 0 WHERE number = -1; UPDATE devkit.block SET prev_hash = 'Genesis' WHERE number = 1"
1823

19-
# Cardano Node variables
20-
CARDANO_NODE_HOST="yaci-cli" # Service name in docker-compose or local cardano node
21-
CARDANO_NODE_PORT="9999" # Uncomment if you are using local cardano node
22-
CARDANO_NODE_VERSION="8.9.0"
23-
CARDANO_NODE_SUBMIT_HOST="cardano-submit-api"
24+
## Cardano Node variables
25+
CARDANO_NODE_HOST=yaci-cli
26+
# Service name in docker-compose or local cardano node
27+
CARDANO_NODE_PORT=3001
28+
# Uncomment if you are using local cardano node
29+
CARDANO_NODE_SUBMIT_HOST=yaci-cli
2430
NODE_SUBMIT_API_PORT=8090
25-
CARDANO_NODE_SOCKET="./node-ipc"
26-
CARDANO_NODE_DB="node/db"
27-
CARDANO_CONFIG="./config/${NETWORK}"
28-
29-
#api env
30-
API_DOCKER_IMAGE_TAG="main"
31-
API_SPRING_PROFILES_ACTIVE_API="dev"
32-
API_PORT="8081"
33-
TRANSACTION_TTL=3000
31+
CARDANO_NODE_VERSION=0.0.0
32+
CARDANO_NODE_SOCKET_PATH=/node
33+
CARDANO_NODE_SOCKET=${CARDANO_NODE_SOCKET_PATH}/node.socket
34+
CARDANO_NODE_DB=/node/db
35+
CARDANO_CONFIG=/config/${NETWORK}
3436

35-
DB_CONNECTION_PARAMS_PROVIDER_TYPE="ENVIRONMENT"
36-
DB_DRIVER_CLASS_NAME="org.postgresql.Driver"
37+
## Api env
38+
API_DOCKER_IMAGE_TAG=main
39+
API_SPRING_PROFILES_ACTIVE=dev
40+
# staging, h2, test. Additional profiles: mempool (if mempool should be activated)
41+
API_PORT=8082
42+
PRINT_EXCEPTION=true
3743

3844
ROSETTA_VERSION=1.4.13
39-
TOPOLOGY_FILEPATH=/config/${NETWORK}/topology.json
40-
GENESIS_SHELLEY_PATH=/config/${NETWORK}/shelley-genesis.json
41-
GENESIS_BYRON_PATH=/config/${NETWORK}/byron-genesis.json
42-
GENESIS_ALONZO_PATH=/config/${NETWORK}/alonzo-genesis.json
43-
GENESIS_CONWAY_PATH=/config/${NETWORK}/conway-genesis.json
45+
TOPOLOGY_FILEPATH=/config/topology.json
46+
GENESIS_SHELLEY_PATH=/config/shelley-genesis.json
47+
GENESIS_BYRON_PATH=/config/byron-genesis.json
48+
GENESIS_ALONZO_PATH=/config/alonzo-genesis.json
49+
GENESIS_CONWAY_PATH=/config/conway-genesis.json
4450

45-
PRINT_EXCEPTION=true
46-
47-
#yaci env
48-
INDEXER_DOCKER_IMAGE_TAG="main"
49-
YACI_SPRING_PROFILES="postgres" # database profiles: h2, postgres
50-
INDEXER_NODE_PORT=3001
51+
## Yaci Indexer env
52+
INDEXER_DOCKER_IMAGE_TAG=main
53+
YACI_SPRING_PROFILES=postgres
54+
# database profiles: h2, h2-testData, postgres
55+
MEMPOOL_ENABLED=false
56+
# Hasn't implemented yet
5157
INITIAL_BALANCE_CALCULATION_BLOCK=0
5258

53-
#devkit env
54-
DEVKIT_ENABLED=true
55-
DEVKIT_URL=yaci-cli
56-
57-
#######################################################
58-
# Ports
59-
#######################################################
60-
HOST_N2N_PORT=3001
59+
## Ports
60+
HOST_N2N_PORT=${CARDANO_NODE_PORT}
61+
HOST_SUBMIT_API_PORT=${NODE_SUBMIT_API_PORT}
6162
HOST_N2C_SOCAT_PORT=3333
6263
HOST_STORE_API_PORT=8080
63-
HOST_VIEWER_PORT=5173
6464
HOST_CLUSTER_API_PORT=10000
65-
HOST_SUBMIT_API_PORT=8090
6665
HOST_OGMIOS_PORT=1337
6766
HOST_KUPO_PORT=1442
67+
HOST_VIEWER_PORT=5173
68+
69+
## Devkit env
70+
DEVKIT_ENABLED=true
71+
DEVKIT_URL=yaci-cli
72+
DEVKIT_PORT=${HOST_N2C_SOCAT_PORT}
6873

69-
#######################################################
70-
# Viewer Config - DON'T CHANGE
71-
#######################################################
74+
## Viewer Config - DON'T CHANGE
7275
VITE_INDEXER_BASE_URL=http://yaci-cli:8080/api/v1
7376
VITE_INDEXER_WS_URL=ws://localhost:${HOST_STORE_API_PORT}/ws/liveblocks
7477
IS_DOCKER=true
7578

76-
#######################################################
77-
# Default Addreses
78-
# Add or remove addresses to topup ada during first run
79-
# Format: <address1>:<ada_amount>,<address2>:<ada_amount>,...
80-
#######################################################
81-
# transaction payment
82-
topup_addresses=addr_test1qz5t8wq55e09usmh07ymxry8atzwxwt2nwwzfngg6esffxvw2pfap6uqmkj3n6zmlrsgz397md2gt7yqs5p255uygaesx608y5:2
79+
## Default Addreses
80+
## Add or remove addresses to topup ada during first run
81+
## Format: <address1>:<ada_amount>,<address2>:<ada_amount>,...
82+
## transaction payment
83+
topup_addresses=addr_test1qz5t8wq55e09usmh07ymxry8atzwxwt2nwwzfngg6esffxvw2pfap6uqmkj3n6zmlrsgz397md2gt7yqs5p255uygaesx608y5:2

.env.docker-compose

Lines changed: 49 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -1,51 +1,60 @@
1+
## Main variables
12
LOG=INFO
2-
NETWORK="preprod" # mainnet, preprod, testnet, devkit
3-
PROTOCOL_MAGIC=1 # mainnet 764824073, preprod 1, testnet 2, devkit 42
3+
NETWORK=preprod
4+
# mainnet, preprod, preview, sanchonet, devkit
5+
PROTOCOL_MAGIC=1
6+
# mainnet 764824073, preprod 1, preview 2, sanchonet 4, devkit 42
47

5-
#common env
6-
DB_ADMIN_USER_NAME="rosetta_db_admin"
7-
DB_ADMIN_USER_SECRET="weakpwd#123_d"
8+
## Postgres image
9+
DB_IMAGE_NAME=postgres
10+
DB_IMAGE_TAG=14.11-bullseye
811

9-
# Postgres variables
10-
DB_IMAGE_NAME="postgres"
11-
DB_IMAGE_TAG="14.11-bullseye"
12-
DB_NAME="rosetta-java-preprod"
13-
DB_HOST="db" # Service name in docker-compose or local db
14-
DB_PORT="5432"
12+
## Postgres variables
13+
DB_NAME=rosetta-java
14+
DB_USER=rosetta_db_admin
15+
DB_SECRET=weakpwd#123_d
16+
DB_HOST=db
17+
# Service name in docker-compose or local db
18+
DB_PORT=5432
1519
DB_SCHEMA=${NETWORK}
16-
DB_PATH="data"
20+
DB_PATH=/data
1721

18-
# Cardano Node variables
19-
CARDANO_NODE_HOST="cardano-node" # Service name in docker-compose or local cardano node
20-
CARDANO_NODE_PORT="3001" # Uncomment if you are using local cardano node
21-
CARDANO_NODE_VERSION="8.9.0"
22-
CARDANO_NODE_SUBMIT_HOST="cardano-submit-api"
22+
## Cardano Node variables
23+
CARDANO_NODE_HOST=cardano-node
24+
# Service name in docker-compose or local cardano node
25+
CARDANO_NODE_PORT=3001
26+
# Uncomment if you are using local cardano node
27+
CARDANO_NODE_VERSION=8.9.0
28+
CARDANO_NODE_SUBMIT_HOST=cardano-submit-api
2329
NODE_SUBMIT_API_PORT=8090
24-
CARDANO_NODE_SOCKET="./node-ipc"
25-
CARDANO_NODE_DB="./node/db"
26-
CARDANO_CONFIG="./config/${NETWORK}"
30+
CARDANO_NODE_SOCKET_PATH=/node
31+
CARDANO_NODE_SOCKET=${CARDANO_NODE_SOCKET_PATH}/node.socket
32+
CARDANO_NODE_DB=/node/db
33+
CARDANO_CONFIG=/config/${NETWORK}
2734

28-
#api env
29-
API_DOCKER_IMAGE_TAG="main"
30-
API_SPRING_PROFILES_ACTIVE_API="dev" # staging. Additional profiles: mempool (if mempool should be activated)
31-
API_PORT=8081
32-
TRANSACTION_TTL=3000
33-
34-
DB_CONNECTION_PARAMS_PROVIDER_TYPE="ENVIRONMENT"
35-
DB_DRIVER_CLASS_NAME="org.postgresql.Driver"
35+
## Api env
36+
API_DOCKER_IMAGE_TAG=main
37+
API_SPRING_PROFILES_ACTIVE=dev
38+
# staging, h2, test. Additional profiles: mempool (if mempool should be activated)
39+
API_PORT=8082
40+
PRINT_EXCEPTION=true
3641

3742
ROSETTA_VERSION=1.4.13
38-
TOPOLOGY_FILEPATH=/config/${NETWORK}/topology.json
39-
GENESIS_SHELLEY_PATH=/config/${NETWORK}/shelley-genesis.json
40-
GENESIS_BYRON_PATH=/config/${NETWORK}/byron-genesis.json
41-
GENESIS_ALONZO_PATH=/config/${NETWORK}/alonzo-genesis.json
42-
GENESIS_CONWAY_PATH=/config/${NETWORK}/conway-genesis.json
43-
API_NODE_SOCKET_PATH=./node/node.socket
44-
PRINT_EXCEPTION=true
43+
TOPOLOGY_FILEPATH=/config/topology.json
44+
GENESIS_SHELLEY_PATH=/config/shelley-genesis.json
45+
GENESIS_BYRON_PATH=/config/byron-genesis.json
46+
GENESIS_ALONZO_PATH=/config/alonzo-genesis.json
47+
GENESIS_CONWAY_PATH=/config/conway-genesis.json
4548

46-
#yaci env
47-
INDEXER_DOCKER_IMAGE_TAG="main"
48-
YACI_SPRING_PROFILES="postgres" # database profiles: h2, postgres
49-
INDEXER_NODE_PORT=3001
49+
## Yaci Indexer env
50+
INDEXER_DOCKER_IMAGE_TAG=main
51+
YACI_SPRING_PROFILES=postgres
52+
# database profiles: h2, h2-testData, postgres
5053
MEMPOOL_ENABLED=false
51-
INITIAL_BALANCE_CALCULATION_BLOCK=0
54+
# Hasn't implemented yet
55+
INITIAL_BALANCE_CALCULATION_BLOCK=0
56+
57+
## Devkit env
58+
DEVKIT_ENABLED=false
59+
DEVKIT_URL=yaci-cli
60+
DEVKIT_PORT=3333

.env.h2

Lines changed: 33 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -1,49 +1,46 @@
1+
## Main variables
12
LOG=INFO
2-
NETWORK=devkit # devkit, mainnet, testnet, prepro
3+
NETWORK=devkit
4+
# mainnet, preprod, preview, sanchonet, devkit
35
PROTOCOL_MAGIC=42
6+
# mainnet 764824073, preprod 1, preview 2, sanchonet 4, devkit 42
47

5-
#common env
6-
DB_ADMIN_USER_NAME=rosetta_db_admin
7-
DB_ADMIN_USER_SECRET=weakpwd#123_d
8-
8+
## H2 image
99
DB_IMAGE_NAME=h2
1010
DB_IMAGE_TAG=14.11-bullseye
11-
DB_NAME=rosetta-java-preprod
12-
DB_HOST=db # Service name in docker-compose or local db
13-
DB_PORT=5432
14-
DB_SCHEMA=${NETWORK}
15-
MAXIMUM_POOL_SIZE=80
16-
JDBC_BATCH_SIZE=1000
17-
SCHEMA=${NETWORK}
18-
CARDANO_NODE_HOST=localhost # Service name in docker-compose or local cardano node
19-
CARDANO_NODE_PORT=3001 # Uncomment if you are using local cardano node
11+
12+
## Postgres variables
13+
DB_NAME=rosetta-java
14+
DB_USER=rosetta_db_admin
15+
DB_SECRET=weakpwd#123_d
16+
17+
## Cardano Node variables
18+
CARDANO_NODE_HOST=localhost
19+
# Service name in docker-compose or local cardano node
20+
CARDANO_NODE_PORT=3001
21+
# Uncomment if you are using local cardano node
2022
CARDANO_NODE_VERSION=8.9.0
21-
CARDANO_NODE_SUBMIT_HOST=cardano-submit-api
23+
CARDANO_NODE_SUBMIT_HOST=localhost
2224
NODE_SUBMIT_API_PORT=8090
23-
CARDANO_NODE_SOCKET=./node-ipc
2425

25-
#api env
26-
API_DOCKER_IMAGE_TAG="main"
26+
## Api env
27+
API_DOCKER_IMAGE_TAG=main
2728
API_SPRING_PROFILES_ACTIVE=h2
28-
API_SPRING_PROFILES_ACTIVE_API=dev
29-
API_EXPOSED_PORT=8081
30-
API_BIND_PORT=8081
31-
TRANSACTION_TTL=3000
32-
33-
DB_CONNECTION_PARAMS_PROVIDER_TYPE=ENVIRONMENT
34-
DB_DRIVER_CLASS_NAME=org.h2.Driver
29+
# staging, h2, test. Additional profiles: mempool (if mempool should be activated)
30+
API_PORT=8082
31+
PRINT_EXCEPTION=true
3532

3633
ROSETTA_VERSION=1.4.13
37-
TOPOLOGY_FILEPATH=config/${NETWORK}/topology.json
38-
GENESIS_SHELLEY_PATH=config/${NETWORK}/shelley-genesis.json
39-
GENESIS_BYRON_PATH=config/${NETWORK}/byron-genesis.json
40-
GENESIS_ALONZO_PATH=config/${NETWORK}/alonzo-genesis.json
41-
GENESIS_CONWAY_PATH=config/${NETWORK}/conway-genesis.json
42-
43-
PRINT_EXCEPTION=true
34+
TOPOLOGY_FILEPATH=./config/${NETWORK}/topology.json
35+
GENESIS_SHELLEY_PATH=./config/${NETWORK}/shelley-genesis.json
36+
GENESIS_BYRON_PATH=./config/${NETWORK}/byron-genesis.json
37+
GENESIS_ALONZO_PATH=./config/${NETWORK}/alonzo-genesis.json
38+
GENESIS_CONWAY_PATH=./config/${NETWORK}/conway-genesis.json
4439

45-
#yaci env
46-
INDEXER_DOCKER_IMAGE_TAG="main"
47-
API_SPRING_PROFILES_ACTIVE_YACI_INDEXER=postgres # database profiles: h2, postgres
48-
INDEXER_NODE_PORT=3001
40+
## Yaci Indexer env
41+
INDEXER_DOCKER_IMAGE_TAG=main
42+
YACI_SPRING_PROFILES=h2
43+
# database profiles: h2, h2-testData, postgres
44+
MEMPOOL_ENABLED=false
45+
# Hasn't implemented yet
4946
INITIAL_BALANCE_CALCULATION_BLOCK=0

.github/workflows/integration-test.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ jobs:
2323
run: |
2424
source ./.env.IntegrationTest
2525
echo "$UPDATE_GENESIS_BLOCK_QUERY" > temp.sql
26-
PGPASSWORD=$DB_ADMIN_USER_SECRET psql -h localhost -p 5432 -d $DB_NAME -U $DB_ADMIN_USER_NAME -f temp.sql
26+
PGPASSWORD=$DB_SECRET psql -h localhost -p 5432 -d $DB_NAME -U $DB_USER -f temp.sql
2727
- name: "Install newman"
2828
run: npm install -g newman
2929
- name: "Install rosetta-cli"

.github/workflows/main.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name: Build main branch
22

33
on:
44
push:
5-
branches: [ main, feat/RA-64-Containerisation-for-Distribution ]
5+
branches: [ main ]
66

77
jobs:
88
build:

.github/workflows/stress-test.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ jobs:
99
- name: Checkout Repository
1010
uses: actions/checkout@v2
1111
- name: "Set up environment"
12-
run: docker compose --env-file .env.docker-compose -f docker-compose.yml up --build -d --wait
12+
run: docker compose --env-file .env.docker-compose -f docker-compose.yaml up --build -d --wait
1313
- name: "Wait for node to be populated"
1414
run: sleep 30s
1515
- name: "Install Node"

.gitignore

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,12 @@ settings.xml
3030
.env*
3131

3232
/data/
33+
/node/
34+
/node-ipc/
35+
/h2/
36+
/logs/
37+
/postgres/
38+
/test-data-generator/src/main/java/org/cardanofoundation/rosetta/testgenerator/devtool/
3339
/docker-compose-3rd.yaml
3440
/testcontainers/node-ipc
3541

0 commit comments

Comments
 (0)