-
Notifications
You must be signed in to change notification settings - Fork 36
/
Copy pathdocker-compose.dev.yaml
173 lines (165 loc) · 4.02 KB
/
docker-compose.dev.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
# Compose schema version
version: '3.4'
# Setup network
networks:
default:
name: fedn_default
services:
# Base services
minio:
image: minio/minio:14128-5ee91dc
hostname: minio
environment:
- GET_HOSTS_FROM=dns
- MINIO_HOST=minio
- MINIO_PORT=9000
- MINIO_ROOT_USER=fedn_admin
- MINIO_ROOT_PASSWORD=password
command: server /data --console-address minio:9001
healthcheck:
test: [ "CMD", "curl", "-f", "http://minio:9000/minio/health/live" ]
interval: 30s
timeout: 20s
retries: 3
ports:
- 9000:9000
- 9001:9001
mongo:
image: mongo:7.0
restart: always
environment:
- MONGO_INITDB_ROOT_USERNAME=fedn_admin
- MONGO_INITDB_ROOT_PASSWORD=password
ports:
- 6534:6534
command: mongod --port 6534
mongo-express:
image: mongo-express:latest
restart: always
depends_on:
- "mongo"
environment:
- ME_CONFIG_MONGODB_SERVER=mongo
- ME_CONFIG_MONGODB_PORT=6534
- ME_CONFIG_MONGODB_ADMINUSERNAME=fedn_admin
- ME_CONFIG_MONGODB_ADMINPASSWORD=password
- ME_CONFIG_BASICAUTH_USERNAME=fedn_admin
- ME_CONFIG_BASICAUTH_PASSWORD=password
ports:
- 8081:8081
fedn_postgres:
image: postgres:15
environment:
POSTGRES_USER: fedn_admin
POSTGRES_PASSWORD: password
POSTGRES_DB: fedn_db
ports:
- "5432:5432"
api-server:
environment:
- GET_HOSTS_FROM=dns
- USER=test
- PROJECT=project
- FLASK_DEBUG=1
- STATESTORE_CONFIG=/app/config/settings-reducer.yaml.template
- MODELSTORAGE_CONFIG=/app/config/settings-reducer.yaml.template
- FEDN_COMPUTE_PACKAGE_DIR=/app
- TMPDIR=/app/tmp
build:
context: .
dockerfile: Dockerfile.dev
args:
BASE_IMG: ${BASE_IMG:-python:3.12-slim}
working_dir: /app
volumes:
- ${HOST_REPO_DIR:-.}/fedn:/app/fedn
depends_on:
- minio
- mongo
- fedn_postgres
command:
- controller
- start
ports:
- 8092:8092
# Combiner
combiner:
environment:
- PYTHONUNBUFFERED=0
- GET_HOSTS_FROM=dns
- STATESTORE_CONFIG=/app/config/settings-combiner.yaml.template
- MODELSTORAGE_CONFIG=/app/config/settings-combiner.yaml.template
- HOOK_SERVICE_HOST=hook:12081
- TMPDIR=/app/tmp
build:
context: .
dockerfile: Dockerfile.dev
args:
BASE_IMG: ${BASE_IMG:-python:3.12-slim}
GRPC_HEALTH_PROBE_VERSION: v0.4.35
working_dir: /app
volumes:
- ${HOST_REPO_DIR:-.}/fedn:/app/fedn
command:
- combiner
- start
- --init
- config/settings-combiner.yaml.template
ports:
- 12080:12080
healthcheck:
test: [ "CMD", "/app/grpc_health_probe", "-addr=localhost:12080" ]
interval: 20s
timeout: 10s
retries: 5
depends_on:
- api-server
- hooks
# Hooks
hooks:
container_name: hook
environment:
- GET_HOSTS_FROM=dns
- TMPDIR=/app/tmp
build:
context: .
dockerfile: Dockerfile.dev
args:
BASE_IMG: ${BASE_IMG:-python:3.12-slim}
GRPC_HEALTH_PROBE_VERSION: v0.4.35
working_dir: /app
volumes:
- ${HOST_REPO_DIR:-.}/fedn:/app/fedn
entrypoint: [ "sh", "-c" ]
command:
- "/venv/bin/pip install --no-cache-dir -e . && /venv/bin/fedn hooks start"
ports:
- 12081:12081
healthcheck:
test: [ "CMD", "/bin/grpc_health_probe", "-addr=localhost:12081" ]
interval: 20s
timeout: 10s
retries: 5
# Client
client:
environment:
- GET_HOSTS_FROM=dns
- FEDN_PACKAGE_EXTRACT_DIR=package
build:
context: .
dockerfile: Dockerfile.dev
args:
BASE_IMG: ${BASE_IMG:-python:3.10-slim}
working_dir: /app
volumes:
- ${HOST_REPO_DIR:-.}/fedn:/app/fedn
command:
- client
- start
- --api-url
- http://api-server:8092
deploy:
replicas: 0
depends_on:
combiner:
condition: service_healthy