cloud foundry bootcamp

Post on 15-May-2015

2.215 Views

Category:

Technology

1 Downloads

Preview:

Click to see full reader

DESCRIPTION

Presentation given in Zurich at the Zurich IT Geeks Meetup demoing Cloud Foundry PaaS.

TRANSCRIPT

© 2012 VMware, Inc. All rights reserved

Cloud Foundry Bootcamp

Alvaro Videla Developer Advocateavidela@vmware.com@old_sound

Wednesday, November 21, 12

About Me

• Developer Advocate for Cloud Foundry• Blog: http://videlalvaro.github.com/• Twitter: @old_sound• http://slideshare.net/old_sound

2

Wednesday, November 21, 12

About Me

• Developer Advocate for Cloud Foundry• Blog: http://videlalvaro.github.com/• Twitter: @old_sound• I created gifsockets™

3

Wednesday, November 21, 12

About Me

Co-authored

RabbitMQ in Action

http://bit.ly/rabbitmq

4

Wednesday, November 21, 12

CONFIDENTIAL

Capabilities

The Basics

How it Works (Architecture)

Micro Cloud Foundry

5Wednesday, November 21, 12

CONFIDENTIAL

What does Cloud Foundry

offer?

6Wednesday, November 21, 12

CONFIDENTIAL

Cloud Foundry: Choice of Runtimes

Wednesday, November 21, 12

CONFIDENTIAL

Frameworks and Runtimes Supported• Out of the Box

• Java (.WAR files, on Tomcat. Spring’s an ideal choice here, of course..)

• Scala (Lift, Play!)

• Ruby (Rails, Sinatra, etc.)

• Node.js

• Ecosystem Partners

• .NET (Uhuru, Tier3)

• Python (Stackato)

• PHP (AppFog)

• Haskell (1)

• Erlang (2)

1) http://www.cakesolutions.net/teamblogs/2011/11/25/haskell-happstack-on-cloudfoundry/2) https://github.com/cloudfoundry/vcap/pull/20

Wednesday, November 21, 12

CONFIDENTIAL

Cloud Foundry: Choice of Clouds

9Wednesday, November 21, 12

CONFIDENTIAL

Main Risk: Lock In

10

Welcome to the hotel California

Such a lovely place

Such a lovely face

Plenty of room at the hotel California

Any time of year, you can find it here

Last thing I remember, I was

Running for the door

I had to find the passage back

To the place I was before

’relax,’ said the night man,

We are programmed to receive.

You can checkout any time you like,

But you can never leave!

-the Eagles

Wednesday, November 21, 12

CONFIDENTIAL

11

Cloud Foundry.org

Wednesday, November 21, 12

CONFIDENTIAL

Cloud Foundry: Clouds

12

§ Joyent

• community lead for Node.js

§ ActiveState

• community lead for Python, Perl

• Providers of Stackato private PaaS

§ AppFog.com

• community lead for PHP

• PaaS for PHP

Wednesday, November 21, 12

CONFIDENTIAL

Micro Cloud Foundry

13Wednesday, November 21, 12

CONFIDENTIAL

Cloud Foundry: Services

14Wednesday, November 21, 12

CONFIDENTIAL

Cloud Foundry: Services

15

§ Services are one of the extensibility planes in Cloud Foundry• there are more services being contributed by the community daily!

§ MySQL, Redis, MongoDB, RabbitMQ, PostgreSQL

§ Services may be shared across applications

§ Cloud Foundry abstracts the provisioning aspect of services through a uniform API hosted in the Cloud Controller

§ It’s very easy to take an app and add a service to the app in a uniform way

Wednesday, November 21, 12

CONFIDENTIAL

Cloud Foundry: Services

16

§ Take Advantage of Services • they cost nothing to setup

• they deliver value

§ They Encourage Better Architectures• Need a fast read-write cache? Redis is ready to go!

• Need to store long-tail documents? Give MongoDB a try

• Need to decouple what applications do from when they do it? Use messaging and RabbitMQ

Wednesday, November 21, 12

CONFIDENTIAL

Demo: logging in, asking questions, & deploying from the CLI

17Wednesday, November 21, 12

CONFIDENTIAL

Cloud Foundry architecture

18Wednesday, November 21, 12

CONFIDENTIAL

Cloud Foundry - Architecture

DEAs

Web

App

Services

DB

HealthManager

RoutersCloudControllers

Load Balancers

DEAs

Web

