-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathmaelstrom-kv
More file actions
executable file
·45 lines (39 loc) · 1.48 KB
/
maelstrom-kv
File metadata and controls
executable file
·45 lines (39 loc) · 1.48 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
#!/bin/bash
# Clean and Run Maelstrom with Nemesis Support
# This script cleans up DETS files, compiles the project, and runs Maelstrom tests
# Usage: ./maelstrom-kv [NODE_COUNT] [NEMESIS_TYPE] [TIME_LIMIT]
NODE_COUNT=${1:-3} # Default to 3 nodes if not specified
NEMESIS_TYPE=${2:-""} # Optional nemesis type: partition, kill, pause, or combinations
TIME_LIMIT=${3:-10} # Default to 10 seconds if not specified
echo "Cleaning DETS files..."
rm -f n*_log.dets
echo "Compiling project..."
MIX_ENV=maelstrom mix compile
# Build nemesis arguments
NEMESIS_ARGS=""
if [ ! -z "$NEMESIS_TYPE" ]; then
case "$NEMESIS_TYPE" in
"partition")
NEMESIS_ARGS="--nemesis partition"
;;
"kill")
NEMESIS_ARGS="--nemesis kill"
;;
"pause")
NEMESIS_ARGS="--nemesis pause"
;;
"partition,kill")
NEMESIS_ARGS="--nemesis partition,kill"
;;
"all")
NEMESIS_ARGS="--nemesis partition,kill,pause"
;;
*)
NEMESIS_ARGS="--nemesis $NEMESIS_TYPE"
;;
esac
echo "Running Maelstrom test with $NODE_COUNT nodes, nemesis: $NEMESIS_TYPE, time limit: ${TIME_LIMIT}s..."
else
echo "Running Maelstrom test with $NODE_COUNT nodes, no nemesis, time limit: ${TIME_LIMIT}s..."
fi
exec java -jar maelstrom.jar test -w lin-kv --bin ./run-vsr-node --node-count $NODE_COUNT --time-limit $TIME_LIMIT --concurrency 6 --latency 0 $NEMESIS_ARGS