-
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.test.yml
More file actions
128 lines (122 loc) · 3.4 KB
/
docker-compose.test.yml
File metadata and controls
128 lines (122 loc) · 3.4 KB
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
# LANCE 3-Node Cluster for Integration Testing
#
# Usage:
# docker-compose -f docker-compose.test.yml up -d # Start cluster
# docker-compose -f docker-compose.test.yml down # Stop cluster
# docker-compose -f docker-compose.test.yml logs -f # View logs
services:
lance-node0:
build:
context: .
dockerfile: Dockerfile
container_name: lance-node0
hostname: lance-node0
command:
- "--node-id=0"
- "--listen=0.0.0.0:1992"
- "--replication=0.0.0.0:1993"
- "--metrics=0.0.0.0:9090"
- "--health=0.0.0.0:8080"
- "--data-dir=/var/lib/lance"
- "--replication-mode=l3"
- "--peers=0@lance-node0:1993,1@lance-node1:1993,2@lance-node2:1993"
ports:
- "1992:1992" # Client port
- "9090:9090" # Metrics
- "8080:8080" # Health
volumes:
- lance-node0-data:/var/lib/lance
networks:
- lance-cluster
healthcheck:
test: ["CMD", "nc", "-z", "localhost", "1992"]
interval: 5s
timeout: 3s
retries: 5
start_period: 10s
lance-node1:
build:
context: .
dockerfile: Dockerfile
container_name: lance-node1
hostname: lance-node1
command:
- "--node-id=1"
- "--listen=0.0.0.0:1992"
- "--replication=0.0.0.0:1993"
- "--metrics=0.0.0.0:9090"
- "--health=0.0.0.0:8080"
- "--data-dir=/var/lib/lance"
- "--replication-mode=l3"
- "--peers=0@lance-node0:1993,1@lance-node1:1993,2@lance-node2:1993"
ports:
- "1993:1992" # Client port (mapped to 1993 on host)
- "9091:9090" # Metrics
- "8081:8080" # Health
volumes:
- lance-node1-data:/var/lib/lance
networks:
- lance-cluster
healthcheck:
test: ["CMD", "nc", "-z", "localhost", "1992"]
interval: 5s
timeout: 3s
retries: 5
start_period: 10s
lance-node2:
build:
context: .
dockerfile: Dockerfile
container_name: lance-node2
hostname: lance-node2
command:
- "--node-id=2"
- "--listen=0.0.0.0:1992"
- "--replication=0.0.0.0:1993"
- "--metrics=0.0.0.0:9090"
- "--health=0.0.0.0:8080"
- "--data-dir=/var/lib/lance"
- "--replication-mode=l3"
- "--peers=0@lance-node0:1993,1@lance-node1:1993,2@lance-node2:1993"
ports:
- "1994:1992" # Client port (mapped to 1994 on host)
- "9092:9090" # Metrics
- "8082:8080" # Health
volumes:
- lance-node2-data:/var/lib/lance
networks:
- lance-cluster
healthcheck:
test: ["CMD", "nc", "-z", "localhost", "1992"]
interval: 5s
timeout: 3s
retries: 5
start_period: 10s
# System Under Test - runs health checks against the cluster
sut:
image: alpine:latest
depends_on:
lance-node0:
condition: service_healthy
lance-node1:
condition: service_healthy
lance-node2:
condition: service_healthy
networks:
- lance-cluster
command: >
sh -c "
echo 'All LANCE nodes are healthy!'
echo 'Verifying cluster connectivity...'
nc -z lance-node0 1992 && echo 'Node 0: OK' || exit 1
nc -z lance-node1 1992 && echo 'Node 1: OK' || exit 1
nc -z lance-node2 1992 && echo 'Node 2: OK' || exit 1
echo 'Cluster health check passed!'
"
networks:
lance-cluster:
driver: bridge
volumes:
lance-node0-data:
lance-node1-data:
lance-node2-data: