+ All Categories
Home > Documents > Large-Scale Deployments With Pogo At Yahoo!

Large-Scale Deployments With Pogo At Yahoo!

Date post: 25-Feb-2016
Category:
Upload: yasuo
View: 53 times
Download: 0 times
Share this document with a friend
Description:
Large-Scale Deployments With Pogo At Yahoo!. Mike Schilli YAPC::NA 06/14/2012. What’s Pogo?. Yahoo’s deployment system Highly scalable (thousands of targets) Highly parallelized rollouts In active use for several years Open Source version available (pre-alpha). Pogo in a CI environment. - PowerPoint PPT Presentation
Popular Tags:
74
Large-Scale Deployments With Pogo At Yahoo! Mike Schilli YAPC::NA 06/14/2012
Transcript
Page 1: Large-Scale Deployments With Pogo At Yahoo!

Large-Scale Deployments With Pogo At Yahoo!

Mike SchilliYAPC::NA 06/14/2012

Page 2: Large-Scale Deployments With Pogo At Yahoo!

What’s Pogo?

• Yahoo’s deployment system– Highly scalable (thousands of targets)– Highly parallelized rollouts– In active use for several years

• Open Source version available (pre-alpha)

Page 3: Large-Scale Deployments With Pogo At Yahoo!

Pogo in a CI environment

Page 4: Large-Scale Deployments With Pogo At Yahoo!

What’s “Deployment”?

• Run one command on many hosts• Each host “knows” what it’s supposed to look

like via a central database• One command brings host into “desired” state• Fetches package updates from edge-server

repos

Page 5: Large-Scale Deployments With Pogo At Yahoo!

Run one command on many hosts

• Act on all hosts immediately

Page 6: Large-Scale Deployments With Pogo At Yahoo!

Run one command on many hosts

• Act on all hosts immediately

Page 7: Large-Scale Deployments With Pogo At Yahoo!

Example Server Farm

Page 8: Large-Scale Deployments With Pogo At Yahoo!

Pogo Features

• Sequences• Parallelizes with constraints• Halts if errors violate constraints• Runs health checks (pre/post hooks)• Command agnostic (rpm, apt-get, custom,

etc.)

Page 9: Large-Scale Deployments With Pogo At Yahoo!

Server Farm Release via Pogo

Page 10: Large-Scale Deployments With Pogo At Yahoo!

Server Farm Release via Pogo

Page 11: Large-Scale Deployments With Pogo At Yahoo!

Server Farm Release via Pogo

Page 12: Large-Scale Deployments With Pogo At Yahoo!

Server Farm Release via Pogo

Page 13: Large-Scale Deployments With Pogo At Yahoo!

Server Farm Release via Pogo

Page 14: Large-Scale Deployments With Pogo At Yahoo!

Server Farm Release via Pogo

Page 15: Large-Scale Deployments With Pogo At Yahoo!

Server Farm Release via Pogo

Page 16: Large-Scale Deployments With Pogo At Yahoo!

Server Farm Release via Pogo

Page 17: Large-Scale Deployments With Pogo At Yahoo!

Server Farm Release via Pogo

Page 18: Large-Scale Deployments With Pogo At Yahoo!

Server Farm Release via Pogo

Page 19: Large-Scale Deployments With Pogo At Yahoo!

Server Farm Release via Pogo

Page 20: Large-Scale Deployments With Pogo At Yahoo!

Pogo Configuration

Page 21: Large-Scale Deployments With Pogo At Yahoo!

Run a Pogo job (tags)

Page 22: Large-Scale Deployments With Pogo At Yahoo!

Pogo UI – Single Job View

Page 23: Large-Scale Deployments With Pogo At Yahoo!

Pogo UI Overview

Page 24: Large-Scale Deployments With Pogo At Yahoo!

Pogo UI – Host View

Page 25: Large-Scale Deployments With Pogo At Yahoo!

Pogo UI – Start it Up

$ perl -Ilib bin/pogo-apipogo-api-28> Listening on 0.0.0.0:7657

$ perl -Ilib bin/pogo-ui -vpogo-ui-22> Listening on port 5000

Page 26: Large-Scale Deployments With Pogo At Yahoo!

Run a Pogo job (targets)

Page 27: Large-Scale Deployments With Pogo At Yahoo!

Pogo Configuration

Page 28: Large-Scale Deployments With Pogo At Yahoo!

State of Pogo

• Pre-alpha Open Source version on Github

• OSS Pogo will be completed in the coming months

Page 29: Large-Scale Deployments With Pogo At Yahoo!

Pogo on Github

• Developed in the open:– https://github.com/ytoolshed/pogo

• Internally used with plugins to adapt to specific data sources

Page 30: Large-Scale Deployments With Pogo At Yahoo!

CI Tests with travis-ci.org

Page 31: Large-Scale Deployments With Pogo At Yahoo!

The Gory Details

Page 32: Large-Scale Deployments With Pogo At Yahoo!

Pogo – User View

Page 33: Large-Scale Deployments With Pogo At Yahoo!

Pogo Workflow

Page 34: Large-Scale Deployments With Pogo At Yahoo!

Authentication/Authorization

• Web server authentication for submitting jobs• Target authentication via passwords or

priv/pub keys• Credentials encrypted with worker pubkey• Credentials never stored persistently (or

ZooKeeper)

Page 35: Large-Scale Deployments With Pogo At Yahoo!

Pogo “Hooks”

• Scripts that run before or after Pogo commands

• Used to prepare host, perform check health, or other functions

• Installed locally on target hosts• rc.d style invocation: run in alphanumeric

order

Page 36: Large-Scale Deployments With Pogo At Yahoo!

Pogo “Hooks” (cont.)

• Two types:– pre hook: run before the specified command– post hook: run after the specified command

• If any hook script fails:– No further scripts or commands run– Host is marked as failed

Page 37: Large-Scale Deployments With Pogo At Yahoo!

Pre-hook Examples

• Take a host out of rotation• Drain database connections• Check that host is ready to be updated

Page 38: Large-Scale Deployments With Pogo At Yahoo!

Post-hook Examples

• Check whether local webserver is serving expected content

• Ping required services• Put host back into rotation

Page 39: Large-Scale Deployments With Pogo At Yahoo!

Host Failures and Concurrency

• If a host fails:– Command returns non-zero– Pre- or post-hook returns non-zero

• The failed host counts against the acceptable number/percent of unavailable hosts

• Example:– Four hosts in an app can run at a time– One host in the app fails– Only three hosts will be acted on at a time going forward

Page 40: Large-Scale Deployments With Pogo At Yahoo!

Implementation

• AnyEvent Framework• Asynchronous, event-based• Added Object::Event for event pub/sub

Page 41: Large-Scale Deployments With Pogo At Yahoo!

HTTP Client in AnyEvent

Page 42: Large-Scale Deployments With Pogo At Yahoo!

HTTP Client in AnyEvent

Page 43: Large-Scale Deployments With Pogo At Yahoo!

HTTP Client in AnyEvent

Page 44: Large-Scale Deployments With Pogo At Yahoo!

AnyEvent and Object::Event

Page 45: Large-Scale Deployments With Pogo At Yahoo!

AnyEvent and Object::Event

Page 46: Large-Scale Deployments With Pogo At Yahoo!

AnyEvent and Object::Event

Page 47: Large-Scale Deployments With Pogo At Yahoo!

Queue Processor with AnyEvent and Object::Event

Page 48: Large-Scale Deployments With Pogo At Yahoo!

AnyEvent

bin/pogo-dispatcher

Page 49: Large-Scale Deployments With Pogo At Yahoo!

Testing AnyEvent Components

Page 50: Large-Scale Deployments With Pogo At Yahoo!

All Pogo Components

Page 51: Large-Scale Deployments With Pogo At Yahoo!

All-In-One Pogo: pogo-one

Page 52: Large-Scale Deployments With Pogo At Yahoo!

All-In-One Pogo: pogo-one

Page 53: Large-Scale Deployments With Pogo At Yahoo!

All-In-One Pogo: pogo-one

Page 54: Large-Scale Deployments With Pogo At Yahoo!

Questions?

Page 55: Large-Scale Deployments With Pogo At Yahoo!

Thanks!

• Pogo on Github: – http://github.com/ytoolshed/pogo

Page 56: Large-Scale Deployments With Pogo At Yahoo!

Lessons learned along the Way

Page 57: Large-Scale Deployments With Pogo At Yahoo!

Set up Unit Tests with Travis-ci.org

Page 58: Large-Scale Deployments With Pogo At Yahoo!

Runs immediately after Github checkins

Page 59: Large-Scale Deployments With Pogo At Yahoo!

CI Tests with travis-ci.org

Page 60: Large-Scale Deployments With Pogo At Yahoo!

Configure CI with travis-ci.org

Page 61: Large-Scale Deployments With Pogo At Yahoo!

Select Github project

Page 62: Large-Scale Deployments With Pogo At Yahoo!

Authorize travis-ci.org

Page 63: Large-Scale Deployments With Pogo At Yahoo!

Travis-ci.org API Calls

Page 64: Large-Scale Deployments With Pogo At Yahoo!

Filling in Passwords

Page 65: Large-Scale Deployments With Pogo At Yahoo!

Filling in Passwords

• Test logging into machines without sshkeys• Convenient for testing• Answer to sudo prompts on targets• Answer to prompts for encrypted packages

Page 66: Large-Scale Deployments With Pogo At Yahoo!

Filling in Passwords

• Good password prompt:

mschilli@localhost's password:

• Not password prompt!

… user ''@'localhost' (using password: NO)

Page 67: Large-Scale Deployments With Pogo At Yahoo!

PasswordMonkey on CPAN

Page 68: Large-Scale Deployments With Pogo At Yahoo!

Plack

Page 69: Large-Scale Deployments With Pogo At Yahoo!

Plack

Page 70: Large-Scale Deployments With Pogo At Yahoo!

Plack/PSGI

• Plack used for server-independent web application– API– Dispatcher Control Port

Page 71: Large-Scale Deployments With Pogo At Yahoo!

Alternatives

• Capistrano• Rundeck• Aegir• Drush

Page 72: Large-Scale Deployments With Pogo At Yahoo!

Pogo UI – Start it Up

$ perl -Ilib bin/pogo-apipogo-api-28> Listening on 0.0.0.0:7657

$ perl -Ilib bin/pogo-ui -vpogo-ui-22> Listening on port 5000

Page 73: Large-Scale Deployments With Pogo At Yahoo!

Pogo UI

• All Cient Side-Javascript• Server just redirects to index.html– Except assets/* js/*

Page 74: Large-Scale Deployments With Pogo At Yahoo!

Thanks!

• Pogo on Github: – http://github.com/ytoolshed/pogo

• PasswordMonkey CPAN Module:– http://search.cpan.org/dist/PasswordMonkey/

• Travis CI Service: – http://travis-ci.org


Recommended