Hands On CloudFoundry

1,075 views

Published on

Slides to the HandsOn CloudFoundry session given with @fbiville on Oct 11th, 2012.

Instructions to the exercises are here : https://github.com/ericbottard/hands-on-cloudfoundry

0 Comments
2 Likes
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total views
1,075
On SlideShare
0
From Embeds
0
Number of Embeds
24
Actions
Shares
0
Downloads
20
Comments
0
Likes
2
Embeds 0
No embeds

No notes for slide
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • Facile à développer, tester, déployer.\nOui mais...\n
  • viralité = nécessite l’elasticité\ntemps réel = peut-être un front-end node.js?\n\nmaintenance : un seul livrable = plus de risques à chaque déploiement. Egalement, fort couplage = nécessite forte synchronisation = releases moins fréquentes.\n\nbranche de maintenance metaboli, on attend toujours...\n\n
  • viralité = nécessite l’elasticité\ntemps réel = peut-être un front-end node.js?\n\nmaintenance : un seul livrable = plus de risques à chaque déploiement. Egalement, fort couplage = nécessite forte synchronisation = releases moins fréquentes.\n\nbranche de maintenance metaboli, on attend toujours...\n\n
  • viralité = nécessite l’elasticité\ntemps réel = peut-être un front-end node.js?\n\nmaintenance : un seul livrable = plus de risques à chaque déploiement. Egalement, fort couplage = nécessite forte synchronisation = releases moins fréquentes.\n\nbranche de maintenance metaboli, on attend toujours...\n\n
  • viralité = nécessite l’elasticité\ntemps réel = peut-être un front-end node.js?\n\nmaintenance : un seul livrable = plus de risques à chaque déploiement. Egalement, fort couplage = nécessite forte synchronisation = releases moins fréquentes.\n\nbranche de maintenance metaboli, on attend toujours...\n\n
  • Du coup, c’est un petit peu plus compliqué.\nLes devs doivent se concentrer sur le dev. Laissons la plomberie au PaaS\n\n
  • \n
  • \n
  • \n
  • avoid lock-in:\n vis a vis d’un provider (eg AppFog, IronFoundry, etc)\n vis a vis de tout provider : CF inside the FW\n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • multi langages, multi ...\n\n
  • multi langages, multi ...\n\n
  • multi langages, multi ...\n\n
  • Hands On CloudFoundry

    1. 1. Hands on CloudFoundryEric Bottard - VMwareFlorent Biville - Lateral Thoughts
    2. 2. Eric Bottard• Developer Advocate VMware• @ebottard• ebottard@vmware.com
    3. 3. Florent Biville• Développeur chez LateralThoughts• @fbiville
    4. 4. Merci ;-) 4
    5. 5. Agenda• Pourquoi le Cloud?• Présentation de CloudFoundry• Maintenant, à vous 5
    6. 6. Pourquoi le Cloud ? 6
    7. 7. Est-ce que votre application ressemble à ça? Tomcat .war Browser Apache MySQL 7
    8. 8. Nouveaux usages, nouveaux challenges 8
    9. 9. Nouveaux usages, nouveaux challenges• Nouveaux besoins – Toujours plus de clients (explosion du mobile) – Viralité des réseaux sociaux – Besoin de notification en quasi temps réel 8
    10. 10. Nouveaux usages, nouveaux challenges• Nouveaux besoins – Toujours plus de clients (explosion du mobile) – Viralité des réseaux sociaux – Besoin de notification en quasi temps réel 8
    11. 11. Nouveaux usages, nouveaux challenges• Nouveaux besoins – Toujours plus de clients (explosion du mobile) – Viralité des réseaux sociaux – Besoin de notification en quasi temps réel• 1 war monolithique – difficile à scaler, approche tout ou rien – difficile à maintenir 8
    12. 12. Nouveaux usages, nouveaux challenges• Nouveaux besoins – Toujours plus de clients (explosion du mobile) – Viralité des réseaux sociaux – Besoin de notification en quasi temps réel• 1 war monolithique – difficile à scaler, approche tout ou rien – difficile à maintenir• Qui provisionne vos environnements pour tests fonctionnels? et vos tests de perf? 8
    13. 13. Bientôt, vos applis ressembleront à ça Tomcat search. war Desktop Browser Tomcat Native users. Node.js Message Bus war Mongo Mobile Front End e.g. RabbitMQ App HTML5 Mobile App Tomcat orders. war MySQL 9
    14. 14. Présentation de CloudFoundry 10
    15. 15. OSS community 11
    16. 16. Ap p lic Data atServices io n Se r vic e In te Msg rfa Services ce Other ServicesAdditional partnerservices … 12
    17. 17. d Avoi n Lo ck-i Ap p Private lic Data atServices Clouds io n Se ce r vic rfa e te In In te Public er Msg rfa vid Services Clouds ce o Pr ud o Cl Micro Other Clouds Services 13
    18. 18. cloudfoundry.com : offre VMware CloudFoundry.COM (beta) Frameworks Services vCenter / vSphere Infrastructure 14
    19. 19. cloudfoundry.org : projet open-source CloudFoundry.ORG Community Frameworks Contributions Community Services Contributions Your Infrastructure Download Setup Tool Chain & Deploy Behind Code Environment Scripts Firewall Cloud Foundry BOSH Apache2 license 15
    20. 20. Micro CF : le premier Cloud de poche Micro Cloud Foundry Frameworks Services Your Laptop/PC Single VM instance of Cloud Foundry that runs on a developer’s MAC or PC 16
    21. 21. Déployer une application 17
    22. 22. En deux motsvmc target <any cloud>vmc login Email: you@somedomain.com Password: *********vmc push myappvmc bind-service myservicevmc instances myapp +10 18
    23. 23. Déployer une application 19
    24. 24. Déployer une applicationWould you like to deploy from the current directory? [Yn]: Y 19
    25. 25. Déployer une applicationWould you like to deploy from the current directory? [Yn]: YApplication Name: ss-showcase 19
    26. 26. Déployer une applicationWould you like to deploy from the current directory? [Yn]: YApplication Name: ss-showcaseDetected a Java SpringSource Spring Application, is thiscorrect? [Yn]: Y 19
    27. 27. Déployer une applicationWould you like to deploy from the current directory? [Yn]: YApplication Name: ss-showcaseDetected a Java SpringSource Spring Application, is thiscorrect? [Yn]: YApplication Deployed URL [ss-showcase.cloudfoundry.com]: 19
    28. 28. Déployer une applicationWould you like to deploy from the current directory? [Yn]: YApplication Name: ss-showcaseDetected a Java SpringSource Spring Application, is thiscorrect? [Yn]: YApplication Deployed URL [ss-showcase.cloudfoundry.com]:Memory reservation (128M, 256M, 512M, 1G, 2G) [512M]: 19
    29. 29. Déployer une applicationWould you like to deploy from the current directory? [Yn]: YApplication Name: ss-showcaseDetected a Java SpringSource Spring Application, is thiscorrect? [Yn]: YApplication Deployed URL [ss-showcase.cloudfoundry.com]:Memory reservation (128M, 256M, 512M, 1G, 2G) [512M]:How many instances? [1]: 19
    30. 30. Déployer une applicationWould you like to deploy from the current directory? [Yn]: YApplication Name: ss-showcaseDetected a Java SpringSource Spring Application, is thiscorrect? [Yn]: YApplication Deployed URL [ss-showcase.cloudfoundry.com]:Memory reservation (128M, 256M, 512M, 1G, 2G) [512M]:How many instances? [1]:Bind existing services to ss-showcase? [yN]: N 19
    31. 31. Déployer une applicationWould you like to deploy from the current directory? [Yn]: YApplication Name: ss-showcaseDetected a Java SpringSource Spring Application, is thiscorrect? [Yn]: YApplication Deployed URL [ss-showcase.cloudfoundry.com]:Memory reservation (128M, 256M, 512M, 1G, 2G) [512M]:How many instances? [1]:Bind existing services to ss-showcase? [yN]: NCreate services to bind to ss-showcase? [yN]: Y1: blob2: mongodb3: mysql4: postgresql5: rabbitmq6: redis 19
    32. 32. Déployer une applicationWould you like to deploy from the current directory? [Yn]: YApplication Name: ss-showcaseDetected a Java SpringSource Spring Application, is thiscorrect? [Yn]: YApplication Deployed URL [ss-showcase.cloudfoundry.com]:Memory reservation (128M, 256M, 512M, 1G, 2G) [512M]:How many instances? [1]:Bind existing services to ss-showcase? [yN]: NCreate services to bind to ss-showcase? [yN]: Y1: blob2: mongodb3: mysql4: postgresql5: rabbitmq6: redisWhat kind of service?: 4 19
    33. 33. Déployer une applicationWould you like to deploy from the current directory? [Yn]: YApplication Name: ss-showcaseDetected a Java SpringSource Spring Application, is thiscorrect? [Yn]: YApplication Deployed URL [ss-showcase.cloudfoundry.com]:Memory reservation (128M, 256M, 512M, 1G, 2G) [512M]:How many instances? [1]:Bind existing services to ss-showcase? [yN]: NCreate services to bind to ss-showcase? [yN]: Y1: blob2: mongodb3: mysql4: postgresql5: rabbitmq6: redisWhat kind of service?: 4Specify the name of the service [postgresql-de404]: my-pg-db 19
    34. 34. Déployer une application 20
    35. 35. Déployer une applicationCreate another? [yN]: N 20
    36. 36. Déployer une applicationCreate another? [yN]: NWould you like to save this configuration? [yN]: N 20
    37. 37. Déployer une applicationCreate another? [yN]: NWould you like to save this configuration? [yN]: NCreating Application: OKCreating Service [my-pg-db]: OKBinding Service [my-pg-db]: OKUploading Application: Checking for available resources: OK Processing resources: OK Packing application: OK Uploading (7K): OKPush Status: OKStaging Application ss-showcase: OKStarting Application ss-showcase: OK 20
    38. 38. STS 21
    39. 39. STS 22
    40. 40. STS Check Add 23
    41. 41. STS Drag & Drop 24
    42. 42. Maintenant, à vous ! 25
    43. 43. Exercice 1 26
    44. 44. Exercice 2 27
    45. 45. Contrôler le Cloud 28
    46. 46. Rappel des concepts• CloudFoundry, c’est des applications et des services• On associe les deux via des bindings• CloudController = REST API• nombre d’instances, urls, mémoire, logs, stats, etc... 29
    47. 47. Exercice 3 30
    48. 48. Consommer des services 31
    49. 49. Un point commun entre tous les OS “ Environment Variables [...] unlike custom config files, or other config mechanisms such as Java System Properties, are a language- and OS- agnostic standard The Twelve Factor App, http://www.12factor.net 32
    50. 50. Exercice 4 33
    51. 51. Auto-reconfiguration 34
    52. 52. Mais mes applis ressemblent à ça...<bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource" destroy-method="close"> <property name="driverClassName" value="com.mysql.jdbc.Driver" /> <property name="url" value="jdbc:mysql://localhost:3306/mydb" /> <property name="username" value="myuser" /> <property name="password" value="s3cr3t" /></bean><bean id="entityManagerFactory" class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean"> <property name="dataSource" ref="dataSource" /> <property name="persistenceUnitName" value="myPersistenceUnit" /> <property name="jpaVendorAdapter"> <bean class="org.springframework.orm.jpa.vendor.HibernateJpaVendorAdapter"> <property name="databasePlatform" value="org.hibernate.dialect.MySQLDialect" /> </bean> </property></bean> 35
    53. 53. Exercice 5 36
    54. 54. Bon ben voilà, merci d’être venus... 37
    55. 55. Deux datasources sont dans un bateau 38
    56. 56. Exercice 6 39
    57. 57. Configuration explicite 40
    58. 58. Namespace <cloud: /><cloud:data-source id="myDataSourceBean" service-name="boundServiceName" /><cloud:mongo-db-factory id="mongoDbFactory" write-concern="FSYNC_SAFE"> <cloud:mongo-options connections-per-host="10" max-wait-time="2000" /></cloud:mongo-db-factory><!-- et bientôt : <cloud:françois />--> 41
    59. 59. Les profils <?xml version="1.0" encoding="UTF-8"?><beans xmlns="http://www.springframework.org/schema/beans"...> <bean id="mongoTemplate" class="org.springframework.data.mongodb.core.MongoTemplate"> <constructor-arg ref="mongoDbFactory" /> </bean> <beans profile="default"> <mongo:db-factory id="mongoDbFactory" dbname="test" host="127.0.0.1" port="27017" username="foo" password="bar" /> </beans> <beans profile="cloud"> <cloud:mongo-db-factory id="mongoDbFactory" service-name="myBoundServiceName" /> </beans></beans> 42
    60. 60. Exercice 7 43
    61. 61. Et si mon appli n’utilise pas Spring ? org.cloudfoundry.runtime.env.CloudEnvironment RdbmsServiceInfo serviceInfo = cloudEnvironment.getServiceInfo( “postgres-reporting”, RdbmsServiceInfo.class ); serviceInfo.getDatabase(); serviceInfo.getHost(); serviceInfo.getPort(); serviceInfo.getUserName(); serviceInfo.getPassword(); 44
    62. 62. Conclusion 45
    63. 63. Conclusion• CloudFoundry = le PaaS ouvert de VMware – langages – frameworks – services – cloud provider 45
    64. 64. Conclusion• CloudFoundry = le PaaS ouvert de VMware – langages – frameworks – services – cloud provider• Extensible – open source (ASL v2) 45
    65. 65. Conclusion• CloudFoundry = le PaaS ouvert de VMware – langages – frameworks – services – cloud provider• Extensible – open source (ASL v2)• Simple – push, bind, instances++ 45

    ×