forked from ocurrent/ocaml-ci
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathdocker-compose.yml
144 lines (136 loc) · 4.02 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
version: '3.1'
volumes:
data:
capnp-secrets:
worker-data:
scheduler-data:
caddy_data:
caddy_config:
secrets:
ocaml-ci-github-key:
file: ${SECRETS_DIR}/private-key.pem
ocaml-ci-webhook-secret:
file: ${SECRETS_DIR}/webhook-secret
services:
caddy:
image: caddy
ports:
- '80:80'
- '443:443'
- '8100:8100'
volumes:
- /etc/caddy:/etc/caddy:ro
- caddy_data:/data
- caddy_config:/config
service:
build:
context: .
dockerfile: Dockerfile
# For local deploys using docker build -t ocaml-ci-service -f Dockerfile .
command: >
--github-app-id ${APP_ID}
--github-private-key-file /run/secrets/ocaml-ci-github-key
--github-webhook-secret-file /run/secrets/ocaml-ci-webhook-secret
--confirm above-average
--confirm-auto-release 120
--capnp-public-address=tcp:service:9000
--capnp-listen-address=tcp:0.0.0.0:9000
--submission-service /capnp-secrets/user.cap
--submission-solver-service /capnp-secrets/user.cap
--migration-path /migrations
--github-account-allowlist '${ALLOW_LIST}'
depends_on:
- scheduler
restart: on-failure
environment:
- "CAPNP_PROFILE=production"
- "PLATFORMS=minimal"
- "DOCKER_BUILDKIT=1"
- "PROGRESS_NO_TRUNC=1"
volumes:
- 'data:/var/lib/ocurrent'
- '/var/run/docker.sock:/var/run/docker.sock'
- 'capnp-secrets:/capnp-secrets'
secrets:
- 'ocaml-ci-github-key'
- 'ocaml-ci-webhook-secret'
sysctls:
- 'net.ipv4.tcp_keepalive_time=60'
web:
build:
context: .
dockerfile: Dockerfile.web
# For local deploys using docker build -t ocaml-ci-web -f Dockerfile.web .
command: >
--backend /capnp-secrets/ocaml-ci-admin.cap
--listen-prometheus=9090
depends_on:
- service
# Wait for the default network to be created
restart: on-failure
volumes:
- 'capnp-secrets:/capnp-secrets:ro'
sysctls:
- 'net.ipv4.tcp_keepalive_time=60'
scheduler:
image: ocurrent/ocluster-scheduler:live
command: >
--secrets-dir=/capnp-secrets
--capnp-secret-key-file=/capnp-secrets/key.pem
--capnp-listen-address=tcp:0.0.0.0:9000
--capnp-public-address=tcp:scheduler:9000
--pools=solver,linux-x86_64
--state-dir=/var/lib/ocluster-scheduler
restart: on-failure
volumes:
- 'scheduler-data:/var/lib/ocluster-scheduler'
- 'capnp-secrets:/capnp-secrets'
# Generate the capability file to allow the
# service to connect to the scheduler
scheduler-cap:
image: ocurrent/ocluster-scheduler:live
entrypoint: /bin/sh
command: -c "ocluster-admin -c /capnp-secrets/admin.cap add-client user >> /capnp-secrets/user.cap"
depends_on:
- scheduler
volumes:
- 'capnp-secrets:/capnp-secrets'
worker:
# image: ocurrent/ocluster-worker:live
build:
context: .
dockerfile: Dockerfile.rsync-worker
command: >
--connect=/capnp-secrets/pool-linux-x86_64.cap
--name=ocluster-worker
--capacity=1
--state-dir=/var/lib/ocluster
--obuilder-store=rsync:/rsync
--rsync-mode=copy
--obuilder-healthcheck=0
# Required for the Docker in Docker container to work
privileged: true
# Wait for the scheduler to write pool-linux-x86_64.cap
restart: on-failure
volumes:
- 'worker-data:/var/lib/ocluster'
- '/var/run/docker.sock:/var/run/docker.sock'
- 'capnp-secrets:/capnp-secrets:ro'
environment:
- DOCKER_BUILDKIT=1
- DOCKER_CLI_EXPERIMENTAL=enabled
solver-worker:
image: ocurrent/solver-service:live
command: >
--connect=/capnp-secrets/pool-solver.cap
--name=solver-worker
--capacity=1
--internal-workers=1
--state-dir=/var/lib/ocluster
# Wait for the scheduler to write pool-solver.cap
restart: on-failure
volumes:
- 'worker-data:/var/lib/ocluster'
- 'capnp-secrets:/capnp-secrets:ro'
environment:
- DOCKER_BUILDKIT=1