29
Google Cloud Platform, Google App Engine, and Google Compute Engine GDG Fresno User Group September 4 th 2014 Bitwise Industries Mural District

Google Cloud Platform, Compute Engine, and App Engine

Embed Size (px)

DESCRIPTION

Introduction to Google Cloud Platform's compute section, Google Compute Engine, Google App Engine. Place these technologies into the cloud service stack, and later show how Google blurs the boundaries of IaaS and PaaS.

Citation preview

Page 1: Google Cloud Platform, Compute Engine, and App Engine

Google Cloud Platform, Google App Engine, and Google Compute Engine

GDG Fresno User GroupSeptember 4th 2014

Bitwise Industries Mural District

Page 2: Google Cloud Platform, Compute Engine, and App Engine

Service variety

Page 3: Google Cloud Platform, Compute Engine, and App Engine

Cloud platform

• Brief history• Roles of Google, Amazon, Microsoft, IBM, HP…• Service levels

Page 4: Google Cloud Platform, Compute Engine, and App Engine

Service levels

• IaaS: Infrastructure as a Service• PaaS: Platform as a Service• SaaS: Software as a Service

SaaS

PaaS

IaaS

Page 5: Google Cloud Platform, Compute Engine, and App Engine

Infrastructure as a Service

• Simplest form: leasing a physical or virtual server box: RackSpace, SoftLayer

• Includes– Hardware: servers, network, routers, load balancers,…– Software: operating systems, databases (storage),

application servers• Amazon AWS (Amazon Web Services) (+ S3 (Simple

Storage Service) + EC2 (Elastic Cloud Compute))• Microsoft Azure: VM Role• Google: GCE - Google Compute Engine*

Page 6: Google Cloud Platform, Compute Engine, and App Engine

Platform as a Service

• The provider takes care some higher level functions in the service stack

• Instead of getting servers, you get an application framework

• Less control over the lower level service elements, but the abstraction should result in less hassle and more focus on the goal

• Google: GAE - Google App Engine*• Azure Web Role, Worker Role, Reporting Services,

etc.

Page 7: Google Cloud Platform, Compute Engine, and App Engine

Software as a Service

• Software deployed on the internet• Designed for end-users• Delivered through the web• The back-end automatically scales, fault-tolerant

persistence• Usually API (Application Programming Interface) is

available for usage or feature extension• Example– Gmail, Google Docs, Google Spreadsheet– Office 365

Page 8: Google Cloud Platform, Compute Engine, and App Engine

IaaS / PaaS / SaaS

Control + Cost Efficiency + Savings

Page 9: Google Cloud Platform, Compute Engine, and App Engine

IaaS / PaaS / SaaS

SaaS

PaaS

IaaS

Leve

l of C

ontr

ol

Leve

l of A

bstr

actio

n

Page 10: Google Cloud Platform, Compute Engine, and App Engine

Google Compute Engine (GCE)

• IaaS level mainly• Minute-by-minute billing (10 minutes minimum)• Variety of virtual hardware selections (CPU

config and mem size)• Standard or custom VM images• Can be accessed through command line and

RESTful API• Came too late?

Page 11: Google Cloud Platform, Compute Engine, and App Engine

Demo

• Spinning up a VM• Selecting VM type• Selecting OS image

Page 12: Google Cloud Platform, Compute Engine, and App Engine

Earlier Demo Last Time

• Hadoop cluster with GCE• Last time we saw a word count example (hello

world of hadoop demos)• Needs extra work– Download and preparation of the hadoop distribution

itself– Applying patches– Generating keys

• But in the end Google also provides a set of tools which make life much easier

Page 13: Google Cloud Platform, Compute Engine, and App Engine

Hadoop

• Hadoop is an open-source software framework that supports data-intensive distributed applications

• A Hadooop cluster is composed of a single master node and multiple worker nodes

• Hadoop is written in Java, utilizes JVMs• Has two main services:– Storing large amounts of data: HDFS, Hadoop

