• Stars
    star
    144
  • Rank 255,590 (Top 6 %)
  • Language
    Python
  • License
    Other
  • Created about 10 years ago
  • Updated 10 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

fast deploy to lots of servers

The Rolling Pin

A tool for rolling changes out to servers.

To roll stuff out, select a group of hosts to affect:

  • a master list of hosts is collected by the "host source" which is pluggable.
  • aliased hostname glob expressions specify which hosts to pay attention to (-h)
  • the list may be truncated by starting after (--startat) or stopping before (--stopbefore) specified hosts

And what commands you'd like to run:

  • components to deploy get built on configurable build servers then deployed to individual hosts (-d)
  • restart services (-r)
  • arbitrary other commands may be specified as long as the remote end knows how to execute them (-c)

The rollout will then begin:

  • rollouts are executed by the "transport" which is pluggable and defaults to ssh.
  • hosts are "enqueued" one at a time with an optional delay between them (--sleeptime)
  • multiple hosts can be worked on in parallel (--parallel)
  • after a number of hosts have completed their work, the rollout can pause to allow sanity checking before continuing on (--pauseafter)

If configured, graphite will be sent a metric of the form events.deploy.{component} for each component deployed.

The rolling pin also features integration with Harold.

Setup

To install:

https://github.com/reddit/rollingpin.git
python setup.py install

Next, copy example.ini to /etc/rollingpin.ini or ~/.rollingpin.ini, modifying the hostsource to suit your environment.

For example, to set up an alias and deploy to 3 static hosts:

[hostsource]
provider = mock
hosts = host1 host2 host3

[aliases]
myhosts = host*

The hosts you are deploying to must have a local deploy script ready to be executed. You can use example-deploy.py as a starting point.

Once your deploy script is in place, update your configuration with its path:

[transport]
command = /usr/local/bin/deploy

When deploying, the deploy script will be called with the desired command on the command line.

For instance:

rollout -h myhosts -c foo

will call:

sudo /usr/local/bin/deploy foo

on the hosts matched by the myhosts alias.

Development

A Vagrantfile is included which sets up a testing environment that uses a mock hostsource and transport so that you can simulate deploys to non-existent hosts.

# launch the environment
host$ vagrant up
host$ vagrant ssh

# "deploy" to the full list of servers
rollingpin$ rollout test

# "deploy" to smaller subsets of servers
rollingpin$ rollout test -h common
rollingpin$ rollout test -h medium
rollingpin$ rollout test -h rare
rollingpin$ rollout test -h singular

# run the test suite
rollingpin$ cd rollingpin/
rollingpin$ python setup.py test

You can also run the test and lint suites in a Docker container:

docker build . -t rollingpin:test && docker run --rm rollingpin:test

More Repositories

1

IndicatorFastScroll

Android library providing a simple UI control for scrolling through RecyclerViews
Kotlin
698
star
2

baseplate.py

reddit's python service framework
Python
539
star
3

redditsans

Reddit Sans. The typeface of the internet.
Pug
405
star
4

rpan-studio

RPAN Studio
C
263
star
5

snudown

reddit's markdown renderer. based on sundown.
C
181
star
6

baseplate.go

Reddit's Service Framework in Go
Go
89
star
7

bugs

opinionated jira client for 80% of a devs jira usage
Shell
87
star
8

node-api-client

JavaScript
86
star
9

mcsauna

Track hottest memcached keys by regex in a graphite-friendly format.
Go
63
star
10

monitors

daemons to monitor reddit ops
Python
61
star
11

thebutton-data

press history for /r/thebutton
60
star
12

AlienBlue

Alien Blue iOS app - r/AlienBlue
Objective-C
59
star
13

devvit

Reddit for Developers
TypeScript
56
star
14

node-platform

A set of tools to enable easy universal rendering and page navigation on a React + Redux stack
JavaScript
47
star
15

node-horse

JavaScript
35
star
16

error-pages

the bummer mobile
HTML
33
star
17

node-build

build system for ES2015 projects
JavaScript
29
star
18

node-flags

🐾
JavaScript
25
star
19

CodableRPC

A Swift RPC client & server implementation using Codable.
Swift
22
star
20

node-horse-react

JavaScript
14
star
21

diamond-memcached-slab-collector

A Diamond collector for capturing memcached slab statistics.
Python
13
star
22

experiments.py

reddit's python experiments framework
Python
10
star
23

snooboots

Exploratory bootstrap customized for reddit
CSS
9
star
24

cabot-alert-slack

A simple Cabot alerting plugin for Slack.
Python
9
star
25

event-tracker

JavaScript
9
star
26

node-rest-cache

An LRU-based caching solution for rest-like data fetching.
JavaScript
9
star
27

devvit-kit

TypeScript
9
star
28

cqlmapper

A baseplate compatible fork of datastax' cqlengine library
Python
9
star
29

node-widgets

A collection of Reddit specific React components and the Redux actions and reducers to accompany them
JavaScript
8
star
30

devvit-sandbox

Devvit example apps and sketches not ready for production.
TypeScript
8
star
31

obs-browser-plugin

Browser plugin for OBS Studio
C++
8
star
32

node-middleware

Middleware for Redux
JavaScript
7
star
33

node-text-js

JavaScript
7
star
34

node-private

login / register / etc endpoints, only useful if you have access your own reddit instance
JavaScript
7
star
35

play

🛝 A little playground for building apps on Reddit.
TypeScript
6
star
36

monoceros

Go
6
star
37

jsapi-example-consumer

JavaScript
5
star
38

reddit-gtm-template

The official tag template for the Reddit conversion pixel for use with Google Tag Manager
Smarty
5
star
39

baseplate.py-upgrader

automates much of the work of upgrading to newer baseplate.py versions
Python
4
star
40

iOS-interview

Sandbox for the iOS Programming Interview
Swift
4
star
41

reddit-coredns-plugins

Some CoreDNS plugins that reddit made
Go
3
star
42

django-underpants

tiny helpers for integrating django with underpants
Python
3
star
43

reddit-client-lib

library of client side code to be shared between multiple projects
JavaScript
3
star
44

data-firehose-client

JavaScript
3
star
45

edgecontext

request.edge_context payload definitions
Go
2
star
46

checkpoints

2
star
47

baseplate-celery

Python
2
star
48

thrift-compiler

a thrift compiler in a docker container
Dockerfile
2
star
49

test

1
star
50

thrift-python

1
star
51

docker-bazelisk

Docker image for Bazelisk
Dockerfile
1
star
52

android-interview

Sandbox for Android Programming Interview
Kotlin
1
star
53

spinnakerpb

Protobufs and a Golang lib for representing Spinnaker pipelines
Go
1
star
54

.github

1
star