31
Play with Cloud Foundry An Open PaaS Wan, Peng May 11, 2012

Play with cloud foundry

Embed Size (px)

DESCRIPTION

My first training session about Cloud Foundry

Citation preview

Page 1: Play with cloud foundry

Play with Cloud FoundryAn Open PaaS

Wan, Peng

May 11, 2012

Page 2: Play with cloud foundry

• Overview

• Development Guide

• Deployment Guide

• Resource

• Q&A

Agenda

Page 3: Play with cloud foundry

Cloud Foundry Overview

• What’s Cloud Foundry?

• Languages/Frameworks

• Inner Service

• Logic View

• Architecture

• Disadvantages

Page 4: Play with cloud foundry

Type Vendor

SaaS

PaaS

IaaS

Cloud Computing System

Page 5: Play with cloud foundry

What’s Cloud Foundry?An open platform-as-a-service (PaaS). The system supports multiple frameworks, multiple application infrastructure services and deployment to multiple clouds.

Page 6: Play with cloud foundry

Languages/Frameworks/Service

Multi-LanguageRuby, Java, Scala, Node.js, Erlang, Python, PHP..

Multi-FrameworkRails, Sinatra, Spring, Grails, Express, Lift

Multi-ServicesMySQL, Postgres, MongoDB, Redis, RabbitMQ

Multi-Cloud, Multi-IaaSPublic Cloud, MicroCloud, Private Cloud

Page 7: Play with cloud foundry

Logic View

Router

Infrastructure

Health Manager

DEA: execution environmentServices: core, ecosystem, etc.

user appsCloud Controller user apps

vmc client STS plugin browser(user app access)

Page 8: Play with cloud foundry

Architecture

Page 9: Play with cloud foundry

Disadvantages

• Limited Services

• Limited File Generate/Access

• Charge Public Cloud

• No Infrastructure in China

• Beta

Page 10: Play with cloud foundry

• Overview

• Development Guide

• Deployment Guide

• Resource

• Q&A

Agenda

Page 11: Play with cloud foundry

Prepare

• Register

• Install Ruby and RubyGems

• Install VMC (VMware Cloud

Client)

• Install STS (with Cloud

Foundry Plugin)

Page 12: Play with cloud foundry

Spring to Cloud Foundry

• Auto Reconfiguration

• Cloud Namespace

• Spring 3.1 Profiles

Page 13: Play with cloud foundry

Auto Reconfiguration

Two modifications

1. Additional Jar

2. Update Web.xml

BeanFactoryPostProcessor

Examines the application context before

creating beans

Swaps existing beans of matching types

Page 14: Play with cloud foundry

Auto Reconfiguration

Page 15: Play with cloud foundry

Cloud App Setup

Maven

Spring Application-Context

Page 16: Play with cloud foundry

Cloud Namespace

Support Data Source

Other Support

Page 17: Play with cloud foundry

Spring 3.1 Profiles V3.1 adds new support for environments Stand-alone Containers

Page 18: Play with cloud foundry

Cloud Foundry / Public Cloud

Demo: Crawler

Http://www.somesite.com

Crawler

RibbitMQ Instance

Input url

WebApp

ConsumingImage Object

Crawler.cloudfoundry.com

MongoDBPersist

Query

Get urlDom parse

Produce Image Object

Page 19: Play with cloud foundry

Crawler WebApp

ImageUnitRepository ImageUnitGateway

MongoDB RabbitMQ

Crawler.war

Cloud Foundry Services

Page 20: Play with cloud foundry

• Overview

• Development Guide

• Deployment Guide

• Resource

• Q&A

Agenda

Page 21: Play with cloud foundry

Deployment Guide

• Deploy App

• Update App

• Binding Service to App

• Start/Stop App

• Scale App

Page 22: Play with cloud foundry

Deploy App

• vmc login• vmc target• vmc push• vmc update• vmc create-service• vmc bind-service

Via STSVia VMC

Page 23: Play with cloud foundry

Access Service

• TCP over HTTP tunnel

• Local client

• Remote server

• gem install caldecott

• vmc tunnel your-service

• Mongodb/mysql command Caldecott

Page 24: Play with cloud foundry

Micro Cloud Foundry(BETA)

A cloud packaged as a VMware Virtual MachineUse as a developer sandbox

• Use the services from Junit integration tests

• Deploy your application for functional testing

• Remote debugging from STS

Page 25: Play with cloud foundry

Micro Cloud Foundry Pre-requisites

Minimum 1 GB

RAM

Resources

Virtualization

Clients

Minimum 8 GB

Disk

Internet Connectivity

(w/DHCP is ideal)

VMC STS

Page 26: Play with cloud foundry

Download code Setup EnvironmentDeploy Behind

FirewallSetup Scripts

Apache2 license

Private CloudCloudFoundry.ORG

Your Infrastructure

Page 27: Play with cloud foundry

• Overview

• Development Guide

• Deployment Guide

• Resource

• Q&A

Agenda

Page 28: Play with cloud foundry

Things to Forget

• First normal form

• Waterfall model

• Single server deployment

• Single language skill

• Build everything from scratch

• Build custom infrastructure

Page 29: Play with cloud foundry

Things to Learn• Agile, API Design• UI Design, Javacript, HTML5, CSS3• A/B Testing• Open Source, Open Standards• Architecture, Distributed Computing • Cloud Platforms and APIs• Multiple types of languages (imperative, object, functional, logic)• Ability to encapsulate domain knowledge in a DSL• Build on the shoulders of giants: reuse, rest APIs• Pick your battles, choose what you need to build yourself to add

value• Learn to live in a box (embrace platform limitations) to think

outside the box• Use an App Store for distribution

Page 30: Play with cloud foundry

• Primary Site : cloudfoundry.com• Open Source Site : cloudfoundry.org• Twitter : @cloudfoundry• Blog : blog.cloudfoundry.com• FB : facebook.com/cloudfoundry• Support : support.cloudfoundry.com

Cloud Foundry Resources

Page 31: Play with cloud foundry

Q & A