-
Notifications
You must be signed in to change notification settings - Fork 11
/
multi-processing.sh
executable file
·52 lines (43 loc) · 1.57 KB
/
multi-processing.sh
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
#!/bin/bash
CURRENT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" >/dev/null 2>&1 && pwd)"
source $CURRENT_DIR/logging_lib.sh
NUM_INSTANCES=$1
shift; # Pop $1 from argument list to pass all arguments "$@" to slumps/wafl:latest
if [ -z "$NUM_INSTANCES" ]; then
log_error "Specifiy the number of AFL instances as argument!"
exit 1
fi
log_info "Running $NUM_INSTANCES AFL instance(s)."
set -a
source $CURRENT_DIR/.env
set +a
# Make sure we're starting a fresh test here
rm -R $CURRENT_DIR/wafl-temp
log_info "Running #1"
docker run --env-file=${CURRENT_DIR}/.env \
-e MASTER_AFL_NODE=True \
-e WAFL_INSTANCE_ID=1 \
-v maven_data:/root/.cache/coursier/v1/https/repo1.maven.org/maven2 \
-v compiled_sources:/home/server/src/out/ \
-v ${LOCAL_WASM_DIR:?err}:/home/server/wasm/ \
-v ${CURRENT_DIR}/wafl-temp/afl-out:/home/client/out/ \
-v ${CURRENT_DIR}/wafl-temp/logs/1:/home/shared/logs/ \
-d wafl:latest $@
if [ $NUM_INSTANCES -lt 2 ]; then
exit 0
fi
for i in $(seq 2 $NUM_INSTANCES); do
log_info "Waiting for previous mill server to compile..."
sleep 30s
log_info "Running #${i}"
docker run --env-file=${CURRENT_DIR}/.env \
-e MASTER_AFL_NODE=False \
-e WAFL_INSTANCE_ID=${i} \
-v maven_data:/root/.cache/coursier/v1/https/repo1.maven.org/maven2 \
-v compiled_sources:/home/server/src/out/ \
-v ${LOCAL_WASM_DIR:?err}:/home/server/wasm/ \
-v ${CURRENT_DIR}/wafl-temp/afl-out:/home/client/out/ \
-v ${CURRENT_DIR}/wafl-temp/logs/${i}:/home/shared/logs/ \
-d wafl:latest $@
done
exit 0