forked from mwasilew/lava-docker-compose
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yml
208 lines (179 loc) · 5.33 KB
/
docker-compose.yml
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
version: '3.4'
x-common-env: &common_env
environment:
- LAVA_ADMIN_USER=admin
- LAVA_ADMIN_PASSWORD=admin
- LAVA_SQUAD_USER=squad-bot
- LAVA_SQUAD_PASSWORD=squad-bot
- LAVA_SQUAD_TOKEN=d0siRzClNHWNtUYJbpmjOPEyPp0QLCKqQtDGTftN
- SQUAD_ADMIN_USER=admin
- SQUAD_ADMIN_PASSWORD=admin
- SQUAD_CELERY_BROKER_URL=amqp://rabbitmq.squad
- XDG_DATA_HOME=/home
x-squad-common-config: &common_squad_config
<<: *common_env
volumes:
- squad-home:/home
services:
database:
image: postgres:9.6
container_name: lava_postgres
environment:
POSTGRES_USER: lavaserver
POSTGRES_PASSWORD: mysecretpassword
volumes:
- pgdata:/var/lib/postgresql/data
squid:
image: datadog/squid
container_name: lava_squid
volumes:
- squid:/var/spool/squid
- ./squid/squid.conf:/etc/squid/squid.conf
ports:
- 3128:3128
server:
<<: *common_env
#image: lavasoftware/amd64-lava-server:2019.01
# Use an updated entrypoint; this is necessary to run provision.sh at boot time
# See https://git.lavasoftware.org/lava/pkg/docker/merge_requests/10
build:
context: ./server-docker
container_name: lava.server
ports:
- 8080:80
volumes:
# Job artifact storage
- joboutput:/var/lib/lava-server/default/media/job-output
# server configuration files and directories
- ./server-overlay/etc/lava-server/settings.conf:/etc/lava-server/settings.conf
- ./server-overlay/etc/lava-server/instance.conf:/etc/lava-server/instance.conf
- ./server-overlay/etc/lava-server/dispatcher-config/health-checks:/etc/lava-server/dispatcher-config/health-checks
- ./server-overlay/etc/lava-server/dispatcher-config/devices:/etc/lava-server/dispatcher-config/devices
- ./server-overlay/etc/lava-server/dispatcher.d:/etc/lava-server/dispatcher.d
- ./server-overlay/etc/lava-server/env.yaml:/etc/lava-server/env.yaml
# provisioning script to add users and boards
- ./server-overlay/root/provision.sh:/root/provision.sh
depends_on:
- database
dispatcher:
#image: lavasoftware/amd64-lava-dispatcher:2019.01
# Use modified container with SNMP added
build:
context: ./dispatcher-docker
container_name: lava_dispatcher
devices:
- /dev/kvm # needed for QEMU
- /dev/net/tun # needed for QEMU
cap_add:
- NET_ADMIN # needed for QEMU
environment:
- "DISPATCHER_HOSTNAME=--hostname=dispatcher"
- "LOGGER_URL=tcp://server:5555" # url to send logs
- "MASTER_URL=tcp://server:5556" # url of lava master
volumes:
- '/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
- /var/lib/lava/dispatcher/tmp:/var/lib/lava/dispatcher/tmp
- worker-http:/var/lib/lava/dispatcher/tmp
- worker-tftp:/srv/tftp
depends_on:
- server
worker-webserver:
build:
context: ./httpd
container_name: worker_httpd
ports:
- 80:80
volumes:
- worker-http:/var/lib/lava/dispatcher/tmp
worker-tftpd:
build:
context: ./tftpd
container_name: worker_tftpd
ports:
- 69:69/udp
volumes:
- worker-tftp:/srv/tftp
ser2net:
build:
context: ./ser2net
container_name: worker_ser2net
volumes:
- ./ser2net/ser2net.conf:/etc/ser2net.conf
- '/dev/serial:/dev/serial' # required for serial adapters
- '/dev:/dev'
devices:
- /dev/serial/by-id/usb-FTDI_TTL232R-3V3_FT914B60-if00-port0
- /dev/serial/by-id/usb-FTDI_FT232R_USB_UART_AL03HJDR-if00-port0
- /dev/serial/by-id/usb-FTDI_TTL232R-3V3_FT9PB4QT-if00-port0
- /dev/serial/by-id/usb-FTDI_FT232R_USB_UART_A907DVD3-if00-port0
# worker-nfs:
# build:
# context: ./nfs
# container_name: worker_nfs
# ports:
# - 111:111/udp
# - 2049:2049
# volumes:
# - worker-http:/var/lib/lava/dispatcher/tmp
squad-rabbitmq:
image: rabbitmq
container_name: rabbitmq.squad
squad-dbmigrate:
# initial setup is based on SQLite
# for using PostgreSQL database additional container has to be created
<<: *common_env
volumes:
- squad-home:/home
- ./squad/setup.sh:/app/setup.sh
- ./squad/create_objects.py:/app/create_objects.py
build:
context: ./squad
command: ./setup.sh
deploy:
restart_policy:
condition: none
depends_on:
- squad-web
- server
squad-web:
<<: *common_squad_config
build:
context: ./squad
command: squad --fast --bind 0.0.0.0:8000
ports:
- '8000:8000'
squad-worker:
<<: *common_squad_config
build:
context: ./squad
command: squad-worker
squad-listener:
<<: *common_squad_config
build:
context: ./squad
command: squad-listener
squad-scheduler:
<<: *common_squad_config
build:
context: ./squad
command: squad-scheduler
volumes:
# postgres data volume
pgdata:
name: lava-server-pgdata
# squid cache volume
squid:
name: lava-squid-cache
# lava-server job artifact volume
joboutput:
name: lava-server-job-output
worker-http:
name: worker-http
worker-tftp:
name: worker-tftp
squad-home:
name: squad-home