Skip to content

Commit bc7caf7

Browse files
committed
Added load test run github action
1 parent b0277e9 commit bc7caf7

30 files changed

Lines changed: 2007 additions & 5 deletions

File tree

Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
name: Run Vlei Verifier Router Load test
2+
on:
3+
push:
4+
branches:
5+
- "main"
6+
pull_request:
7+
branches:
8+
- "main"
9+
workflow_dispatch:
10+
jobs:
11+
load-test:
12+
name: Run vlei-verifier-router load test
13+
runs-on: ubuntu-latest
14+
timeout-minutes: 60
15+
steps:
16+
- name: Checkout repo
17+
uses: actions/checkout@v4
18+
- name: Set up Python 3.12.2
19+
uses: actions/setup-python@v2
20+
with:
21+
python-version: 3.12.2
22+
- name: Install libsodium
23+
run: |
24+
sudo apt-get update
25+
sudo apt-get install -y libsodium-dev
26+
- name: Install dependencies
27+
run: |
28+
python -m pip install --upgrade pip
29+
pip install flake8 pytest pytest-cov hio httpx
30+
pip install -r requirements.txt
31+
##################################
32+
# RUN ROUTER MODE
33+
##################################
34+
- name: Start Router Mode Services
35+
run: |
36+
docker compose down
37+
docker compose -f docker-compose-load-test.yml up router -d
38+
39+
- name: Wait for Router Mode services to be healthy
40+
run: |
41+
docker compose ps
42+
sleep 15
43+
44+
- name: Run Load Test for Router Mode
45+
run: |
46+
echo "Running Router mode load test..."
47+
python test/load/load_test.py
48+
49+
- name: Stop Router Mode Services
50+
run: docker compose down
51+
52+
##################################
53+
# RUN VERIFIER MODE
54+
##################################
55+
- name: Start Verifier Mode Services
56+
run: |
57+
docker compose down
58+
docker compose -f docker-compose-load-test.yml up verifier -d
59+
60+
- name: Wait for Verifier service to be healthy
61+
run: |
62+
docker compose ps
63+
sleep 15
64+
65+
- name: Run Load Test for Verifier Mode
66+
run: |
67+
echo "Running Verifier mode load test..."
68+
python load_test.py
69+
70+
- name: Stop Verifier Mode Services
71+
run: docker compose down
72+
73+
- name: Print Results Done
74+
run: echo "Load tests completed successfully!"

.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ lib64/
1919
parts/
2020
sdist/
2121
var/
22-
test/load/test_data
2322
wheels/
2423
share/python-wheels/
2524
*.egg-info/

docker-compose-load-test.yml

