-
Notifications
You must be signed in to change notification settings - Fork 2
/
justfile
204 lines (171 loc) · 5.83 KB
/
justfile
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
sync-version:
#!/bin/bash -e
cd {{justfile_directory()}}
vers='0.1.0-dev'
for pkg in `ls crates`
do
echo $pkg $vers
pushd crates/$pkg > /dev/null
cargo set-version $vers
popd > /dev/null
done
fmt:
#!/bin/bash -ex
cargo fmt
cargo sort -w > /dev/null
build:
cargo build --release --offline
miri:
MIRIFLAGS=-Zmiri-backtrace=full \
cargo miri test -p epkv-utils -- --test-threads=1 \
--skip watermark \
--skip flag_group \
--skip stepper
test:
cargo test --release --offline
check: fmt
cargo check
cargo clippy
dev:
#!/bin/bash -ex
cd {{justfile_directory()}}
just check
just miri
just test
udeps:
#!/bin/bash -ex
cd {{justfile_directory()}}
cargo +nightly udeps
doc:
cargo doc -p rocksdb --no-deps
cargo doc --workspace --no-deps --open
generate-local-cluster which: build
#!/bin/bash -ex
cd {{justfile_directory()}}
export RUST_BACKTRACE=full
./target/release/epkv-eval cluster generate \
--config crates/epkv-eval/tests/local-cluster-{{which}}.json \
--target /tmp/epkv-cluster/config
local-server name: build
#!/bin/bash -ex
cd {{justfile_directory()}}
if [ -z "$EPKV_BENCHING" ]; then
export RUST_BACKTRACE=full
export RUST_LOG=epkv_server=debug,epkv_rocks=debug,epkv_epaxos=debug,epkv_protocol=debug
fi
./target/release/epkv-server --config /tmp/epkv-cluster/config/{{name}}.json
local-monitor: build
#!/bin/bash -ex
cd {{justfile_directory()}}
export RUST_BACKTRACE=full
export RUST_LOG=epkv_monitor=debug,epkv_protocol=debug
./target/release/epkv-monitor --config /tmp/epkv-cluster/config/monitor.json
eval *ARGS:
#!/bin/bash -e
cd {{justfile_directory()}}
export RUST_BACKTRACE=full
export RUST_LOG=epkv_eval=debug,epkv_protocol=debug
./target/release/epkv-eval {{ARGS}}
boot-local-cluster which: build
#!/bin/bash -ex
cd {{justfile_directory()}}
rm -rf /tmp/epkv-cluster
just generate-local-cluster {{which}}
mkdir -p target/local-cluster/log
just local-monitor >target/local-cluster/log/monitor.ansi 2>&1 &
sleep 0.5s
just local-server alpha >target/local-cluster/log/alpha.ansi 2>&1 &
just local-server beta >target/local-cluster/log/beta.ansi 2>&1 &
just local-server gamma >target/local-cluster/log/gamma.ansi 2>&1 &
if [ "{{which}}" == "5" ]; then
just local-server delta >target/local-cluster/log/delta.ansi 2>&1 &
just local-server epsilon >target/local-cluster/log/epsilon.ansi 2>&1 &
fi
sleep 1s
ps -ef | rg 'epkv'
killall:
killall epkv-server
killall epkv-monitor
bench-local-case1 which key_size value_size cmd_count batch_size:
#!/bin/bash -ex
cd {{justfile_directory()}}
mkdir -p target/local-cluster/bench
TIME=`date -u +"%Y-%m-%d-%H-%M-%S"`
CONFIG=crates/epkv-eval/tests/local-bench-{{which}}.json
OUTPUT=target/local-cluster/bench/$TIME-case1.json
./target/release/epkv-eval bench \
--config $CONFIG \
--output $OUTPUT \
case1 \
--key-size {{key_size}} \
--value-size {{value_size}} \
--cmd-count {{cmd_count}} \
--batch-size {{batch_size}}
bench-local-case2 which key_size value_size cmd_count batch_size:
#!/bin/bash -ex
cd {{justfile_directory()}}
mkdir -p target/local-cluster/bench
TIME=`date -u +"%Y-%m-%d-%H-%M-%S"`
CONFIG=crates/epkv-eval/tests/local-bench-{{which}}.json
OUTPUT=target/local-cluster/bench/$TIME-case2.json
./target/release/epkv-eval bench \
--config $CONFIG \
--output $OUTPUT \
case2 \
--key-size {{key_size}} \
--value-size {{value_size}} \
--cmd-count {{cmd_count}} \
--batch-size {{batch_size}}
bench-local-case3 which value_size cmd_count conflict_rate interval_ms interval_count:
#!/bin/bash -ex
cd {{justfile_directory()}}
mkdir -p target/local-cluster/bench
TIME=`date -u +"%Y-%m-%d-%H-%M-%S"`
CONFIG=crates/epkv-eval/tests/local-bench-{{which}}.json
OUTPUT=target/local-cluster/bench/$TIME-case3.json
./target/release/epkv-eval bench \
--config $CONFIG \
--output $OUTPUT \
case3 \
--value-size {{value_size}} \
--cmd-count {{cmd_count}} \
--conflict-rate {{conflict_rate}} \
--interval-ms {{interval_ms}} \
--interval-count {{interval_count}}
bench-local-case4 which interval_ms="":
#!/bin/bash -ex
cd {{justfile_directory()}}
mkdir -p target/local-cluster/bench
TIME=`date -u +"%Y-%m-%d-%H-%M-%S"`
CONFIG=crates/epkv-eval/tests/local-bench-{{which}}.json
OUTPUT=target/local-cluster/bench/$TIME-case4.json
LOG=target/local-cluster/log/case4.log
if [ -z "{{interval_ms}}" ]; then
./target/release/epkv-eval bench \
--config $CONFIG \
--output $OUTPUT \
case4
else
./target/release/epkv-eval bench \
--config $CONFIG \
--output $OUTPUT \
case4 \
--interval-ms {{interval_ms}} \
> $LOG
fi
bench-local-case5 which value_size conflict_rate interval cmds server_name:
#!/bin/bash -ex
cd {{justfile_directory()}}
mkdir -p target/local-cluster/bench
TIME=`date -u +"%Y-%m-%d-%H-%M-%S"`
CONFIG=crates/epkv-eval/tests/local-bench-{{which}}.json
OUTPUT=target/local-cluster/bench/$TIME-case5.json
./target/release/epkv-eval bench \
--config $CONFIG \
--output $OUTPUT \
case5 \
--value-size {{value_size}} \
--conflict-rate {{conflict_rate}} \
--cmds-per-interval {{cmds}} \
--interval-ms {{interval}} \
--server-name {{server_name}}