Skip to content

Commit

Permalink
init github action for benchmark sanity check
Browse files Browse the repository at this point in the history
Change-Id: Ica2cbab2681d196862e307c0b6e15945df2d0b9c
  • Loading branch information
xiaosong yang committed Oct 29, 2024
1 parent f235b27 commit adceb06
Showing 1 changed file with 69 additions and 0 deletions.
69 changes: 69 additions & 0 deletions .github/workflows/sanity-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
name: benchmark sanity check

on:
push:
branches:
- master
paths-ignore:
- '**.md'
- '**.png'

env:
RUST_TOOLCHAIN: nightly
TOOLCHAIN_PROFILE: minimal

jobs:
benchmark:
runs-on: ubuntu-latest
steps:
- name: Checkout sources
uses: actions/checkout@v2
- name: Install toolchain
uses: actions-rs/toolchain@v1
with:
profile: ${{ env.TOOLCHAIN_PROFILE }}
toolchain: ${{ env.RUST_TOOLCHAIN }}
override: true
- name: Build Proxy
run: |
sudo apt-get install -y pkg-config
cargo build --verbose
- name: Cache
uses: Swatinem/rust-cache@v1
- name: Run proxy
run: |
cd examples/ &&
./gen_cert.sh &&
cp certs/server.key certs/key.pem &&
cp certs/server.crt certs/cert.pem &&
sudo bash -c "ulimit -Sl 512 && ulimit -Hl 512 && sudo -u runner RUSTUP_TOOLCHAIN=nightly RUST_LOG=NONE /home/runner/.cargo/bin/cargo run --package monolake -- -c benchmark/proxy/monolake/monolake.toml &"
- name: Install Run Server
run: |
sudo apt-get update &&
sudo apt-get install -y openssl nginx &&
sudo cp ./benchmark/server/nginx-web.conf /etc/nginx/nginx.conf &&
sudo cp -r ./benchmark/server/webroot/* /usr/share/nginx/html/ &&
cat examples/certs/server.key examples/certs/server.pkcs8 > ./combined.pem &&
sudo mv ./combined.pem /etc/nginx/ &&
mv certs examples/ &&
sudo cp examples/certs/cert.pem /etc/nginx/ &&
sudo systemctl enable nginx &&
sudo systemctl start nginx &&
sleep 2
- name: Checkout client
uses: actions/checkout@v2
with:
repository: 'giltene/wrk2'
path: 'wrk2'
- name: Build client
run: |
sudo apt-get -y install gcc make git libssl-dev zlib1g-dev &&
cd wrk2 &&
make WITH_OPENSSL=/usr &&
sleep 2
- name: Run client
run: |
cd wrk2 &&
curl -vvv http://localhost:8402 &&
./wrk -d 1m -c 640 -t 64 -R 200000 --latency http://localhost:8402 &&
sleep 2

0 comments on commit adceb06

Please sign in to comment.