london devops - orc

25
Orc Zero downtime deployments made easy Tomas Doran (t0m) @bobtfish <[email protected] > https://github.com/bo btfi

Upload: tomas-doran

Post on 08-May-2015

433 views

Category:

Documents


0 download

DESCRIPTION

Talk about Orc, our continuous deployment framework

TRANSCRIPT

Page 1: London devops - orc

OrcZero downtime deployments made easy

Tomas Doran (t0m)@bobtfish<[email protected]>https://github.com/bobtfish/

Page 2: London devops - orc

Problem space:

•Multiple heterogeneous applications

•Multiple servers per app

•Multiple environments

•Custom deployment solutions / semi-manual deployment

Page 3: London devops - orc

Observed problems:

•Support nightmare

•Failed / inconsistent deployments

•New applications extremely costly to deploy

Page 4: London devops - orc

Solution:

•Application infrastructure contract

•Defined interface for infrastructure to interact with your application:

•How to launch

•How to query health

•Any application which complies gets continuous deployment - free

Page 5: London devops - orc

Reliable

•Contract conformity checked by a common test suite

•CI builds to check deployability

Page 6: London devops - orc

Predictable

•Deployment is model driven

•Store desired state in ‘cmdb’

•Audit live servers, adjust reality to conform to desired state

•State machine - easy to test!

Page 7: London devops - orc

Safe•Each possible step in a deployment is

a state transition

•Sample live state after each transition - if model doesn’t match reality, stop!

•Mcollective agent - flexible per-user + fact based permissions for free

Page 8: London devops - orc

Architecture

Page 9: London devops - orc

Participation?

•Need to be able to cleanly remove instances from load balancer

•Make load balancer health check do 2 things:

•Check app = healthy

•Check participation = true

•Tatin - tiny REST service to drop state into

Page 10: London devops - orc

Contract URIs

•App:

•http://localhost:xxxx/info/health

•http://localhost:xxxx/info/version

•Participation:

•http://localhost:yyyy/app_name/environment_name/instance_name

Page 11: London devops - orc

deployapp methods

•get status (health + version)

•enable participation

•disable participation

•upgrade version

Page 12: London devops - orc

State machine

Page 13: London devops - orc

Multiple instances

•Discover all instances

•Work out next transition for each instance

•Each transition has a weight

•Sort by weight - take highest weighted

•Repeat until no transitions left

Page 14: London devops - orc

Simple example

AppApp

DesireDesiredd

versioversionn

ActualActualversioversio

nn

DesireDesiredd

partpart

ActualActualpartpart ActionAction WeighWeigh

tt

host1 5 4 Y YDisable part

1

host2 5 4 Y YDisabl

epart

1

Page 15: London devops - orc

Simple example

AppApp

DesireDesiredd

versioversionn

ActualActualversioversio

nn

DesireDesiredd

partpart

ActualActualpartpart ActionAction WeighWeigh

tt

host1 5 4 Y NUpgra

de2

host2 5 4 Y YDisabl

epart

1

Page 16: London devops - orc

Simple example

AppApp

DesireDesiredd

versioversionn

ActualActualversioversio

nn

DesireDesiredd

partpart

ActualActualpartpart ActionAction WeighWeigh

tt

host1 5 5 Y NEnable

part3

host2 5 4 Y YDisabl

epart

1

Page 17: London devops - orc

Simple example

AppApp

DesireDesiredd

versioversionn

ActualActualversioversio

nn

DesireDesiredd

partpart

ActualActualpartpart ActionAction WeighWeigh

tt

host1 5 5 Y Y None 0

host2 5 4 Y YDisabl

epart

1

Page 18: London devops - orc

Simple example

AppApp

DesireDesiredd

versioversionn

ActualActualversioversio

nn

DesireDesiredd

partpart

ActualActualpartpart ActionAction WeighWeigh

tt

host1 5 5 Y Y None 0

host2 5 4 Y NDisabl

epart

1

Page 19: London devops - orc

Simple example

AppApp

DesireDesiredd

versioversionn

ActualActualversioversio

nn

DesireDesiredd

partpart

ActualActualpartpart ActionAction WeighWeigh

tt

host1 5 5 Y Y None 0

host2 5 4 Y NUpgra

de2

Page 20: London devops - orc

Simple example

AppApp

DesireDesiredd

versioversionn

ActualActualversioversio

nn

DesireDesiredd

partpart

ActualActualpartpart ActionAction WeighWeigh

tt

host1 5 5 Y Y None 0

host2 5 5 Y Y None 0

Page 21: London devops - orc

A/B groups

•Can run A/B groups of the same app with different versions

•Can upgrade non-participating group, test, then swap participation.

•Same model just works

Page 22: London devops - orc

Status

•Orc, deployapp + contract test harness open source

•Docs still very lacking.

•You need to plug in your own repository module (and your own launcher for non jar apps)

Page 23: London devops - orc

Todo

•Better deployment (public gem+debs)

•Deployapp configuration rewrite

•http artifact fetcher

•More app launchers - rack/wsgi/psgi apps!

•Docs - specifically load balancer configs + installation.

Page 24: London devops - orc

Code

•The ideas here are way more important than the code

•Development sponsored by TIM Group

•Yes, of course we are hiring :)

•https://github.com/youdevise/orc

Page 25: London devops - orc

Thanks!

https://github.com/youdevise/orc

Questions?