App

DEAs

App

100s

of D

EA

s

CloudControllersCloud

Controllers

Services

DB

Services

DB

Load BalancersLoad

Balancers

Routers

HealthManagerHealth

Manager

Routers

Message Bus

(NATS)Message Bus

(NATS)Message Bus

(NATS)

Web Service API

Client, e.g. VMC

Wednesday, November 21, 12

CONFIDENTIAL

Application deployment flow

VMCCloud

Controller DEADEA

RouterRouter

Application

Wednesday, November 21, 12

CONFIDENTIAL

Application deployment flow

VMCvmc push Cloud

Controller DEADEA

RouterRouter

Application

Wednesday, November 21, 12

CONFIDENTIAL

Application deployment flow

VMCvmc push

Framework detection

Cloud Controller DEADEA

RouterRouter

Application

Wednesday, November 21, 12

CONFIDENTIAL

Application deployment flow

VMCvmc push

Framework detection

Cloud Controller

create app DEADEA

RouterRouter

Application

Wednesday, November 21, 12

CONFIDENTIAL

Application deployment flow

VMCvmc push

Framework detection

Cloud Controller

create app

Framework specific staging

plugin

DEADEA

CreatesDroplet

RouterRouter

Application

Wednesday, November 21, 12

CONFIDENTIAL

Application deployment flow

VMCvmc push

Framework detection

Cloud Controller

create app

Framework specific staging

plugin

DEADEA

find DEA for app

CreatesDroplet

RouterRouter

Application

Wednesday, November 21, 12

CONFIDENTIAL

Application deployment flow

VMCvmc push

Framework detection

Cloud Controller

create app

Framework specific staging

plugin

DEADEA

find DEA for app

CreatesDroplet

I’m available

RouterRouter

Application

Wednesday, November 21, 12

CONFIDENTIAL

Application deployment flow

VMCvmc push

Framework detection

Cloud Controller

create app

Framework specific staging

plugin

DEADEA

find DEA for app

CreatesDroplet

deploy droplet

I’m available

RouterRouter

Application

Wednesday, November 21, 12

CONFIDENTIAL

Application deployment flow

VMCvmc push

Framework detection

Cloud Controller

create app

Framework specific staging

plugin

DEADEA

find DEA for app

CreatesDroplet

deploy droplet

I’m available

RouterRouter

Applicationstart

Wednesday, November 21, 12

CONFIDENTIAL

Application deployment flow

VMCvmc push

Framework detection

Cloud Controller

create app

Framework specific staging

plugin

DEADEA

find DEA for app

CreatesDroplet

deploy droplet

I’m available

RouterRouter

update routes

Applicationstart

Wednesday, November 21, 12

CONFIDENTIAL

About the staging plugin

21

§ Framework specific

§ Creates a zip file = black box• Contains everything necessary for DEA to run the application

• Two scripts: start.sh, stop.sh

Wednesday, November 21, 12

CONFIDENTIAL

Request handling flow

22

Load Balancer RouterRouterLoad Balancer

HTTP Request HTTP Request

DEAApplication

HTTP Request

Wednesday, November 21, 12

CONFIDENTIAL

Request handling flow

22

Load Balancer RouterRouterLoad Balancer

HTTP Request HTTP Request

DEAApplication

HTTP Request

Wednesday, November 21, 12

CONFIDENTIAL

Self Healing Infrastructure§ If an application instance crashes

• DEA detects unexpected exit => DEA broadcasts message• Routers remove instance from routing• Health manager notifies Cloud Controller• Cloud Controller re-launches instance

§ If an DEA VM crashes• Application instances become unavailable• Health Manager notices the missing instances and notifies the

Cloud Controller• Cloud Controller requests application instances to be started• Existing DEA will reply and start the applications

Wednesday, November 21, 12

CONFIDENTIAL

Micro Cloud Foundry

24Wednesday, November 21, 12

CONFIDENTIAL

What is in Micro Cloud Foundry?

25

Open source Platform as a Service project

App Instances Services

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

Wednesday, November 21, 12

CONFIDENTIAL

Pre-requisites for using Micro Cloud Foundry

26

Minimum 1 GB

RAM

Minimum 8 GB

Disk

Internet Connectivity

(w/DHCP is ideal)

VMC STSCommand line GUI

Wednesday, November 21, 12

CONFIDENTIAL

Register and login to CloudFoundry.com

27Wednesday, November 21, 12

