91
Introduzione al Cloud computing Roberto Beraldi

Introduzione al Cloudcomputing - uniroma1.itberaldi/PSD2012/slides/Cloud...GAE architecture • Google App Engine speaks with web applications through the Web Server Gateway Interface

  • Upload
    others

  • View
    4

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Introduzione al Cloudcomputing - uniroma1.itberaldi/PSD2012/slides/Cloud...GAE architecture • Google App Engine speaks with web applications through the Web Server Gateway Interface

Introduzione al Cloud computing

Roberto Beraldi

Page 2: Introduzione al Cloudcomputing - uniroma1.itberaldi/PSD2012/slides/Cloud...GAE architecture • Google App Engine speaks with web applications through the Web Server Gateway Interface

Outline

• What is cloud computing

• Benefit of cloud computing

• Types of cloud computing

• Examples

Page 3: Introduzione al Cloudcomputing - uniroma1.itberaldi/PSD2012/slides/Cloud...GAE architecture • Google App Engine speaks with web applications through the Web Server Gateway Interface

What is cloud computing

A style of computing in which dynamically

scalable and often virtualized resources are

provided as a service over the Internet.

[Wikipedia]

Page 4: Introduzione al Cloudcomputing - uniroma1.itberaldi/PSD2012/slides/Cloud...GAE architecture • Google App Engine speaks with web applications through the Web Server Gateway Interface

Why is it called cloud?

• Services provided on virtualised resources

• Virtual machines spawned on demand

• Location of services no longer certain

• Pay as you go price model

User

UserCloud with servers

Page 5: Introduzione al Cloudcomputing - uniroma1.itberaldi/PSD2012/slides/Cloud...GAE architecture • Google App Engine speaks with web applications through the Web Server Gateway Interface

A new IT model?

• “Cloud computing is likely to have the same impact on

software that foundries have had on the hardware industry”*

“fab-less” semiconductor

companies,whose value is

innovative chip design

Semiconductor foundries that

produce chips for others

Multiplex of state-of-the-art

fabrication line

[*] Above the Clouds: A Berkeley View of Cloud Computing

Page 6: Introduzione al Cloudcomputing - uniroma1.itberaldi/PSD2012/slides/Cloud...GAE architecture • Google App Engine speaks with web applications through the Web Server Gateway Interface

A new IT model?

Production Transportation Users

Utility computing

Page 7: Introduzione al Cloudcomputing - uniroma1.itberaldi/PSD2012/slides/Cloud...GAE architecture • Google App Engine speaks with web applications through the Web Server Gateway Interface

• Flexibility:

-Flexible provisioning

-Add machines on demand

-Add storage on demand

• Effort:

-Low barrier to entry

-Elimination of up-front commitment of cloud users

-Initial effort: no need to spec and set up physical infrastructure

-No need to maintain physical infrastructure

Benefit of cloud computing

Page 8: Introduzione al Cloudcomputing - uniroma1.itberaldi/PSD2012/slides/Cloud...GAE architecture • Google App Engine speaks with web applications through the Web Server Gateway Interface

Benefit of cloud computing• Cost:

-No Initial capital expenditure

-No Costs of over-provisioning for scalability

-Pay for what you use

• Reliability:

-Redundancy

-Trust reliability of provider

-Data backups

-..but, what happens when provider goes down?

- …What about Security? Privacy?

Page 9: Introduzione al Cloudcomputing - uniroma1.itberaldi/PSD2012/slides/Cloud...GAE architecture • Google App Engine speaks with web applications through the Web Server Gateway Interface

Example: provisioning

Provisioning for peak load

Underprovisioning -1

Underprovisioning - 2

Page 10: Introduzione al Cloudcomputing - uniroma1.itberaldi/PSD2012/slides/Cloud...GAE architecture • Google App Engine speaks with web applications through the Web Server Gateway Interface

Storage service in the cloud

Page 11: Introduzione al Cloudcomputing - uniroma1.itberaldi/PSD2012/slides/Cloud...GAE architecture • Google App Engine speaks with web applications through the Web Server Gateway Interface

Cloud computing flavors

(IaaS) Infrastructure as a Service

(SaaS)Software as a Service

XaaS (PaaS) Platform as a Service

Page 12: Introduzione al Cloudcomputing - uniroma1.itberaldi/PSD2012/slides/Cloud...GAE architecture • Google App Engine speaks with web applications through the Web Server Gateway Interface

XaaS

• A service is delivered through two access points:

• Standard web browsing (HTTP) and

• Programmatic access (Rest,XML-RPC,SOAP, etc. over HTTP)

Programmatic Service Access

(many methods)

Web URL

