cloud operating system unit 11 sever technology ii m. c. chiang department of computer science and...

36
Cloud Operating System Unit 11 Sever Technology II M. C. Chiang Department of Computer Science and Engineering National Sun Yat-sen University Kaohsiung, Taiwan, ROC Cloud Operating System

Upload: andrea-pope

Post on 27-Dec-2015

216 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Cloud Operating System Unit 11 Sever Technology II M. C. Chiang Department of Computer Science and Engineering National Sun Yat-sen University Kaohsiung,

Cloud Operating System

Unit 11Sever Technology II

M. C. Chiang

Department of Computer Science and Engineering National Sun Yat-sen University

Kaohsiung, Taiwan, ROC

Cloud Operating System

Page 2: Cloud Operating System Unit 11 Sever Technology II M. C. Chiang Department of Computer Science and Engineering National Sun Yat-sen University Kaohsiung,

Outline

Platform as a Service Case Study

Google App Engine (GAE) Amazon Web Service (AWS)

Google App Engine Overview Features of Amazon Web Service

Highly Customization

04/19/23 Cloud Operating System - Uint 11: Server Technology 2 U11-2

Page 3: Cloud Operating System Unit 11 Sever Technology II M. C. Chiang Department of Computer Science and Engineering National Sun Yat-sen University Kaohsiung,

Platform as a Service

The middle layer between IaaS and SaaS Provides an ‘platform’ developing softwares. The platform interacts with cloud infrastructure. Providers

GoogleAppEngine Amazon Beanstalk Windows Azure

04/19/23 Cloud Operating System - Uint 11: Server Technology 2 U11-3

Page 4: Cloud Operating System Unit 11 Sever Technology II M. C. Chiang Department of Computer Science and Engineering National Sun Yat-sen University Kaohsiung,

Platform as a Service

What should a PaaS do? Should aware the loading and capacity, and expand

or shrink when necessary. Self-service. Rapid elasticity.

Should be easy to control, prevent outgrowing in rush hours. Measured service.

Should be reliable, of course.

04/19/23 Cloud Operating System - Uint 11: Server Technology 2 U11-4

Page 5: Cloud Operating System Unit 11 Sever Technology II M. C. Chiang Department of Computer Science and Engineering National Sun Yat-sen University Kaohsiung,

Case Study: GAE and AWS

Google App Engine Initial release: Apri 7, 2008 Newest stable release: February 28, 2012 Support Python, Java, Go, and other JVM language

Amazon Web Service - Beanstalk Initial release: December 1, 2010

AWS release in July 2002

Newest release: March 20, 2012 Support Java, PHP

04/19/23 Cloud Operating System - Uint 11: Server Technology 2 U11-5

Page 6: Cloud Operating System Unit 11 Sever Technology II M. C. Chiang Department of Computer Science and Engineering National Sun Yat-sen University Kaohsiung,

Google App Engine

Provides an easy way to build and maintain applications.

Based on the global distributed infrastructure. Be scalable. Low cost. Coupled with numerous Google existing

applications. (Gmail, Google Docs, etc.)

04/19/23 Cloud Operating System - Uint 11: Server Technology 2 U11-6

Page 7: Cloud Operating System Unit 11 Sever Technology II M. C. Chiang Department of Computer Science and Engineering National Sun Yat-sen University Kaohsiung,

GAE - Features

Dynamic web serving. Persistent storage with queries, sorting and

transactions. Scaling and load balancing automatically. Local development environment. Task queue. Scheduled task.

04/19/23 Cloud Operating System - Uint 11: Server Technology 2 U11-7

Page 8: Cloud Operating System Unit 11 Sever Technology II M. C. Chiang Department of Computer Science and Engineering National Sun Yat-sen University Kaohsiung,

GAE - Components

Runtime Environment DataStore Services

04/19/23 Cloud Operating System - Uint 11: Server Technology 2 U11-8

Page 9: Cloud Operating System Unit 11 Sever Technology II M. C. Chiang Department of Computer Science and Engineering National Sun Yat-sen University Kaohsiung,

GAE – Runtime Environments

Runtime Environment Python

Rapid responses to web requests. Supports popular web application frameworks. Works with any application that supports CGI or WSGI.

Java Based on common Java web technology standards. Plugin for Eclipse. Supports other language. (JRuby, JavaScript, Scala)

Go A statically typed, compiled language. Great for CPU-intensive tasks. Huge external libraries support.

04/19/23 Cloud Operating System - Uint 11: Server Technology 2 U11-9

