Cloud Foundry Bootcamp

Post on 07-May-2015

1460 Views

Category:

Technology

4 Downloads

Preview:

Click to see full reader

DESCRIPTION

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

Transcript

© 2012 VMware, Inc. All rights reserved

Cloud Foundry Bootcamp

Andy Piper Developer Advocateapiper@vmware.com@andypiper

Hello I’m Andy

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.

@andypiperapiper@vmware.com

CONFIDENTIAL

Capabilities

The Basics

How it Works (Architecture)

Micro Cloud Foundry

4

CONFIDENTIAL

What does Cloud Foundry

offer?

5

CONFIDENTIAL

Cloud Foundry: Choice of Runtimes

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

CONFIDENTIAL

Cloud Foundry: Choice of Clouds

8

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

CONFIDENTIAL

10

Cloud Foundry.org

CONFIDENTIAL

11

Cloud Foundry.org

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

CONFIDENTIAL

Micro Cloud Foundry

13

CONFIDENTIAL

Cloud Foundry: Services

14

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

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

CONFIDENTIAL

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

17

CONFIDENTIAL

Demo: Using the tunnel to talk to your services

18

CONFIDENTIAL

Cloud Foundry architecture

19

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

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

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

CONFIDENTIAL

Request handling flow

23

Load Balancer RouterRouterLoad Balancer

HTTP Request HTTP Request

DEAApplication

HTTP Request

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

CONFIDENTIAL

Micro Cloud Foundry

25

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

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

CONFIDENTIAL

Register and login to CloudFoundry.com

28

CONFIDENTIAL

Select a domain name

29

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

CONFIDENTIAL

Remember the configuration token

30

CONFIDENTIAL

Download, unzip and open micro.vmx

31

CONFIDENTIAL

Configure Micro Cloud Foundry

32

Pick password

Enter token

CONFIDENTIAL

Getting started with Cloud Foundry...

33

CONFIDENTIAL

Register

34

http://cloudfoundry.com/signup

Use promo code

cfopentoursofia

CONFIDENTIAL

Welcome email

35

CONFIDENTIAL

Ways to use Cloud Foundry

36

command line...

IDE plugin...

toolchain plugin...

Cloud IDEs

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"

CONFIDENTIAL

Installing vmc on Windows

38

Install the vmc gem

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

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:"apiper@vmware.com

Password:"********

Successfully"logged"into"

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

Cloud Foundry Integration plugin for Eclipse

41

Eclipse support:

✦ CF Integration for Eclipse

✦ SpringSource Tool Suite

Cloud Foundry Integration plugin for Eclipse

42

© 2012 VMware, Inc. All rights reserved

Thank You

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

http://cloudfoundry.com

Questions? @cloudfoundry #cloudfoundry

@andypiper / apiper@vmware.com

top related