(standard HTTP methods)

web browerHTTP

Application

HTTP

Rest,XML-RPC,etc

Service

PaaS

IaaS

(a.k.a. web API) SaaS

Page 13: Introduzione al Cloudcomputing - uniroma1.itberaldi/PSD2012/slides/Cloud...GAE architecture • Google App Engine speaks with web applications through the Web Server Gateway Interface

Software as a Service

• A SW application that runs remotely

• Does not require any local special installation (accessed through standard methods), e.g., js program making calls from within a browser

• SW components do not interact with each other; rather they are ‘orchestrated’ remotely…

SW applicationSW Component

Client SW

Page 14: Introduzione al Cloudcomputing - uniroma1.itberaldi/PSD2012/slides/Cloud...GAE architecture • Google App Engine speaks with web applications through the Web Server Gateway Interface

Example

Page 15: Introduzione al Cloudcomputing - uniroma1.itberaldi/PSD2012/slides/Cloud...GAE architecture • Google App Engine speaks with web applications through the Web Server Gateway Interface

Top Web API*

1) Google Maps – mapping: 5 billion calls /day and 2184 mashups

2) Facebook - social networking: 5 billion calls /day and 237 mashups

3) Flickr- photos sharing : 567 mashups

4) Twitter – microblogging : 3 billion calls /day , 75% of alltraffic and 547 mashups

5) Netflix – video : about 1 billion calls/day

6) eBay – auction : about half billion calls/ day and 206 mashups

7) Amazon- online storage : over 100 billion objects stored in S3

8) Salesforce.com – CRM : over 50% of all their transactions

9) Twilio – telephony: 144 mashups

10) Box.net – online storage: 70 mashups

(*) Source: GetApp.com@2011

Page 16: Introduzione al Cloudcomputing - uniroma1.itberaldi/PSD2012/slides/Cloud...GAE architecture • Google App Engine speaks with web applications through the Web Server Gateway Interface

Example: Doodle®

Page 17: Introduzione al Cloudcomputing - uniroma1.itberaldi/PSD2012/slides/Cloud...GAE architecture • Google App Engine speaks with web applications through the Web Server Gateway Interface

SaaS example

Page 18: Introduzione al Cloudcomputing - uniroma1.itberaldi/PSD2012/slides/Cloud...GAE architecture • Google App Engine speaks with web applications through the Web Server Gateway Interface

Google forms

Edit

publishhttps://spreadsheets.google.com/viewform?formkey

read

Page 19: Introduzione al Cloudcomputing - uniroma1.itberaldi/PSD2012/slides/Cloud...GAE architecture • Google App Engine speaks with web applications through the Web Server Gateway Interface

Google docs®

Page 20: Introduzione al Cloudcomputing - uniroma1.itberaldi/PSD2012/slides/Cloud...GAE architecture • Google App Engine speaks with web applications through the Web Server Gateway Interface

Google APIs

Page 21: Introduzione al Cloudcomputing - uniroma1.itberaldi/PSD2012/slides/Cloud...GAE architecture • Google App Engine speaks with web applications through the Web Server Gateway Interface

Flickr® API

•Le funzioni del sito sono

rese disponibili come

servizi web

•Ci sono 3 differenti ‘end-

point’, ciascuno per un

formato di richiesta

differente

http://api.flickr.com/services/soap/

http://api.flickr.com/services/rest/

http://api.flickr.com/services/xmlrpc/

Page 22: Introduzione al Cloudcomputing - uniroma1.itberaldi/PSD2012/slides/Cloud...GAE architecture • Google App Engine speaks with web applications through the Web Server Gateway Interface

Facebook API

• “The Graph API presents a simple, consistent view of the Facebook social graph,

uniformly representing objects in the graph (e.g., people, photos, events, and

pages) and the connections between them (e.g., friend relationships, shared

content, and photo tags).”

Page 23: Introduzione al Cloudcomputing - uniroma1.itberaldi/PSD2012/slides/Cloud...GAE architecture • Google App Engine speaks with web applications through the Web Server Gateway Interface

Graph API, simple but great idea

People People

friend relationship

home books…

Page 24: Introduzione al Cloudcomputing - uniroma1.itberaldi/PSD2012/slides/Cloud...GAE architecture • Google App Engine speaks with web applications through the Web Server Gateway Interface

ExampleObject ID

Page 25: Introduzione al Cloudcomputing - uniroma1.itberaldi/PSD2012/slides/Cloud...GAE architecture • Google App Engine speaks with web applications through the Web Server Gateway Interface

Example: query the object..