CONFIDENTIAL

Select a domain name

28

*.cloudfoundry.me => IP address of your machine where Micro Cloud Foundry is running

Wednesday, November 21, 12

CONFIDENTIAL

Remember the configuration token

29Wednesday, November 21, 12

CONFIDENTIAL

Download, unzip and open micro.vmx

30Wednesday, November 21, 12

CONFIDENTIAL

Configure Micro Cloud Foundry

31Wednesday, November 21, 12

CONFIDENTIAL

Configure Micro Cloud Foundry

31

Pick password

Wednesday, November 21, 12

CONFIDENTIAL

Configure Micro Cloud Foundry

31

Pick password

Enter token

Wednesday, November 21, 12

CONFIDENTIAL

Getting started with Cloud Foundry...

32Wednesday, November 21, 12

CONFIDENTIAL

Register

33

http://cloudfoundry.com/signup

Use promo code

cfnownov12

Wednesday, November 21, 12

CONFIDENTIAL

Welcome email

34Wednesday, November 21, 12

CONFIDENTIAL

Ways to use Cloud Foundry

35

command line...

IDE plugin...

toolchain plugin...

Cloud IDEs

Wednesday, November 21, 12

CONFIDENTIAL

Example vmc commands

36

$  gem  install  vmc

$  vmc  target  <any  cloud>$  vmc  login  <credentials>$  vmc  push  <my-­‐app>      >  bind  services?  Yes

$  vmc  update  <my-­‐app>$  vmc  instances  <my-­‐app>  +100  

Wednesday, November 21, 12

CONFIDENTIAL

Installing vmc on Windows

37

Wednesday, November 21, 12

CONFIDENTIAL

Installing vmc on Windows

37

Install the vmc gem

Wednesday, November 21, 12

CONFIDENTIAL

Installing vmc on Mac OSX

38

$ curl -L https://get.rvm.io | bash -s stable --ruby

$ rvm install 1.9.2

$ rvm use 1.9.2

$ gem install vmc

Use Ruby Version Manager http://beginrescueend.com/

You need:Command Line Tools for OSX orXCode 4.1

Wednesday, November 21, 12

CONFIDENTIAL

Logging into CloudFoundry.com

39

Wednesday, November 21, 12

CONFIDENTIAL

Logging into CloudFoundry.com

39

$  vmc  target  api.cloudfoundry.comSuccessfully  targeted  to                  [http://api.cloudfoundry.com]

Wednesday, November 21, 12

CONFIDENTIAL

Logging into CloudFoundry.com

39

$  vmc  target  api.cloudfoundry.comSuccessfully  targeted  to                  [http://api.cloudfoundry.com]

$  vmc  loginAttempting  login  to      [http://api.cloudfoundry.com]Email:  avidela@vmware.comPassword:  ********Successfully  logged  into      [http://api.cloudfoundry.com]

Wednesday, November 21, 12

Cloud Foundry Integration plugin for Eclipse

40

Eclipse support:

✦ CF Integration for Eclipse

✦ SpringSource Tool Suite

Wednesday, November 21, 12

Cloud Foundry Integration plugin for Eclipse

41

Wednesday, November 21, 12

Sample App: CloudStagram

42

Wednesday, November 21, 12

Sample App: CloudStagram

43

Wednesday, November 21, 12

Sample App: CloudStagram

44

Wednesday, November 21, 12

Sample App: CloudStagram

45

Wednesday, November 21, 12

Sample App: CloudStagram

46

Wednesday, November 21, 12

Sample App: CloudStagram

47

Wednesday, November 21, 12

Sample App: CloudStagram

48

Wednesday, November 21, 12

Sample App: CloudStagram

49

Wednesday, November 21, 12

Sample App: CloudStagram

50

Frontend Appnode.js

Wednesday, November 21, 12

Sample App: CloudStagram

51

Frontend Appnode.js

Image Resizersnode.js

Wednesday, November 21, 12

Sample App: CloudStagram

52

Frontend Appnode.js

Image ResizersClojure

Wednesday, November 21, 12

CODE OR IT DIDN’T HAPPEN

53

Wednesday, November 21, 12

© 2012 VMware, Inc. All rights reserved

Thank You

CloudFoundry Source Samples: https://github.com/cloudfoundry-samples/

http://cloudfoundry.com

Questions? @cloudfoundry #cloudfoundry

@old_sound / avidela@vmware.com

Wednesday, November 21, 12

top related