-
Notifications
You must be signed in to change notification settings - Fork 3
154 lines (131 loc) · 4.77 KB
/
benchmark.yml
File metadata and controls
154 lines (131 loc) · 4.77 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
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
name: Benchmark
on:
workflow_dispatch:
jobs:
benchmark:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
driver:
- configs/drivers/reference/jedis.json
- configs/drivers/reference/lettuce.json
- configs/drivers/reference/redisson.json
- configs/drivers/reference/spring-data-redis-jedis.json
- configs/drivers/reference/spring-data-redis-lettuce.json
workload:
- configs/workloads/reference/basic-standalone-single-client.json
- configs/workloads/reference/basic-standalone-100-clients.json
steps:
- uses: actions/checkout@v4
- name: Set up JDK 21
uses: actions/setup-java@v4
with:
java-version: '21'
distribution: 'temurin'
cache: maven
- name: Install build dependencies
run: |
sudo apt-get update
sudo apt-get install -y build-essential
- name: Start Valkey server
run: |
# Use Makefile target which builds from source and configures with persistence disabled
make server-standalone-start
# Wait for server to be ready
sleep 2
# Verify server is up and persistence is disabled
work/valkey/bin/valkey-cli ping
work/valkey/bin/valkey-cli CONFIG GET save
- name: Build Java benchmark
run: |
cd java
mvn -B package -DskipTests
- name: Extract names for result file
id: names
run: |
DRIVER_NAME=$(basename ${{ matrix.driver }} .json)
WORKLOAD_NAME=$(basename ${{ matrix.workload }} .json)
echo "driver_name=$DRIVER_NAME" >> $GITHUB_OUTPUT
echo "workload_name=$WORKLOAD_NAME" >> $GITHUB_OUTPUT
echo "result_file=results/github-runner/reference/${DRIVER_NAME}-${WORKLOAD_NAME}.ndjson" >> $GITHUB_OUTPUT
- name: Run benchmark
run: |
mkdir -p results/github-runner/reference
java -jar java/target/resp-bench-java-1.0.0-SNAPSHOT.jar \
--server localhost:6379 \
--driver ${{ matrix.driver }} \
--workload ${{ matrix.workload }} \
--metrics ${{ steps.names.outputs.result_file }} \
--commit-id ${{ github.sha }}
- name: Stop Valkey server
if: always()
run: |
make server-standalone-stop || true
- name: Upload results
uses: actions/upload-artifact@v4
with:
name: benchmark-${{ steps.names.outputs.driver_name }}-${{ steps.names.outputs.workload_name }}
path: ${{ steps.names.outputs.result_file }}
retention-days: 30
generate-graphs:
needs: benchmark
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: write
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.11'
- name: Install dependencies
run: |
pip install matplotlib numpy
- name: Download all artifacts
uses: actions/download-artifact@v4
with:
path: results/github-runner/reference
pattern: benchmark-*
merge-multiple: true
- name: List downloaded results
run: |
echo "Downloaded results:"
find results -name "*.ndjson" -type f
- name: Generate graphs - Single Client
run: |
python scripts/generate_graphs.py \
--results "results/github-runner/reference/*-basic-standalone-single-client.ndjson" \
--output graphs/single-client/ \
--phase STEADY \
--workload "Single Client" \
--commit-id ${{ github.sha }}
- name: Generate graphs - 100 Clients
run: |
python scripts/generate_graphs.py \
--results "results/github-runner/reference/*-basic-standalone-100-clients.ndjson" \
--output graphs/100-clients/ \
--phase STEADY \
--workload "100 Clients" \
--commit-id ${{ github.sha }}
- name: Upload graphs
uses: actions/upload-artifact@v4
with:
name: benchmark-graphs
path: graphs/
retention-days: 30
- name: Create PR with updated graphs
if: github.ref == 'refs/heads/main'
uses: peter-evans/create-pull-request@v6
with:
commit-message: "Update benchmark graphs"
title: "🔄 Update benchmark graphs"
body: |
This PR updates the benchmark comparison graphs from the latest CI run.
Commit: ${{ github.sha }}
Run: ${{ github.run_id }}
branch: update-benchmark-graphs
delete-branch: true
add-paths: |
graphs/