-
Notifications
You must be signed in to change notification settings - Fork 45
/
docker-compose.yaml
266 lines (266 loc) · 6.98 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
258
259
260
261
262
263
264
265
266
services:
spdk:
image: $QUAY_SPDK:$SPDK_VERSION
profiles:
- build
build:
context: spdk/
dockerfile: ../Dockerfile.spdk
target: spdk
platforms: [$TARGET_PLATFORM]
args:
SPDK_VERSION:
SPDK_CEPH_VERSION:
SPDK_PKGDEP_ARGS:
SPDK_CONFIGURE_ARGS:
SPDK_TARGET_ARCH:
SPDK_MAKEFLAGS:
SPDK_NAME:
SPDK_SUMMARY:
SPDK_DESCRIPTION:
SPDK_URL:
SPDK_MAINTAINER: $MAINTAINER
BUILD_DATE:
SPDK_GIT_REPO:
SPDK_GIT_BRANCH:
SPDK_GIT_COMMIT:
CEPH_CLUSTER_CEPH_REPO_BASEURL:
labels:
io.ceph.nvmeof:
# Used to export RPM packages externally (via bind mount)
spdk-rpm-export:
extends:
service: spdk
image: spdk-rpm-export
build:
target: rpm-export
bdevperf:
extends:
service: spdk
image: bdevperf
build:
target: bdevperf
volumes:
# sudo bash -c 'echo 2048 > /sys/devices/system/node/node0/hugepages/hugepages-2048kB/nr_hugepages'
# https://spdk.io/doc/containers.html
# TODO: Pending of https://github.com/spdk/spdk/issues/2973
- /dev/hugepages:/dev/hugepages
- /dev/vfio/vfio:/dev/vfio/vfio
cap_add:
- SYS_ADMIN # huge-pages
- CAP_SYS_NICE # RTE
- SYS_PTRACE # gdb
ulimits:
nofile: $NVMEOF_NOFILE
memlock: -1
ceph-base:
build:
context: .
dockerfile: Dockerfile.ceph
platforms: [$TARGET_PLATFORM]
args:
CEPH_CLUSTER_VERSION:
CEPH_CLUSTER_CEPH_REPO_BASEURL:
labels:
io.ceph.nvmeof:
environment:
TOUCHFILE: /tmp/ceph.touch
entrypoint: >-
sh -c './vstart.sh --new $$CEPH_VSTART_ARGS &&
echo ceph dashboard nvmeof-gateway-add -i <(echo nvmeof-devel:5500) nvmeof.1 &&
pushd /etc/ceph &&
openssl req -x509 -newkey rsa:4096 -nodes -keyout server.key -out server.crt -days 3650 -subj /CN=my.server -addext "subjectAltName = IP:192.168.13.3, IP:0.0.0.0" &&
openssl req -x509 -newkey rsa:4096 -nodes -keyout client.key -out client.crt -days 3650 -subj /CN=client1 &&
popd &&
ceph osd pool create rbd &&
sleep infinity'
healthcheck:
test: >
[ -f /etc/ceph/server.crt ] &&
[ -f /etc/ceph/server.key ] &&
[ -f /etc/ceph/client.crt ] &&
[ -f /etc/ceph/client.key ] &&
ceph osd pool stats rbd
start_period: 6s
interval: 3s
retries: 10
volumes:
- ceph-conf:/etc/ceph
ulimits:
nofile: 1024
networks:
default:
ipv4_address: 192.168.13.2
ipv6_address: 2001:db8::2
ceph:
extends:
service: ceph-base
image: $QUAY_CEPH:$CEPH_CLUSTER_VERSION
container_name: ceph
ceph-devel:
extends:
service: ceph-base
image: $QUAY_CEPH-devel:$CEPH_CLUSTER_VERSION
container_name: ceph-devel
volumes:
- ${CEPH_DEVEL_MGR_PATH?Define the path of your local Ceph repo}/src/pybind/mgr:/usr/share/ceph/mgr
nvmeof-base:
build:
context: .
platforms: [$TARGET_PLATFORM]
args:
NVMEOF_TARGET: gateway
NVMEOF_SPDK_VERSION:
NVMEOF_NAME:
NVMEOF_SUMMARY:
NVMEOF_DESCRIPTION:
NVMEOF_URL:
NVMEOF_VERSION:
NVMEOF_MAINTAINER: $MAINTAINER
NVMEOF_TAGS:
NVMEOF_WANTS:
NVMEOF_EXPOSE_SERVICES:
BUILD_DATE:
NVMEOF_GIT_REPO:
NVMEOF_GIT_BRANCH:
NVMEOF_GIT_COMMIT:
NVMEOF_GIT_MODIFIED_FILES:
NVMEOF_CEPH_VERSION:
SPDK_GIT_REPO:
SPDK_GIT_BRANCH:
SPDK_GIT_COMMIT:
HUGEPAGES:
HUGEPAGES_DIR:
CONTAINER_REGISTRY:
labels:
io.ceph.nvmeof:
volumes:
# sudo bash -c 'echo 2048 > /sys/devices/system/node/node0/hugepages/hugepages-2048kB/nr_hugepages'
# https://spdk.io/doc/containers.html
# TODO: Pending of https://github.com/spdk/spdk/issues/2973
- /dev/hugepages:/dev/hugepages
- /dev/vfio/vfio:/dev/vfio/vfio
- $NVMEOF_CONFIG:/src/ceph-nvmeof.conf
- /tmp/coredump:/tmp/coredump # core dump
- /var/log/ceph:/var/log/ceph
- ceph-conf:/etc/ceph:ro
cap_add:
- SYS_ADMIN # huge-pages
- CAP_SYS_NICE # RTE
- SYS_PTRACE # gdb
ulimits:
nofile: $NVMEOF_NOFILE
memlock: -1
core:
soft: -1
hard: -1
ports:
- "$NVMEOF_IO_PORT" # I/O controllers
- "$NVMEOF_GW_PORT" # Gateway
- "$NVMEOF_DISC_PORT" # Discovery
nvmeof:
extends:
service: nvmeof-base
image: $QUAY_NVMEOF:$NVMEOF_VERSION
ports:
- "$NVMEOF_IO_PORT" # I/O controllers
- "$NVMEOF_GW_PORT" # Gateway
- "$NVMEOF_PROMETHEUS_PORT" # Prometheus Exporter
depends_on:
ceph:
condition: service_healthy
discovery:
extends:
service: nvmeof-base
image: $QUAY_NVMEOF:$NVMEOF_VERSION
ports:
- "$NVMEOF_DISC_PORT" # Discovery
depends_on:
ceph:
condition: service_healthy
entrypoint: >-
python3 -m control.discovery
# Used to update lockfile (make update-lockfile)
nvmeof-builder-base:
extends:
service: nvmeof-base
image: nvmeof-builder-base
build:
target: builder-base
args:
NVMEOF_TARGET: cli
volumes:
- .:/src
# Used to regenerate gRPC protobuf files
nvmeof-builder:
extends:
service: nvmeof-base
image: nvmeof-builder
build:
target: builder
args:
NVMEOF_TARGET: cli
volumes:
- ./control:/src/control
# Used to export Python package
nvmeof-python-export:
extends:
service: nvmeof-base
image: nvmeof-python-export
build:
target: builder
args:
NVMEOF_TARGET: cli
nvmeof-devel:
image: nvmeof-devel:$NVMEOF_VERSION
# Runs from source code in current dir
extends:
service: nvmeof-base
build:
target: builder
args:
# https://daobook.github.io/pdm/usage/dependency/#add-development-only-dependencies
PDM_INSTALL_DEV: "-d"
depends_on:
ceph-devel:
condition: service_healthy
volumes:
- ./control:/src/control
nvmeof-cli:
image: $QUAY_NVMEOFCLI:$NVMEOF_VERSION
build:
context: .
platforms: [$TARGET_PLATFORM]
args:
NVMEOF_TARGET: cli
NVMEOF_NAME: $NVMEOF_CLI_NAME
NVMEOF_SUMMARY: $NVMEOF_CLI_SUMMARY
NVMEOF_DESCRIPTION: $NVMEOF_CLI_DESCRIPTION
NVMEOF_URL:
NVMEOF_VERSION:
NVMEOF_MAINTAINER: $MAINTAINER
NVMEOF_TAGS: ""
NVMEOF_WANTS: ""
NVMEOF_EXPOSE_SERVICES: ""
BUILD_DATE:
NVMEOF_GIT_REPO:
NVMEOF_GIT_BRANCH:
NVMEOF_GIT_COMMIT:
SPDK_GIT_REPO:
SPDK_GIT_BRANCH:
SPDK_GIT_COMMIT:
HUGEPAGES:
HUGEPAGES_DIR:
labels:
io.ceph.nvmeof:
volumes:
- ceph-conf:/etc/ceph
volumes:
ceph-conf:
networks:
default:
enable_ipv6: true
ipam:
config:
- subnet: 192.168.13.0/24
- subnet: 2001:0DB8::/112