play with cloud foundry an open paas shi, tao may 11, 2012
TRANSCRIPT
Play with Cloud FoundryAn Open PaaS
Shi, Tao
May 11, 2012
• Overview
• Development Guide
• Deployment Guide
• Resource
• Q&A
Agenda
Cloud Foundry Overview
• What’s Cloud Foundry?
• Languages/Frameworks
• Inner Service
• Logic View
• Architecture
• Disadvantages
Type Vendor
SaaS
PaaS
IaaS
Cloud Computing System
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.
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
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)
Architecture
Disadvantages
• Limited Services
• Limited File Generate/Access
• Charge Public Cloud
• No Infrastructure in China
• Beta
• Overview
• Development Guide
• Deployment Guide
• Resource
• Q&A
Agenda
Prepare
• Register
• Install Ruby and RubyGems
• Install VMC (VMware Cloud
Client)
• Install STS (with Cloud
Foundry Plugin)
Spring to Cloud Foundry
• Auto Reconfiguration
• Cloud Namespace
• Spring 3.1 Profiles
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
Auto Reconfiguration
Cloud App Setup
Maven
Spring Application-Context
Cloud Namespace
Support Data Source
Other Support
Spring 3.1 Profiles V3.1 adds new support for environments Stand-alone Containers
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
Crawler WebApp
ImageUnitRepository ImageUnitGateway
MongoDB RabbitMQ
Crawler.war
Cloud Foundry Services
• Overview
• Development Guide
• Deployment Guide
• Resource
• Q&A
Agenda
Deployment Guide
• Deploy App
• Update App
• Binding Service to App
• Start/Stop App
• Scale App
Deploy App
• vmc login• vmc target• vmc push• vmc update• vmc create-service• vmc bind-service
Via STSVia VMC
Access Service
• TCP over HTTP tunnel
• Local client
• Remote server
• gem install caldecott
• vmc tunnel your-service
• Mongodb/mysql command Caldecott
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
Micro Cloud Foundry Pre-requisites
Minimum 1 GB
RAM
Resources
Virtualization
Clients
Minimum 8 GB
Disk
Internet Connectivity
(w/DHCP is ideal)
VMC STS
Download code Setup EnvironmentDeploy Behind
FirewallSetup Scripts
Apache2 license
Private CloudCloudFoundry.ORG
Your Infrastructure
• Overview
• Development Guide
• Deployment Guide
• Resource
• Q&A
Agenda
Things to Forget
• First normal form
• Waterfall model
• Single server deployment
• Single language skill
• Build everything from scratch
• Build custom infrastructure
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
• 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
Q & A