2. About Josh Long
Spring Developer Advocate
@starbuxman
josh.long@springsource.com
th
si
is
im
po
rta
nt
!
Free Book!
SpringSource.org/roo
CONFIDENTIAL
20. Main Risk: Lock In 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
24. Cloud Foundry: Clouds
AppFog.com
• community lead for PHP
• PaaS for PHP
Joyent
• community lead for Node.js
ActiveState
• community lead for Python, Perl
• Providers of Stackato private PaaS
CONFIDENTIAL
32. Cloud Foundry: Services
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
• Cassandra? COBOL / CICS, Oracle
CONFIDENTIAL
33. Cloud Foundry: Services
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
36. Accessing Your Services
Debugging and accessing the data locally
• Caldecott --> Service tunneling. Access your Cloud Foundry service as if it was local.
CONFIDENTIAL
37. Demo: Using the tunnel to talk to your services
CONFIDENTIAL
44. Application Deployment Flow
find DEA for
app
vmc push
create app
VMC Cloud Controller DEA
DEA Application
Framework
detection
Framework
specific
staging plugin
Creates
Droplet
Router
Router
CONFIDENTIAL
45. Application Deployment Flow
find DEA for
app
vmc push I’m available
create app
VMC Cloud Controller DEA
DEA Application
Framework
detection
Framework
specific
staging plugin
Creates
Droplet
Router
Router
CONFIDENTIAL
46. Application Deployment Flow
find DEA for
app
vmc push I’m available
create app
VMC Cloud Controller DEA
DEA Application
deploy droplet
Framework
detection
Framework
specific
staging plugin
Creates
Droplet
Router
Router
CONFIDENTIAL
47. Application Deployment Flow
find DEA for
app
vmc push I’m available
create app
VMC Cloud Controller start
DEA
DEA Application
deploy droplet
Framework
detection
Framework
specific
staging plugin
Creates
Droplet
Router
Router
CONFIDENTIAL
48. Application Deployment Flow
find DEA for
app
vmc push I’m available
create app
VMC Cloud Controller start
DEA
DEA Application
deploy droplet
Framework
detection
Framework
specific
staging plugin
update routes
Creates
Droplet
Router
Router
CONFIDENTIAL
49. About the staging plugin
Framework specific
Creates a zip file = black box
• Contains everything necessary for DEA to run the application
• Two scripts: start.sh, stop.sh
CONFIDENTIAL
50. Staging plugin for the Spring framework
Adds CloudAutoStagingBeanFactoryPostProcessor bean:
• Modifies bean definitions
• Implements auto-reconfiguration
Defines CloudApplicationContextInitializer in web.xml
• Activates cloud profile
• Defines PropertySource for CloudEnvironment properties
CONFIDENTIAL
53. 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
54. But where are the VMs?!?
Cloud Foundry has a layered architecture
• Cloud Controller, DEA, … layer = processes
• VM management layer
Benefits: decoupling, simplicity, ….
CloudFoundry.com creates vSphere VMs running different Cloud
Foundry components
CONFIDENTIAL
56. What is in Micro Cloud Foundry?
App Instances Services
Open source Platform as a Service project
10.04
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
57. Pre-requisites for using Micro Cloud Foundry
Minimum 1 GB Minimum 8 GB Internet Connectivity
RAM Disk (w/DHCP is ideal)
VMC STS
Command line GUI
CONFIDENTIAL
66. Logging into Micro Cloud Foundry
$ vmc target api.cer-micro1.cloudfoundry.me
Successfully targeted to [http://api.cer-micro1.cloudfoundry.me]
CONFIDENTIAL
67. Logging into Micro Cloud Foundry
$ vmc target api.cer-micro1.cloudfoundry.me
Successfully targeted to [http://api.cer-micro1.cloudfoundry.me]
$ vmc register
Email: crichardson@vmware.com
Password: ********
Verify Password: ********
Creating New User: OK
Attempting login to [http://api.cer-micro1.cloudfoundry.me]
Successfully logged into [http://api.cer-micro1.cloudfoundry.me]
CONFIDENTIAL
68. Josh Long | josh.long@springsource.com | @starbuxman
Questions?
Signup @ www.cloudfoundry.com using promo code:
CFOpenTour2012
CONFIDENTIAL
Hinweis der Redaktion
\n
\n
Hello, thank you or having me. Im pleased to have the opportunity to introduce you today to Spring and the SpringSource Tool Suite \n\nMy name is Josh Long. I serve as the developer advocate for the Spring framework. I’ve used it in earnest and advocated it for many years now. i’m an author on 3 books on the technology, as well as a comitter to many of the Spring projects. Additionally, I take community activism very seriously and do my best to participate in the community. Sometimes this means answering question on Twitter, or in the forums, or helping contribute to the InfoQ.com and Artima.com communities\n
So I now want to walk you through the process of getting started with Cloud Foundry\n
The first step is to register at Cloud Foundry.com\n\nYou enter your email address along with a promo code to expedite signup\n
You will then get a welcome email containing your temporary password\n
Once you have been signed up you can then start using CloudFoundry.com\n\nYou have several different tools to choose from.\n\nI want to begin by showing you the command line tool- vmc\n
Once you have been signed up you can then start using CloudFoundry.com\n\nYou have several different tools to choose from.\n\nI want to begin by showing you the command line tool- vmc\n
Once you have been signed up you can then start using CloudFoundry.com\n\nYou have several different tools to choose from.\n\nI want to begin by showing you the command line tool- vmc\n
Once you have been signed up you can then start using CloudFoundry.com\n\nYou have several different tools to choose from.\n\nI want to begin by showing you the command line tool- vmc\n
Once you have been signed up you can then start using CloudFoundry.com\n\nYou have several different tools to choose from.\n\nI want to begin by showing you the command line tool- vmc\n
Vmc is written in Ruby so the first step is to install the Ruby runtime.\nOn Windows...\n
Vmc is written in Ruby so the first step is to install the Ruby runtime.\nOn Windows...\n
Vmc is written in Ruby so the first step is to install the Ruby runtime.\nOn Windows...\n
Vmc is written in Ruby so the first step is to install the Ruby runtime.\nOn Windows...\n
On Mac, you can use the Ruby Version Manager to install ruby.\n
So I now want to walk you through the process of getting started with Cloud Foundry\n
\n
\n
This is what happens when you run the command.\n
\n
\n
\n
\n
\n
\n
\n
\n
Once you have deployed the application there are various commands that you can use.\n\nFor example, you can scale the application using the vmc scale command.\n\nIn this example, I’m added two more instances of the application.\n\n\n
\n
You can also use Cloud foundry from within STS, which is an eclipse-based IDE for building enterprise java applications.\n
\n
\n
\n
\n
\n
\n
\n
\n
So I now want to walk you through the process of getting started with Cloud Foundry\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
The packaging of the application into a droplet is handled by a framework-specific staging plugin.\n\nIt creates a zip file that contains everything the DEA needs to run the application.\nAt its root at two scripts: start and stop that are invoked by the DEA.\n
What the staging plugin does is very dependent on the framework.\nFor example, the Spring staging plugin alters the application’s configuration.\n\n\n\n
Load balancer\n Sends request to one of many Routers\n Router\n Selects application instance\n Handles sticky sessions\n Forwards request to application instance\n Application instance\n Handles request\n \n
Die when you are dead\n
In all of this discussion you might be wondering where the VMs are?\n
So I now want to walk you through the process of getting started with Cloud Foundry\n
MCF is CF packaged as a VMware virtual machine.\nIt contains all the services as CloudFoundry.com\n\nIt’s especially useful as a developer sandbox:\n* You can use the services for your JUNIT integration tests\n* You can also run your application for development and testing\n\nFor Java developers\n
To run MCF there are a few things that you need\n
The first step is to register and login to CF.com\n\n\n
You then have to pick a unique domain name for your MCF.\n
CF then displays a configuration token that you must later enter into MCF\n
You then download and unzip MCF and open the micro.VMX\nWhich launches FUSION or VMware player\n