Skip to content

Commit 37762ad

Browse files
authored
Merge pull request #607 from code0-tech/604-add-aquila-config-to-config-generator
Add aquila config to config-generator
2 parents 55c631a + 5833f38 commit 37762ad

7 files changed

Lines changed: 81 additions & 20 deletions

File tree

.gitlab/ci/container-boot.gitlab-ci.yml

Lines changed: 25 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,16 @@ container:boot:sagittarius:grpc:
5454
- support/grpc_check_health --host docker:50051 --service liveness --retries 20
5555
- support/grpc_check_health --host docker:50051 --service readiness --retries 20
5656

57+
.container:boot:sagittarius-grpc-preparation:
58+
- bundle install
59+
- docker compose up postgres -d
60+
- docker compose up sagittarius-grpc -d
61+
- docker ps --all
62+
- docker compose logs sagittarius-grpc -f &
63+
- support/grpc_check_health --host docker:50051 --service readiness --retries 20
64+
- >
65+
docker compose exec sagittarius-grpc bin/rails runner 'Runtime.create!(name: "Boot Test Runtime", token: "runtime_token")'
66+
5767
container:boot:aquila:
5868
extends:
5969
- .container:boot
@@ -64,15 +74,8 @@ container:boot:aquila:
6474
variables:
6575
SAGITTARIUS_VARIANT: ce
6676
script:
67-
- bundle install
68-
- docker compose up postgres -d
77+
- !reference [.container:boot:sagittarius-grpc-preparation]
6978
- docker compose up nats -d
70-
- docker compose up sagittarius-grpc -d
71-
- docker ps --all
72-
- docker compose logs sagittarius-grpc -f &
73-
- support/grpc_check_health --host docker:50051 --service readiness --retries 20
74-
- >
75-
docker compose exec sagittarius-grpc bin/rails runner 'Runtime.create!(name: "Boot Test Runtime", token: "runtime_token")'
7679
- docker compose up aquila -d
7780
- docker compose logs aquila -f &
7881
- support/grpc_check_health --host docker:8081 --service liveness --retries 20
@@ -83,10 +86,15 @@ container:boot:taurus:
8386
- .container:boot
8487
needs:
8588
- generate-environment
89+
- manifest:aquila
90+
- manifest:sagittarius
8691
- manifest:taurus
92+
variables:
93+
SAGITTARIUS_VARIANT: ce
8794
script:
88-
- bundle install
95+
- !reference [.container:boot:sagittarius-grpc-preparation]
8996
- docker compose up nats -d
97+
- docker compose up aquila -d
9098
- docker compose up taurus -d
9199
- docker compose logs taurus -f &
92100
- support/grpc_check_health --host docker:8082 --service liveness --retries 20
@@ -97,7 +105,12 @@ container:boot:draco:
97105
- .container:boot
98106
needs:
99107
- generate-environment
108+
- manifest:aquila
109+
- manifest:sagittarius
110+
- manifest:taurus
100111
- manifest:draco
112+
variables:
113+
SAGITTARIUS_VARIANT: ce
101114
parallel:
102115
matrix:
103116
- DRACO_VARIANT:
@@ -107,8 +120,10 @@ container:boot:draco:
107120
- amd64
108121
- arm64
109122
script:
110-
- bundle install
123+
- !reference [.container:boot:sagittarius-grpc-preparation]
111124
- docker compose up nats -d
125+
- docker compose up aquila -d
126+
- docker compose up taurus -d
112127
- docker compose up draco -d
113128
- docker compose logs draco -f &
114129
- support/grpc_check_health --host docker:8083 --service liveness --retries 20
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
{
2+
"runtimes": [
3+
{
4+
"identifier": "taurus",
5+
"token": "<%= env('TAURUS_AQUILA_TOKEN') %>"
6+
},
7+
{
8+
"identifier": "draco-rest",
9+
"token": "<%= env('DRACO_REST_AQUILA_TOKEN') %>"
10+
},
11+
{
12+
"identifier": "draco-cron",
13+
"token": "<%= env('DRACO_CRON_AQUILA_TOKEN') %>"
14+
}
15+
]
16+
}

docker-compose/.env

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,10 @@ AQUILA_SAGITTARIUS_URL=http://nginx:80
1414
AQUILA_SAGITTARIUS_TOKEN=
1515
DRACO_REST_PORT=8084
1616