Page 26: Introduzione al Cloudcomputing - uniroma1.itberaldi/PSD2012/slides/Cloud...GAE architecture • Google App Engine speaks with web applications through the Web Server Gateway Interface

Facebook API

Page 27: Introduzione al Cloudcomputing - uniroma1.itberaldi/PSD2012/slides/Cloud...GAE architecture • Google App Engine speaks with web applications through the Web Server Gateway Interface

Another example: ORANGE

Page 28: Introduzione al Cloudcomputing - uniroma1.itberaldi/PSD2012/slides/Cloud...GAE architecture • Google App Engine speaks with web applications through the Web Server Gateway Interface

• Dropbox is a free (up to 2GB), web-based cloud storage mechanism– file backup service

– data sharing

– Data sync among different clients

– Mobile applications

Android

iPhone

iPad

Blackberry

Windows

Linux

MAC

.mp3

.avi.jpg

REST / JSON

Storage as a Service

Page 29: Introduzione al Cloudcomputing - uniroma1.itberaldi/PSD2012/slides/Cloud...GAE architecture • Google App Engine speaks with web applications through the Web Server Gateway Interface

Features

Page 30: Introduzione al Cloudcomputing - uniroma1.itberaldi/PSD2012/slides/Cloud...GAE architecture • Google App Engine speaks with web applications through the Web Server Gateway Interface

Dropbox API

The Dropbox API utilizes a REST-style architecture over the HTTP

protocol. In other words, many of the functions in it use standard URLs

via GET or POST. All messaging is delivered in the JSON format

Page 31: Introduzione al Cloudcomputing - uniroma1.itberaldi/PSD2012/slides/Cloud...GAE architecture • Google App Engine speaks with web applications through the Web Server Gateway Interface

Technology supported

Page 32: Introduzione al Cloudcomputing - uniroma1.itberaldi/PSD2012/slides/Cloud...GAE architecture • Google App Engine speaks with web applications through the Web Server Gateway Interface

Example of applications

Page 33: Introduzione al Cloudcomputing - uniroma1.itberaldi/PSD2012/slides/Cloud...GAE architecture • Google App Engine speaks with web applications through the Web Server Gateway Interface

Example (SourceKit)

• A Textmate like lightweight programmer's text editor right inside of Chrome. It saves files directly to Dropbox, so if you have the Dropbox sync software installed, the changes will appear locally as if you did so with a text editor! Changes will be stored remotely so naturally this same extension will pull up the same copy of the file everywhere!

Page 34: Introduzione al Cloudcomputing - uniroma1.itberaldi/PSD2012/slides/Cloud...GAE architecture • Google App Engine speaks with web applications through the Web Server Gateway Interface

Another example

Page 35: Introduzione al Cloudcomputing - uniroma1.itberaldi/PSD2012/slides/Cloud...GAE architecture • Google App Engine speaks with web applications through the Web Server Gateway Interface

Platform as a Service

• Provide a ‘platform’ for application

development

• Developers do have access to a SDK that

allows to develop a new application and to

deploy it in the cloud

• Impact on the programming model

• Google’s app engine, Windows Azure,

Picloud…

Page 36: Introduzione al Cloudcomputing - uniroma1.itberaldi/PSD2012/slides/Cloud...GAE architecture • Google App Engine speaks with web applications through the Web Server Gateway Interface

PaaS – Ex1: GAE

• Cloud service for running web applications on the

Google data center

• Do one thing well

– Simple configuration

– Transparent scalability

• “infinite” number of applications, req/sec storage

– Security

• All applications run inside a sandbox, do not have direct access to

file system, cannot open other connections

Page 37: Introduzione al Cloudcomputing - uniroma1.itberaldi/PSD2012/slides/Cloud...GAE architecture • Google App Engine speaks with web applications through the Web Server Gateway Interface

GAE architecture

• Google App Engine speaks with web applications through the Web Server Gateway Interface (WSGI) standard protocol

• App Engine and SDK includes the webapp2 framework that implements WSGI

– Advanced frameworks can be used, e.g., Django

WEB AppHTTP Requests

WEB Server

WSGI Protocol

Page 38: Introduzione al Cloudcomputing - uniroma1.itberaldi/PSD2012/slides/Cloud...GAE architecture • Google App Engine speaks with web applications through the Web Server Gateway Interface

GAE: supported language

• Java

– JVM, Java servlet, …

– SDK Eclipse extension

• Python

– Standard library (without ‘unsecure’ calls)

• Go

Page 39: Introduzione al Cloudcomputing - uniroma1.itberaldi/PSD2012/slides/Cloud...GAE architecture • Google App Engine speaks with web applications through the Web Server Gateway Interface
Page 40: Introduzione al Cloudcomputing - uniroma1.itberaldi/PSD2012/slides/Cloud...GAE architecture • Google App Engine speaks with web applications through the Web Server Gateway Interface

