-
Notifications
You must be signed in to change notification settings - Fork 1
/
quickInstall.sh
executable file
·162 lines (145 loc) · 5.67 KB
/
quickInstall.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
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
#!/bin/bash
#
# This script is meant to streamline the process of setting up SAAF and FaaS Runner on
# EC2 instances. Simply run the script to download all nessessary dependencies and
# setup each cloud platforms CLI.
# @author Robert Cordingly
#
clear
echo You are about to install everything needed to use SAAF, FaaS Runner, and their helper tools.
echo You will have the option to install and configure each supported FaaS platform\'s CLI.
echo Each installer has some steps to do. This script will pause and give you directions for what you are supposed to do.
echo
read -rsp $'Press any key to continue. Use CTRL+Z to quit at any time.\n' -n1 key
clear
echo
read -p "Would you like to update and upgrade apt? [y/N]" -n 1 -r
echo
if [[ $REPLY =~ ^[Yy]$ ]]; then
sudo apt update
sudo apt upgrade
echo
read -rsp $'Finished! Press any key to continue...\n' -n1 key
fi
clear
echo
read -p "Would you like to download SAAF to the current directory? [y/N]" -n 1 -r
echo
if [[ $REPLY =~ ^[Yy]$ ]]; then
sudo apt install git
git clone https://github.com/wlloyduw/SAAF
echo
read -rsp $'Repository cloned! Press any key to continue...\n' -n1 key
fi
clear
echo
read -p "Would you like to install dependencies for SAAF and FaaS Runner? [y/N]" -n 1 -r
echo
if [[ $REPLY =~ ^[Yy]$ ]]; then
echo Installing neutral dependencies...
sudo apt update
sudo apt upgrade
sudo apt install parallel bc curl jq python3 python3-pip nodejs npm maven -y
pip3 install requests boto3 botocore tqdm numpy pandas matplotlib ipython jupyter
echo
read -rsp $'Dependencies installed! Press any key to continue...\n' -n1 key
fi
clear
echo
read -p "Would you like to install and setup AWS Lambda? [y/N]" -n 1 -r
echo
if [[ $REPLY =~ ^[Yy]$ ]]; then
echo Installing AWS CLI...
sudo apt install awscli python3 python3-pip -y
pip3 install --upgrade awscli
clear
echo Setting up AWS CLI! Get your access keys ready!
echo
echo Set region to "us-east-1"
echo Set output type to "json"
read -rsp $'Press any key to continue...\n' -n1 key
aws configure
echo
echo Configuration complete! Functions can now be deployed to AWS Lambda.
read -rsp $'Press any key to continue...\n' -n1 key
fi
clear
echo
read -p "Would you like to install and setup Google Cloud Functions? [y/N]" -n 1 -r
echo
if [[ $REPLY =~ ^[Yy]$ ]]; then
echo Installing GCloud SDK...
echo "deb [signed-by=/usr/share/keyrings/cloud.google.gpg] https://packages.cloud.google.com/apt cloud-sdk main" | sudo tee -a /etc/apt/sources.list.d/google-cloud-sdk.list
apt-get install apt-transport-https ca-certificates
curl https://packages.cloud.google.com/apt/doc/apt-key.gpg | sudo apt-key --keyring /usr/share/keyrings/cloud.google.gpg add -
sudo apt-get update && sudo apt-get install google-cloud-sdk -y
sudo apt-get install google-cloud-sdk-app-engine-java -y
sudo add-apt-repository ppa:cncf-buildpacks/pack-cli
sudo apt-get update
sudo apt-get install pack-cli
clear
echo Setting up GCloud CLI!
echo
echo This SDK is more difficult to install than AWS. A browser will open, sign in and allow premissions.
echo After signed in, return to the Terminal window.
echo
echo If asked to choose a project, create a new project.
echo Name the project to something like uw-tacoma{STUDENT ID}. Projects must have a unique names!
echo
echo Google will ask to enable the cloudfunctions API, enter y. It will fail. Enter y again and it will say there was an error again.
echo This is fine, it should have worked.
echo
read -rsp $'Press any key to continue...\n' -n1 key
gcloud init
gcloud functions list
gcloud auth configure-docker us-central1-docker.pkg.dev
echo
echo Configuration complete! Functions can now be deployed to Google Cloud Functions.
read -rsp $'Press any key to continue...\n' -n1 key
fi
clear
echo
read -p "Would you like to install and setup IBM Cloud Functions? [y/N]" -n 1 -r
echo
if [[ $REPLY =~ ^[Yy]$ ]]; then
echo Installing IBM Cloud CLI...
curl -fsSL https://clis.cloud.ibm.com/install/linux | sh
ibmcloud update
ibmcloud plugin install cloud-functions
clear
echo Setting up IBM Cloud CLI!
echo
echo IBM requires you to login through their CLI.
echo After logging in, select the us-south region.
echo
read -rsp $'Press any key to continue...\n' -n1 key
ibmcloud login
ibmcloud plugin install cloud-functions
ibmcloud target --cf
ibmcloud target -g Default
echo
echo Configuration complete! Functions can now be deployed to IBM Cloud Functions. Your account was configured to use the default Cloud Foundry namespace.
read -rsp $'Press any key to continue...\n' -n1 key
fi
clear
echo
read -p "Would you like to install and setup Azure Functions? [y/N]" -n 1 -r
echo
if [[ $REPLY =~ ^[Yy]$ ]]; then
echo Installing Azure Functions CLI.
curl https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor >microsoft.gpg
sudo mv microsoft.gpg /etc/apt/trusted.gpg.d/microsoft.gpg
sudo sh -c 'echo "deb [arch=amd64] https://packages.microsoft.com/repos/microsoft-ubuntu-$(lsb_release -cs)-prod $(lsb_release -cs) main" > /etc/apt/sources.list.d/dotnetdev.list'
sudo apt-get update
sudo apt-get install azure-functions-core-tools python3-venv -y
curl -sL https://aka.ms/InstallAzureCLIDeb | sudo bash
clear
echo Setting up Azure CLI.
echo
echo It is simple, a browser will open, login and you are done.
read -rsp $'Press any key to continue...\n' -n1 key
az login
echo
echo Configuration complete! Functions can now be deployed to Azure.
read -rsp $'Press any key to continue...\n' -n1 key
fi