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

Run Any App on Mesos on Any Infrastructure Using Docker

Run Any App on Mesos on Any Infrastructure Using Docker

* Quick intro to Docker
* Docker integration in Mesos 0.20
* Use case example

Victor Vieux

August 21, 2014
Tweet

More Decks by Victor Vieux

Other Decks in Technology

Transcript

  1. #MesosCon 2014, Chicago
    Run Any App on Mesos on Any
    infrastructure Using Docker
    Victor Vieux, Docker Inc.
    @vieux
    #MesosCon  

    View Slide

  2. Outline
    •  Quick Introduction to Docker
    •  Docker integration in Mesos
    •  Use case example
    #MesosCon  

    View Slide

  3. What is Docker ?
    #MesosCon  

    View Slide

  4. The Matrix From Hell
    #MesosCon  

    View Slide

  5. Another Matrix From Hell
    #MesosCon  

    View Slide

  6. Solution:
    the intermodal shipping container
    #MesosCon  

    View Slide

  7. Solved!
    #MesosCon  

    View Slide

  8. Solution to the deployment problem:
    the Linux container
    #MesosCon  

    View Slide

  9. Solved!
    #MesosCon  

    View Slide

  10. High level approach:
    lightweight VM
    •  own process space
    •  own network interface
    •  can run stuff as root
    •  can have it’s own /sbin/init
    (different from the host)
    “Machine Container”
    #MesosCon  

    View Slide

  11. Low level approach:
    chroot on steroids
    •  can also not have it’s own /sbin/init
    •  container = isolated process(es)
    •  share kernel with the host
    “Application Container”
    #MesosCon  

    View Slide

  12. Layers
    #MesosCon  

    View Slide

  13. Layers
    #MesosCon  

    View Slide

  14. Layers
    #MesosCon  

    View Slide

  15. Layers
    #MesosCon  

    View Slide

  16. Layers
    #MesosCon  

    View Slide

  17. What’s really docker ?
    #MesosCon  

    View Slide

  18. [email protected]:~$ docker run –it ubuntu bash
    [email protected]:/# ps aux
    USER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMAND
    root 1 0.0 0.0 18048 1960 ? Ss 08:35 0:00 bash
    root 13 0.0 0.0 15276 1140 ? R+ 08:35 0:00 ps aux
    [email protected]:~$ docker run –d crosbymichael/redis
    699eb403b54b
    [email protected]:~$ docker inspect 699eb403b54b
    "IPAddress": "172.17.0.2",
    "Ports": {
    ”6379/tcp": [{
    "HostIp": "0.0.0.0",
    "HostPort": "49153"
    }]
    }
    Runtime for Linux containers
    #MesosCon  

    View Slide

  19. Standard format for containers and a
    place to share them
    •  Fetch an image from the public registry with
    “docker pull”
    •  Enter an image with “docker run“ and do some
    changes
    •  Record those changes with “docker commit”,
    repeat as many times as needed
    •  And then share the result with “docker push” on
    the public registry, or a private one
    #MesosCon  

    View Slide

  20. Docker integration in
    Mesos
    #MesosCon  

    View Slide

  21. Docker integration in Mesos timeline
    •  2011 : LXC
    •  2012 : cgroups
    •  2013 : Docker (preliminary)
    •  Early 2014 : External containerizer for Docker
    •  Last week : Docker as 1st class citizen
    #MesosCon  

    View Slide

  22. Requirements
    •  Mesos masters & slaves >= 0.20
    •  Docker >= 1.0.0 on each slave
    •  Add ‘docker’ to the -–containerizers
    slaves flag
    #MesosCon  

    View Slide

  23. Changes in the API 1/2
    #MesosCon  

    View Slide

  24. Changes in the API 2/2
    •  Command is now optional so you can
    use the docker image default one.
    •  Shell boolean added to wrap your
    command with sh –c “…” to handle
    symbols like | > &
    #MesosCon  

    View Slide

  25. Small Note
    Mesos do a docker pull before each run, to
    make sure you are running the last version.
    •  From the docker index
    – You need internet access
    •  Local images
    – You need to run a private registry to host them
    #MesosCon  

    View Slide

  26. Use case example:
    gocover.io + VoltFramework
    #MesosCon  

    View Slide

  27. GoCover.io
    #MesosCon  

    View Slide

  28. VoltFramework
    #MesosCon  

    View Slide

  29. VoltFramework
    #MesosCon  

    View Slide

  30. VoltFramework
    #MesosCon  

    View Slide

  31. •  Open-Source
    https://github.com/VoltFramework/volt
    •  Golang
    •  Static binary, easy installation
    wget
    chmod +x ./volt
    ./volt –-master=… --ip=…
    h*ps://github.com/VoltFramework/volt/releases/download/v1.0.0-­‐alpha/volt  
    VoltFramework
    #MesosCon  

    View Slide

  32. •  Adding Docker support was super easy
    VoltFramework
    #MesosCon  

    View Slide

  33. Thank you! Questions?
    http://docker.io
    http://docker.com
    @docker - @vieux
    #MesosCon  

    View Slide