LAB: Hello Word in GAE

• What we need:

– Google account

– GAE registration

• Plafond free (10 app)

– Register a new application

• The application ID will be used to deploy the

application

– SDK

– Python 2.7 (does not support 3.x)

Page 41: Introduzione al Cloudcomputing - uniroma1.itberaldi/PSD2012/slides/Cloud...GAE architecture • Google App Engine speaks with web applications through the Web Server Gateway Interface

Hello Word in GAE

helloworld.py

app.yaml

Code

ConfSimulator

“Google Cloud”Deploy

Web-based Admin console

Step 1

Step 3

Step 2

Step 4

Page 42: Introduzione al Cloudcomputing - uniroma1.itberaldi/PSD2012/slides/Cloud...GAE architecture • Google App Engine speaks with web applications through the Web Server Gateway Interface

Hello Word in GAE

• Define a handler for the HTTP requests as a class that extends webapp2.RequestHandler class (MainPage)– Attributes : response, request (instance of class Request, Response)

– Methods: get,post, etc.. (to override)

• Map HTTP get request to get method (also post, put, etc..)

• Write data to HTTP response through self.response

• app is a global name that must assigned to the application

helloworld.py

Code

Step 1

Page 43: Introduzione al Cloudcomputing - uniroma1.itberaldi/PSD2012/slides/Cloud...GAE architecture • Google App Engine speaks with web applications through the Web Server Gateway Interface

app.yaml

Conf

“Google Cloud”Deploy

Web-based Admin console

Step 3

Step 4

• An application name helloword must be registered with the google engine– helloworld.appspot.com

appcfg.py update .

Page 44: Introduzione al Cloudcomputing - uniroma1.itberaldi/PSD2012/slides/Cloud...GAE architecture • Google App Engine speaks with web applications through the Web Server Gateway Interface

GAE architecture (simplified view)

App Eng

Front End

App Eng

Front End

App Eng

Front End

App Server

Loa

d

Ba

lan

cer

App Server App Server

API layer

APP APP APP

Other

Google

Service

HTTP Requests

Page 45: Introduzione al Cloudcomputing - uniroma1.itberaldi/PSD2012/slides/Cloud...GAE architecture • Google App Engine speaks with web applications through the Web Server Gateway Interface

Python GAE architecture

Python

VM

Standard

Lib

App

Read-only

File system

Source: Google App Engine – Guido van Rossum

REQ/REP

DATASTOREMEMCACHE

BigTable

URLfetch

mail

images

ServicesSandbox

Stateless Google API

Stateful API

CGI

Page 46: Introduzione al Cloudcomputing - uniroma1.itberaldi/PSD2012/slides/Cloud...GAE architecture • Google App Engine speaks with web applications through the Web Server Gateway Interface

Python GAE architecture (scaling)

Python

VM

Standard

Lib

App

Read-only

File system

Source: Google App Engine – Guido van Rossum

REQ/REP

DATASTOREMEMCACHE

BigTable

URLfetch

mail

images

Services

Stateless Google API

Stateful API

HTTP (e.g., service time <10 sec,

Size of a file < 1 MB)

•Queue of precreated

processes

•Quota on resources

SandboxCGI

Page 47: Introduzione al Cloudcomputing - uniroma1.itberaldi/PSD2012/slides/Cloud...GAE architecture • Google App Engine speaks with web applications through the Web Server Gateway Interface

More complex example

• Use a google calendar through your own

application

• OAuth 2.0 required to grant access (token)

• Calendar API call requires the token

• Application must be registered to the Google

API console

Page 48: Introduzione al Cloudcomputing - uniroma1.itberaldi/PSD2012/slides/Cloud...GAE architecture • Google App Engine speaks with web applications through the Web Server Gateway Interface

Google Calendar

• Event

• Calendar

• CalendarList

API

REST

Page 49: Introduzione al Cloudcomputing - uniroma1.itberaldi/PSD2012/slides/Cloud...GAE architecture • Google App Engine speaks with web applications through the Web Server Gateway Interface

Actors

Developer

User

Web application

Google API console

developregister

define: redirect_uri

authenticate

User consent

consent

OAuth Authorization

server

Page 50: Introduzione al Cloudcomputing - uniroma1.itberaldi/PSD2012/slides/Cloud...GAE architecture • Google App Engine speaks with web applications through the Web Server Gateway Interface

User authentication and consensus

Authorization

Server

http://accounts.goole.com /o/oauth2/auth

GET accounts.google.com/o/oauth2/auth?

