-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathfairstation_setup.sh
executable file
·79 lines (72 loc) · 2.46 KB
/
fairstation_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
#!/usr/bin/env sh
# Before running the script, make it executable chmod +x command
# method to download and setup environment
ubuntu_env_setup(){
sudo apt update
sudo apt install apt-transport-https git \
ca-certificates curl gnupg lsb-release -y
sudo mkdir -p /etc/apt/keyrings
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | \
sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg
echo \
"deb [arch=$(dpkg --print-architecture) \
signed-by=/etc/apt/keyrings/docker.gpg] \
https://download.docker.com/linux/ubuntu \
$(lsb_release -cs) stable" | \
sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
sudo apt update
sudo apt install \
docker-ce docker-ce-cli containerd.io docker-compose-plugin -y
sudo usermod -aG docker $USER # if permission becomes an issue
source ~/.bash_profile
# If this docker install fails, can install docker compose through pip.
# Using the latest version, hopefully does not break anything else.
sudo service docker start
docker-compose --version
docker --version
}
redhat_env_setup(){
sudo dnf config-manager \
--add-repo=https://download.docker.com/linux/centos/docker-ce.repo
sudo yum update
sudo yum install -y yum-utils git curl wget #device-mapper-persistent-data lvm2
sudo yum install docker-ce --allowerasing # if dependency issues with podman
sudo yum install -y docker-ce-cli containerd.io
sudo systemctl enable --now docker
sudo usermod -aG docker $USER
source ~/.bash_profile
id -nG
docker version
curl -s https://api.github.com/repos/docker/compose/releases/latest | \
grep browser_download_url | \
grep docker-compose-linux-x86_64 | cut -d '"' -f 4 | wget -qi -
chmod +x docker-compose-linux-x86_64
sudo mv docker-compose-linux-x86_64 /usr/local/bin/docker-compose
docker-compose version
rm docker-compose-linux*
}
docker_setup(){
docker-compose up -d --quiet-pull
}
repo_setup(){
umask 0002
git clone https://github.com/MaastrichtU-CDS/protrait_fairifier2.git
cd fairifier2
cp .env.example .env
}
echo "Running the process as sudo"
echo "Setting up the environment"
source /etc/os-release
if [ ${ID_LIKE} == "debian" ]; then
ubuntu_env_setup
elif [ ${ID_LIKE} == "fedora" ]; then
redhat_env_setup
else
echo ${ID_LIKE}
echo "This script does not support your OS!"
fi
echo "Downloading the repo and creating the environment file for airflow"
repo_setup
echo "Creating docker containers"
docker_setup
echo "Done. Airflow can be accessed on 8080, Graphdb on 7200, term mapper on 5005"