Documente Academic
Documente Profesional
Documente Cultură
Simon Lallemand
System Engineer
@slallema
Agenda
New infrastructure
ecosystem 100% rkt powered carpooling
Facts and figures
40 million
members 21 million mobile
app downloaded
12 million travelers
per quarter
(iPhone + Android)
CO2
Currently in
22 countries
France, Spain, UK, Italy, Poland,
Hungary, Croatia, Serbia, Romania,
Founded 1 million Germany, Belgium, India, Mexico,
tonnes less CO2 in the The Netherlands, Luxembourg,
in 2006 past year Portugal, Ukraine, Czech Republic,
Slovakia, Russia, Brazil and Turkey.
Our server growth
Baremetal Baremetal
Web Dedicated Baremetal Baremetal Baremetal Baremetal 14 racks 17 racks
hosting servers 1 rack 3 racks 5 racks 8 racks 150 servers 300 servers
2 DC 3 DC
Hardware
Virtu Chef Foreman Containers
uniformization
2015
2012 2013 2014 2015
2016
Key principles
Leading the industrialization at BlaBlaCar
Metal is invisible
Decouple hardware management and
what runs on it
Route everything
Keep the network simple and scalable
Remove snowflakes
Be service oriented
New Infrastructure Ecosystem
100% rkt powered carpooling
Containers
For everything !
CoreOS Container Linux
On 100% of our new servers
rkt
as container runtime
New Infrastructure Ecosystem
The tools
Harmonize the way we build
Quick build
One way of doing things
Easy to understand for newcomers
As little code replication as possible
aci-manifest.yml
attributes
redis.yml
A standardized structure
runlevels Ease maintenance and teamwork
build
install.sh Inspired by config management
templates Separation of templates, attributes and scripts.
etc
redis
redis.conf.tmpl
dgr : ACI manifest
name: redis:0.1
aci:
app:
exec:
- /usr/bin/redis-server
- /etc/redis/redis.conf Use of dependencies
Composition
dependencies: Lighter images
- debian:8.6
dgr : runlevel build
aci-manifest.yml
attributes
redis.yml
runlevels Scripts executed in the container
build Build from inside the container with all the
install.sh dependencies
templates
etc
redis
redis.conf.tmpl
tests
dgr : runlevel build
name: example.com/aci-redis-dicator:1
builder:
dependencies:
- example.org/aci-go Build from outside of the container
- example.org/aci-git Dedicated builder image with go & git
aci:
app:
exec:
- /bin/dictator
dgr : runlevel builder
#!/dgr/bin/busybox sh
Builder script
git clone \ Clone, build and copy binary to
https://github.com/blablacar/redis-dictator target ACI
cd redis-dictator Only /bin/dictator in final ACI
go build
cp dist/dictator ${ROOTFS}/bin
dgr : runlevel builder
name: example.org/gentoo-redis:1
builder:
dependencies:
- example.org/gentoo-stage4 Other example
Builder with gentoos stage4
aci:
dependencies:
- example.org/base
app:
exec: [ /usr/bin/redis-server ]
dgr : runlevel builder
aci-manifest.yml
attributes
redis.yml
runlevels Render configuration files
Templates stored in the aci
build Default attributes stored in the aci
install.sh Overridable when used as dependencies
templates Overridable by environment var
etc
redis
redis.conf.tmpl
dgr : templates & attributes
# templates/etc/redis.conf.tmpl
daemonize no
port {{ .redis.port }}
# attributes/redis.yml
default:
redis:
port: 6379
dgr : runlevel prestart
aci-manifest.yml
attributes
redis.yml
runlevels Initialize container
prestart-late prestart-early and prestart-late scripts
Before and after templating
10-init-db.sh Initialize environment before exec
templates
etc
redis
redis.conf.tmpl
dgr : testing
aci-manifest.yml
attributes Testing
runlevels Bats as default tester
templates
tests wait.sh
wait.sh Wait for service to be ready
my_cool_tests.bats
dgr : testing
#!/dgr/bin/bats -x
~ # dgr init
~ # dgr try
~ # dgr build
~ # dgr test
~ # dgr install
~ # dgr push
github.com/blablacar/dgr
INSERT
Pods Services and Environments
LOGO
HERE Different services that use the same pods
Environments (1 per DC for prod + dev)
Abstraction of fleet commands
ggn
Manage services
in fleet clusters
github.com/blablacar/ggn
ggn
...
ggn : service manifest
# attributes/redis.yml
override:
redis:
maxmemory: 4GB Override attributes
Inject run context attributes as environment var
TEMPLATER_OVERRIDE={redis:{max
memory: 4GB}}
ggn : unit.tmpl
[Unit]
Description=Redis POD {{.
[Service]
KillMode=mixed
Restart=always
ExecStart=/usr/bin/rkt run \
--set-env=TEMPLATER_OVERRIDE='{{.jsonAttrs}}'
{{.acis}}
ggn : run a POD
github.com/blablacar/ggn
Dynamic topology of services
go-synapse go-nerve
/database/node1
/database
go-synapse watches zookeeper
service keys and reloads haproxy
if changes are detected go-nerve does health checks and
reports to zookeeper in service
keys
HAProxy
node1
Applications hit their local
haproxy to access backends
Our infrastructure ecosystem
front_1
nerve nerve
php mysql-main_1
Service Discovery
create
nginx nerve zookeeper
Service Codebase synapse
synapse monitoring
Container Registry store
( Were hiring )
@slallema
@BlaBlaCarTech
Thanks!
@BlaBlaCarTech
BlaBlaTech.com