response_type=code&

scope=https://www.googleapis.com/auth/calendar&

redirect_uri=https://xxxxxx/oauth2callback&

client_id=<given at registration time>&

hl=it

http://code.google.com/intl/it-IT/apis/accounts/docs/OAuth2.html

http://code.google.com/intl/it-IT/apis/accounts/docs/OAuth2WebServer.html

Page 51: Introduzione al Cloudcomputing - uniroma1.itberaldi/PSD2012/slides/Cloud...GAE architecture • Google App Engine speaks with web applications through the Web Server Gateway Interface

Passing authorization

Browser

Autherization

Server

Callback

Web application

GET

Redirect (302)

Location: http:// code=..

Page 52: Introduzione al Cloudcomputing - uniroma1.itberaldi/PSD2012/slides/Cloud...GAE architecture • Google App Engine speaks with web applications through the Web Server Gateway Interface

Registering the application

to be used inside authetication requests

URI used to redirect the browser after authentication

(specified during application registration)

Page 53: Introduzione al Cloudcomputing - uniroma1.itberaldi/PSD2012/slides/Cloud...GAE architecture • Google App Engine speaks with web applications through the Web Server Gateway Interface

Obtaining an access token

home.pyoauth2callback.py

OAuth Server

- url: /.*

script: home.app

- url: /oauth2callback.*

script: oauth2callback.app

secure: always

app.yaml

Cloud Application

Page 54: Introduzione al Cloudcomputing - uniroma1.itberaldi/PSD2012/slides/Cloud...GAE architecture • Google App Engine speaks with web applications through the Web Server Gateway Interface

Performing operations

oauth2callback.py

Calendar

Cloud Application

Rest endpoint

Page 55: Introduzione al Cloudcomputing - uniroma1.itberaldi/PSD2012/slides/Cloud...GAE architecture • Google App Engine speaks with web applications through the Web Server Gateway Interface

Mobile cloud computing

Repubblica del 31 marzo

Page 56: Introduzione al Cloudcomputing - uniroma1.itberaldi/PSD2012/slides/Cloud...GAE architecture • Google App Engine speaks with web applications through the Web Server Gateway Interface

Get the list of events from a calendar

• Demo

Page 57: Introduzione al Cloudcomputing - uniroma1.itberaldi/PSD2012/slides/Cloud...GAE architecture • Google App Engine speaks with web applications through the Web Server Gateway Interface

Another example: Trip support

• In this example, events are trips from one city

to another

• We add support by weather conditions and

directions

Page 58: Introduzione al Cloudcomputing - uniroma1.itberaldi/PSD2012/slides/Cloud...GAE architecture • Google App Engine speaks with web applications through the Web Server Gateway Interface

PaaS example2: Windows Azure

• It is a set of integrated cloud technologies each

providing a specific set of services to application

developers

• Windows Azure provides developer-accessible

services for creating applications

• Strongly integrated with Visual studio

– Development fabric simulator

– Development storage simulator

Page 59: Introduzione al Cloudcomputing - uniroma1.itberaldi/PSD2012/slides/Cloud...GAE architecture • Google App Engine speaks with web applications through the Web Server Gateway Interface

Architectural view

Windows Azure provides a

Window-based environment for

running applications and storing

data in MS datacenters

SQL Azure provides data service in

the cloud on SQL Server

AppFabric provides cloud

service for connecting

applications running in the

cloud or on premises

Page 60: Introduzione al Cloudcomputing - uniroma1.itberaldi/PSD2012/slides/Cloud...GAE architecture • Google App Engine speaks with web applications through the Web Server Gateway Interface

Windows Azure Architecture

The fabric layer provides

virtualization (Hyper-V)

Compute service: allows to

run applications following a

specific programming model

Storage service is available to

cloud and on-premises

applications. Accessed via

REST

Page 61: Introduzione al Cloudcomputing - uniroma1.itberaldi/PSD2012/slides/Cloud...GAE architecture • Google App Engine speaks with web applications through the Web Server Gateway Interface

Azure: Service Model

• Developers write their code and describes a service

model

• Service model includes role definitions, VM size,

instance count, endpoints, etc.

• Packaged code + the service model are uploaded to

Azure, which deploys the service in the Microsoft

Datacenters according the service

Page 62: Introduzione al Cloudcomputing - uniroma1.itberaldi/PSD2012/slides/Cloud...GAE architecture • Google App Engine speaks with web applications through the Web Server Gateway Interface

DeployementWeb Portal

1. Register (Live-id)

Conf(n.inst. =3)

Fabric

Controller

Service

.cspkg

Service

Service

Service

2. Create Hosted-Service

