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

Running container at BlaBlaCar — While 42 (San-Francisco)

Running container at BlaBlaCar — While 42 (San-Francisco)

Meetup While42 in San-Francisco

Matthieu Moquet

April 06, 2016
Tweet

More Decks by Matthieu Moquet

Other Decks in Technology

Transcript

  1. Running containers at
    #While42 (San-Francisco)

    View Slide

  2. $100
    $25
    $25 $25 $25

    View Slide

  3. 25 million
    members in January 2016

    View Slide

  4. 22 countries

    View Slide

  5. 20M
    40M
    80M
    160M
    129M
    2014 2015 2016 2017
    Travelers
    transported
    2014

    View Slide

  6. metal servers
    services
    run. containers
    120
    150+
    2000+

    View Slide

  7. View Slide

  8. github.com/coreos/rkt

    View Slide

  9. $ (sudo) rkt run ./image.aci
    Archive of filesystem
    & instructions of
    what to run
    Foreground process
    Require root

    View Slide

  10. $ rkt run example.org/image.aci
    Fetch the image first
    and then run it

    View Slide

  11. How to build an ACI?

    View Slide

  12. App Container (appc)
    Open specification that defines several aspects
    of how to run applications in containers

    View Slide

  13. Pronounced « digg-er »
    github.com/blablacar/dgr

    View Slide

  14. ├── aci-manifest.yml
    ├── attributes
    │ └── redis.yml
    ├── runlevels
    │ └── build
    │ └── install.sh
    └── templates
    └── etc
    └── redis
    └── redis.conf.tmpl

    View Slide

  15. name: aci-redis
    aci:
    app:
    exec:
    - /usr/bin/redis-server
    - /etc/redis/redis.conf

    View Slide

  16. name: aci-redis
    aci:
    app:
    exec:
    - /usr/bin/redis-server
    - /etc/redis/redis.conf
    dependencies:
    - aci-debian
    Not included in
    redis image

    View Slide

  17. Runlevel: Build

    View Slide

  18. ├── aci-manifest.yml
    ├── attributes
    │ └── redis.yml
    ├── runlevels
    │ └── build
    │ └── install.sh
    └── templates
    └── etc
    └── redis
    └── redis.conf.tmpl

    View Slide

  19. #!/bin/bash
    apt install -y redis-server

    View Slide

  20. Runlevel: Prestart

    View Slide

  21. Dump configuration files
    Initialize database/user
    Enable/Disable modules
    Change mod/owner

    View Slide

  22. ├── aci-manifest.yml
    ├── attributes
    │ └── redis.yml
    ├── runlevels
    │ └── build
    │ └── install.sh
    └── templates
    └── etc
    └── redis
    └── redis.conf.tmpl

    View Slide

  23. # templates/etc/redis/redis.conf.tmpl
    daemonize no
    port {{ .redis.port }}
    ...
    # attributes/redis.yml
    default:
    redis:
    port: 6379
    Resolved at
    runtime

    View Slide

  24. POD
    Running several ACIs
    in the same context

    View Slide

  25. name: example.org/pod-myapp:1
    pod:
    apps:
    - dependencies:
    - example.org/aci-nginx:1.8.1
    app:
    exec: [/usr/sbin/nginx, -g, daemon off]
    - dependencies:
    - example.org/aci-php:5.6
    - example.org/aci-myapp:42
    app:
    exec: [/usr/sbin/php5-fpm, -F]

    View Slide

  26. $ rkt run \
    example.org/pod-myapp_aci-nginx:1 \
    example.org/pod-myapp_aci-php:1

    View Slide

  27. pod-myapp_aci-nginx
    pod-myapp_aci-php
    Linux kernel
    other process
    ...
    1.2.3.4
    172.16.8.8
    :80
    :9000

    View Slide

  28. Services discovery with
    smartstack
    synapse + nerve
    by Airbnb

    View Slide

  29. Zookeeper
    haproxy
    php
    healtcheck
    mysql
    client
    server

    View Slide

  30. Thank you!
    @BlaBlaCarTech
    @MattKetmo
    blablatech.com

    View Slide