Page 10: Cloud Operating System Unit 11 Sever Technology II M. C. Chiang Department of Computer Science and Engineering National Sun Yat-sen University Kaohsiung,

GAE – DataStore (1)

BigTable Characteristics

Object-oriented Database Information is represented in the form of objects.

No JOIN Not a traditional relationship database.

Fault Tolerance Many duplications on different servers.

Load Balance Server farm.

04/19/23 Cloud Operating System - Uint 11: Server Technology 2 U11-10

Page 11: Cloud Operating System Unit 11 Sever Technology II M. C. Chiang Department of Computer Science and Engineering National Sun Yat-sen University Kaohsiung,

GAE – DataStore (2)

BigTable Based on

Google File System (GFS) Optimization on data add and read.

MapReduce A model for data processing on parallel system. “Map” divides the data. “Reduce” integrates the results.

Chubby Providing an interface for loosely-coupled distributed system. Data synchronization.

04/19/23 Cloud Operating System - Uint 11: Server Technology 2 U11-11

Page 12: Cloud Operating System Unit 11 Sever Technology II M. C. Chiang Department of Computer Science and Engineering National Sun Yat-sen University Kaohsiung,

GAE – Services (1)

Services Memcache Task Queue Image Manipulation URL Fetch Mail XMPP

04/19/23 Cloud Operating System - Uint 11: Server Technology 2 U11-12

Page 13: Cloud Operating System Unit 11 Sever Technology II M. C. Chiang Department of Computer Science and Engineering National Sun Yat-sen University Kaohsiung,

GAE – Services (2)

Memcache Provides a high performance in-memory key-value

cache for the applications.

Task Queue Initiated by the user. Can also be created by the application to break

down the task.

Image Manipulation Can resize, crop, rotate and flip images

04/19/23 Cloud Operating System - Uint 11: Server Technology 2 U11-13

Page 14: Cloud Operating System Unit 11 Sever Technology II M. C. Chiang Department of Computer Science and Engineering National Sun Yat-sen University Kaohsiung,

GAE – Services (3)

URL Fetch For applications to access resources on the internet. Available for port 80 (http) and port 443 (https). HTTP redirect limit: 5. (2008)

Mail For applications to send email messages. Uses Google infrastructure.

04/19/23 Cloud Operating System - Uint 11: Server Technology 2 U11-14

Page 15: Cloud Operating System Unit 11 Sever Technology II M. C. Chiang Department of Computer Science and Engineering National Sun Yat-sen University Kaohsiung,

GAE – Services (4)

XMPP XMPP is an instant-messaging protocol, used by

Google Talk, Jabber, and other IM networks. App Engine does not act as an XMPP service itself. Supported by Python and Java so far.

These (URL Fetch, Mail, XMPP) are the ways for applications to communicate with the outside world.

04/19/23 Cloud Operating System - Uint 11: Server Technology 2 U11-15

Page 16: Cloud Operating System Unit 11 Sever Technology II M. C. Chiang Department of Computer Science and Engineering National Sun Yat-sen University Kaohsiung,

GAE – Sandbox (1)

What is a Sandbox? Computer Security

A mechanism for separating running programs.

Software Development A testing environment for isolating untested code.

How does a Sandbox work? Cuts a specified block of memory. Simulates the true environment in the memory. Records the behaviors of applications.

04/19/23 Cloud Operating System - Uint 11: Server Technology 2 U11-16

Page 17: Cloud Operating System Unit 11 Sever Technology II M. C. Chiang Department of Computer Science and Engineering National Sun Yat-sen University Kaohsiung,

GAE – Sandbox (2)

Some limitations of GAE sandbox. Applications can only access the internet through the

provided services, such as URL Fetch. Applications can only be connected from outside by

making HTTP or HTTPS requests on the standard ports. Applications can not write to the file system. Applications can only read files uploaded with the

application code. Applications code only runs in response to a web

request, and must respond in 60 seconds.

04/19/23 Cloud Operating System - Uint 11: Server Technology 2 U11-17

Page 18: Cloud Operating System Unit 11 Sever Technology II M. C. Chiang Department of Computer Science and Engineering National Sun Yat-sen University Kaohsiung,

GAE – GQL

A text-based query language which is similar to SQL.

No JOIN. It’s inefficient when queries span more than one

machine.

Instead, GQL has ReferenceProperty() key-lists

to help to create relationships between entities.

04/19/23 Cloud Operating System - Uint 11: Server Technology 2 U11-18

Page 19: Cloud Operating System Unit 11 Sever Technology II M. C. Chiang Department of Computer Science and Engineering National Sun Yat-sen University Kaohsiung,