http://xxxx.cloudapp.net

3. Package upload

.csconf + .cspkg

Page 63: Introduzione al Cloudcomputing - uniroma1.itberaldi/PSD2012/slides/Cloud...GAE architecture • Google App Engine speaks with web applications through the Web Server Gateway Interface

Difference with traditional

programming model

• Interaction with the OS– Previous release allows only run application in the

user mode. Now removed

– Modify the system property is critical, however. The application can moved on other VM

• Storage must be external to role instances. – File system is not a persistent storage!

• Interactions among roles – Asynchronous through queues (though direct

interaction is possible)

– Instances must be stateless

Page 64: Introduzione al Cloudcomputing - uniroma1.itberaldi/PSD2012/slides/Cloud...GAE architecture • Google App Engine speaks with web applications through the Web Server Gateway Interface

Programming model

• A Windows Azure application is built from one or more roles

• A Windows Azure application runs multiple instances of the

each role

– Each on these instances run inside a VM provided by the hypervisor

Hyper-V®

– Number of instances are defined via a configuration file (is not varied

automatically)

• A Windows Azure application behaves correctly when any role

instance fail

Page 65: Introduzione al Cloudcomputing - uniroma1.itberaldi/PSD2012/slides/Cloud...GAE architecture • Google App Engine speaks with web applications through the Web Server Gateway Interface

Roles

• Web roles are intended to accept and process HTTP requests

using IIS (Internet Information Service)

– Developers can create Web role instances using various technologies

including ASP.NET, Windows Communication Foundation (WCF), PHP

and java

• Worker roles are intended to perform background jobs. They

typically interact with the Web role via a queue

• VM roles run an image (Virtual Hard Disk, VHD) of a Windows

Server 2008 R2 virtual machine

– The VHD is created using on-premises machine

Page 66: Introduzione al Cloudcomputing - uniroma1.itberaldi/PSD2012/slides/Cloud...GAE architecture • Google App Engine speaks with web applications through the Web Server Gateway Interface

Example

2 tier application model: web

role (front-end) and worker

role (back-end)

•Application designed to

scale-out (multiple copies on

different VM) rather than

scale-up (one copy on a

‘bigger’ machine)

•No affinity among roles:

multiple request can be sent

to different instances

Page 67: Introduzione al Cloudcomputing - uniroma1.itberaldi/PSD2012/slides/Cloud...GAE architecture • Google App Engine speaks with web applications through the Web Server Gateway Interface

PiCloud (python)

Page 68: Introduzione al Cloudcomputing - uniroma1.itberaldi/PSD2012/slides/Cloud...GAE architecture • Google App Engine speaks with web applications through the Web Server Gateway Interface

Iaas: Amazon Web Service

Page 69: Introduzione al Cloudcomputing - uniroma1.itberaldi/PSD2012/slides/Cloud...GAE architecture • Google App Engine speaks with web applications through the Web Server Gateway Interface

IaaS Example: SeeWEB

http://www.seeweb.it/cloudserver/

Calcolatore

Page 70: Introduzione al Cloudcomputing - uniroma1.itberaldi/PSD2012/slides/Cloud...GAE architecture • Google App Engine speaks with web applications through the Web Server Gateway Interface

La “nuvola italiana”

Page 71: Introduzione al Cloudcomputing - uniroma1.itberaldi/PSD2012/slides/Cloud...GAE architecture • Google App Engine speaks with web applications through the Web Server Gateway Interface

Cloud actors

Page 72: Introduzione al Cloudcomputing - uniroma1.itberaldi/PSD2012/slides/Cloud...GAE architecture • Google App Engine speaks with web applications through the Web Server Gateway Interface

Grid computing

• Use of a ‘computational grid’

• Allows to share computation resources (computers, clusters,.. storage, db) and special devices (e.g., telescopes) among virtual organizations

• Resources are managed by different organization

• Usually for scientific purpose

• Simple yet effective example: Seti@home

– More precisely it desktop grid or ‘Volunteer computing’

Page 73: Introduzione al Cloudcomputing - uniroma1.itberaldi/PSD2012/slides/Cloud...GAE architecture • Google App Engine speaks with web applications through the Web Server Gateway Interface

SETI: Search for Extra-Terrestrial Intelligence

Data is recorded on high-density tapes at the Arecibo telescope in Puerto Rico and sent to Berckely

The data is then divided into

0.25 Mbyte chunks (which

we call "work-units")

10 KHz x 2 (Nyquist) x 100 s

x 8 bit These are sent from the Seti@Home server over the Internet to people around the world to analyze.

Internet

