Velociraptor · eggmonster • Setuptools multi-installed packages • Managed by central config...

26
Velociraptor an open-source app deployment system by YouGov

Transcript of Velociraptor · eggmonster • Setuptools multi-installed packages • Managed by central config...

Page 1: Velociraptor · eggmonster • Setuptools multi-installed packages • Managed by central config server • YAML configs with inherited properties • Violated repeatability •

Velociraptoran open-source app deployment system by YouGov

Page 2: Velociraptor · eggmonster • Setuptools multi-installed packages • Managed by central config server • YAML configs with inherited properties • Violated repeatability •

YouGov

• Top 25 research company

• Based in London

• Global offices

• Gathers beliefs and behaviors from millions

• Data + expertise → What the World Thinks™

• Heavily invested in Python

Page 3: Velociraptor · eggmonster • Setuptools multi-installed packages • Managed by central config server • YAML configs with inherited properties • Violated repeatability •

motivation

• repeatable deployment

• developer driven

• language agnostic

• Python

• PaaS

Page 4: Velociraptor · eggmonster • Setuptools multi-installed packages • Managed by central config server • YAML configs with inherited properties • Violated repeatability •

eggmonster• Setuptools multi-installed packages

• Managed by central config server

• YAML configs with inherited properties

• Violated repeatability

• one app might update another’s packages

• No GUI

• Fixed ports and manual routing

Page 5: Velociraptor · eggmonster • Setuptools multi-installed packages • Managed by central config server • YAML configs with inherited properties • Violated repeatability •

Consideration

• Juju

• ActiveState Stackato

• Based on CloudFoundry and Docker

Page 6: Velociraptor · eggmonster • Setuptools multi-installed packages • Managed by central config server • YAML configs with inherited properties • Violated repeatability •

Inspiration

• Heroku!

• 12-Factor Methodology

• http://12factor.net

• Buildpacks

• Docker (lxc)

Page 7: Velociraptor · eggmonster • Setuptools multi-installed packages • Managed by central config server • YAML configs with inherited properties • Violated repeatability •

Implementation• Django

• GUI

• Postgres database models

• TastyPie API

• MongoDB

• Images

• Slugs

• Celery workers

• Supervisord to host processes (procs)

• Command-line Interface

Page 8: Velociraptor · eggmonster • Setuptools multi-installed packages • Managed by central config server • YAML configs with inherited properties • Violated repeatability •

Features

• Zero downtime deployment

• Pluggable Balancers

• Managed Config

• Repeatable Deployments

• Uptests!

Page 9: Velociraptor · eggmonster • Setuptools multi-installed packages • Managed by central config server • YAML configs with inherited properties • Violated repeatability •

Platform• Stacks / Images

• Buildpacks

• Apps

• Squads

• Ingredients (config)

• Builds

• Releases

• Swarms

Page 10: Velociraptor · eggmonster • Setuptools multi-installed packages • Managed by central config server • YAML configs with inherited properties • Violated repeatability •

Stacks

• Runtime environment

• Akin to Heroku stacks

• Linux images

• base

• provisioning script

• Images built through GUI

Page 11: Velociraptor · eggmonster • Setuptools multi-installed packages • Managed by central config server • YAML configs with inherited properties • Violated repeatability •

Buildpacks

• Inspired by Heroku

• Industry standard for building apps

• Simple protocol (detect, compile, release)

• Supports many languages and techniques

Page 12: Velociraptor · eggmonster • Setuptools multi-installed packages • Managed by central config server • YAML configs with inherited properties • Violated repeatability •

Apps

• Repository (Git or Mercurial)

• Relevant buildpack (autodetection)

• Relevant stack

Page 13: Velociraptor · eggmonster • Setuptools multi-installed packages • Managed by central config server • YAML configs with inherited properties • Violated repeatability •

Squads

• Pool of hosts

• Commodity

• Identically provisioned

• Colocated

Page 14: Velociraptor · eggmonster • Setuptools multi-installed packages • Managed by central config server • YAML configs with inherited properties • Violated repeatability •

Config Ingredients

• Re-usable Application Config

• YAML

Page 15: Velociraptor · eggmonster • Setuptools multi-installed packages • Managed by central config server • YAML configs with inherited properties • Violated repeatability •

Builds

• Buildpack output

• Freezes dependencies

• Slug without config

• Combine with config to create a Release (slug)

Page 16: Velociraptor · eggmonster • Setuptools multi-installed packages • Managed by central config server • YAML configs with inherited properties • Violated repeatability •

Swarms• Primary target for Velociraptor

• Logical combination of

• a Process

• within an App

• at a Tag (designates build)

• with Config (ingredients + direct)

• targeting a Squad

• routed in a Balancer

Page 17: Velociraptor · eggmonster • Setuptools multi-installed packages • Managed by central config server • YAML configs with inherited properties • Violated repeatability •

Balancers• Internet-facing hosts

• Route traffic to procs in Pools

• Supports:

• Nginx

• Varnish

• Stingray

• Pluggable, extensible

Page 18: Velociraptor · eggmonster • Setuptools multi-installed packages • Managed by central config server • YAML configs with inherited properties • Violated repeatability •

Uptests

• Sanity check

• Arbitrary executable

• Guard routing until proc validated

Page 19: Velociraptor · eggmonster • Setuptools multi-installed packages • Managed by central config server • YAML configs with inherited properties • Violated repeatability •

Demo

Page 20: Velociraptor · eggmonster • Setuptools multi-installed packages • Managed by central config server • YAML configs with inherited properties • Violated repeatability •

Getting Started

• walkthrough

• Vagrant + Virtualbox

• Mercurial

• test suite

• py.test

Page 21: Velociraptor · eggmonster • Setuptools multi-installed packages • Managed by central config server • YAML configs with inherited properties • Violated repeatability •

Production Deployment

• Create hosts with supervisord and proc_publisher.

• Create a virtualenv for bootstrapping (similar to development model).

• Configure and provision production databases.

• Use bootstrap instance to build/deploy a production instance of Velociraptor.

Page 22: Velociraptor · eggmonster • Setuptools multi-installed packages • Managed by central config server • YAML configs with inherited properties • Violated repeatability •

Alternatives• ActiveState Stackato (http://www.activestate.com/

stackato)

• Google Kubernetes (http://kubernetes.io)

• Ansible Tower (http://www.ansible.com/home)

• Gilliam (http://gilliam.github.io/)

• Tsuru (http://docs.tsuru.io/en/latest/)

• openroku (https://github.com/openruko)

Page 23: Velociraptor · eggmonster • Setuptools multi-installed packages • Managed by central config server • YAML configs with inherited properties • Violated repeatability •

Questions?

Page 24: Velociraptor · eggmonster • Setuptools multi-installed packages • Managed by central config server • YAML configs with inherited properties • Violated repeatability •

Why not Docker?

• Docker is opinionated about its process management role.

• Conflicts with use of supervisord.

• https://github.com/docker/docker/issues/503

Page 25: Velociraptor · eggmonster • Setuptools multi-installed packages • Managed by central config server • YAML configs with inherited properties • Violated repeatability •

Advanced Features

• Shell in application context.

• Volume mounts.

Page 26: Velociraptor · eggmonster • Setuptools multi-installed packages • Managed by central config server • YAML configs with inherited properties • Violated repeatability •

References

• Repository https://bitbucket.org/yougov/velociraptor