-
Notifications
You must be signed in to change notification settings - Fork 1
177 lines (171 loc) · 6.71 KB
/
ci.yml
File metadata and controls
177 lines (171 loc) · 6.71 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
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
name: CI
on:
push:
branches: [main]
pull_request:
branches: [main]
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: cachix/install-nix-action@v27
with:
nix_path: nixpkgs=channel:nixos-unstable
- name: Cache Nix store
uses: actions/cache@v4
with:
path: |
~/.cache/nix
/nix/store
key: nix-${{ runner.os }}-${{ hashFiles('**/Cargo.lock', '**/flake.nix', '**/flake.lock') }}
restore-keys: |
nix-${{ runner.os }}-
- name: Cache Cargo
uses: actions/cache@v4
with:
path: |
~/.cargo/registry
~/.cargo/git
target
key: cargo-${{ runner.os }}-${{ hashFiles('**/Cargo.lock') }}
restore-keys: |
cargo-${{ runner.os }}-
- name: Build
run: nix build
- name: Run tests
run: nix develop -c cargo test --all
- name: Check formatting
run: nix develop -c cargo fmt --check
- name: Clippy
run: nix develop -c cargo clippy --all -- -D warnings
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: libaethalloc
path: result/lib/*.so
benchmarks:
runs-on: ubuntu-latest
needs: build
steps:
- uses: actions/checkout@v4
- name: Download artifact
uses: actions/download-artifact@v4
with:
name: libaethalloc
path: ./lib
- name: Compile benchmarks
run: |
gcc -O3 -pthread benches/packet_churn.c -o /tmp/packet_churn
gcc -O3 -pthread benches/kv_store.c -o /tmp/kv_store
gcc -O3 -pthread benches/producer_consumer.c -o /tmp/producer_consumer
gcc -O3 -pthread benches/multithread_churn.c -o /tmp/multithread_churn
gcc -O3 -pthread benches/fragmentation.c -o /tmp/fragmentation
- name: Packet Churn
run: |
echo "GLIBC=$(/tmp/packet_churn | jq -r '.throughput_ops_per_sec')" >> $GITHUB_ENV
echo "AETHALLOC=$(LD_PRELOAD=$(realpath lib/*.so) /tmp/packet_churn | jq -r '.throughput_ops_per_sec')" >> $GITHUB_ENV
- name: KV Store
run: |
echo "GLIBC_KV=$(/tmp/kv_store | jq -r '.throughput_ops_per_sec')" >> $GITHUB_ENV
echo "AETHALLOC_KV=$(LD_PRELOAD=$(realpath lib/*.so) /tmp/kv_store | jq -r '.throughput_ops_per_sec')" >> $GITHUB_ENV
- name: Producer-Consumer
run: |
echo "GLIBC_PC=$(/tmp/producer_consumer | jq -r '.throughput_ops_per_sec')" >> $GITHUB_ENV
echo "AETHALLOC_PC=$(LD_PRELOAD=$(realpath lib/*.so) /tmp/producer_consumer | jq -r '.throughput_ops_per_sec')" >> $GITHUB_ENV
- name: Multithread Churn
run: |
echo "GLIBC_MT=$(/tmp/multithread_churn | jq -r '.throughput_ops_per_sec')" >> $GITHUB_ENV
echo "AETHALLOC_MT=$(LD_PRELOAD=$(realpath lib/*.so) /tmp/multithread_churn | jq -r '.throughput_ops_per_sec')" >> $GITHUB_ENV
- name: Fragmentation
run: |
echo "GLIBC_RSS=$(/tmp/fragmentation | jq -r '.summary.final_rss_kb')" >> $GITHUB_ENV
echo "AETHALLOC_RSS=$(LD_PRELOAD=$(realpath lib/*.so) /tmp/fragmentation | jq -r '.summary.final_rss_kb')" >> $GITHUB_ENV
stress-tests:
runs-on: ubuntu-latest
needs: build
continue-on-error: true
steps:
- uses: actions/checkout@v4
- name: Download artifact
uses: actions/download-artifact@v4
with:
name: libaethalloc
path: ./lib
- name: Compile stress tests
run: |
gcc -O3 benches/tail_latency.c -o /tmp/tail_latency
gcc -O3 benches/massive_alloc.c -o /tmp/massive_alloc
gcc -O3 benches/corruption_test.c -o /tmp/corruption_test
- name: Tail Latency
run: |
echo "=== GLIBC ===" && /tmp/tail_latency 8 10000 || echo "glibc tail latency failed"
echo "=== AETHALLOC ===" && LD_PRELOAD=$(realpath lib/*.so) /tmp/tail_latency 8 10000 || echo "aethalloc tail latency failed"
- name: Massive Allocations
run: |
echo "=== GLIBC ===" && /tmp/massive_alloc || echo "glibc massive alloc failed"
echo "=== AETHALLOC ===" && LD_PRELOAD=$(realpath lib/*.so) /tmp/massive_alloc || echo "aethalloc massive alloc failed"
- name: Corruption Test
run: LD_PRELOAD=$(realpath lib/*.so) /tmp/corruption_test || echo "corruption test failed"
macro-benchmark:
runs-on: ubuntu-latest
needs: build
continue-on-error: true
steps:
- uses: actions/checkout@v4
- name: Download artifact
uses: actions/download-artifact@v4
with:
name: libaethalloc
path: ./lib
- uses: dtolnay/rust-toolchain@stable
- name: Clone ripgrep
run: cd /tmp && git clone --depth 1 https://github.com/BurntSushi/ripgrep.git
- name: Build ripgrep (glibc)
run: |
echo "=== GLIBC ==="
time cargo build --release --manifest-path /tmp/ripgrep/Cargo.toml 2>&1 | tail -5
- name: Clean and rebuild (aethalloc)
run: |
cargo clean --manifest-path /tmp/ripgrep/Cargo.toml
echo "=== AETHALLOC ==="
time bash -c 'LD_PRELOAD=$(realpath lib/*.so) cargo build --release --manifest-path /tmp/ripgrep/Cargo.toml 2>&1 | tail -5'
metrics-overhead:
runs-on: ubuntu-latest
needs: build
continue-on-error: true
steps:
- uses: actions/checkout@v4
- uses: cachix/install-nix-action@v27
with:
nix_path: nixpkgs=channel:nixos-unstable
- name: Cache Cargo
uses: actions/cache@v4
with:
path: |
~/.cargo/registry
~/.cargo/git
aethalloc-metrics/target
key: metrics-cargo-${{ runner.os }}-${{ hashFiles('aethalloc-metrics/Cargo.lock') }}
- name: Download artifact
uses: actions/download-artifact@v4
with:
name: libaethalloc
path: ./lib
- name: Build aethalloc-metrics
run: cd aethalloc-metrics && cargo build --release
- name: Compile benchmark
run: gcc -O3 -pthread benches/packet_churn.c -o /tmp/packet_churn
- name: Test without metrics
run: |
echo "=== WITHOUT METRICS ==="
for i in 1 2 3; do
LD_PRELOAD=$(realpath lib/*.so) /tmp/packet_churn | jq -r '.throughput_ops_per_sec'
done
- name: Test with metrics library (not started)
run: |
echo "=== WITH METRICS LIBRARY (not started) ==="
for i in 1 2 3; do
LD_PRELOAD="$(realpath lib/*.so):$(realpath aethalloc-metrics/target/release/libaethalloc_metrics.so)" /tmp/packet_churn | jq -r '.throughput_ops_per_sec'
done