zephyrfs/zephyrfs-deploy / 53a1215

Browse files

boilerplate

Authored by mfwolffe <wolffemf@dukes.jmu.edu>
SHA
53a12151ef93793bf60a892888b9333fa7da535b
Tree
aae2598

2 changed files

StatusFile+-
A docker/docker-compose.test.yml 115 0
A docker/docker-compose.yml 128 0
docker/docker-compose.test.ymladded
@@ -0,0 +1,115 @@
1
+version: '3.8'
2
+
3
+# Test configuration with faster startup and more logging
4
+services:
5
+  coordinator:
6
+    build:
7
+      context: ../../zephyrfs-coordinator
8
+      dockerfile: Dockerfile
9
+    container_name: zephyrfs-coordinator-test
10
+    ports:
11
+      - "19090:9090"
12
+    environment:
13
+      - LOG_LEVEL=debug
14
+      - LISTEN_PORT=9090
15
+      - DATA_DIR=/var/lib/zephyrfs
16
+      - TEST_MODE=true
17
+    networks:
18
+      - zephyrfs-test
19
+    healthcheck:
20
+      test: ["CMD", "./coordinator", "--health-check"]
21
+      interval: 10s
22
+      timeout: 5s
23
+      retries: 2
24
+      start_period: 20s
25
+
26
+  node1:
27
+    build:
28
+      context: ../../zephyrfs-node  
29
+      dockerfile: Dockerfile
30
+    container_name: zephyrfs-node1-test
31
+    ports:
32
+      - "14001:4001"
33
+      - "18081:8080"
34
+    environment:
35
+      - LOG_LEVEL=debug
36
+      - P2P_PORT=4001
37
+      - API_PORT=8080
38
+      - COORDINATOR_URL=http://coordinator:9090
39
+      - NODE_ID=test-node1
40
+      - STORAGE_QUOTA=1GB
41
+      - TEST_MODE=true
42
+    networks:
43
+      - zephyrfs-test
44
+    depends_on:
45
+      coordinator:
46
+        condition: service_healthy
47
+    healthcheck:
48
+      test: ["CMD", "zephyrfs-node", "--health-check"]
49
+      interval: 10s
50
+      timeout: 5s
51
+      retries: 2
52
+      start_period: 20s
53
+
54
+  node2:
55
+    build:
56
+      context: ../../zephyrfs-node
57
+      dockerfile: Dockerfile
58
+    container_name: zephyrfs-node2-test
59
+    ports:
60
+      - "14002:4001"
61
+      - "18082:8080"
62
+    environment:
63
+      - LOG_LEVEL=debug
64
+      - P2P_PORT=4001
65
+      - API_PORT=8080
66
+      - COORDINATOR_URL=http://coordinator:9090
67
+      - NODE_ID=test-node2
68
+      - STORAGE_QUOTA=1GB
69
+      - TEST_MODE=true
70
+    networks:
71
+      - zephyrfs-test
72
+    depends_on:
73
+      coordinator:
74
+        condition: service_healthy
75
+    healthcheck:
76
+      test: ["CMD", "zephyrfs-node", "--health-check"]
77
+      interval: 10s
78
+      timeout: 5s
79
+      retries: 2
80
+      start_period: 20s
81
+
82
+  node3:
83
+    build:
84
+      context: ../../zephyrfs-node
85
+      dockerfile: Dockerfile
86
+    container_name: zephyrfs-node3-test
87
+    ports:
88
+      - "14003:4001"
89
+      - "18083:8080"
90
+    environment:
91
+      - LOG_LEVEL=debug
92
+      - P2P_PORT=4001
93
+      - API_PORT=8080
94
+      - COORDINATOR_URL=http://coordinator:9090
95
+      - NODE_ID=test-node3
96
+      - STORAGE_QUOTA=1GB
97
+      - TEST_MODE=true
98
+    networks:
99
+      - zephyrfs-test
100
+    depends_on:
101
+      coordinator:
102
+        condition: service_healthy
103
+    healthcheck:
104
+      test: ["CMD", "zephyrfs-node", "--health-check"]
105
+      interval: 10s
106
+      timeout: 5s
107
+      retries: 2
108
+      start_period: 20s
109
+
110
+networks:
111
+  zephyrfs-test:
112
+    driver: bridge
113
+    ipam:
114
+      config:
115
+        - subnet: 172.21.0.0/16
docker/docker-compose.ymladded
@@ -0,0 +1,128 @@
1
+version: '3.8'
2
+
3
+services:
4
+  coordinator:
5
+    build:
6
+      context: ../../zephyrfs-coordinator
7
+      dockerfile: Dockerfile
8
+    container_name: zephyrfs-coordinator
9
+    ports:
10
+      - "9090:9090"
11
+    volumes:
12
+      - coordinator_data:/var/lib/zephyrfs
13
+    environment:
14
+      - LOG_LEVEL=info
15
+      - LISTEN_PORT=9090
16
+      - DATA_DIR=/var/lib/zephyrfs
17
+    networks:
18
+      - zephyrfs
19
+    healthcheck:
20
+      test: ["CMD", "./coordinator", "--health-check"]
21
+      interval: 30s
22
+      timeout: 10s
23
+      retries: 3
24
+      start_period: 40s
25
+
26
+  node1:
27
+    build:
28
+      context: ../../zephyrfs-node  
29
+      dockerfile: Dockerfile
30
+    container_name: zephyrfs-node1
31
+    ports:
32
+      - "4001:4001"
33
+      - "8081:8080"
34
+    volumes:
35
+      - node1_data:/var/lib/zephyrfs
36
+    environment:
37
+      - LOG_LEVEL=info
38
+      - P2P_PORT=4001
39
+      - API_PORT=8080
40
+      - COORDINATOR_URL=http://coordinator:9090
41
+      - NODE_ID=node1
42
+      - STORAGE_QUOTA=10GB
43
+    networks:
44
+      - zephyrfs
45
+    depends_on:
46
+      coordinator:
47
+        condition: service_healthy
48
+    healthcheck:
49
+      test: ["CMD", "zephyrfs-node", "--health-check"]
50
+      interval: 30s
51
+      timeout: 10s
52
+      retries: 3
53
+      start_period: 40s
54
+
55
+  node2:
56
+    build:
57
+      context: ../../zephyrfs-node
58
+      dockerfile: Dockerfile
59
+    container_name: zephyrfs-node2
60
+    ports:
61
+      - "4002:4001"
62
+      - "8082:8080"
63
+    volumes:
64
+      - node2_data:/var/lib/zephyrfs
65
+    environment:
66
+      - LOG_LEVEL=info
67
+      - P2P_PORT=4001
68
+      - API_PORT=8080
69
+      - COORDINATOR_URL=http://coordinator:9090
70
+      - NODE_ID=node2
71
+      - STORAGE_QUOTA=10GB
72
+    networks:
73
+      - zephyrfs
74
+    depends_on:
75
+      coordinator:
76
+        condition: service_healthy
77
+    healthcheck:
78
+      test: ["CMD", "zephyrfs-node", "--health-check"]
79
+      interval: 30s
80
+      timeout: 10s
81
+      retries: 3
82
+      start_period: 40s
83
+
84
+  node3:
85
+    build:
86
+      context: ../../zephyrfs-node
87
+      dockerfile: Dockerfile
88
+    container_name: zephyrfs-node3
89
+    ports:
90
+      - "4003:4001"
91
+      - "8083:8080"
92
+    volumes:
93
+      - node3_data:/var/lib/zephyrfs
94
+    environment:
95
+      - LOG_LEVEL=info
96
+      - P2P_PORT=4001
97
+      - API_PORT=8080
98
+      - COORDINATOR_URL=http://coordinator:9090
99
+      - NODE_ID=node3
100
+      - STORAGE_QUOTA=10GB
101
+    networks:
102
+      - zephyrfs
103
+    depends_on:
104
+      coordinator:
105
+        condition: service_healthy
106
+    healthcheck:
107
+      test: ["CMD", "zephyrfs-node", "--health-check"]
108
+      interval: 30s
109
+      timeout: 10s
110
+      retries: 3
111
+      start_period: 40s
112
+
113
+networks:
114
+  zephyrfs:
115
+    driver: bridge
116
+    ipam:
117
+      config:
118
+        - subnet: 172.20.0.0/16
119
+
120
+volumes:
121
+  coordinator_data:
122
+    driver: local
123
+  node1_data:
124
+    driver: local  
125
+  node2_data:
126
+    driver: local
127
+  node3_data:
128
+    driver: local