Page 74: Introduzione al Cloudcomputing - uniroma1.itberaldi/PSD2012/slides/Cloud...GAE architecture • Google App Engine speaks with web applications through the Web Server Gateway Interface

SETI

• Find deviations from Gaussian

• Get data chunk from the central server (radio-telescope)

• FFT as screensaver

Page 75: Introduzione al Cloudcomputing - uniroma1.itberaldi/PSD2012/slides/Cloud...GAE architecture • Google App Engine speaks with web applications through the Web Server Gateway Interface

http://lhcathome.cern.ch/grid/index.shtml

Page 76: Introduzione al Cloudcomputing - uniroma1.itberaldi/PSD2012/slides/Cloud...GAE architecture • Google App Engine speaks with web applications through the Web Server Gateway Interface

Macchine virtuali

• Una macchina virtuale è una macchina Logica

“realizzata in software” (ML) che gira su una

macchina Fisica (MF)

• Due tipi principali di emulazione

• Emulazione non nativa. ML≠MF

– Tipicamente Process virtual machine

• Emulazione nativa. ML=MF

– Tipicamente System virtual machine

Page 77: Introduzione al Cloudcomputing - uniroma1.itberaldi/PSD2012/slides/Cloud...GAE architecture • Google App Engine speaks with web applications through the Web Server Gateway Interface

Process virtual machine

• Gira come processo SW

• Utile per ottenere portabilità ed interoperabilità di

applicazioni

• Java Virtual Machine

• Common Language Runtime (CLR), cuore

dell’architettura .NET

Page 78: Introduzione al Cloudcomputing - uniroma1.itberaldi/PSD2012/slides/Cloud...GAE architecture • Google App Engine speaks with web applications through the Web Server Gateway Interface

Macchina virtuali ed interoperabilità

• Java Virtual Machine (JVM)– ISA: Macchina a stack (zero-register)

– Linguaggio macchina: Bytecode

JVM

MF1 MF2 MFn

Java

• Portabilità:

“write once run

everywhere”

Page 79: Introduzione al Cloudcomputing - uniroma1.itberaldi/PSD2012/slides/Cloud...GAE architecture • Google App Engine speaks with web applications through the Web Server Gateway Interface

Macchina virtuali ed interoperabilità

• Common Language Runtime (CLR); .NET framework

– Macchina a stack (zero-register)

– Common Intermediate Language (CIL); MSIL

IL

MF1 MF2 MFn

C# VB F#

Compiltatore di

back-end

Just In Time (JIT)

Compiltatore di

front-end

• Cross-language

integration

Page 80: Introduzione al Cloudcomputing - uniroma1.itberaldi/PSD2012/slides/Cloud...GAE architecture • Google App Engine speaks with web applications through the Web Server Gateway Interface

System virtual machine

• La Macchina virtuale riproduce la stessa

macchina fisica (“Efficient, isolated duplicate

of a real machine”*)

• La virtualizzazione è realizzata da un Virtual

Machine Monitor (VMM) o hypervisor

• Processo : SO = Supervisor : Hypervisor

Page 81: Introduzione al Cloudcomputing - uniroma1.itberaldi/PSD2012/slides/Cloud...GAE architecture • Google App Engine speaks with web applications through the Web Server Gateway Interface

System virtual machine

• Due tipologie principali di hypervisor

• Full virtualization

– Il SO gira senza alcuna modifica (VMWare)

– Necessario per SO legacy

• Paravirtualization

– Il SO deve essere modificato per effettuare Hyper Calls (Xen)

– Maggiore efficienza

Page 82: Introduzione al Cloudcomputing - uniroma1.itberaldi/PSD2012/slides/Cloud...GAE architecture • Google App Engine speaks with web applications through the Web Server Gateway Interface

VMM- propietà

• Fidelity

– Ogni programma che gira sulla VM (dal VMM) deveavere lo stesso comportamento dello stessoprogramma eseguito sul sistema fisico

• Safety

– Controllo completo delle risorse virtualizzate

• Efficiency

– Una buona percentuale di istruzioni deve essereesguita senza l’intervento del VMM

Page 83: Introduzione al Cloudcomputing - uniroma1.itberaldi/PSD2012/slides/Cloud...GAE architecture • Google App Engine speaks with web applications through the Web Server Gateway Interface

Risorse

• Xen and the Art of Virtualization, Pratt et al.

SOSP 2003.

• A Comparison of Software and Hardware

Techniques for x86 Virtualization, K. Adams,

O. Agesen. ASPLOS 2006.

Page 84: Introduzione al Cloudcomputing - uniroma1.itberaldi/PSD2012/slides/Cloud...GAE architecture • Google App Engine speaks with web applications through the Web Server Gateway Interface

