-
Notifications
You must be signed in to change notification settings - Fork 2
173 lines (171 loc) · 6.19 KB
/
k6.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
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
name: K6 Loki qxip/qryn
on:
workflow_dispatch:
inputs:
qryn_tag:
description: 'Build/Tag for qryn (latest)'
required: false
clickhouse_tag:
description: 'BuildTag for ClickHouse (latest)'
required: false
clickhouse_image:
description: 'Image for ClickHouse'
required: false
jobs:
build:
name: Run k6 on qryn:latest
runs-on: ubuntu-latest
continue-on-error: true
env:
QRYN_VERSION: "ghcr.io/metrico/qryn:${{ github.event.inputs.qryn_tag || 'latest' }}"
services:
minio:
image: bitnami/minio:latest
options: --name minio --hostname minio
ports:
- "9001:9000"
env:
MINIO_ROOT_USER: minio
MINIO_ROOT_PASSWORD: minio123
MINIO_ACCESS_KEY: minio
MINIO_SECRET_KEY: minio123
clickhouse:
image: "${{ github.event.inputs.clickhouse_image || 'clickhouse/clickhouse-server' }}:${{ github.event.inputs.clickhouse_tag || 'latest' }}"
options: --name clickhouse --hostname clickhouse
ports:
- 8123:8123
env:
PORT: 8123
CLICKHOUSE_USER: qryn
CLICKHOUSE_PASSWORD: qryn
#volumes:
# - ${{ github.workspace }}/clickhouse/configs/config.xml:/etc/clickhouse-server/config.d/config.xml"
qryn:
image: "ghcr.io/metrico/qryn:${{ github.event.inputs.qryn_tag || 'latest' }}"
options: --name qryn --hostname qryn
ports:
- 3100:3100
env:
CLICKHOUSE_SERVER: clickhouse
CLICKHOUSE_AUTH: "qryn:qryn"
steps:
- name: List services (pre)
continue-on-error: true
uses: docker://docker
with:
args: docker ps
- name: Manual Checkout
run: |
git clone https://github.com/metrico/qryn-bench
mv qryn-bench/* ./
git clone https://github.com/metrico/qryn-docker-s3
#sudo cp -r ./qryn-docker-s3/configs/config.xml ${{ github.workspace }}/clickhouse/configs/config.xml
- name: Copy Config
uses: docker://docker
with:
args: docker cp ./qryn-docker-s3/configs/clickhouse/config.d/storage.xml clickhouse:/etc/clickhouse-server/config.d/storage.xml
- name: Restart Services (db)
if: true
continue-on-error: true
uses: docker://docker
with:
args: docker restart clickhouse qryn
- name: List services (post-restart)
continue-on-error: true
uses: docker://docker
with:
args: docker ps
- uses: actions/setup-go@v4
with:
go-version: '1.20'
- name: Download k6 for Prometheus
run: |
wget https://github.com/metrico/qryn-bench/releases/download/latest/k6
chmod +x k6
- name: Download k6 for Prometheus
run: |
wget https://github.com/metrico/qryn-bench/releases/download/latest/k6-tracing -O k6-tracing
chmod +x k6-tracing
- name: Collect Workflow Telemetry
uses: runforesight/[email protected]
- name: Wait for Loki API
uses: mydea/action-wait-for-api@v1
with:
url: "http://localhost:3100/loki/api/v1/label"
expected-response-field: "status"
expected-response-field-value: "success"
timeout: 60
- name: Run k6 loki test
run: ./k6 run --out csv=results.csv loki/qryn-loki-loadtest.js
env:
K6_VUS: 1
K6_ITERACTIONS: 50
- run: mv summary.txt loki_summary.txt
#if: always()
- name: Wait for Prom API
uses: mydea/action-wait-for-api@v1
with:
url: "http://localhost:3100/api/v1/query"
expected-response-field: "status"
expected-response-field-value: "success"
timeout: 30
- name: Run k6 prometheus test
run: ./k6 run --out csv=results.csv prometheus/qryn-loadtest.js
env:
K6_WRITE_HOSTNAME: "localhost:3100"
K6_READ_HOSTNAME: "localhost:3100"
K6_WRITE_REQUEST_RATE: 1
K6_WRITE_SERIES_PER_REQUEST: 5
K6_READ_REQUEST_RATE: 1
K6_DURATION_MIN: 1
K6_SCRAPE_INTERVAL_SECONDS: 15
RAMP_UP_MIN: 0
- run: mv summary.txt prom_summary.txt
#if: always()
- name: Wait for Tempo API
uses: mydea/action-wait-for-api@v1
with:
url: "http://localhost:3100/api/search/tags"
- name: Run k6 tempo test
run: ./k6-tracing run --out csv=results.csv tempo/qryn-tempo-template.js
env:
K6_TEMPO_ENDPOINT: "http://localhost:3100"
K6_VUS: 1
K6_DURATION_MINUTES: 1
K6_ITERATIONS: 20
- run: mv summary.txt tempo_summary.txt
#if: always()
- name: Strip Text report
#if: always()
run: |
sed -i 's/[^[:print:]]/*/' *_summary.txt
sed -i 's/[\d128-\d255]//g' *_summary.txt
- uses: actions/upload-artifact@v3
#if: always()
with:
name: results
path: |
loki_summary.txt
prom_summary.txt
tempo_summary.txt
- name: Summary Report
#if: always()
run: |
echo "### qryn image" >> $GITHUB_STEP_SUMMARY
echo "qxip/qryn:${{ github.event.inputs.qryn_tag || 'latest' }}" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "### cowsdb image" >> $GITHUB_STEP_SUMMARY
echo "${{ github.event.inputs.clickhouse_image || 'ghcr.io/cowsdb/cowsdb' }}:${{ github.event.inputs.clickhouse_tag || 'latest' }}" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "### Loki Test" >> $GITHUB_STEP_SUMMARY
cat loki_summary.txt >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "### Prometheus Test" >> $GITHUB_STEP_SUMMARY
cat prom_summary.txt >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "### Tempo Test" >> $GITHUB_STEP_SUMMARY
cat tempo_summary.txt >> $GITHUB_STEP_SUMMARY
- name: Pull Docker logs
run: |
docker logs "${{ job.services.clickhouse.id }}"
docker logs "${{ job.services.qryn.id }}"