forked from PrincetonUniversity/faas-profiler
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconfigure.sh
executable file
·52 lines (45 loc) · 1.37 KB
/
configure.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
# This script sets some universal parameters.
# It should be run oly once.
# Installing basic dependencies if needed
sudo apt-get install -y moreutils
# Check if python3.10 is installed
if ! command -v python3.10 &> /dev/null
then
echo "Python 3.10 could not be found. Installing..."
sudo apt-get install -y software-properties-common
sudo add-apt-repository -y ppa:deadsnakes/ppa
sudo apt-get update
sudo apt-get install -y python3.10
else
echo "Python 3.10 is already installed."
fi
# Check if pip is installed
if ! command -v pip3 &> /dev/null
then
echo "Pip could not be found. Installing..."
sudo apt-get install -y python3-pip
else
echo "Pip is already installed."
fi
# Install python dependencies
python3.10 -m pip install -r requirements.txt
# Configure path variables used by the platform
ROOTLINE='FAAS_ROOT="'$(echo $PWD)'"'
echo $ROOTLINE >> GenConfigs.py
echo 'WSK_PATH = "'$(which wsk)'"' >> GenConfigs.py
# Configure root path
echo $ROOTLINE | cat - invocation-scripts/monitoring.sh | sponge invocation-scripts/monitoring.sh
echo $ROOTLINE | cat - monitoring/RuntimeMonitoring.sh | sponge monitoring/RuntimeMonitoring.sh
# Make local directories
if [ -d "logs" ]
then
echo "Directory logs already exists."
else
mkdir logs
fi
if [ -d "data_archive" ]
then
echo "Directory data_archive already exists."
else
mkdir data_archive
fi