-
Notifications
You must be signed in to change notification settings - Fork 189
174 lines (146 loc) · 5.13 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
---
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@v4
with:
go-version: '1.18'
check-latest: true
- name: Build bombardier
run: go build -o bombardier
- name: 📤 Upload bombardier
uses: actions/upload-artifact@v3
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: Sykursen/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@v3
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@v3
with:
name: sozu
path: target/release/sozu
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@v3
with:
name: bombardier
path: .github/workflows
- name: 📥 Download lagging_server
uses: actions/download-artifact@v3
with:
name: lagging_server
path: .github/workflows
- name: 📥 Download sozu
uses: actions/download-artifact@v3
with:
name: sozu
path: .github/workflows
- name: Host mapping sozu.io domains
run: |
sudo echo "127.0.0.1 sozu.io" | sudo tee -a /etc/hosts
sudo echo "127.0.0.1 rsa-2048.sozu.io" | sudo tee -a /etc/hosts
sudo echo "127.0.0.1 rsa-4096.sozu.io" | sudo tee -a /etc/hosts
sudo echo "127.0.0.1 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@v4
with:
python-version: 3.12
- name: Fix rights
working-directory: .github/workflows
run: |
chmod +x bombardier
chmod +x lagging_server
chmod +x sozu
ls -la
- name: Launch bench
working-directory: .github/workflows
run:
python bench.py
- name: 📤 Upload lagging_server logs
uses: actions/upload-artifact@v3
with:
name: lagging_server_logs
path: .github/workflows/lagging_server.log
- name: 📤 Upload sozu logs
uses: actions/upload-artifact@v3
with:
name: sozu_logs
path: .github/workflows/sozu.log