Distributed File System– Processing large amounts of data: implementation of

the MapReduce programming model

Page 14: Google Cloud Platform, Compute Engine, and App Engine

Name node

HDFS

MetadataStore

Data node Data node Data node

Node 1 Node 2

Block A Block B Block A Block B

Node 3

Block A Block B

Page 15: Google Cloud Platform, Compute Engine, and App Engine

Name nodeHeart beat signals and

communication

Job / task management

Jobtracker

Data node Data node Data node

Tasktracker Tasktracker

Map 1 Reduce 1 Map 2 Reduce 2

Tasktracker

Map 3 Reduce 3

Page 16: Google Cloud Platform, Compute Engine, and App Engine

Google App Engine

• PaaS level member of Google Cloud Platform• It’s for developing, hosting, and scaling out

web applications• Supported languages:– Python– Java (+ JVM langs Groovy, JRuby, Scala, Clojure)– Go (experimental)– PHP (experimental)

Page 17: Google Cloud Platform, Compute Engine, and App Engine

Google App Engine

• Python– Django, CherryPy, Pyramid, Flask, web2py,

webapp2, and more– CGI adapters

• Java– Servlet 2.5 technology, Jetty Web Server– JSP, Java Server Faces, JPA, JDO, Spring

Framework, Struts 2*, Grails*, ….

Page 18: Google Cloud Platform, Compute Engine, and App Engine

Google App Engine

• Restrictions:– Can only execute code which respond to HTTP

requests– Answer cannot take longer than 60 seconds!– Normally only pure Python modules (no C or

Pyrex)*– …

Page 19: Google Cloud Platform, Compute Engine, and App Engine

GAE Example

• High score chart in the cloud• Java servlets• Google Datastore (NoSQL) for the data, non

relational• https://

github.com/59DAYSOFCODE/Project-Deal-ORound/tree/master/cards/server/Server/src/main

• (not open source unfortunately)

Page 20: Google Cloud Platform, Compute Engine, and App Engine

Web.xml<?xml version="1.0" encoding="utf-8"?><web-app version="2.5" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">

<servlet><servlet-name>DataStoreSendDataEndPoint</servlet-name><servlet-class>core.DataStoreSendDataEndPointServlet</servlet-class></servlet><servlet><servlet-name>DataStoreFetchEndPoint</servlet-name><servlet-class>core.DataStoreFetchEndPointServlet</servlet-class></servlet><servlet-mapping><servlet-name>DataStoreSendDataEndPoint</servlet-name><url-pattern>/sendData</url-pattern></servlet-mapping><servlet-mapping><servlet-name>DataStoreFetchEndPoint</servlet-name><url-pattern>/fetchData</url-pattern></servlet-mapping>

</web-app>

Page 21: Google Cloud Platform, Compute Engine, and App Engine

Servlets

• DataFetchEndpointServlet.java• DataStoreSendDataEndPointServlet.java

Page 22: Google Cloud Platform, Compute Engine, and App Engine

Google Cloud Platform Live Events

Page 24: Google Cloud Platform, Compute Engine, and App Engine

Demo: Sudoku Solver

• Peter Norvig’s solver algorithm:– http://norvig.com/sudoku.html

• Final demo:– http://compute-demo.appspot.com

• Demo source code:– https://github.com/GoogleCloudPlatform/appengi

ne-opencv-sudoku-python

Page 25: Google Cloud Platform, Compute Engine, and App Engine

Ease

• Deploy:gcloud preview app deploy

• Application specific setting1. from google.appengine.api import modules2. modules.set_num_instances(42)

Page 26: Google Cloud Platform, Compute Engine, and App Engine

Google Cloud Platform

Page 27: Google Cloud Platform, Compute Engine, and App Engine

Thank you!

• Questions?

Page 28: Google Cloud Platform, Compute Engine, and App Engine

Google has perks

Page 29: Google Cloud Platform, Compute Engine, and App Engine

A screw > nothing is perfect