-
Notifications
You must be signed in to change notification settings - Fork 189
217 lines (180 loc) · 6.21 KB
/
benchmark.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
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
---
name: Benchmark
on: [ push, pull_request ]
env:
CARGO_TERM_COLOR: always
jobs:
build-bombardier:
name: Build Bombardier 💣️
runs-on: ubuntu-latest
steps:
- name: Clone bombardier
uses: actions/checkout@v4
with:
repository: codesenberg/bombardier
path: .
- uses: actions/setup-go@v5
with:
go-version: '1.18'
check-latest: false
- name: Build bombardier
run: go build -o bombardier
- name: 📤 Upload bombardier
uses: actions/upload-artifact@v4
with:
name: bombardier
path: bombardier
build-lagging_server:
name: Build Lagging_Server ⚡️
runs-on: ubuntu-latest
steps:
- name: Install rust toolchain
uses: actions-rust-lang/setup-rust-toolchain@v1
with:
rustflags: ""
- name: Clone lagging_server
uses: actions/checkout@v4
with:
repository: CleverCloud/lagging_server
path: .
- uses: Swatinem/rust-cache@v2
with:
cache-all-crates: true
prefix-key: "lagging_server"
- name: Build lagging_server
run: cargo build --release
- name: 📤 Upload lagging_server
uses: actions/upload-artifact@v4
with:
name: lagging_server
path: target/release/lagging_server
build-sozu:
name: Build Sozu 🦀
runs-on: ubuntu-latest
steps:
- name: Install protobuf compiler
run: sudo apt-get install -y protobuf-compiler
- name: Install rust toolchain
uses: actions-rust-lang/setup-rust-toolchain@v1
with:
rustflags: ""
- uses: actions/checkout@v4
- uses: Swatinem/rust-cache@v2
with:
cache-all-crates: true
prefix-key: "sozu"
- name: Build Sozu
run: cargo build --release
- name: 📤 Upload sozu
uses: actions/upload-artifact@v4
with:
name: sozu
path: target/release/sozu
build-bench-logger:
name: Build bench_logger 🦀
runs-on: ubuntu-latest
steps:
- name: Install protobuf compiler
run: sudo apt-get install -y protobuf-compiler
- name: Install rust toolchain
uses: actions-rust-lang/setup-rust-toolchain@v1
with:
rustflags: ""
- uses: actions/checkout@v4
- uses: Swatinem/rust-cache@v2
with:
cache-all-crates: true
prefix-key: "sozu"
- name: Build Sozu bench logger (for benchmarking)
run: cargo build --release --example bench_logger
- name: 📤 Upload sozu bench logger
uses: actions/upload-artifact@v4
with:
name: bench_logger
path: target/release/examples/bench_logger
bench:
name: Benchmark 🎯
runs-on: ubuntu-latest
needs: [build-bombardier, build-lagging_server, build-sozu]
steps:
- uses: actions/checkout@v4
- name: 📥 Download bombardier
uses: actions/download-artifact@v4
with:
name: bombardier
path: .github/workflows
- name: 📥 Download lagging_server
uses: actions/download-artifact@v4
with:
name: lagging_server
path: .github/workflows
- name: 📥 Download sozu
uses: actions/download-artifact@v4
with:
name: sozu
path: .github/workflows
- name: Host mapping sozu.io domains
run: |
sudo echo "0.0.0.0 sozu.io" | sudo tee -a /etc/hosts
sudo echo "0.0.0.0 rsa-2048.sozu.io" | sudo tee -a /etc/hosts
sudo echo "0.0.0.0 rsa-4096.sozu.io" | sudo tee -a /etc/hosts
sudo echo "0.0.0.0 ecdsa.sozu.io" | sudo tee -a /etc/hosts
- name: Generate TLS key rsa 2048
working-directory: .github/workflows
run: |
openssl req -newkey rsa:2048 -nodes -keyout rsa-2048.key -out rsa-2048.csr -config rsa-2048.cnf
openssl x509 -req -days 365 -in rsa-2048.csr -signkey rsa-2048.key -out rsa-2048.pem -extensions req_ext -extfile rsa-2048.cnf
sudo cp rsa-2048.pem /usr/local/share/ca-certificates/rsa-2048.crt
sudo update-ca-certificates
- name: Generate TLS key rsa 4096
working-directory: .github/workflows
run: |
openssl req -newkey rsa:4096 -nodes -keyout rsa-4096.key -out rsa-4096.csr -config rsa-4096.cnf
openssl x509 -req -days 365 -in rsa-4096.csr -signkey rsa-4096.key -out rsa-4096.pem -extensions req_ext -extfile rsa-4096.cnf
sudo cp rsa-4096.pem /usr/local/share/ca-certificates/rsa-4096.crt
sudo update-ca-certificates
- name: Generate TLS key ecdsa
working-directory: .github/workflows
run: |
openssl ecparam -name prime256v1 -genkey -out ecdsa.key
openssl req -new -key ecdsa.key -out ecdsa.csr -config ecdsa.cnf
openssl x509 -req -days 365 -in ecdsa.csr -signkey ecdsa.key -out ecdsa.pem -extensions req_ext -extfile ecdsa.cnf
sudo cp ecdsa.pem /usr/local/share/ca-certificates/ecdsa.crt
sudo update-ca-certificates
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: 3.12
- name: Fix rights
working-directory: .github/workflows
run: |
chmod +x bombardier
chmod +x lagging_server
chmod +x sozu
- name: ⚡ Launch bench
working-directory: .github/workflows
run: python bench.py
bench-logs:
name: benchmark the logger
runs-on: ubuntu-latest
needs: [build-sozu, build-bench-logger]
steps:
- uses: actions/checkout@v4
- name: 📥 Download sozu
uses: actions/download-artifact@v4
with:
name: sozu
path: .github/workflows
- name: 📥 Download sozu bench logger
uses: actions/download-artifact@v4
with:
name: bench_logger
path: .github/workflows
- name: Fix rights
working-directory: .github/workflows
run: |
chmod +x sozu
chmod +x bench_logger
- name: Bench the logs
working-directory: .github/workflows
run: python bench_logs.py