forked from canonical/testflinger-docker
-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yaml
257 lines (221 loc) · 4.93 KB
/
docker-compose.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
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
version: "3.9"
services:
db:
image: redis:latest
restart: unless-stopped
container_name: tf-db
networks:
needham_int:
ipv4_address: 10.245.128.13
# docker_int:
# ipv4_address: 10.172.10.13
expose:
- 6379
hostname: tf-db
volumes:
- db_data:/var/lib/redis
- db_log:/var/log/redis
environment:
- REDIS_REPLICATION_MODE=master
command: [
"redis-server",
"--bind 0.0.0.0",
"--maxmemory 16384mb",
"--maxmemory-policy allkeys-lfu"
]
mqtt:
depends_on:
- db
build:
context: .
dockerfile: tf-mqtt
restart: unless-stopped
container_name: tf-mqtt
networks:
needham_int:
ipv4_address: 10.245.128.14
# docker_int:
# ipv4_address: 10.172.10.14
expose:
- 1883
- 9001
hostname: tf-mqtt
# volumes:
# - ./mqtt/conf:/mosquitto/config
api:
depends_on:
- mqtt
build:
context: .
dockerfile: tf-api
restart: unless-stopped
container_name: tf-api
sysctls:
net.core.somaxconn: 2048
networks:
needham_int:
ipv4_address: 10.245.128.10
# docker_int:
# ipv4_address: 10.172.10.10
expose:
- 8000
hostname: tf-api
volumes:
- api_data:/data/testflinger
environment:
- PATH=/data/testflinger:$PATH
command: [
"gunicorn",
"-b=0.0.0.0",
"-t=0",
"-k=gevent",
"--worker-connections=1000",
"testflinger:app"
]
agent:
depends_on:
- api
build:
context: .
dockerfile: tf-agent
stdin_open: true
tty: true
privileged: true
restart: unless-stopped
container_name: tf-agent
networks:
needham_int:
ipv4_address: 10.245.128.11
# docker_int:
# ipv4_address: 10.172.10.11
expose:
- 19999
hostname: tf-agent
volumes:
# for agents (docker in docker)
- /var/run/docker.sock:/var/run/docker.sock
- agent_data:/data/testflinger-agent
- snappy_data:/data/snappy-device-agents
- docker_data:/data/docker
- ./log:/var/log/sut-agent
# netdata volumes
# - netdata_cache:/var/cache/netdata
# - netdata_config:/etc/netdata
# - netdata_lib:/var/lib/netdata
# - /proc:/host/proc:ro
# - /sys:/host/sys:ro
# - /etc/os-release:/host/etc/os-release:ro
# environment:
# - PATH=/data/testflinger-agent:/data/snappy-device-agents:$PATH
command: ["/opt/tf-entrypoint.sh"]
# # for netdata
# cap_add:
# - SYS_PTRACE
# security_opt:
# - apparmor:unconfined
cli:
depends_on:
- agent
build:
context: .
dockerfile: tf-cli
stdin_open: true
tty: true
restart: unless-stopped
container_name: tf-cli
networks:
needham_int:
ipv4_address: 10.245.128.12
# docker_int:
# ipv4_address: 10.172.10.12
hostname: tf-cli
volumes:
- cli_data:/data/testflinger-cli
environment:
- PATH=/data/testflinger-cli:$PATH
portainer:
depends_on:
- cli
image: portainer/portainer-ce:2.9.3
restart: unless-stopped
container_name: nh-portainer
networks:
needham_int:
ipv4_address: 10.245.128.15
# docker_int:
# ipv4_address: 10.172.10.15
expose:
- 9443
hostname: nh-portainer
volumes:
- /var/run/docker.sock:/var/run/docker.sock
- portainer_data:/data
jenkins:
depends_on:
- cli
image: jenkins/jenkins:lts
restart: unless-stopped
container_name: nh-jenkins
networks:
needham_int:
ipv4_address: 10.245.128.16
# docker_int:
# ipv4_address: 10.172.10.16
expose:
- 8080
- 50000
hostname: nh-jenkins
volumes:
- jenkins_data:/var/jenkins_home
- ./jenkins/backups:/data/backups
- ./jenkins/pipelines:/opt/pipelines
restarter:
depends_on:
- api
image: docker
restart: unless-stopped
container_name: tf-restarter
volumes:
- /var/run/docker.sock:/var/run/docker.sock
# periodic execution (UTC 06:00)
command: [
"/bin/sh",
"-c",
"while true; \
do if [ `date +'%H'` -eq 6 ];
then echo 'restarting tf-api @' `date`;
docker restart tf-api;
echo;
sleep 3600;
fi; \
done"]
networks:
# docker_int:
# driver: macvlan
# driver_opts:
# parent: docker0
# ipam:
# config:
# - subnet: "10.172.10.1/24"
needham_int:
driver: macvlan
driver_opts:
parent: eno2
ipam:
config:
- subnet: "10.245.128.0/22"
# - gatway: "10.245.128.9"
volumes:
db_data: {}
db_log: {}
api_data: {}
agent_data: {}
snappy_data: {}
docker_data: {}
agent_log: {}
cli_data: {}
portainer_data: {}
jenkins_data: {}
# netdata_cache: {}
# netdata_config: {}
# netdata_lib: {}