-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy pathdocker-compose.yaml
243 lines (232 loc) · 7.96 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
version: "3.4"
services:
db:
image: ${DC_POSTGRES_IMAGE}
environment:
POSTGRES_USER: lavaserver
POSTGRES_PASSWORD: lavaserverdbpass
volumes:
- db-data:/var/lib/postgresql/data
restart: unless-stopped
lava-scheduler:
image: ${DC_SERVER_IMAGE}
volumes:
- device-types:/etc/lava-server/dispatcher-config/device-types:ro
- devices:/etc/lava-server/dispatcher-config/devices:ro
- health-checks:/etc/lava-server/dispatcher-config/health-checks:ro
- ./overlays/etc/lava-server/settings.d/01-database.yaml:/etc/lava-server/settings.d/01-database.yaml:ro
- ./overlays/etc/lava-server/settings.d/01-events.yaml:/etc/lava-server/settings.d/01-events.yaml:ro
- ./overlays/etc/lava-server/lava-scheduler:/etc/lava-server/lava-scheduler:ro
depends_on:
- db
environment:
SERVICES: "lava-scheduler"
restart: unless-stopped
lava-publisher:
image: ${DC_SERVER_IMAGE}
volumes:
- ./overlays/etc/lava-server/settings.d/01-database.yaml:/etc/lava-server/settings.d/01-database.yaml:ro
- ./overlays/etc/lava-server/settings.d/01-events.yaml:/etc/lava-server/settings.d/01-events.yaml:ro
- ./overlays/etc/lava-server/settings.d/02-publisher.yaml:/etc/lava-server/settings.d/02-publisher.yaml:ro
environment:
SERVICES: "lava-publisher"
ports:
- 5500:5500
- 8001:8001
restart: unless-stopped
lava-server:
image: ${DC_SERVER_IMAGE}
volumes:
- device-types:/etc/lava-server/dispatcher-config/device-types
- devices:/etc/lava-server/dispatcher-config/devices
- dispatcher-config:/etc/lava-server/dispatcher.d
- health-checks:/etc/lava-server/dispatcher-config/health-checks
- joboutput:/var/lib/lava-server/default/media/job-output
- ./overlays/etc/lava-server/settings.d/01-database.yaml:/etc/lava-server/settings.d/01-database.yaml:ro
- ./overlays/etc/lava-server/settings.d/01-events.yaml:/etc/lava-server/settings.d/01-events.yaml:ro
- ./overlays/etc/lava-server/settings.d/01-unsecure.yaml:/etc/lava-server/settings.d/01-unsecure.yaml:ro
- ./overlays/etc/lava-server/settings.d/02-autoregister.yaml:/etc/lava-server/settings.d/02-autoregister.yaml:ro
# Example for development
# If you wanted to point to a local git checkout of lava for development
# of lava_dispatcher, you can uncomment out the lines below and
# set the 'source:' to point to where your lava checkout is
# The example assumes its relative in ../lava
#
# - type: bind
# source: ../lava/lava_server
# target: /usr/lib/python3/dist-packages/lava_server
# - type: bind
# source: ../lava/lava_scheduler_app
# target: /usr/lib/python3/dist-packages/lava_scheduler_app
# - type: bind
# source: ../lava/lava_common
# target: /usr/lib/python3/dist-packages/lava_common
depends_on:
- db
- apache2
- lava-publisher
- lava-scheduler
- lava-coordinator
environment:
SERVICES: "gunicorn"
BIND: "--bind lava-server:8000"
LAVA_ADMIN_USERNAME: "${DC_LAVA_ADMIN_USERNAME}"
LAVA_ADMIN_PASSWORD: "${DC_LAVA_ADMIN_PASSWORD}"
restart: unless-stopped
lava-coordinator:
image: ${DC_SERVER_IMAGE}
environment:
SERVICES: "lava-coordinator"
ports:
- 3079:3079
restart: unless-stopped
apache2:
image: ${DC_SERVER_IMAGE}
volumes:
- ./overlays/etc/apache2/sites-available/lava-server.conf:/etc/apache2/sites-available/lava-server.conf:ro
environment:
SERVICES: "apache2"
ports:
- 80:80
restart: unless-stopped
lava-dispatcher:
#image: ${DC_DISPATCHER_IMAGE}
# Needed, support scripts refer to the container by this name.
container_name: lava-dispatcher
build:
context: ./lite-lava-dispatcher
args:
image: ${DC_DISPATCHER_IMAGE}
extra_packages: "linux-image-amd64 curl"
depends_on:
- lava-dispatcher-webserver
- lava-dispatcher-tftpd
- lava-dispatcher-ser2net
- lava-dispatcher-nfs
hostname: worker0
devices:
# - /dev/kvm # needed for QEMU
- /dev/net/tun # needed for QEMU
security_opt:
- apparmor:unconfined # needed for usb mass storage
cap_add:
- NET_ADMIN # needed for QEMU
- SYS_ADMIN # needed for usb mass storage
environment:
WORKER_NAME: "--name=${DC_DISPATCHER_HOSTNAME}"
URL: "${DC_LAVA_SERVER_HOSTNAME}"
http_proxy: "${http_proxy}"
https_proxy: "${https_proxy}"
ftp_proxy: "${ftp_proxy}"
volumes:
- ./overlays/etc/lava-dispatcher/lava-worker:/etc/lava-dispatcher/lava-worker:ro
- /var/run/docker.sock:/var/run/docker.sock # allow to use docker inside this container
- /run/udev:/run/udev:ro # libudev expects it for udev events
- /sys/devices:/sys/devices # for udevadm trigger to work
- /boot:/boot:ro
- /lib/modules:/lib/modules:ro
- '/dev/bus:/dev/bus:ro' # required for USB devices
- '/dev/serial:/dev/serial:ro' # required for serial adapters
- '/dev/disk:/dev/disk:ro' # required for SDMux
- worker-state:/var/lib/lava/dispatcher/worker/
#- worker-http:/var/lib/lava/dispatcher/tmp
- worker-tftp:/srv/tftp
- ./test-images:/test-images:ro
# should be mounted transitively for transitive container access to downloads
- /var/lib/lava/dispatcher/tmp:/var/lib/lava/dispatcher/tmp
# Example for development
# If you wanted to point to a local git checkout of lava for development
# of lava_dispatcher, you can uncomment out the lines below and
# set the 'source:' to point to where your lava checkout is
# The example assumes its relative in ../lava
#
# - type: bind
# source: ../lava/lava_dispatcher
# target: /usr/lib/python3/dist-packages/lava_dispatcher
# - type: bind
# source: ../lava/lava_common
# target: /usr/lib/python3/dist-packages/lava_common
# - type: bind
# source: ../lava/lava_dispatcher_host
# target: /usr/lib/python3/dist-packages/lava_dispatcher_host
lava-dispatcher-webserver:
image: httpd
volumes:
- ./httpd/httpd.conf:/usr/local/apache2/conf/httpd.conf:ro
ports:
- 80
volumes:
- worker-http:/var/lib/lava/dispatcher/tmp
lava-dispatcher-tftpd:
build:
context: ./tftpd
environment:
http_proxy: "${http_proxy}"
https_proxy: "${https_proxy}"
ftp_proxy: "${ftp_proxy}"
ports:
- 69:69/udp
volumes:
- worker-tftp:/srv/tftp
lava-dispatcher-ser2net:
# Required, lite-lava-docker-compose scripts use "lava-ser2net" hostname.
container_name: lava-ser2net
build:
context: ./ser2net
environment:
http_proxy: "${http_proxy}"
https_proxy: "${https_proxy}"
ftp_proxy: "${ftp_proxy}"
privileged: true
volumes:
- '/dev/serial:/dev/serial' # required for serial adapters
- '/dev:/dev'
- type: bind
source: ./ser2net/ser2net.conf
target: /etc/ser2net.conf
devices: []
ports:
- 7101:7101
# LITE devices port range
- 5000-5036:5000-5036
networks:
default:
aliases:
# Existing board configs that users have around, may still refer to
# the older hostname, "ser2net", so we add it as an alias here.
- ser2net
lava-dispatcher-nfs:
build:
context: ./nfs
environment:
http_proxy: "${http_proxy}"
https_proxy: "${https_proxy}"
ftp_proxy: "${ftp_proxy}"
privileged: true
volumes:
- worker-http:/var/lib/lava/dispatcher/tmp
ports:
- 111:111
- 111:111/udp
- 2049:2049
- 2049:2049/udp
- 35543:35543
volumes:
db-data:
name: lava-server-pgdata
device-types:
name: lava-server-device-types
devices:
name: lava-server-devices
dispatcher-config:
name: lava-server-dispatcher-config
health-checks:
name: lava-server-health-checks
joboutput:
name: lava-server-joboutput
worker-state:
name: lava-server-worker-state
worker-http:
name: lava-server-worker-http
worker-tftp:
name: lava-server-worker-tftp