Skip to content

CI: Add sozu benchmark #5

CI: Add sozu benchmark

CI: Add sozu benchmark #5

Workflow file for this run

---
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