-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathbuildContainers.sh
More file actions
executable file
·118 lines (110 loc) · 3.24 KB
/
buildContainers.sh
File metadata and controls
executable file
·118 lines (110 loc) · 3.24 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
#!bin/bash
## File to build all benchmark containers
# Help Menu
help_menu() {
echo "Help Menu: "
echo "Use the following options with buildContainers script:"
echo "-clean or -c to remove all images/instances and exit"
echo "-linpack or -lp to build linpack benchmark"
echo "-noploop or -np to build noploop benchmark"
echo "-cachebench or -cb to build cachebench benchmark"
echo "-sysbench or -sb to build sysbench benchmark"
exit
}
clean() {
# Removing docker images
echo "---------- Removing Docker images ----------"
active_docker_images=$(sudo docker images | grep -E '.*(capstone+)+.*' | awk '{print $3}')
for docker_image in $active_docker_images; do
sudo docker rmi $docker_image
done
sysbench_docker_image=$(sudo docker images | grep -E '.*(ljishen/sysbench+)+.*' | awk '{print $3}')
if [ -n "$active_docker_images" ]; then
sudo docker rmi $sysbench_docker_image
fi
dangling_docker_image=$(sudo docker images -f "dangling=true" -q)
for docker_image in $dangling_docker_image; do
sudo docker rmi $docker_image
done
# echo "---------- Displaying all Docker images after cleanup ----------"
# sudo docker images
}
while [ ! -z "$1" ]; do
case "$1" in
--clean | -c)
shift
clean
exit
;;
--linpack | -lp)
# Linpack Benchmark
shift
echo "---------- Building Linpack container ----------"
cd linpack
sudo docker build -t capstone_linpack ./
cd ..
;;
--noploop | -np)
# Noploop Benchmark
shift
echo "---------- Building Noploop container ----------"
cd noploop
sudo docker build -t capstone_noploop ./
cd ..
;;
--cachebench | -cb)
# Cachebench Benchmark
shift
echo "---------- Building llcbench (Cachebench) container ----------"
cd cachebench
sudo docker build -t capstone_cachebench ./
cd ..
;;
--unixbench | -ub)
# Unixbench Benchmark
shift
echo "---------- Building Unixbench container ----------"
cd unixbench
sudo docker build -t capstone_unixbench ./
cd ..
;;
--ycruncher | -yc)
# Y-Cruncher Benchmark
shift
echo "---------- Building Y-cruncher container ----------"
cd ycruncher
sudo docker build -t capstone_ycruncher ./
cd ..
;;
--bonnie | -bo)
# Bonnie++ Benchmark
shift
echo "---------- Building Bonnie++ container ----------"
cd bonnie
sudo docker build -t capstone_bonnie ./
cd ..
;;
--sysbench | -sb)
# Sysbench Benchmark
shift
echo "---------- Building Sysbench container ----------"
cd sysbench
sudo docker build -t capstone_sysbench ./
cd ..
;;
--stream | -st)
# Stream Benchmark
shift
echo "---------- Building Stream container ----------"
cd stream
sudo docker build -t capstone_stream ./
cd ..
;;
*)
help_menu
;;
esac
shift $(($# > 0 ? 1 : 0))
done
# echo "---------- Displaying all Docker images ----------"
# sudo docker images