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 full-size slide

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

    View full-size slide

  3. What is Docker ?
    #MesosCon  

    View full-size slide

  4. The Matrix From Hell
    #MesosCon  

    View full-size slide

  5. Another Matrix From Hell
    #MesosCon  

    View full-size slide

  6. Solution:
    the intermodal shipping container
    #MesosCon  

    View full-size slide

  7. Solved!
    #MesosCon  

    View full-size slide

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

    View full-size slide

  9. Solved!
    #MesosCon  

    View full-size 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 full-size 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 full-size slide

  12. Layers
    #MesosCon  

    View full-size slide

  13. Layers
    #MesosCon  

    View full-size slide

  14. Layers
    #MesosCon  

    View full-size slide

  15. Layers
    #MesosCon  

    View full-size slide

  16. Layers
    #MesosCon  

    View full-size slide

  17. What’s really docker ?
    #MesosCon  

    View full-size slide

  18. user@dockerhost:~$ docker run –it ubuntu bash
    root@1b55513ade2e:/# 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
    user@dockerhost:~$ docker run –d crosbymichael/redis
    699eb403b54b
    user@dockerhost:~$ docker inspect 699eb403b54b
    "IPAddress": "172.17.0.2",
    "Ports": {
    ”6379/tcp": [{
    "HostIp": "0.0.0.0",
    "HostPort": "49153"
    }]
    }
    Runtime for Linux containers
    #MesosCon  

    View full-size 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 full-size slide

  20. Docker integration in
    Mesos
    #MesosCon  

    View full-size 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 full-size slide

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

    View full-size slide

  23. Changes in the API 1/2
    #MesosCon  

    View full-size 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 full-size 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 full-size slide

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

    View full-size slide

  27. GoCover.io
    #MesosCon  

    View full-size slide

  28. VoltFramework
    #MesosCon  

    View full-size slide

  29. VoltFramework
    #MesosCon  

    View full-size slide

  30. VoltFramework
    #MesosCon  

    View full-size 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 full-size slide

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

    View full-size slide

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

    View full-size slide