0
Cloud Foundry BootcampLondon, England!Josh Long @starbuxmanChris Richardson @crichardson© 2012 VMware, Inc. All rights res...
About Josh Long              Spring Developer Advocate              @starbuxman              josh.long@springsource.com   ...
getting started with Cloud Foundry...        CONFIDENTIAL
Register   http://cloudfoundry.com/signup                                            Use promo code                       ...
Welcome email                CONFIDENTIAL
Ways to use Cloud Foundry                   CONFIDENTIAL
Ways to use Cloud Foundry                   CONFIDENTIAL
Ways to use Cloud Foundry                   CONFIDENTIAL
Ways to use Cloud Foundry                   CONFIDENTIAL
Ways to use Cloud Foundry                   CONFIDENTIAL
Ways to use Cloud Foundry                   CONFIDENTIAL
Installing vmc on Windows                   CONFIDENTIAL
Installing vmc on Windows                                  Install the vmc gem                   CONFIDENTIAL
Installing vmc on Mac OSX Use Ruby Version Manager http://beginrescueend.com/$ bash -s stable <<(curl -s https://raw.githu...
what doesCloud Foundry    offer?     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...
---Manifests   applications:              target:                  name: html5expenses                  url: ${name}.${tar...
Cloud Foundry: Choice of Clouds                   CONFIDENTIAL
Main Risk: Lock In      Welcome to the hotel california                        Such a lovely place                        ...
Open Source Advantage                  CONFIDENTIAL
Open Source Advantage                  CONFIDENTIAL
Cloud Foundry.org                    CONFIDENTIAL
Cloud Foundry: Clouds          AppFog.com           • community lead for PHP           • PaaS for PHP          Joyent   ...
Micro Cloud Foundry (beta)                    CONFIDENTIAL
Example vmc commands $ vmc target <any cloud> $ vmc login <credentials> $ vmc push <my-app> !    > bind services? Yes $ vm...
Scale the application$ vmc instances cf1 +2Scaling Application instances up to 3: OK$ vmc stats cf1+----------+-----------...
Demo: logging in,      asking questions, &      deploying from the CLI                    CONFIDENTIAL
Using Cloud Foundry from Eclipse & STS http://springsource.com/developer/sts                      CONFIDENTIAL
Demo: developing with Eclipse & STS                    CONFIDENTIAL
Cloud Foundry: Services                   CONFIDENTIAL
Cloud Foundry: Services Services are one of the extensibility planes in Cloud Foundry• there are more services being cont...
Cloud Foundry: Services Take Advantage of Services • they cost nothing to setup • they deliver value They Encourage Bett...
Cloud Foundry: Services                   CONFIDENTIAL
Cloud Foundry: Services                   CONFIDENTIAL
Accessing Your Services Debugging and accessing the data locally   • Caldecott --> Service tunneling. Access your Cloud F...
Demo: Using the tunnel to talk to your services                     CONFIDENTIAL
Cloud Foundry architecture     CONFIDENTIAL
Application Deployment Flow      VMC       Cloud Controller         DEA                                          DEA      ...
Application Deployment Flowvmc push           VMC    Cloud Controller         DEA                                         ...
Application Deployment Flowvmc push             VMC        Cloud Controller         DEA                                   ...
Application Deployment Flowvmc push                        create app             VMC                     Cloud Controller...
Application Deployment Flowvmc push                        create app             VMC                     Cloud Controller...
Application Deployment Flow                                                               find DEA for                     ...
Application Deployment Flow                                                               find DEA for                     ...
Application Deployment Flow                                                               find DEA for                     ...
Application Deployment Flow                                                               find DEA for                     ...
Application Deployment Flow                                                               find DEA for                     ...
About the staging plugin Framework specific Creates a zip file = black box • Contains everything necessary for DEA to ru...
Staging plugin for the Spring framework Adds CloudAutoStagingBeanFactoryPostProcessor bean: • Modifies bean definitions •...
Request handling flowHTTP Request                     HTTP Request                  HTTP Request               Load Balanc...
Request handling flowHTTP Request                     HTTP Request                  HTTP Request               Load Balanc...
Self Healing Infrastructure If an application instance crashes • DEA detects unexpected exit => DEA broadcasts message • ...
But where are the VMs?!? Cloud Foundry has a layered architecture • Cloud Controller, DEA, … layer = processes • VM manag...
usingMicro Cloud Foundry        CONFIDENTIAL
What is in Micro Cloud Foundry?     App Instances                                Services      Open source Platform as a S...
Pre-requisites for using Micro Cloud Foundry            Minimum 1 GB         Minimum 8 GB       Internet Connectivity     ...
Register and login to CloudFoundry.com                    CONFIDENTIAL
Select a domain name*.cloudfoundry.me => IP address of your machine where Micro Cloud Foundry isrunning                   ...
Remember the configuration token                   CONFIDENTIAL
Download, unzip and open micro.vmx                   CONFIDENTIAL
Configure Micro Cloud Foundry                   CONFIDENTIAL
Configure Micro Cloud Foundry                                  Pick                                  password             ...
Configure Micro Cloud Foundry                                  Pick                                  password             ...
Logging into Micro Cloud Foundry                    CONFIDENTIAL
Logging into Micro Cloud Foundry$ vmc target api.cer-micro1.cloudfoundry.meSuccessfully targeted to [http://api.cer-micro1...
Logging into Micro Cloud Foundry$ vmc target api.cer-micro1.cloudfoundry.meSuccessfully targeted to [http://api.cer-micro1...
Josh Long | josh.long@springsource.com | @starbuxman                 Questions?   Signup @ www.cloudfoundry.com using prom...
Upcoming SlideShare
Loading in...5
×

The Cloud Foundry bootcamp talk from SpringOne On The Road - Europe

1,162

Published on

a simple introduction to Cloud Foundry from the perspective of building applications using Cloud Foundry

Published in: Technology
0 Comments
2 Likes
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total Views
1,162
On Slideshare
0
From Embeds
0
Number of Embeds
0
Actions
Shares
0
Downloads
45
Comments
0
Likes
2
Embeds 0
No embeds

No notes for slide
  • \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&amp;#x2019;ve used it in earnest and advocated it for many years now. i&amp;#x2019;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&amp;#x2019;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&amp;#x2019;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&amp;#x2019;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
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • Transcript of "The Cloud Foundry bootcamp talk from SpringOne On The Road - Europe"

    1. 1. Cloud Foundry BootcampLondon, England!Josh Long @starbuxmanChris Richardson @crichardson© 2012 VMware, Inc. All rights reserved
    2. 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
    3. 3. getting started with Cloud Foundry... CONFIDENTIAL
    4. 4. Register http://cloudfoundry.com/signup Use promo code CFOpenTour2012 CONFIDENTIAL
    5. 5. Welcome email CONFIDENTIAL
    6. 6. Ways to use Cloud Foundry CONFIDENTIAL
    7. 7. Ways to use Cloud Foundry CONFIDENTIAL
    8. 8. Ways to use Cloud Foundry CONFIDENTIAL
    9. 9. Ways to use Cloud Foundry CONFIDENTIAL
    10. 10. Ways to use Cloud Foundry CONFIDENTIAL
    11. 11. Ways to use Cloud Foundry CONFIDENTIAL
    12. 12. Installing vmc on Windows CONFIDENTIAL
    13. 13. Installing vmc on Windows Install the vmc gem CONFIDENTIAL
    14. 14. Installing vmc on Mac OSX Use Ruby Version Manager http://beginrescueend.com/$ bash -s stable <<(curl -s https://raw.github.com/wayneeseguin/rvm/master/binscripts/rvm-installer)$ rvm install 1.9.2$ rvm use 1.9.2$ gem install vmc CONFIDENTIAL
    15. 15. what doesCloud Foundry offer? CONFIDENTIAL
    16. 16. Cloud Foundry: Choice of Runtimes CONFIDENTIAL
    17. 17. 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
    18. 18. ---Manifests applications: target: name: html5expenses url: ${name}.${target-base} framework: name: spring info: mem: 512M description: Java SpringSource Spring Application exec: mem: 512M instances: 1 services: expenses-mysql: type: :mysql CONFIDENTIAL
    19. 19. Cloud Foundry: Choice of Clouds CONFIDENTIAL
    20. 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
    21. 21. Open Source Advantage CONFIDENTIAL
    22. 22. Open Source Advantage CONFIDENTIAL
    23. 23. Cloud Foundry.org CONFIDENTIAL
    24. 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
    25. 25. Micro Cloud Foundry (beta) CONFIDENTIAL
    26. 26. Example vmc commands $ vmc target <any cloud> $ vmc login <credentials> $ vmc push <my-app> ! > bind services? Yes $ vmc update <my-app> $ vmc instances <my-app> +100 CONFIDENTIAL
    27. 27. Scale the application$ vmc instances cf1 +2Scaling Application instances up to 3: OK$ vmc stats cf1+----------+-------------+----------------+--------------+--------------+| Instance | CPU (Cores) | Memory (limit) | Disk (limit) | Uptime |+----------+-------------+----------------+--------------+--------------+| 0 | 1.2% (4) | 90.6M (512M) | 8.5M (2G) | 0d:0h:3m:3s || 1 | 9.5% (4) | 60.9M (512M) | 8.4M (2G) | 0d:0h:0m:17s || 2 | 9.4% (4) | 55.5M (512M) | 8.4M (2G) | 0d:0h:0m:17s |+----------+-------------+----------------+--------------+--------------+ CONFIDENTIAL
    28. 28. Demo: logging in, asking questions, & deploying from the CLI CONFIDENTIAL
    29. 29. Using Cloud Foundry from Eclipse & STS http://springsource.com/developer/sts CONFIDENTIAL
    30. 30. Demo: developing with Eclipse & STS CONFIDENTIAL
    31. 31. Cloud Foundry: Services CONFIDENTIAL
    32. 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. 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
    34. 34. Cloud Foundry: Services CONFIDENTIAL
    35. 35. Cloud Foundry: Services CONFIDENTIAL
    36. 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. 37. Demo: Using the tunnel to talk to your services CONFIDENTIAL
    38. 38. Cloud Foundry architecture CONFIDENTIAL
    39. 39. Application Deployment Flow VMC Cloud Controller DEA DEA Application Router Router CONFIDENTIAL
    40. 40. Application Deployment Flowvmc push VMC Cloud Controller DEA DEA Application Router Router CONFIDENTIAL
    41. 41. Application Deployment Flowvmc push VMC Cloud Controller DEA DEA Application Framework detection Router Router CONFIDENTIAL
    42. 42. Application Deployment Flowvmc push create app VMC Cloud Controller DEA DEA Application Framework detection Router Router CONFIDENTIAL
    43. 43. Application Deployment Flowvmc push create app VMC Cloud Controller DEA DEA Application Framework detection Framework specific staging plugin Creates Droplet Router Router CONFIDENTIAL
    44. 44. Application Deployment Flow find DEA for appvmc push create app VMC Cloud Controller DEA DEA Application Framework detection Framework specific staging plugin Creates Droplet Router Router CONFIDENTIAL
    45. 45. Application Deployment Flow find DEA for appvmc push I’m available create app VMC Cloud Controller DEA DEA Application Framework detection Framework specific staging plugin Creates Droplet Router Router CONFIDENTIAL
    46. 46. Application Deployment Flow find DEA for appvmc 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. 47. Application Deployment Flow find DEA for appvmc 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. 48. Application Deployment Flow find DEA for appvmc 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. 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. 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
    51. 51. Request handling flowHTTP Request HTTP Request HTTP Request Load Balancer Router Application Load Balancer Router DEA CONFIDENTIAL
    52. 52. Request handling flowHTTP Request HTTP Request HTTP Request Load Balancer Router Application Load Balancer Router DEA CONFIDENTIAL
    53. 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. 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
    55. 55. usingMicro Cloud Foundry CONFIDENTIAL
    56. 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. 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
    58. 58. Register and login to CloudFoundry.com CONFIDENTIAL
    59. 59. Select a domain name*.cloudfoundry.me => IP address of your machine where Micro Cloud Foundry isrunning CONFIDENTIAL
    60. 60. Remember the configuration token CONFIDENTIAL
    61. 61. Download, unzip and open micro.vmx CONFIDENTIAL
    62. 62. Configure Micro Cloud Foundry CONFIDENTIAL
    63. 63. Configure Micro Cloud Foundry Pick password CONFIDENTIAL
    64. 64. Configure Micro Cloud Foundry Pick password Enter token CONFIDENTIAL
    65. 65. Logging into Micro Cloud Foundry CONFIDENTIAL
    66. 66. Logging into Micro Cloud Foundry$ vmc target api.cer-micro1.cloudfoundry.meSuccessfully targeted to [http://api.cer-micro1.cloudfoundry.me] CONFIDENTIAL
    67. 67. Logging into Micro Cloud Foundry$ vmc target api.cer-micro1.cloudfoundry.meSuccessfully targeted to [http://api.cer-micro1.cloudfoundry.me]$ vmc registerEmail: crichardson@vmware.comPassword: ********Verify Password: ********Creating New User: OKAttempting login to [http://api.cer-micro1.cloudfoundry.me]Successfully logged into [http://api.cer-micro1.cloudfoundry.me] CONFIDENTIAL
    68. 68. Josh Long | josh.long@springsource.com | @starbuxman Questions? Signup @ www.cloudfoundry.com using promo code: CFOpenTour2012 CONFIDENTIAL
    1. A particular slide catching your eye?

      Clipping is a handy way to collect important slides you want to go back to later.

    ×