17+
TAURUS_AQUILA_TOKEN=taurus
18+
DRACO_REST_AQUILA_TOKEN=draco-rest
19+
DRACO_CRON_AQUILA_TOKEN=draco-cron
20+
1721
# Active services
1822
COMPOSE_PROFILES=ide,runtime
1923

docker-compose/docker-compose.yml

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ services:
1010
restart: "no"
1111
profiles:
1212
- ide
13+
- runtime
1314

1415
postgres:
1516
image: postgres:16.1
@@ -129,7 +130,10 @@ services:
129130

130131
aquila:
131132
depends_on:
132-
- nats
133+
config-generator:
134+
condition: service_completed_successfully
135+
nats:
136+
condition: service_started
133137
image: ${IMAGE_REGISTRY}/aquila:${IMAGE_TAG}
134138
environment:
135139
MODE: dynamic
@@ -138,6 +142,13 @@ services:
138142
GRPC_HOST: 0.0.0.0
139143
SAGITTARIUS_URL: "${AQUILA_SAGITTARIUS_URL}"
140144
RUNTIME_TOKEN: "${AQUILA_SAGITTARIUS_TOKEN}"
145+
volumes:
146+
- generated-configs:/tmp/generated-configs:ro
147+
entrypoint: |
148+
sh -c "
149+
cp /tmp/generated-configs/aquila.service.configuration.json /service.configuration.json
150+
exec /aquila
151+
"
141152
restart: unless-stopped
142153
profiles:
143154
- runtime
@@ -152,6 +163,7 @@ services:
152163
AQUILA_URL: 'http://aquila:8081'
153164
NATS_URL: nats://nats:4222
154165
DEFINITION_PATH: '/definitions'
166+
AQUILA_TOKEN: "${TAURUS_AQUILA_TOKEN}"
155167
restart: unless-stopped
156168
profiles:
157169
- runtime
@@ -168,6 +180,7 @@ services:
168180
DEFINITION_PATH: '/definitions'
169181
HTTP_SERVER_PORT: 8084
170182
HTTP_SERVER_HOST: "0.0.0.0"
183+
AQUILA_TOKEN: "${DRACO_REST_AQUILA_TOKEN}"
171184
ports:
172185
- "${DRACO_REST_PORT}:8084"
173186
restart: unless-stopped
@@ -184,6 +197,7 @@ services:
184197
NATS_URL: nats://nats:4222
185198
NATS_BUCKET: 'flow_store'
186199
DEFINITION_PATH: '/definitions'
200+
AQUILA_TOKEN: "${DRACO_CRON_AQUILA_TOKEN}"
187201
restart: unless-stopped
188202
profiles:
189203
- runtime

support/config/aquila.actions.json

Lines changed: 0 additions & 8 deletions
This file was deleted.
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{
2+
"runtimes": [
3+
{
4+
"identifier": "taurus",
5+
"token": "taurus"
6+
},
7+
{
8+
"identifier": "draco",
9+
"token": "draco"
10+
}
11+
]
12+
}

support/docker-compose.yml

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ services:
6262
SAGITTARIUS_URL: http://sagittarius-grpc:50051
6363
RUNTIME_TOKEN: runtime_token
6464
volumes:
65-
- ./config/aquila.actions.json:/action.configuration.json
65+
- ./config/aquila.service.configuration.json:/service.configuration.json
6666
ports:
6767
- "8081:8081"
6868

@@ -71,6 +71,10 @@ services:
7171
networks:
7272
- boot
7373
environment:
74+
MODE: dynamic
75+
AQUILA_URL: 'http://aquila:8081'
76+
AQUILA_TOKEN: taurus
77+
DEFINITION_PATH: '/definitions'
7478
NATS_URL: nats://nats:4222
7579
WITH_HEALTH_SERVICE: "true"
7680
GRPC_HOST: 0.0.0.0
@@ -83,6 +87,10 @@ services:
8387
networks:
8488
- boot
8589
environment:
90+
MODE: dynamic
91+
AQUILA_URL: 'http://aquila:8081'
92+
AQUILA_TOKEN: draco
93+
DEFINITION_PATH: '/definitions'
8694
NATS_URL: nats://nats:4222
8795
WITH_HEALTH_SERVICE: "true"
8896
GRPC_HOST: 0.0.0.0

0 commit comments

Comments
 (0)