-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathinstallmachinelearning.txt
More file actions
48 lines (37 loc) · 1.48 KB
/
installmachinelearning.txt
File metadata and controls
48 lines (37 loc) · 1.48 KB
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
#!/bin/sh
set -e
#
# This script is meant for quick & easy install via:
# curl -sSL https://healthcatalyst.github.io/InstallScripts/installmachinelearning.txt | sh -s <username> <domain>
u="$(whoami)"
echo "Running version 1.09 as: $u"
username="$1"
domain="$2"
password="$3"
echo "User name: $username"
if [ ! -z "$username" ]; then
if [ -z "$password" ]; then
echo "Please enter password for $username@$domain:"
read -e password < /dev/tty
fi
fi
echo "stopping existing docker container"
docker stop fabric.machinelearning || echo 'no container to stop'
echo "removing docker container"
docker rm fabric.machinelearning || echo 'no container to remove'
echo "removing docker image"
docker rmi healthcatalyst/fabric.machinelearning || echo 'no image to remove'
echo "pulling latest docker image from repo"
docker pull healthcatalyst/fabric.machinelearning
echo "starting docker container with new image."
docker run -d --privileged=true --restart=unless-stopped -p 8080:8080 --name fabric.machinelearning healthcatalyst/fabric.machinelearning
echo "sleeping until docker container is up"
#until [ "`/usr/bin/docker inspect -f {{.State.Running}} fabric.machinelearning`"=="true" ]; do
# sleep 1s;
#done;
sleep 5s;
# if username was passed then create a keytab file in docker container
if [ ! -z "$username" ]; then
echo "creating keytab file for username & password"
docker exec fabric.machinelearning opt/install/setupkeytab.sh $username $domain $password
fi