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

  • 1,077 views
Uploaded on

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

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

More in: Technology
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Be the first to comment
No Downloads

Views

Total Views
1,077
On Slideshare
0
From Embeds
0
Number of Embeds
0

Actions

Shares
Downloads
43
Comments
0
Likes
1

Embeds 0

No embeds

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
    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’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
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n

Transcript

  • 1. Cloud Foundry BootcampLondon, England!Josh Long @starbuxmanChris Richardson @crichardson© 2012 VMware, Inc. All rights reserved
  • 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. getting started with Cloud Foundry... CONFIDENTIAL
  • 4. Register http://cloudfoundry.com/signup Use promo code CFOpenTour2012 CONFIDENTIAL
  • 5. Welcome email CONFIDENTIAL
  • 6. Ways to use Cloud Foundry CONFIDENTIAL
  • 7. Ways to use Cloud Foundry CONFIDENTIAL
  • 8. Ways to use Cloud Foundry CONFIDENTIAL
  • 9. Ways to use Cloud Foundry CONFIDENTIAL
  • 10. Ways to use Cloud Foundry CONFIDENTIAL
  • 11. Ways to use Cloud Foundry CONFIDENTIAL
  • 12. Installing vmc on Windows CONFIDENTIAL
  • 13. Installing vmc on Windows Install the vmc gem CONFIDENTIAL
  • 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. what doesCloud Foundry offer? CONFIDENTIAL
  • 16. Cloud Foundry: Choice of Runtimes CONFIDENTIAL
  • 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. ---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. Cloud Foundry: Choice of Clouds 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
  • 21. Open Source Advantage CONFIDENTIAL
  • 22. Open Source Advantage CONFIDENTIAL
  • 23. Cloud Foundry.org 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
  • 25. Micro Cloud Foundry (beta) CONFIDENTIAL
  • 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. 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. Demo: logging in, asking questions, & deploying from the CLI CONFIDENTIAL
  • 29. Using Cloud Foundry from Eclipse & STS http://springsource.com/developer/sts CONFIDENTIAL
  • 30. Demo: developing with Eclipse & STS CONFIDENTIAL
  • 31. Cloud Foundry: Services 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
  • 34. Cloud Foundry: Services CONFIDENTIAL
  • 35. Cloud Foundry: Services 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
  • 38. Cloud Foundry architecture CONFIDENTIAL
  • 39. Application Deployment Flow VMC Cloud Controller DEA DEA Application Router Router CONFIDENTIAL
  • 40. Application Deployment Flowvmc push VMC Cloud Controller DEA DEA Application Router Router CONFIDENTIAL
  • 41. Application Deployment Flowvmc push VMC Cloud Controller DEA DEA Application Framework detection Router Router CONFIDENTIAL
  • 42. Application Deployment Flowvmc push create app VMC Cloud Controller DEA DEA Application Framework detection Router Router CONFIDENTIAL
  • 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. 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. 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. 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. 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. 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. 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
  • 51. Request handling flowHTTP Request HTTP Request HTTP Request Load Balancer Router Application Load Balancer Router DEA CONFIDENTIAL
  • 52. Request handling flowHTTP Request HTTP Request HTTP Request Load Balancer Router Application Load Balancer Router DEA 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
  • 55. usingMicro Cloud Foundry 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
  • 58. Register and login to CloudFoundry.com CONFIDENTIAL
  • 59. Select a domain name*.cloudfoundry.me => IP address of your machine where Micro Cloud Foundry isrunning CONFIDENTIAL
  • 60. Remember the configuration token CONFIDENTIAL
  • 61. Download, unzip and open micro.vmx CONFIDENTIAL
  • 62. Configure Micro Cloud Foundry CONFIDENTIAL
  • 63. Configure Micro Cloud Foundry Pick password CONFIDENTIAL
  • 64. Configure Micro Cloud Foundry Pick password Enter token CONFIDENTIAL
  • 65. Logging into Micro Cloud Foundry CONFIDENTIAL
  • 66. Logging into Micro Cloud Foundry$ vmc target api.cer-micro1.cloudfoundry.meSuccessfully targeted to [http://api.cer-micro1.cloudfoundry.me] CONFIDENTIAL
  • 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. Josh Long | josh.long@springsource.com | @starbuxman Questions? Signup @ www.cloudfoundry.com using promo code: CFOpenTour2012 CONFIDENTIAL