Upgrade to Pro — share decks privately, control downloads, hide ads and more …

DockerGrunn - Holy Ship

DockerGrunn - Holy Ship

My Presentation of januari 8th 2015

Avatar for Joshua Peper

Joshua Peper

January 08, 2015
Tweet

More Decks by Joshua Peper

Other Decks in Programming

Transcript

  1. Programma • Kickoff presentatie: Holy Ship 
 @joshuapeper (Peperzaken) •

    Orchestration: Basic tooling voor Docker
 @bok (the Factor.e) • Case study: CI + CD (Continuous Delivery)
 @nederdirk (Recras) • Borrel en Q&A
  2. Inhoud • Introductie Docker, Containers en (Matrix from hell) •

    Separation of Concerns • Whats the Diff? • Ecosystem • Eerste migraties bij Peperzaken
  3. Het probleem Static website Web frontend User DB Queue Analytics

    DB Background workers API endpoint nginx 1.5 + modsecurity + openssl + bootstrap 2 postgresql + pgv8 + v8 hadoop + hive + thrift + OpenJDK Ruby + Rails + sass + Unicorn Redis + redis-sentinel Python 3.0 + celery + pyredis + libcurl + ffmpeg + libopencv + nodejs + phantomjs Python 2.7 + Flask + pyredis + celery + psycopg + postgresql-client Development VM QA server Public Cloud Disaster recovery Contributor’s laptop Production Servers Multiplicity of Stacks Multiplicity of hardware environments Production Cluster Customer Data Center Do services and apps interact appropriately? Can I migrate smoothly and quickly?
  4. Matrix from hell Static website Web frontend Background workers User

    DB Analytics DB Queue Developme nt VM QA Server Single Prod Server Onsite Cluster Public Cloud Contributor ’s laptop Customer Servers ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?
  5. Vracht vervoer < 1960 Multiplicity of Goods Multipilicity of methods

    for transporting/ storing Do I worry about how goods interact (e.g. coffee beans next to spices) Can I transport quickly and smoothly (e.g. from boat to train to truck)
  6. Matrix from hell ? ? ? ? ? ? ?

    ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?
  7. Oplossing: Intermodal Shipping Containers Multiplicity of Goods Multiplicity of methods

    for transporting/storing Do I worry about how goods interact (e.g. coffee beans next to spices) Can I transport quickly and smoothly (e.g. from boat to train to truck) … ondertussen, kan ingeladen, uitgeladen, gestapeld, getransporteerd worden over lange afstanden, op elke denkbare manier Standaard container, past alles in, blijft gesloten en onaangetast tijdens transport…
  8. Docker: shipping containers voor code Static website Web frontend User

    DB Queue Analytics DB Development VM QA server Public Cloud Contributor’s laptop Multiplicity of Stacks Multiplicity of hardware environments Production Cluster Customer Data Center Do services and apps interact appropriately? Can I migrate smoothly and quickly … die gemanipuleerd kan worden op een standaard manier, ongeacht de inhoud en op bijna elk hardware platform kan draaien Een engine die het mogelijk maakt om elke inhoud te hebben, lichtgewicht verpakt, portable en zelfvoorzienend…
  9. Nieuwe matrix Static website Web frontend Background workers User DB

    Analytics DB Queue Developme nt VM QA Server Single Prod Server Onsite Cluster Public Cloud Contributor ’s laptop Customer Servers
  10. Developers • Build once…. (finally) run anywhere* • In de

    container is het ALTIJD dezelfde situatie • De container heeft nooit gezeik met andere services • Check je code/image in en klaar voor rollout • Instant replay van production setup (debug)
  11. Systems • Configure once… run anything • Maakt services lifecycle

    efficiënter en consistent • Kwaliteit van code gaat omhoog • Geen verschillen tussen dev / test /prod omgeving • Veel minder overhead dan VM’s/Hypervisors
  12. Separation of concerns • PJ de Developer • Maakt zich

    druk over wat er “in” de container gebeurd • Zijn code • Zijn Libraries • Zijn Package Manager • Zijn Apps • Zijn Data • Alle linux servers zijn gelijk aan elkaar • Swagman de Systems Guy • Maakt zich druk over de “buitenkant” van de container • Logging • Remote access • Monitoring • Network config • Alle containers starten, stoppen, kopiëren, attac migrate, etc. op dezelfde manier
  13. Containers VS VM’s App A Hypervisor (Type 2) Host OS

    Server Guest OS Bins/ Libs App A’ Guest OS Bins/ Libs App B Guest OS Bins/ Libs App A Docker Host OS Server App A Bins/Libs App B App B App B App B VM Container Containers zijn geïsoleerd, maar delen OS en, waar mogelijk, bins/libs Guest OS Guest OS …resultaat is significant snellere ontwikkeling, minder overhead, makkelijkere migratie en snellere restarts Bins/Libs
  14. Waarom zijn containers zo klein Bins/ Libs App A Orginele

    App
 (Geen OS wat ruimte
 of resources inneemt) App Δ Bins/ App A Bins/ Libs App A’ Guest OS Bins/ Libs Aangepaste App Kopie bij schrijven mogelijkheden staan toe om alleen de verschillen tussen containers te bewaren. VMs Elke app, elke kopie van een app
 en elke kleine modificatie vereist
 een nieuwe virtuele server.
 App A Guest OS Bins/ Libs Kopie van App Geen OS. Kan 
 bins/libs delen App A Guest OS Guest OS VMs Containers
  15. Basic setup Source Code Repository Dockerfile For A Docker Engine

    Docker Container Image Registry Build Docker Host 2 OS (Linux) Container A Container B Container C Container A Push Search Pull Run Host 1 OS (Linux)
  16. Update cycle Docker Engine Docker Container Image Registry Docker Engine

    Push Update Bins/ Libs App A App Δ Bins/ Base Container Image Host is now running A’’ Container Mod A’’ App Δ Bins/ Bins/ Libs App A Bins/ Bins/ Libs App A’’ Host running A wants to upgrade to A’. Requests update. Gets only diffs Container Mod A’
  17. Migrated Tool Klant Tijd JIRA Intern 1 week Gitlab Intern

    2 uur GoalZero WeCare backend NAM 1 dag Askbot Opensource 1 dag Apollo massive push VNV, Regionale omroepen 1 dag QuakeDetector RTV Noord 2 uur Generic PhpMyAdmin Intern 1 uur
  18. Lessons learned • Containers bewaren state niet (data loss) •

    Data containers niet handig te verplaatsen • Orchestration tools in de kinderschoenen • Backup van data was uitdaging • Denk in microservices, maakt het makkelijker…