-
Notifications
You must be signed in to change notification settings - Fork 4
139 lines (115 loc) · 4.07 KB
/
bench.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
name: "Benchmark"
on:
push:
branches: [main]
workflow_dispatch:
pull_request:
env:
REGISTRY: ghcr.io
WORKDIR: dev/local/ch-bench-read
COMPOSE_FILE: docker-compose.ci.yml
OTEL_EXPORTER_OTLP_INSECURE: "true"
CGO_ENABLED: 0
CHECK_BENCH_BROKEN: "false"
jobs:
PromQL:
runs-on: [Linux, bench]
steps:
- name: Install Go
uses: actions/setup-go@v5
with:
go-version: "1.21.x"
cache: false
- uses: docker/setup-buildx-action@v3
- name: Docker log in
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- uses: actions/checkout@v4
- name: Get Go environment
id: go-env
run: |
echo "cache=$(go env GOCACHE)" >> $GITHUB_ENV
echo "modcache=$(go env GOMODCACHE)" >> $GITHUB_ENV
echo "goversion=$(go env GOVERSION)" >> $GITHUB_ENV
- name: Set up cache
uses: actions/cache@v4
with:
path: |
${{ env.cache }}
${{ env.modcache }}
key: Benchmark-${{ runner.os }}-go-${{ env.goversion }}-${{ hashFiles('**/go.sum') }}
restore-keys: |
Benchmark-${{ runner.os }}-go-${{ env.goversion }}
- name: Go build
env:
CGO_ENABLED: 0
run: |
go build -trimpath -buildvcs=false -v ./cmd/oteldb
go build -trimpath -buildvcs=false -v ./cmd/chotel
- name: Reset compose
working-directory: ${{ env.WORKDIR }}
run: docker compose down --remove-orphans --volumes --timeout 10
- name: Start compose
working-directory: ${{ env.WORKDIR }}
run: docker compose up -d
- name: Load data
run: |
wget https://storage.yandexcloud.net/faster-public/oteldb/req.rwq
go run github.com/go-faster/oteldb/cmd/otelbench promrw replay -i req.rwq
- name: Warmup
working-directory: ${{ env.WORKDIR }}
run: go run github.com/go-faster/oteldb/cmd/otelbench promql bench -i testdata/node-exporter-selected.promql.yml --warmup 10
- name: Test
working-directory: ${{ env.WORKDIR }}
run: go run github.com/go-faster/oteldb/cmd/otelbench promql bench -o report.yml -i testdata/node-exporter-selected.promql.yml --trace --allow-empty=false --warmup 5
- name: Upload report
uses: actions/upload-artifact@v4
with:
name: report.yml
path: ${{ env.WORKDIR }}/report.yml
if-no-files-found: error
retention-days: 1
- name: Analyze report
working-directory: ${{ env.WORKDIR }}
run: go run github.com/go-faster/oteldb/cmd/otelbench promql analyze -i report.yml
- name: Cleanup
working-directory: ${{ env.WORKDIR }}
if: ${{ ! cancelled() }}
run: docker compose down --remove-orphans --volumes --timeout 10
CheckBenchAPI:
runs-on: [Linux, bench]
steps:
- name: Install Go
uses: actions/setup-go@v5
with:
go-version: "1.21.x"
cache: false
- uses: actions/checkout@v4
- name: Get Go environment
id: go-env
run: |
echo "cache=$(go env GOCACHE)" >> $GITHUB_ENV
echo "modcache=$(go env GOMODCACHE)" >> $GITHUB_ENV
echo "goversion=$(go env GOVERSION)" >> $GITHUB_ENV
- name: Set up cache
uses: actions/cache@v4
with:
path: |
${{ env.cache }}
${{ env.modcache }}
key: Benchmark-API-${{ runner.os }}-go-${{ env.goversion }}-${{ hashFiles('**/go.sum') }}
restore-keys: |
Benchmark-API-${{ runner.os }}-go-${{ env.goversion }}
- name: Go build
run: go build -trimpath -buildvcs=false -v ./cmd/otelbench
- name: Ping
if: ${{ env.CHECK_BENCH_BROKEN != 'true' }}
run: ./otelbench api ping
- name: Status
if: ${{ env.CHECK_BENCH_BROKEN != 'true' }}
run: ./otelbench api status
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}