-
Notifications
You must be signed in to change notification settings - Fork 2
/
install_full.sh
76 lines (56 loc) · 1.92 KB
/
install_full.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
#!/bin/bash
sudo apt-get install jq
json_path='docker_sdk_api/api/data/paths.json'
# change training api image name based on architecture CPU/GPU
change_image_name(){
jq '."image_name"="'$1'"' "$json_path" >temp.$$.json && mv temp.$$.json "$json_path"
}
adjust_base_dir(){
#Adjust basedir path
python3 adjust_basedir_path.py
}
CPU_docker_image="classification_training_api_cpu"
GPU_docker_image="classification_training_api_gpu"
echo '----------------------------------------------'
echo 'Please choose docker image build architecture'
PS3='Please enter your choice: '
options=("GPU" "CPU")
adjust_base_dir
select opt in "${options[@]}"
do
case $opt in
"GPU")
change_image_name "$GPU_docker_image"
break
;;
"CPU")
change_image_name "$CPU_docker_image"
break
;;
*) echo "invalid option $REPLY";;
esac
done
# This will install docker following [https://docs.docker.com/install/linux/docker-ce/ubuntu/]
sudo apt-get remove docker docker-engine docker.io
sudo apt-get update
sudo apt-get install \
apt-transport-https \
ca-certificates \
curl \
software-properties-common
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
sudo apt-key fingerprint 0EBFCD88
sudo add-apt-repository \
"deb [arch=amd64] https://download.docker.com/linux/ubuntu \
$(lsb_release -cs) \
stable"
sudo apt-get update
sudo apt-get install -y docker-ce
sudo groupadd docker
sudo usermod -aG docker ${USER}
docker run hello-world
#This will install docker-compose following [https://docs.docker.com/compose/install/]
sudo curl -L "https://github.com/docker/compose/releases/download/1.26.2/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
sudo chmod +x /usr/local/bin/docker-compose
sudo ln -s /usr/local/bin/docker-compose /usr/bin/docker-compose
docker-compose --version