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

Docker at eBay

Docker at eBay

How we use Docker to build and test eBay Now

teddziuba

July 31, 2013
Tweet

Other Decks in Technology

Transcript

  1. Docker at eBay
    Ted Dziuba
    Senior Member of Technical Staff
    eBay Now
    [email protected]
    Wednesday, July 31, 13

    View Slide

  2. Docker at eBay
    Virtualenv’s Broken Promises: Encapsulation
    2
    [email protected]:~$ pip install lxml
    This will fail spectactularly on a clean Ubuntu machine.
    Wednesday, July 31, 13

    View Slide

  3. Docker at eBay
    Virtualenv’s Broken Promises: Encapsulation
    3
    Get your OS-level dependencies first, of course.
    [email protected]:~$ sudo apt-get install python-dev libxml2-dev libxslt1-dev
    Works on My Machine Works on Our Machines Works in Production
    Wednesday, July 31, 13

    View Slide

  4. Docker at eBay
    Getting There with Vagrant
    4
    Works on My Machine Works on Our Machines Works in Production
    install_cmd = “apt-get update; apt-get install -y python-dev ”\
    “libxml2-dev libxslt1-dev; pip install -r requirements.txt;”
    config.vm.provision :shell, :inline => install_cmd
    Wednesday, July 31, 13

    View Slide

  5. Docker at eBay
    You Can’t Ship a Vagrantfile
    5
    Vagrant VM Production
    Application
    Database Redis
    Memcache RabbitMQ
    Load Balancer
    Database
    Load Balancer
    Database
    Database
    Redis
    Load Balancer
    Redis
    Application
    Load Balancer
    Application
    RabbitMQ
    Load Balancer
    RabbitMQ
    RabbitMQ
    Memcache
    Memcache
    Memcache
    Memcache
    Memcache
    Memcache
    Memcache
    Wednesday, July 31, 13

    View Slide

  6. Docker at eBay
    Production never gets less containerized.
    6
    Wednesday, July 31, 13

    View Slide

  7. Docker at eBay
    Containerizing Development in eBay Now
    7
    FROM teddziuba/python2.7
    ADD requirements.txt /tmp/requirements.txt
    RUN pip install -r /tmp/requirements.txt
    Application Dockerfile
    Containerized DB
    [email protected]:~$ docker run -d teddziuba/
    postgresql-development-9.2
    Django manage.py
    wrapper
    [email protected]:~$ docker run -t -i -p
    8000:8000 -e DATABASE_URL=’...’ -v /path/to/
    src:/app-dev ebaynow python /app-dev/
    manage.py runserver 0.0.0.0:8000
    Wednesday, July 31, 13

    View Slide

  8. Docker at eBay
    Containerize service dependencies and address them as
    environment variables.
    8
    Wednesday, July 31, 13

    View Slide

  9. Docker at eBay
    Development Containers Go Straight to CI
    9
    Thing Under Test
    Database Container
    Integration Test Case
    Container
    Application Container
    Jenkins Test Runner
    Wednesday, July 31, 13

    View Slide

  10. Docker at eBay
    Run database driven tests in parallel.
    10
    Wednesday, July 31, 13

    View Slide

  11. Docker at eBay
    Docker in Production at eBay (Coming Soon)
    11
    Thing Under Test
    Database Container
    Integration Test Case Container
    Thing Serving HTTP Traffic
    Production Database
    Load Balancer
    Application Container
    Database Container
    Emacs
    My Workstation Jenkins Production
    Wednesday, July 31, 13

    View Slide

  12. Docker at eBay 12
    Works on My Machine Works on Our Machines Works in Production
    Wednesday, July 31, 13

    View Slide

  13. Docker at eBay
    Questions?
    13
    Wednesday, July 31, 13

    View Slide