GQL – ReferenceProperty() (1)

One-to-many. Allows disks to fail without the system failing. Associates an arbitrary number of repeated

types of information with a single entity. For example, how to design a database for

users to assign as many phone numbers to each of their contacts as they like?

04/19/23 Cloud Operating System - Uint 11: Server Technology 2 U11-19

Page 20: Cloud Operating System Unit 11 Sever Technology II M. C. Chiang Department of Computer Science and Engineering National Sun Yat-sen University Kaohsiung,

GQL – ReferenceProperty() (2) class Contact(db.Model):

class PhoneNumber(db.Model):

contact = db.ReferenceProperty(Contact, collection_name=‘phone_numbers’)

phone_type = db.StringProperty(choices=(‘home’, ‘work’, ‘mobile’, ‘other’))

number = db.PhoneNumberProperty()

If we have a contact named “Kevin” who has a home phone and a work phone, we can populate his contact information like this:

kevin = Contact(name=‘Kevin’)

kevin.put()

PhoneNumber(contact=kevin, phone_type=‘home’, number=‘(07)551-3146’).put()

PhoneNumber(contact=kevin, phone_type=‘work’, number=(06)331-2545).put()

04/19/23 Cloud Operating System - Uint 11: Server Technology 2 U11-20

Page 21: Cloud Operating System Unit 11 Sever Technology II M. C. Chiang Department of Computer Science and Engineering National Sun Yat-sen University Kaohsiung,

GQL – key-lists

Many-to-many. Allows lots of different objects to share other

instances between each other. For example, we can design a database with

the ability for users to organize their contacts into groups.

04/19/23 Cloud Operating System - Uint 11: Server Technology 2 U11-21

Page 22: Cloud Operating System Unit 11 Sever Technology II M. C. Chiang Department of Computer Science and Engineering National Sun Yat-sen University Kaohsiung,

GAE – Request Handling Architecture

04/19/23 Cloud Operating System - Uint 11: Server Technology 2 U11-22

Page 23: Cloud Operating System Unit 11 Sever Technology II M. C. Chiang Department of Computer Science and Engineering National Sun Yat-sen University Kaohsiung,

GAE – Request Handling Procedure (1) Load balancer routes the request to one of the

frontends. Frontend determines the applications supplied

from the domain name. According to the configuration, applications tell

frontends how to treat the requests based on the URL paths. Path may map to a static file which should be served

to the client directly. Path may map to a request handler.

04/19/23 Cloud Operating System - Uint 11: Server Technology 2 U11-23

Page 24: Cloud Operating System Unit 11 Sever Technology II M. C. Chiang Department of Computer Science and Engineering National Sun Yat-sen University Kaohsiung,

GAE – Request Handling Procedure (2) URL path match conditions

No Match HTTP 404

Match the path of one of the applications static files Frontend routes the request to the static file servers.

Match a pattern mapped to one of the application’s request handlers Frontend sends the request to the application server.

04/19/23 Cloud Operating System - Uint 11: Server Technology 2 U11-24

Page 25: Cloud Operating System Unit 11 Sever Technology II M. C. Chiang Department of Computer Science and Engineering National Sun Yat-sen University Kaohsiung,

GAE – APIs Overview (1)

Backends Allow application author to retrieve information about

backend servers.

Storing Data Provides persistent storage for App Engine

applications. Can be used directly or via the provided JDO or JPA

interfaces. Does operations like get, put, delete, query to the

entities.

04/19/23 Cloud Operating System - Uint 11: Server Technology 2 U11-25

Page 26: Cloud Operating System Unit 11 Sever Technology II M. C. Chiang Department of Computer Science and Engineering National Sun Yat-sen University Kaohsiung,

GAE – APIs Overview (2) Data Processing (Python)

MapReduce In experimental. Developed by Google. A computing model to do efficient distributed computing over

large data sets.

Services APIs for the existing services.

App Identity, Blobstore, Capabilities, Channel Conversion, Images, LogService, Mail, Memcache, Multitenancy, Oauth, Prospective Search, Task Queues, URL Fetch, Users, XMPP.

04/19/23 Cloud Operating System - Uint 11: Server Technology 2 U11-26

Page 27: Cloud Operating System Unit 11 Sever Technology II M. C. Chiang Department of Computer Science and Engineering National Sun Yat-sen University Kaohsiung,

GAE – APIs Overview (3)

Tools Remote API (Java)

Helps to access App Engine services from any Java application.

