-
Notifications
You must be signed in to change notification settings - Fork 6
/
run_benchmarks.sh
executable file
·71 lines (61 loc) · 1.97 KB
/
run_benchmarks.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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
#!/usr/bin/env bash
readonly ANSIBLE_HOME=benchmark/ansible
readonly DOCKER_COMPOSE=benchmark/ansible/docker-compose.yml
package() {
mvn -DskipTests=true clean package
}
copy_worker_artifacts() {
local files="${ANSIBLE_HOME}/roles/flamestream-common/files/"
local worker=runtime/target/flamestream-runtime-1.0-SNAPSHOT.jar
local dependencies=runtime/target/lib
local entrypoint=runtime/target/entrypoint.sh
local examples=examples/target/flamestream-examples-1.0-SNAPSHOT.jar
local examples_dependencies=examples/target/lib
if [[ -f "$worker" && -d "$dependencies" && -f "$entrypoint" && -f "$examples" && -d "$examples_dependencies" ]]; then
rm -rf "${files}/lib"
cp "$worker" "$files"
cp "$entrypoint" "$files"
cp -r "$dependencies" "$files"
cp -rp "$examples_dependencies" "$files"
cp -rp "$examples" "${files}/lib"
else
echo "Some artifacts hasn't been found"
return 1
fi
}
copy_flink_artifacts() {
local files="${ANSIBLE_HOME}/roles/flink-bench/files"
local bench="benchmark/flink-benchmark/target/flink-benchmark-1.0-SNAPSHOT-uber.jar"
if [[ -f "$bench" ]]; then
cp "$bench" "$files"
else
echo "Some artifacts hasn't been found"
return 1
fi
}
docker_compose_up() {
docker-compose -f "$DOCKER_COMPOSE" up -d
}
local_bench() {
docker_compose_up \
&& package \
&& copy_worker_artifacts \
&& ansible-playbook -v -i "${ANSIBLE_HOME}/local.yml" "${ANSIBLE_HOME}/flamestream.yml"
}
remote_bench() {
package \
&& copy_worker_artifacts \
&& ansible-playbook -v -i "${ANSIBLE_HOME}/aws.yml" "${ANSIBLE_HOME}/flamestream.yml"
}
local_flink_bench() {
docker_compose_up \
&& package \
&& copy_flink_artifacts \
&& ansible-playbook -v -i "${ANSIBLE_HOME}/local.yml" "${ANSIBLE_HOME}/flink.yml"
}
remote_flink_bench() {
package \
&& copy_flink_artifacts \
&& ansible-playbook -v -i "${ANSIBLE_HOME}/aws.yml" "${ANSIBLE_HOME}/flink.yml"
}
[[ "$0" == "$BASH_SOURCE" ]] && local_flink_bench