Ce diaporama a bien été signalé.
Nous utilisons votre profil LinkedIn et vos données d’activité pour vous proposer des publicités personnalisées et pertinentes. Vous pouvez changer vos préférences de publicités à tout moment.

Enabling Microservices @Orbitz - DockerCon 2015

3 444 vues

Publié le

Slides from Orbitz's use case for microservices on docker & mesos at Velocity Santa Clara 2015 conference.

Details: http://sched.co/39S6

Publié dans : Technologie

Enabling Microservices @Orbitz - DockerCon 2015

  1. 1. Enabling Microservices @Orbitz Steve Hoffman @bacoboy Rick Fast @tortiepoint Senior Principal Engineers
  2. 2. Agenda • Brief Architecture Overview/History • From Monolithic to Services to Microservices with Docker • Automated Pipelines • Questions
  3. 3. #dockercon
  4. 4. #dockercon 2000
  5. 5. #dockercon 2000 Yes, we are STILL hiring!
  6. 6. #dockercon 2000 Yes, we are STILL hiring! @OrbitzTalent
  7. 7. #dockercon 2000 Web Layer Business Layer
  8. 8. #dockercon 2000
  9. 9. #dockercon 2000
  10. 10. #dockercon 2000 Business Layer
  11. 11. #dockercon 2000 Business Layer
  12. 12. #dockercon Business Layer 2000
  13. 13. #dockercon Business Layer 2003
  14. 14. #dockercon Business Layer 2003
  15. 15. #dockercon 2003 Business Layer
  16. 16. #dockercon 2003
  17. 17. #dockercon 2004
  18. 18. #dockercon 2004
  19. 19. #dockercon 2004
  20. 20. #dockercon 2012
  21. 21. #dockercon 2012
  22. 22. #dockercon 2012 • Multiple Brands • Websites • Webservices • Multiple Backends • 500+ apps / thousands of instances • Deployments Daily (sometimes more)
  23. 23. #dockercon • Multiple Brands • Websites • Webservices • Multiple Backends • 500+ apps / thousands of instances • Deployments Daily (sometimes more) 2015
  24. 24. #dockercon Process Overkill
  25. 25. #dockercon Different Provisioning Tools DEV OPS
  26. 26. #dockercon Different Provisioning Tools DEV OPS Application Platform!=
  27. 27. #dockercon A New Experiment • Microservices? • Decompose single “service” into the actual 40+ sub-services - Any change to sub-service was a deployment of many • Could it be a simple Spring Boot App in Docker (12 factor?) • Backward compatible with existing service infrastructure. • Code to Production w/o help from other Humans
  28. 28. #dockercon The Docker Slave aka “The Rickbot”
  29. 29. #dockercon The Docker Slave aka “The Rickbot” App App App
  30. 30. #dockercon App App App
  31. 31. #dockercon App App App
  32. 32. #dockercon App App App Register & Lookup
  33. 33. #dockercon 10.10.10.10 10.10.10.10:31002 App App App Register & Lookup
  34. 34. #dockercon App App App
  35. 35. #dockercon App App App
  36. 36. #dockercon
  37. 37. #dockercon
  38. 38. #dockercon
  39. 39. #dockercon
  40. 40. #dockercon
  41. 41. #dockercon http://consul.io
  42. 42. #dockercon App App App
  43. 43. #dockercon App App App
  44. 44. #dockercon 10.10.10.10 App App App
  45. 45. #dockercon 10.10.10.10 10.10.10.10:51515 App App App
  46. 46. #dockercon App App App
  47. 47. #dockercon App App App
  48. 48. #dockercon App App App
  49. 49. #dockercon 10.10.10.10 App App App
  50. 50. #dockercon 10.10.10.10 10.10.10.10:1337 App App App
  51. 51. #dockercon Almost done… App App App
  52. 52. #dockercon App App App
  53. 53. #dockercon App App App
  54. 54. #dockercon App App App
  55. 55. #dockercon App App App VIP
  56. 56. #dockercon App App App VIP
  57. 57. #dockercon App App App VIP
  58. 58. #dockercon App App App VIP https://github.com/QubitProducts/bamboo
  59. 59. #dockercon App App App
  60. 60. #dockercon App App App
  61. 61. #dockercon App App App
  62. 62. #dockercon App App App
  63. 63. A Little More Background
  64. 64. #dockercon
  65. 65. #dockercon Module Module Module Module
  66. 66. #dockercon Editorial Module • A Continuously Deployed Microservice • www.orbitz.com - (scroll down)
  67. 67. #dockercon Orbitz Content Orchestration Service Content (Solr) Editorial Module Search Module Hotel Module
  68. 68. #dockercon Orbitz Content Orchestration Service Content (Solr) Editorial Module Search Module Hotel Module Hotel Team Search Team Content Team
  69. 69. #dockercon Orbitz Content Orchestration Service Content (Solr) Editorial Module Search Module Hotel Module
  70. 70. #dockercon Orbitz Content Orchestration Service Content (Solr) Editorial Module Search Module Hotel Module Hotel Team Search Team Content Team
  71. 71. #dockercon Pre-Continuous Delivery 1.2-­‐BETA-­‐20150401-­‐113002 Test Discard Test Discard 1.2-­‐BETA-­‐20150402-­‐093002 Build Build And so on…
  72. 72. #dockercon Pre-Continuous Delivery 1.2-­‐BETA-­‐20150401-­‐113002 Test Discard Test Discard 1.2-­‐BETA-­‐20150402-­‐093002 Build Build Test Deploy 1.2 Build
  73. 73. Continuous Delivery with Jenkins, Docker, and Ansible (And then Marathon)
  74. 74. #dockercon Yo rfast-mbp:git rfast$ yo microservice _-----_ | | .--------------------------. |--(o)--| | Welcome to the kickass | `---------´ | Microservice | ( _´U`_ ) | generator! | /___A___ '--------------------------' | ~ | __'.___.'__ ´ ` |° ´ Y ` ? Enter the name of your service. (E.G. "my-service")
  75. 75. #dockercon Committer Pull Request
  76. 76. #dockercon Committer Reviewer Pull Request
  77. 77. #dockercon Committer Reviewer Pull Request
  78. 78. #dockercon Committer Reviewer Pull Request
  79. 79. Jenkins Pipeline
  80. 80. #dockercon if(…) { x ++; } Merge
  81. 81. #dockercon Pipeline (Simplified) build unit test publish deploy dev acceptance tests deploy qa deploy staging open RFC deploy prod close RFC
  82. 82. #dockercon Build if(…) { x ++; } 1.2 Merge
  83. 83. #dockercon Build if(…) { x ++; } 1.2 Merge 1.2. editorial-module.jar ./gradlew build {BUILD_NUMBER}
  84. 84. #dockercon Build 1.2 Merge editorial-module.jar if(…) { x ++; } 171.2.
  85. 85. #dockercon Build 1.2 Merge editorial-module.jar FROM orbitz/java-8 ADD build/editorial-module.jar /opt/orbitz CWD /opt/orbitz CMD java -jar editorial-module.jar if(…) { x ++; } 171.2.
  86. 86. #dockercon Build 1.2 Merge editorial-module.jar orbitz/editorial-module:1.2.17 if(…) { x ++; } 171.2.
  87. 87. #dockercon Build orbitz/editorial-module:1.2.17
  88. 88. #dockercon Deploy - hosts: dev - tasks: - name: find previous images docker_facts: image=orbitz/{{application}} register: previous - name: deploy new image docker: image=orbitz/{{application}}:{{version}} … - name: wait for service wait_for: port={{port}} … - name: check health endpoint uri: url="http://{{fqdn}}:{{port}}/health" … - name: kill old image docker: {{previous}} git pull playbook.yml (abridged)
  89. 89. #dockercon host-001 host-002 host-003 host-004 host-005 - hosts: dev
  90. 90. #dockercon Deploy host-001 1.2.16
  91. 91. #dockercon Deploy 1.2.16 1.2.17 host-001
  92. 92. #dockercon 1.2.16 1.2.17 host-001 Deploy DATABASE_URL=jdbc://whatever/db/stuff CONSUL_HOST={{ansible_fqdn}} LOGSTASH_HOST={{ansible_fqdn}} GRAPHITE_HOST={{ansible_fqdn}}
  93. 93. #dockercon Deploy 1.2.16 1.2.17 /health host-001
  94. 94. #dockercon Deploy 1.2.16 1.2.17 /health 200 OK host-001
  95. 95. #dockercon Deploy 1.2.16 1.2.17 host-001
  96. 96. #dockercon Deploy 1.2.17 host-001
  97. 97. #dockercon Deploy host-002 1.2.16 And so on… host-001 1.2.17
  98. 98. #dockercon What’s next?
  99. 99. #dockercon How to handle failure?
  100. 100. #dockercon What happens when a VM is moved?
  101. 101. #dockercon What if I need to add capacity?
  102. 102. #dockercon Deploy (Second Attempt) - hosts: dev - tasks: - name: find previous images docker_facts: image=orbitz/{{application}} register: previous - name: deploy new image docker: image=orbitz/{{application}}:{{version}} … - name: wait for service wait_for: port={{port}} … - name: check health endpoint uri: url="http://{{fqdn}}:{{port}}/health" … - name: kill old image docker: {{previous}} git pull playbook.yml (abridged)
  103. 103. #dockercon Deploy (Second Attempt) - hosts: dev - tasks: - name: find previous images docker_facts: image=orbitz/{{application}} register: previous - name: deploy new image docker: image=orbitz/{{application}}:{{version}} … - name: wait for service wait_for: port={{port}} … - name: check health endpoint uri: url="http://{{fqdn}}:{{port}}/health" … - name: kill old image git pull playbook.yml (abridged) - hosts: localhost - tasks: - name: marathon deploy marathon: image=orbitz/{{application}}:{{version}} instances=3
  104. 104. #dockercon Deploy (Second Attempt) git pull playbook.yml (abridged) - hosts: localhost - tasks: - name: marathon deploy marathon: image=orbitz/{{application}}:{{version}} instances=3
  105. 105. #dockercon Deploy (Second Attempt) New host setup
  106. 106. #dockercon Deploy (Second Attempt) Mesos Agent New host setup 1.2.16
  107. 107. #dockercon Deploy (Second Attempt) - tasks: marathon: … playbook.yml 1.2.16 1.2.16 1.2.16
  108. 108. #dockercon Deploy (Second Attempt) - tasks: marathon: … 1.2.16 1.2.16 1.2.16
  109. 109. #dockercon Deploy (Second Attempt) - tasks: marathon: … 1.2.16 1.2.16 1.2.16
  110. 110. #dockercon Deploy (Second Attempt) - tasks: marathon: … PUT /apps/editorial-module { “image”: “orbitz/editorial-module:1.2.17” … } 1.2.16 1.2.16 1.2.16
  111. 111. #dockercon Deploy (Second Attempt) PUT /apps/editorial-module { “image”: “orbitz/editorial-module:1.2.17” … } - tasks: marathon: … 1.2.16 1.2.16 1.2.16 app = GET /v2/apps/editorial-module if not app then deploy_id = POST /v2/apps { “image”: “orbitz/editorial-module:1.2.17”, “id”: “editorial-module” } else deploy_id = PUT /v2/apps/editorial-module { “image”: “orbitz/editorial-module:1.2.17” } end if while GET /v2/deployments contains deploy_id // still deploying end // deploy complete
  112. 112. #dockercon Deploy (Second Attempt) - tasks: marathon: … PUT /apps/editorial-module { “image”: “orbitz/editorial-module:1.2.17” … } 1.2.16 1.2.16 1.2.16
  113. 113. #dockercon Deploy (Second Attempt) - tasks: marathon: … 1.2.16 1.2.16 1.2.16
  114. 114. #dockercon Deploy (Second Attempt) - tasks: marathon: … 1.2.16 1.2.16 1.2.16 1.2.17 1.2.17 1.2.17
  115. 115. #dockercon Deploy (Second Attempt) - tasks: marathon: … /health 1.2.16 1.2.16 1.2.16 1.2.17 1.2.17 1.2.17
  116. 116. #dockercon Deploy (Second Attempt) - tasks: marathon: … /health 200 OK 200 OK 200 OK 1.2.16 1.2.16 1.2.16 1.2.17 1.2.17 1.2.17
  117. 117. #dockercon - tasks: marathon: … 1.2.17 1.2.17 1.2.17
  118. 118. #dockercon And off to the next environment… 1.2.17 1.2.17 1.2.17
  119. 119. #dockercon 1.2.17 1.2.17 1.2.17 What if?
  120. 120. #dockercon 1.2.17 1.2.17
  121. 121. #dockercon 1.2.17 1.2.17
  122. 122. #dockercon 1.2.17 1.2.17 1.2.17
  123. 123. #dockercon /health 200 OK 1.2.17 1.2.17 1.2.17
  124. 124. #dockercon 1.2.17 1.2.17 1.2.17
  125. 125. #dockercon Smoke/Acceptance Testing 1.2.17 1.2.17 1.2.17
  126. 126. #dockercon Paper Trail create tickets commit(s)
  127. 127. #dockercon Paper Trail fail! close/fail
  128. 128. #dockercon Paper Trail ok close
  129. 129. Build Unit Test Deploy Dev Deploy Prod Deploy Staging Acceptance Test Code Review & Push Production Pre-Production Open RFC Close RFC
  130. 130. #dockercon What’s inside the containers? • Spring Boot • Dropwizard Metrics (formerly Coda Hale, Yammer) • Consul Registration/Discovery • Logstash + Logback • Swagger • Hystrix • Retrofit + Consul OrbitzWorldwide/consul-client
  131. 131. #dockercon –You “Why didn’t you use {{.x}}?”
  132. 132. #dockercon Keeping an eye on… Kubernetes Amazon Elastic Container Service Docker Swarm
  133. 133. #dockercon Summary • Create a shared platform for docker deployments using shared and app-specific “localhost” helpers — this was ours, yours SHOULD look different — adapt to change, don’t fight it. • Take people out of the release process - Docker - repeatable applications - Chef - repeatable infrastructure — Environment aware - Jenkins - repeatable releases • Delineate configuration concerns: - Known at Compile time — Bake into Docker image - Known at Boot time — Bake into Playbook/Launcher - parameter to Docker run - Changes Anytime — Externalize (consul K/V, etcd, zookeeper)
  134. 134. Thanks! Steve Hoffman @bacoboy Rick Fast @tortiepoint

×