Lines changed: 294 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,294 @@
1+
configs:
2+
config.json:
3+
content: |
4+
{
5+
"verifier_instances": [
6+
"http://vlei-verifier-1:7676",
7+
"http://vlei-verifier-2:7676",
8+
"http://vlei-verifier-3:7676",
9+
"http://vlei-verifier-4:7676",
10+
"http://vlei-verifier-5:7676"
11+
]
12+
}
13+
wan.json:
14+
content: |
15+
{
16+
"dt": "2022-01-20T12:57:59.823350+00:00",
17+
"wan": {
18+
"dt": "2022-01-20T12:57:59.823350+00:00",
19+
"curls": ["tcp://witness-demo:5632/", "http://witness-demo:5642/"]
20+
},
21+
}
22+
23+
wil.json:
24+
content: |
25+
{
26+
"dt": "2022-01-20T12:57:59.823350+00:00",
27+
"wil": {
28+
"dt": "2022-01-20T12:57:59.823350+00:00",
29+
"curls": ["http://witness-demo:5643/"]
30+
}
31+
}
32+
wes.json:
33+
content: |
34+
{
35+
"dt": "2022-01-20T12:57:59.823350+00:00",
36+
"wes": {
37+
"dt": "2022-01-20T12:57:59.823350+00:00",
38+
"curls": ["http://witness-demo:5644/"]
39+
}
40+
}
41+
42+
wit.json:
43+
content: |
44+
{
45+
"dt": "2022-01-20T12:57:59.823350+00:00",
46+
"wit": {
47+
"dt": "2022-01-20T12:57:59.823350+00:00",
48+
"curls": ["http://witness-demo:5645/"]
49+
}
50+
}
51+
52+
wub.json:
53+
content: |
54+
{
55+
"dt": "2022-01-20T12:57:59.823350+00:00",
56+
"wub": {
57+
"dt": "2022-01-20T12:57:59.823350+00:00",
58+
"curls": ["http://witness-demo:5646/"]
59+
}
60+
}
61+
62+
wyx.json:
63+
content: |
64+
{
65+
"dt": "2022-01-20T12:57:59.823350+00:00",
66+
"wyx": {
67+
"dt": "2022-01-20T12:57:59.823350+00:00",
68+
"curls": ["http://witness-demo:5647/"]
69+
}
70+
}
71+
services:
72+
vlei-verifier-router:
73+
build:
74+
context: .
75+
dockerfile: ./images/vlei-verifier-router.dockerfile
76+
image: gleif/vlei-verifier-router:latest
77+
hostname: vlei-verifier-router
78+
configs:
79+
- source: config.json
80+
target: /usr/local/var/server/config.json
81+
depends_on:
82+
- redis
83+
- vlei-verifier-1
84+
- vlei-verifier-2
85+
- vlei-verifier-3
86+
- vlei-verifier-4
87+
- vlei-verifier-5
88+
environment:
89+
REDIS_HOST: redis
90+
REDIS_PORT: 6379
91+
ports:
92+
- 7676:7676
93+
healthcheck:
94+
test: ["CMD", "wget", "--spider", "http://vlei-verifier-router:7676/docs"]
95+
interval: 2s
96+
timeout: 3s
97+
retries: 5
98+
start_period: 2s
99+
redis:
100+
image: redis:latest
101+
container_name: redis
102+
ports:
103+
- "6379:6379"
104+
- "6379:6379"
105+
volumes:
106+
- redis_data:/data
107+
restart: always
108+
109+
vlei-server:
110+
image: gleif/vlei
111+
environment:
112+
- PYTHONUNBUFFERED=1
113+
- PYTHONIOENCODING=UTF-8
114+
command:
115+
- vLEI-server
116+
- -s
117+
- ./schema/acdc
118+
- -c
119+
- ./samples/acdc/
120+
- -o
121+
- ./samples/oobis/
122+
healthcheck:
123+
test:
124+
- CMD
125+
- curl
126+
- -f
127+
- http://localhost:7723/oobi/EBfdlu8R27Fbx-ehrqwImnK-8Cm79sqbAQ4MmvEAYqao
128+
interval: 2s
129+
timeout: 3s
130+
retries: 5
131+
start_period: 2s
132+
ports:
133+
- 7723:7723
134+
135+
witness-demo:
136+
image: weboftrust/keri-witness-demo:1.1.0
137+
environment:
138+
- PYTHONUNBUFFERED=1
139+
- PYTHONIOENCODING=UTF-8
140+
healthcheck:
141+
test: [ 'CMD', 'curl', '-f', 'http://localhost:5642/oobi' ]
142+
interval: 2s
143+
timeout: 3s
144+
retries: 5
145+
start_period: 2s
146+
configs:
147+
- source: wan.json
148+
target: /keripy/scripts/keri/cf/main/wan.json
149+
- source: wes.json
150+
target: /keripy/scripts/keri/cf/main/wes.json
151+
- source: wil.json
152+
target: /keripy/scripts/keri/cf/main/wil.json
153+
- source: wit.json
154+
target: /keripy/scripts/keri/cf/main/wit.json
155+
- source: wub.json
156+
target: /keripy/scripts/keri/cf/main/wub.json
157+
- source: wyx.json
158+
target: /keripy/scripts/keri/cf/main/wyx.json
159+
160+
vlei-verifier-single-mode:
161+
image: gleif/vlei-verifier:latest
162+
container_name: vlei-verifier-single-mode
163+
hostname: vlei-verifier-single-mode
164+
environment:
165+
- VERIFIER_CONFIG_FILE=verifier-config-test.json
166+
depends_on:
167+
- vlei-server
168+
- witness-demo
169+
ports:
170+
- 7676:7676
171+
healthcheck:
172+
test: [ 'CMD', 'wget', '--spider', 'http://vlei-verifier-single-mode:7676/health' ]
173+
interval: 2s
174+
timeout: 3s
175+
retries: 5
176+
start_period: 2s
177+
178+
vlei-verifier-1:
179+
image: gleif/vlei-verifier:latest
180+
container_name: vlei-verifier-1
181+
hostname: vlei-verifier-1
182+
environment:
183+
- VERIFIER_CONFIG_FILE=verifier-config-test.json
184+
depends_on:
185+
- vlei-server
186+
- witness-demo
187+
ports:
188+
- 5652:7676
189+
healthcheck:
190+
test: [ 'CMD', 'wget', '--spider', 'http://vlei-verifier-1:7676/health' ]
191+
interval: 2s
192+
timeout: 3s
193+
retries: 5
194+
start_period: 2s
195+
196+
vlei-verifier-2:
197+
image: gleif/vlei-verifier:latest
198+
container_name: vlei-verifier-2
199+
hostname: vlei-verifier-2
200+
environment:
201+
- VERIFIER_CONFIG_FILE=verifier-config-test.json
202+
depends_on:
203+
- vlei-server
204+
- witness-demo
205+
ports:
206+
- 5653:7676
207+
healthcheck:
208+
test: [ 'CMD', 'wget', '--spider', 'http://vlei-verifier-2:7676/health' ]
209+
interval: 2s
210+
timeout: 3s
211+
retries: 5
212+
start_period: 2s
213+
214+
vlei-verifier-3:
215+
image: gleif/vlei-verifier:latest
216+
container_name: vlei-verifier-3
217+
hostname: vlei-verifier-3
218+
environment:
219+
- VERIFIER_CONFIG_FILE=verifier-config-test.json
220+
depends_on:
221+
- vlei-server
222+
- witness-demo
223+
ports:
224+
- 5654:7676
225+
healthcheck:
226+
test: [ 'CMD', 'wget', '--spider', 'http://vlei-verifier-3:7676/health' ]
227+
interval: 2s
228+
timeout: 3s
229+
retries: 5
230+
start_period: 2s
231+
232+
vlei-verifier-4:
233+
image: gleif/vlei-verifier:latest
234+
container_name: vlei-verifier-4
235+
hostname: vlei-verifier-4
236+
environment:
237+
- VERIFIER_CONFIG_FILE=verifier-config-test.json
238+
depends_on:
239+
- vlei-server
240+
- witness-demo
241+
ports:
242+
- 5655:7676
243+
healthcheck:
244+
test: [ 'CMD', 'wget', '--spider', 'http://vlei-verifier-4:7676/health' ]
245+
interval: 2s
246+
timeout: 3s
247+
retries: 5
248+
start_period: 2s
249+
250+
vlei-verifier-5:
251+
image: gleif/vlei-verifier:latest
252+
container_name: vlei-verifier-5
253+
hostname: vlei-verifier-5
254+
environment:
255+
- VERIFIER_CONFIG_FILE=verifier-config-test.json
256+
depends_on:
257+
- vlei-server
258+
- witness-demo
259+
ports:
260+
- 5656:7676
261+
healthcheck:
262+
test: [ 'CMD', 'wget', '--spider', 'http://vlei-verifier-5:7676/health' ]
263+
interval: 2s
264+
timeout: 3s
265+
retries: 5
266+
start_period: 2s
267+
268+
router:
269+
image: alpine:latest
270+
command: [ 'echo', 'Router mode dependencies running' ]
271+
depends_on:
272+
vlei-server:
273+
condition: service_healthy
274+
witness-demo:
275+
condition: service_healthy
276+
vlei-verifier-router:
277+
condition: service_healthy
278+
279+
verifier:
280+
image: alpine:latest
281+
command: [ 'echo', 'Verifier mode dependencies running' ]
282+
depends_on:
283+
vlei-server:
284+
condition: service_healthy
285+
witness-demo:
286+
condition: service_healthy
287+
vlei-verifier-single-mode:
288+
condition: service_healthy
289+
290+
291+
volumes:
292+
redis_data:
293+
294+

images/vlei-verifier-router.dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Use Python 3.12 as the base image
2-
FROM python:3.12-slim
2+
FROM python:3.12
33

44
WORKDIR /usr/local/var/server
55

0 commit comments

Comments
 (0)