cloud foundry bootcamp

43
© 2012 VMware, Inc. All rights reserved Cloud Foundry Bootcamp Andy Piper Developer Advocate [email protected] @andypiper

Upload: andy-piper

Post on 07-May-2015

1.464 views

Category:

Technology


4 download

DESCRIPTION

The basics of how to get started with Cloud Foundry, presented at the Cloud Foundry Open Tour in Sofia, Bulgaria, November 2012

TRANSCRIPT

Page 1: Cloud Foundry Bootcamp

© 2012 VMware, Inc. All rights reserved

Cloud Foundry Bootcamp

Andy Piper Developer [email protected]@andypiper

Page 2: Cloud Foundry Bootcamp

Hello I’m Andy

Page 3: Cloud Foundry Bootcamp

a few things about me

Developer Advocate @ Cloud Foundrysocial web enthusiast

maker, educator, LEGO fanOSS supporter / contributor

Eclipse Committer (Paho / MQTT)excited by “what’s next”, Internet of Things, etc.

@[email protected]

Page 4: Cloud Foundry Bootcamp

CONFIDENTIAL

Capabilities

The Basics

How it Works (Architecture)

Micro Cloud Foundry

4

Page 5: Cloud Foundry Bootcamp

CONFIDENTIAL

What does Cloud Foundry

offer?

5

Page 6: Cloud Foundry Bootcamp

CONFIDENTIAL

Cloud Foundry: Choice of Runtimes

Page 7: Cloud Foundry Bootcamp

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

Page 8: Cloud Foundry Bootcamp

CONFIDENTIAL

Cloud Foundry: Choice of Clouds

8

Page 9: Cloud Foundry Bootcamp

CONFIDENTIAL

Main Risk: Lock In

9

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

Page 10: Cloud Foundry Bootcamp

CONFIDENTIAL

10

Cloud Foundry.org

Page 11: Cloud Foundry Bootcamp

CONFIDENTIAL

11

Cloud Foundry.org

Page 12: Cloud Foundry Bootcamp

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

Page 13: Cloud Foundry Bootcamp

CONFIDENTIAL

Micro Cloud Foundry

13

Page 14: Cloud Foundry Bootcamp

CONFIDENTIAL

Cloud Foundry: Services

14

Page 15: Cloud Foundry Bootcamp

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

Page 16: Cloud Foundry Bootcamp

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

Page 17: Cloud Foundry Bootcamp

CONFIDENTIAL

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

17

Page 18: Cloud Foundry Bootcamp

CONFIDENTIAL

Demo: Using the tunnel to talk to your services

18

Page 19: Cloud Foundry Bootcamp

CONFIDENTIAL

Cloud Foundry architecture

19

Page 20: Cloud Foundry Bootcamp

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

Page 21: Cloud Foundry Bootcamp

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

Page 22: Cloud Foundry Bootcamp

CONFIDENTIAL

About the staging plugin

22

Framework specific

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

• Two scripts: start.sh, stop.sh

Page 23: Cloud Foundry Bootcamp

CONFIDENTIAL

Request handling flow

23

Load Balancer RouterRouterLoad Balancer

HTTP Request HTTP Request

DEAApplication

HTTP Request

Page 24: Cloud Foundry Bootcamp

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

Page 25: Cloud Foundry Bootcamp

CONFIDENTIAL

Micro Cloud Foundry

25

Page 26: Cloud Foundry Bootcamp

CONFIDENTIAL

What is in Micro Cloud Foundry?

26

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

Page 27: Cloud Foundry Bootcamp

CONFIDENTIAL

Pre-requisites for using Micro Cloud Foundry

27

Minimum 1 GB

RAM

Minimum 8 GB

Disk

Internet Connectivity

(w/DHCP is ideal)

VMC STSCommand line GUI

Page 28: Cloud Foundry Bootcamp

CONFIDENTIAL

Register and login to CloudFoundry.com

28

Page 29: Cloud Foundry Bootcamp

CONFIDENTIAL

Select a domain name

29

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

Page 30: Cloud Foundry Bootcamp

CONFIDENTIAL

Remember the configuration token

30

Page 31: Cloud Foundry Bootcamp

CONFIDENTIAL

Download, unzip and open micro.vmx

31

Page 32: Cloud Foundry Bootcamp

CONFIDENTIAL

Configure Micro Cloud Foundry

32

Pick password

Enter token

Page 33: Cloud Foundry Bootcamp

CONFIDENTIAL

Getting started with Cloud Foundry...

33

Page 34: Cloud Foundry Bootcamp

CONFIDENTIAL

Register

34

http://cloudfoundry.com/signup

Use promo code

cfopentoursofia

Page 35: Cloud Foundry Bootcamp

CONFIDENTIAL

Welcome email

35

Page 36: Cloud Foundry Bootcamp

CONFIDENTIAL

Ways to use Cloud Foundry

36

command line...

IDE plugin...

toolchain plugin...

Cloud IDEs

Page 37: Cloud Foundry Bootcamp

CONFIDENTIAL

Example vmc commands

37

$"gem"install"vmc

$"vmc"target"<any"cloud>

$"vmc"login"<credentials>

$"vmc"push"<my7app>" "">"bind"services?"Yes

$"vmc"update"<my7app>

$"vmc"instances"<my7app>"+100"

Page 38: Cloud Foundry Bootcamp

CONFIDENTIAL

Installing vmc on Windows

38

Install the vmc gem

Page 39: Cloud Foundry Bootcamp

CONFIDENTIAL

Installing vmc on Mac OSX

39

$ 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

Page 40: Cloud Foundry Bootcamp

CONFIDENTIAL

Logging into CloudFoundry.com

40

$"vmc"target"api.cloudfoundry.com

Successfully"targeted"to"

""""""""[http://api.cloudfoundry.com]

$"vmc"login

Attempting"login"to"

""[http://api.cloudfoundry.com]

Email:"[email protected]

Password:"********

Successfully"logged"into"

""[http://api.cloudfoundry.com]

Page 41: Cloud Foundry Bootcamp

Cloud Foundry Integration plugin for Eclipse

41

Eclipse support:

✦ CF Integration for Eclipse

✦ SpringSource Tool Suite

Page 42: Cloud Foundry Bootcamp

Cloud Foundry Integration plugin for Eclipse

42

Page 43: Cloud Foundry Bootcamp

© 2012 VMware, Inc. All rights reserved

Thank You

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

http://cloudfoundry.com

Questions? @cloudfoundry #cloudfoundry

@andypiper / [email protected]