-
Notifications
You must be signed in to change notification settings - Fork 0
/
run_artifact.sh
executable file
·88 lines (55 loc) · 2.96 KB
/
run_artifact.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
72
73
74
75
76
77
78
79
80
81
#!/bin/bash
print_colorful_text() {
local text="$1"
local color_code="$2"
echo "\e[${color_code}m${text}\e[0m"
}
if [ "$1" = "--slurm" ]; then
execution_mode_arg="--slurm"
echo "Running in job-based mode";
elif ([ "$1" = "--native" ]); then
execution_mode_arg="--native"
echo "Running in native mode";
else
echo "Provide correct execution mode: --slurm or --native"
exit
fi
if [ -z "$2" ]; then
echo "Provide container: docker or podman"
exit
elif [ "$2" = "docker" ]; then
container="docker"
echo "Using docker"
elif [ "$2" = "podman" ]; then
container="podman"
echo "Using podman"
else
echo "Wrong container: provide docker or podman"
fi
# CREATE ASCII ART SAYING " CoMeT ARTIFACT"
./generate_ascii_art.sh
echo "================== Run a container test to make sure container works =================="
${container} run docker.io/hello-world
echo "====================================================================================="
echo "================== Pulling the Docker image to run the experiments =================="
${container} pull docker.io/nisabostanci/comet-image:latest
echo "====================================================================================="
echo "============================== Compiling the simulator ============================="
${container} run --rm -v $PWD:/app/ docker.io/nisabostanci/comet-image:latest /bin/bash -c "cd /app/ && mkdir -p build && sh ./build-docker.sh"
${container} run --rm -v $PWD:/app/ docker.io/nisabostanci/comet-image:latest/bin/bash -c "./app/ramulator"
echo "====================================================================================="
echo "============= Generating the run scripts (this may take a while) ==================="
${container} run --rm -v $PWD:/app/ docker.io/nisabostanci/comet-image:latest /bin/bash -c "python3 /app/genrunsp_docker.py ${PWD} ${execution_mode_arg} ${container}"
# check if cputraces/ directory is empty
if [ "$(ls -A cputraces/)" ]; then
echo "================== cputraces/ directory is not empty =================="
else
echo "================== cputraces/ directory is empty =================="
echo "================== Downloading the traces into ./cputraces =================="
wget --load-cookies /tmp/cookies.txt "https://docs.google.com/uc?export=download&confirm=$(wget --quiet --save-cookies /tmp/cookies.txt --keep-session-cookies --no-check-certificate 'https://docs.google.com/uc?export=download&id=18BAvuQybyKT-RRHeAUFOsMAttG4xWlj-' -O- | sed -rn 's/.*confirm=([0-9A-Za-z_]+).*/\1\n/p')&id=18BAvuQybyKT-RRHeAUFOsMAttG4xWlj-" -O cputraces.tar.bz2 && rm -rf /tmp/cookies.txt
echo "================== Decompressing the traces into ./cputraces =================="
tar -xvf cputraces.tar.bz2
fi
echo "====================================================================================="
echo "============================== Launching experiments =============================="
sh ./run.sh