Play with Cloud Foundryx - cotbi

gayheadtibburInternet and Web Development

Feb 5, 2013 (4 years and 8 months ago)

242 views

Play with Cloud Foundry

An 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
-
Language

Ruby, Java,
Scala
, Node.js,
Erlang
, Python, PHP..



Multi
-
Framework

Rails, Sinatra, Spring, Grails, Express, Lift



Multi
-
Services

MySQL
,
Postgres
,
MongoDB
,
Redis
,
RabbitMQ



Multi
-
Cloud, Multi
-
IaaS

Public Cloud,
MicroCloud
, Private Cloud

Logic View

R
outer

I
nfrastructure

H
ealth
M
anager

DEA: execution environment

S
ervices: core, ecosystem, etc.

user apps

C
loud
C
ontroller

user apps

vmc client

STS plugin

browser

(user app access)

Architecture

H
e
a
l
t
h

Ma
n
a
g
e
r
Se
rvi
ce

"A"
Pro
vi
si
o
n
i
n
g

Ag
e
n
t
D
ro
p
l
e
t

Exe
cu
t
i
o
n

Ag
e
n
t

(D
EA)
C
l
o
u
d

C
o
n
t
ro
l
l
e
r
C
l
o
u
d

C
o
n
t
ro
l
l
e
r
Router
Router
Se
rvi
ce

"A"
Cloud
C
o
n
t
ro
l
l
e
r
D
a
t
a
b
a
se
R
o
u
t
e
s
d
ro
p
l
e
t

re
q
u
e
st
s
R
o
u
t
e
s
R
EST

API

re
q
u
e
st
s
Pe
rsi
st
s
d
ro
p
l
e
t
s

a
n
d

p
ro
vi
si
o
n
e
d

se
rvi
ce
s
Pe
ri
o
d
i
ca
l
l
y
sca
n
s
f
o
r
co
n
si
st
e
n
cy
D
ro
p
l
e
t

ch
a
n
g
e

notifi
ca
t
i
o
n
s
D
ro
p
l
e
t

st
a
rt
/
st
o
p

re
q
u
e
st
s
O
rch
e
st
ra
t
e
s
(St
a
rt
,

St
o
p
,

F
i
n
d
)
R
e
g
i
st
e
rs
a
n
d

u
n
re
g
i
st
e
rs
R
e
g
i
st
e
rs
a
n
d

u
n
re
g
i
st
e
rs
Se
n
d
s
d
ro
p
l
e
t

h
e
a
rt

b
e
a
t
s
a
n
d
e
xi
t

me
ssa
g
e
s
Pro
vi
si
o
n

a
n
d

u
n
p
ro
vi
si
o
n
Ad
ve
rt
i
se
Se
rvi
ce
Pro
vi
si
o
n
and
u
n
p
ro
vi
si
o
n
G
u
e
st

a
p
p
l
i
ca
t
i
o
n
s
co
n
su
me
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

Consuming

Image Object

Crawler.cloudfoundry.com

MongoDB

Persist

Query

Get
url

Dom 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 STS

Via 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 Machine

Use

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 Environment

Deploy

Behind


Firewall


Setup Scripts

Apache2 license

Private Cloud




CloudFoundry.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