ProtoRPC (Python) In experimental. A simple way to send and receive HTTP-based RPC

services.

04/19/23 Cloud Operating System - Uint 11: Server Technology 2 U11-27

Page 28: Cloud Operating System Unit 11 Sever Technology II M. C. Chiang Department of Computer Science and Engineering National Sun Yat-sen University Kaohsiung,

Amazon Web Service

Amazon is the pioneer of Cloud Computing Fully customization from bottom-up. Amazon Web Service (AWS) including IaaS

and PaaS. Users should build up the IaaS first, then

develop in the PaaS envrironment, Amazon Beanstalk.

04/19/23 Cloud Operating System - Uint 11: Server Technology 2 U11-28

Page 29: Cloud Operating System Unit 11 Sever Technology II M. C. Chiang Department of Computer Science and Engineering National Sun Yat-sen University Kaohsiung,

Amazon Web Service - Components Amazon Elastic Compute Cloud (EC2)

Provides virtual machine instances. Can customize instance images.

Amazon Simple Storage Service (S3) Provides storage.

04/19/23 Cloud Operating System - Uint 11: Server Technology 2 U11-29

Page 30: Cloud Operating System Unit 11 Sever Technology II M. C. Chiang Department of Computer Science and Engineering National Sun Yat-sen University Kaohsiung,

Amazon Web Service - Components Amazon Relational Database Service (RDS)

Provides database instances. Can select between MySQL and Oracle in many versions and configurations.

Amazon Elastic Beanstalk The PaaS solution of AWS. Still in beta.

Other services Load balancer, monitors, notification, etc. About 20 services in total.

04/19/23 Cloud Operating System - Uint 11: Server Technology 2 U11-30

Page 31: Cloud Operating System Unit 11 Sever Technology II M. C. Chiang Department of Computer Science and Engineering National Sun Yat-sen University Kaohsiung,

Amazon Web Service AWS controls

Operating system Language (Java, PHP) Middleware stack

(tomcat, RDS…) Can be easily extended

Architecture (Web) Storage Data center

User controls Application Code Selecting the middleware

stack (anything except tomcat)

HW configuration Performance Limited control over the

OS using Linux tools JVM tuning/configuration

04/19/23 Cloud Operating System - Uint 11: Server Technology 2 U11-31

Page 32: Cloud Operating System Unit 11 Sever Technology II M. C. Chiang Department of Computer Science and Engineering National Sun Yat-sen University Kaohsiung,

AWS Beanstalk

Main Design goals Easy to use Scalable

Development tools AWS Toolkit for Eclipse

For Java development.

AWS DevTools For PHP development.

04/19/23 Cloud Operating System - Uint 11: Server Technology 2 U11-32

Page 33: Cloud Operating System Unit 11 Sever Technology II M. C. Chiang Department of Computer Science and Engineering National Sun Yat-sen University Kaohsiung,

AWS Beanstalk – Components

Application Not only the codes Including

Versions Environments Environment configurations

Conceptually similar to a folder

04/19/23 Cloud Operating System - Uint 11: Server Technology 2 U11-33

Page 34: Cloud Operating System Unit 11 Sever Technology II M. C. Chiang Department of Computer Science and Engineering National Sun Yat-sen University Kaohsiung,

AWS Beanstalk – Components

Version The real deployable code Labeled with development iteration (so it called version)

Part of application. Applications can have many versions.

04/19/23 Cloud Operating System - Uint 11: Server Technology 2 U11-34

Page 35: Cloud Operating System Unit 11 Sever Technology II M. C. Chiang Department of Computer Science and Engineering National Sun Yat-sen University Kaohsiung,

AWS Beanstalk – Components

Environment The instance runs deployed version. Each environment runs only a single version.

Environment Configuration Record the collection of parameters of an

environment. Such as instance type, auto scaling limits, scaling

trigger, database type, system parameters, etc.

04/19/23 Cloud Operating System - Uint 11: Server Technology 2 U11-35

Page 36: Cloud Operating System Unit 11 Sever Technology II M. C. Chiang Department of Computer Science and Engineering National Sun Yat-sen University Kaohsiung,

AWS Beanstalk – API Overview Can categorize into 3 types

The Core Utilities API Query, authentication, request/response

The API Interact with other Amazon services AutoScaling, EC2, S3, RDS, etc.

Extensions (2 extensions currently) API that helps create HTML <from> element for uploading

file to S3 service PHP native file management function wrappers for S3

service

04/19/23 Cloud Operating System - Uint 11: Server Technology 2 U11-36