Classical virtualization

• “A classical VMM executes guest operating system directly, but at a reduced privileged level. The VMM intercepts traps from the de-privileged guest, and emulates the trapping instruction against a virtual machine state”[*]

• Teorema: Se tutte le istruzioni sensibili (che possono modificare lo stato delle risorse) girano in modalità protetta, allora è possibilerealizzare un VMM seguendo la “classical virtualization”

• Le archietterure x86 (32 e 64 bit) no hw assisted non sonovirtualizzabili in modo classico (p.e. popf non genera trap)

• Tali architetture x86 sono virtualizzate mediante altre tecniche, come la tecnica “Binary Translation” usata nei VMM della VMWare

[*]”A camparison of Software and Hardware Techniques for x86 Virtualization”, K.Adams, O.Agesen, ASPLOS 2006

Page 85: Introduzione al Cloudcomputing - uniroma1.itberaldi/PSD2012/slides/Cloud...GAE architecture • Google App Engine speaks with web applications through the Web Server Gateway Interface

Classical virtualization, esempio

1

3

4

5

Guest OS Istruzione non privilegiata

verde = User Mode

rosso = System Mode

Istruzione privilegiata

p.e. CLI, Clear Interrupts

2trap

VMM

tempo

2’

Livello User Livello Kernela. La CPU esegue un’istruzione

privilegiata, ma si trova in

modalità utente

b. La CPU genera una trap

c. Il controllo passa al VMM che

emula l’istruzione ed esce (il

controllo ritorna al SO guest)

d. Nota 2’ non e’ la stessa

istruzione 2 ma un insieme di

istruzioni che emulano la 2

modificando lo stato della

macchina virtuale (per

esempio, CLI�VCPU.IF=0)

Page 86: Introduzione al Cloudcomputing - uniroma1.itberaldi/PSD2012/slides/Cloud...GAE architecture • Google App Engine speaks with web applications through the Web Server Gateway Interface

Software Virtualization

• L’architettura x86 non è virtualizzabile in modo classico (p.e.,

popf non genera trap)

• Una tecnica alternativa di virtualizzazione è scrivere un

interprete software che esegue le istruzioni modificando una

CPU virtuale, VCPU (anche diversa da quella fisica)

• Binary Translation (BT): Il codice macchina viene “tradotto” in

codice eseguibile direttamente dalla CPU (emulazione nativa)

Page 87: Introduzione al Cloudcomputing - uniroma1.itberaldi/PSD2012/slides/Cloud...GAE architecture • Google App Engine speaks with web applications through the Web Server Gateway Interface

Software Virtualization

• Molte istruzioni sono in realtà identiche a quelle di partenza!

• Solo quelle sensibili sono tradotte in una serie di istruzioni che

modificano la VCPU e le strutture dati di supporto al S.O.

• La traduzione del codice binario è dinamica (avviene a run-

time, interleaving di traduzione di blocchi di codice – p.e. 12

istruzioni - ed esecuzione) e on-demand

Page 88: Introduzione al Cloudcomputing - uniroma1.itberaldi/PSD2012/slides/Cloud...GAE architecture • Google App Engine speaks with web applications through the Web Server Gateway Interface

Type-1 hypervisor (bare metal)

• Il Guest OS gira senza alcuna modifica (full virtualization)

• Hardware Server (cloud computing)

• Esempi: Hyper-V(Microsoft) , VMWare ESX

Page 89: Introduzione al Cloudcomputing - uniroma1.itberaldi/PSD2012/slides/Cloud...GAE architecture • Google App Engine speaks with web applications through the Web Server Gateway Interface

Type-2 hypervisor (hosted)• Gira sopra un Sistema Operativo (detto Host)

• Guest OS non modificato (full virtualization); Guest OS gira al “3 livello”

(minore efficienza)

• Spesso usato lato client

Page 90: Introduzione al Cloudcomputing - uniroma1.itberaldi/PSD2012/slides/Cloud...GAE architecture • Google App Engine speaks with web applications through the Web Server Gateway Interface

Paravirtualization

• Richiede una modifica (porting) del Sistema

Operativo poichè è necessario prevedere

chiamate esplicite all’hypervisor (hypercall)

• Elevata efficienza

Page 91: Introduzione al Cloudcomputing - uniroma1.itberaldi/PSD2012/slides/Cloud...GAE architecture • Google App Engine speaks with web applications through the Web Server Gateway Interface

Big view

Full

Virtualization

Para

Virtualization

Type 1

Hypervisor

Type 2

Hypervisor

Process Level

Virtualization

System Level

Virtualization

Java

.NET

Virtualization