Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

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

1,770 views

Published on

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

Published in: Technology
  • Be the first to comment

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

×