2017年5月5日 星期五

Google Cloud Platform GCP - Tutorial

 

Google Cloud Platform 的 Quickstarts 蠻有參考價值。

https://cloud.google.com/getting-started/#ten-min-tutorial-section

 

Step1: Create a VM instance running Debian 8 OS

Step2: Install Apache(2) server and put /var/www/html/index.html

Step3: Try compute engine, 其實就是 step 1 + use python for a simple http server.

Step4: Try to run github sample code.  I pick the Python Flask Skeleton for Google App Engine

 

(a) pip use apt-get (Debian) or yum (centos or redhat)

   > sudo apt-get install python-pip

(b) install google cloud SDK 包含 gcloud, gsutil, bq, etc. command-line tools.  

How?   可以參考 https://cloud.google.com/sdk/downloads

Download sdk.

Run install.sh

Initialize SDK:  > sudo gcloud init

不過應該有更容易的方法 install Cloud SDK, to be checked.

 

(c) install App Engine Python SDK:  How : > sudo gcloud components install app-engine-python

(d) > sudo gcloud components install app-engine-python-extras

 

接下來就是參考 git 的 tutorial

https://github.com/GoogleCloudPlatform/appengine-flask-skeleton

> sudo apt-get install git

> sudo  git clone https://github.com/GoogleCloudPlatform/appengine-flask-skeleton.git 

> cd appengine-flask-skeleton

> sudo pip install -r requirements.txt -t lib

不過 python 仍然有問題。這是 python 最麻煩的地方。要解決 packages 之間的相容性問題。一般需要 pip, virtualenv, etc.  請參考前文用 anaconda 解決 pip, virtualenv, 和相容性問題。

我找到一個很好的 blog.

https://haroldsoh.com/2016/04/28/set-up-anaconda-ipython-tensorflow-julia-on-a-google-compute-engine-vm/

 

Finally I made one work in “google Interactive Tutorial” 中的 “my-instance” VM.

I install anaconda2 and anaconda3, and tensor flow on anaconda3. 

 

 


沒有留言:

張貼留言

追蹤者