-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathinstall.sh
executable file
·110 lines (89 loc) · 3.15 KB
/
install.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
# Copyright 2017 IBM Corp.
#
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
set -e
GENESIS_REMOTE="https://github.com/open-power-ref-design/cluster-genesis.git"
GENESIS_LOCAL="cluster-genesis"
GENESIS_COMMIT="9bba99dd6dba8a49c96870d311bbbb400e8906f2"
GENESIS_VERSION="1.3"
GENESIS_FULL=$(pwd)/$GENESIS_LOCAL
POWERAI_HOME=$(pwd)
PACKAGE_DIR="playbooks/packages"
DKMS_LOCATION="http://mirrors.kernel.org/ubuntu/pool/main/d/dkms/dkms_2.2.0.3-2ubuntu11_all.deb"
DKMS_FILE=${PACKAGE_DIR}/dkms.deb
CUDA_REPO="https://developer.nvidia.com/compute/cuda/8.0/prod/local_installers/cuda-repo-ubuntu1604-8-0-local_8.0.44-1_ppc64el-deb"
CUDA_FILE=${PACKAGE_DIR}/cuda8.deb
CUDNN5_FILE=${PACKAGE_DIR}/cudnn5.deb
CUDNN5_DEV_FILE=${PACKAGE_DIR}/cudnn5_dev.deb
MLNX_OFED_FILE=${PACKAGE_DIR}/ofed.tgz
MLDL_REPO="https://public.dhe.ibm.com/software/server/POWER/Linux/mldl/ubuntu/mldl-repo-local_3.4.2_ppc64el.deb"
MLDL_FILE=${PACKAGE_DIR}/mldl.deb
PACKAGE_DIR="playbooks/packages"
DYNAMIC_INVENTORY=$GENESIS_FULL/"playbooks/inventory.py"
ACTIVATE_FILE=".activate"
if [ "X$CUDNN5_DEB" = "X" ] ; then
echo '$CUDNN5_DEB is not set. Please point to the location of libcudnn deb file'
exit 1
fi
if [ "X$CUDNN5_DEV_DEB" = "X" ] ; then
echo '$CUDNN5_DEV_DEB is not set. Please point to the location of libcudnn-dev deb file'
exit 1
fi
#sudo apt-get install aptitude
#pull cluster-genesis into project directory
scripts/setup_git_repo.sh "${GENESIS_REMOTE}" "${GENESIS_LOCAL}" "${GENESIS_COMMIT}"
#apply any patches to genesis.
scripts/patch_source.sh "${GENESIS_LOCAL}"
mkdir -p ${PACKAGE_DIR}
#Download Cuda Repo
if [ ! -f ${CUDA_FILE} ];
then
echo "Downloading Cuda repository"
wget ${CUDA_REPO} -O ${CUDA_FILE}
else
echo "SKIPPING: Cuda repo already downloaded"
fi
if [ ! -f ${DKMS_FILE} ];
then
echo "Downloading dkms package"
wget ${DKMS_LOCATION} -O ${DKMS_FILE}
else
echo "SKIPPING: dkms package already downloaded"
fi
if [ ! -f ${MLDL_FILE} ];
then
echo "Downloading mldl repo"
wget ${MLDL_REPO} -O ${MLDL_FILE}
else
echo "SKIPPING: mldl repo already downloaded"
fi
cp ${CUDNN5} ${CUDNN5_FILE}
cp ${CUDNN5_DEV} ${CUDNN5_DEV_FILE}
if [ "X$MLNX_OFED" != "X" ] ; then
cp ${MLNX_OFED} ${MLNX_OFED_FILE}
fi
#call cluster genesis install script
cd ${GENESIS_LOCAL}
scripts/install.sh
cd ..
#
# Move variables to activate file to be sourced by deploy.sh
# This allows us to not require the user to export the variables
# manually, and can be run in a separate environment than the
# install.sh script.
#
echo 'DYNAMIC_INVENTORY='$DYNAMIC_INVENTORY > ${ACTIVATE_FILE}
echo 'GENESIS_FULL='$GENESIS_FULL >> ${ACTIVATE_FILE}
echo 'POWERAI_HOME='$POWERAI_HOME >> ${ACTIVATE_FILE}