-
Notifications
You must be signed in to change notification settings - Fork 5
/
setup.sh
executable file
·120 lines (118 loc) · 3.17 KB
/
setup.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
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
119
120
# !/bin/bash
leaderFailure=0
if command -v julia &> /dev/null
then
julia setupJulia.jl
else
echo "Error: Julia is not installed on your system."
echo "Do you want to install Julia? (y/n)"
read installJulia
if [ $installJulia == "y" ]
then
if [ "$(uname)" == "Linux" ] && [ "$(uname -m)" == "x86_64" ]
then
echo "Downloading Julia..."
wget https://julialang-s3.julialang.org/bin/linux/x64/1.9/julia-1.9.3-linux-x86_64.tar.gz
echo "Extracting Julia..."
tar -xvzf julia-1.9.3-linux-x86_64.tar.gz
echo "Installing Julia..."
sudo cp -r julia-1.9.3 /opt/
sudo ln -s /opt/julia-1.9.3/bin/julia /usr/local/bin/julia
echo "Julia has been installed."
elif [ "$(uname)" == "Linux" ] && [ "$(uname -m)" == "aarch64" ]
then
echo "Downloading Julia..."
wget https://julialang-s3.julialang.org/bin/linux/aarch64/1.9/julia-1.9.3-linux-aarch64.tar.gz
echo "Extracting Julia..."
tar -xvzf julia-1.9.3-linux-aarch64.tar.gz
echo "Installing Julia..."
sudo cp -r julia-1.9.3 /opt/
sudo ln -s /opt/julia-1.9.3/bin/julia /usr/local/bin/julia
echo "Julia has been installed."
else
echo "Please download Julia from https://julialang.org/downloads/, install it, and then re-run this script."
exit 1
fi
julia setupJulia.jl
else
echo "Please install Julia and re-run this script."
exit 1
fi
fi
if command -v pip &> /dev/null
then
echo "pip is installed"
else
echo "pip is not installed"
echo "Do you want to install pip? (y/n)"
read installPip
if [ $installPip == "y" ]
then
sudo apt install -y python3-pip
else
echo "Please install pip and re-run this script."
exit 1
fi
fi
python3 -m pip install -r requirements.txt
sudo apt install -y docker.io
sudo apt-get install -y libpstreams-dev
sudo apt-get install build-essential
sudo usermod -a -G docker $USER
arr=("DNAVisualizationWorkflow" "ImageProcessingWorkflow" "RegressionTuningWorkflow" "Text2SpeechCensoringWorkflow" "VideoAnalyticsWorkflow")
cd ./scheduler/data
for dirname in "${arr[@]}"
do
if [ -d "$dirname" ]
then
echo "Directory $dirname exists."
else
mkdir "$dirname"
fi
done
cd ../
if [ -d "logs" ]
then
echo "Directory logs exists for the scheduler."
else
mkdir logs
fi
cd ../
cd ./log-parser/get-workflow-logs/data
for dirname in "${arr[@]}"
do
if [ -d "$dirname" ]
then
echo "Directory $dirname exists."
else
mkdir "$dirname"
fi
done
cd ../
if [ -d "logs" ]
then
echo "Directory logs exists for the log collector."
else
mkdir logs
fi
cd ../../
cd ./host-agents/execution-agent
if [ -d "logs" ]
then
echo "Directory logs exists for the host agents."
else
mkdir logs
fi
if [ -d "data" ]
then
echo "Directory data exists for the host agents."
else
mkdir data
fi
cd ../../
if [ $leaderFailure -eq 1 ]
then
cd ./log-parser/get-workflow-logs
python3 getNewDatastoreLogs.py
fi
echo "Please exit your current session and relogin"