forked from GoogleCloudPlatform/cloudml-samples
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup_cloud_shell.sh
More file actions
executable file
·53 lines (46 loc) · 1.93 KB
/
setup_cloud_shell.sh
File metadata and controls
executable file
·53 lines (46 loc) · 1.93 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
49
50
51
52
53
#!/bin/bash
# Copyright 2016 Google Inc. 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.
# Sets up the development environment for Cloud ML on Cloud Shell.
# Quit early if any command fails.
set -ex
# Some pip installed tools are added to ~/.local/bin, which should be
# added to the PATH.
if [[ ":${PATH}:" != *":${HOME}/.local/bin:"* ]]; then
echo "Updating PATH"
PATH=${HOME}/.local/bin:${PATH}
echo 'export PATH=${HOME}/.local/bin:${PATH}' >> ~/.bashrc
fi
# Install Python development packages.
pip install --user -U pillow
pip install --user -U numpy pandas scikit-learn pyyaml
# Install scipy separately so that pip does not get killed.
pip install --user -U scipy
# Install TensorFlow.
pip install --user -U https://storage.googleapis.com/tensorflow/linux/cpu/debian/jessie/tensorflow-0.11.0-cp27-none-linux_x86_64.whl
# Install the Cloud ML SDK.
pip install --user -U https://storage.googleapis.com/cloud-ml/sdk/cloudml-0.1.9-alpha.tar.gz
# Download the Cloud ML samples.
mkdir -p ~/google-cloud-ml
cd ~/google-cloud-ml
if [ -d samples ]; then
# Back up the previous samples.
OLD_DIR="samples_$(date +%Y-%m-%d_%H-%M-%S)"
mv samples "${OLD_DIR}"
fi
curl -L -o cloudml-samples.zip https://github.com/GoogleCloudPlatform/cloudml-samples/archive/master.zip
unzip cloudml-samples.zip
mv cloudml-samples-master/ samples/
# Everything completed successfully.
echo "Success! Your environment has the required tools and dependencies."