forked from opiproject/opi-spdk-bridge
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yml
70 lines (65 loc) · 2.15 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
# SPDX-License-Identifier: Apache-2.0
# Copyright (c) 2022 Dell Inc, or its subsidiaries.
---
version: "3.7"
services:
spdk:
image: "ghcr.io/opiproject/opi-spdk:${SPDK_TAG-main}"
build:
context: spdk
volumes:
- /dev/hugepages:/dev/hugepages
- /dev/shm:/dev/shm
- /proc:/proc
- /var/tmp:/var/tmp
ports:
- "9009:9009"
- "4444:4444"
privileged: true
networks:
- opi
working_dir: /usr/libexec/spdk/scripts
command: |
sh -x -c 'sync; echo 1 > /proc/sys/vm/drop_caches && \
mkdir -p /mnt/huge && \
grep hugetlbfs /proc/mounts || mount -t hugetlbfs nodev /mnt/huge && \
echo 1024 > /proc/sys/vm/nr_hugepages && \
grep "" /sys/kernel/mm/hugepages/hugepages-*/nr_hugepages && \
dd if=/dev/zero of=/tmp/aio_bdev_file bs=512 count=64 && \
/usr/local/bin/spdk_tgt -m 0x1 -s 512 --no-pci -S /var/tmp 2>&1 & \
for i in `seq 1 10`; do ./rpc.py spdk_get_version && break || sleep 1; done && \
./rpc.py bdev_malloc_create -b Malloc0 64 512 && \
./rpc.py bdev_malloc_create -b Malloc1 64 512 && \
./rpc.py nvmf_create_transport -t TCP -u 8192 -m 4 -c 0 && \
./rpc.py nvmf_create_subsystem nqn.2016-06.io.spdk:cnode1 -a -s SPDK00000000000001 -d SPDK_Controller1 && \
./rpc.py nvmf_subsystem_add_listener nqn.2016-06.io.spdk:cnode1 -t tcp -a `hostname -i` -f ipv4 -s 4444 && \
./rpc_http_proxy.py 0.0.0.0 9009 spdkuser spdkpass'
healthcheck:
test: ["CMD-SHELL", "python3 /usr/libexec/spdk/scripts/rpc.py spdk_get_version || exit 1"]
interval: 6s
retries: 5
start_period: 20s
timeout: 10s
opi-spdk-server:
build:
context: server
volumes_from:
- spdk:rw
ports:
- "50051:50051"
networks:
- opi
depends_on:
spdk:
condition: service_healthy
command: /opi-spdk-bridge -port=50051
opi-spdk-client:
build:
context: client
networks:
- opi
depends_on:
- opi-spdk-server
command: /opi-storage-client -addr=opi-spdk-server:50051
networks:
opi: