Distributed Development Stack
Distributed Development Stack
Development Stack
Andrew Odewahn
A Field Guide to the Distributed Development Stack
by Andrew Odewahn
Copyright © 2014 Andrew Odewahn. All rights reserved.
Printed in the United States of America.
Published by O’Reilly Media, Inc., 1005 Gravenstein Highway North, Sebasto‐
pol, CA 95472.
O’Reilly books may be purchased for educational, business, or sales promo‐
tional use. Online editions are also available for most titles ( http://safaribook‐
sonline.com ). For more information, contact our corporate/institutional sales
department: 800-998-9938 or [email protected] .
While the publisher and the author(s) have used good faith efforts to ensure
that the information and instructions contained in this work are accurate, the
publisher and the author(s) disclaim all responsibility for errors or omissions,
including without limitation responsibility for damages resulting from the use
of or reliance on this work. Use of the information and instructions contained
in this work is at your own risk. If any code samples or other technology this
work contains or describes is subject to open source licenses or the intellec‐
tual property rights of others, it is your responsibility to ensure that your use
thereof complies with such licenses and/or rights.
978-1-491-91658-2
[LSI]
Table of Contents
Introduction 1
How to Contribute 3
iii
Tools 20
For More Information 21
Appendix: Contributors 37
Survey 39
iv | Table of Contents
Introduction
1
anyone who has watched DevOps for any length of time can
tell you, it’s a space bursting with interesting and exciting new
tools, so my list and guilt quickly got out of hand.
Once I reached the limits of the Sticky as a medium, I started to
look for patterns in my list. Some were obvious. For example,
many of the tools, like Ansible, Salt, or (to a certain extent)
Dockerfiles, fit into a clear infrastructure-automation group
pioneered by Chef, CFEngine, and Puppet. So, too, the many
cloud services.
But where would something like CoreOS, Docker, or Mesos fit?
As I thought about how to group them, they seemed somehow
tied up with the notion of containerization, but that just
seemed too narrow. Rather, these projects and tools were part
of a much larger trend — enabling clustering and distributed
computing—and containerization was just a piece. So, rather
than group by technology, it made sense to me to group by
trend—in other words, what did the tool enable, and why was
that trend important?
Simultaneously, other people at O’Reilly were also exploring
this same question, but from a different perspective. In "Every‐
thing is distributed,” Courtney Nash, the chair of Velocity, was
asking “how do we manage systems that are too large to under‐
stand, too complex to control, and that fail in unpredictable
ways.” In "Beyond the stack,” Mike Loukides was thinking
about how “a new toolset has grown up to support the develop‐
ment of massively distributed applications,” and described the
profound consequences that the shift from well-tended, inter‐
nal servers to disposable VMs was having on the traditional
“LAMP” stack. (As well as its hipster cousin, the MEAN stack.)
So, it’s from this context that my Sticky list grew into this Field
Guide to the Distributed Development Stack. The Guide is
organized into buckets based on a general observation, such as:
2 | Introduction
• The codebase is in git
• The entire application runs locally in development
• The environment is automated in the code
• The monitoring infrastructure is critical
• Tests done in code, not by a QA department
In addition to being a (hopefully) useful framework, the Guide
is also meant to be a living resource. So, we’ve put the source on
GitHub and invite you to contribute. If you feel like we’ve
missed a tool (which we most certainly have, since new things
are popping up every day) or a major theme, then fork the repo
and send me a pull request. We’ll be keeping this document up
to date and republishing it as we watch this trend continue to
grow. We’ll use O’Reilly Atlas to pull in the contributions and
periodically republish the guide.
This is still very much a work-in-progress, but I hope it will be
a resource you’ll add to your own Sticky collection.
How to Contribute
To contribute to the DDS field guide: Fork this repo Agree to
the O’Reilly Contributor License Agreement Add your tool /
contribution Submit a pull request
If your request is accepted, we’ll add you to the Contributors
page.
How to Contribute | 3
The Cloud Is the Default Platform
5
• Internal cloud and PaaS services.
These are tools and services you’re likely to encounter here:
Hosted PaaS
Hosted PaaS services add a layer on top of the raw offerings of
hosting providers:
Internal Services
These are tools that create virtual internal clouds (i.e., on prem‐
ise). While they’re technically running in your own internal
datacenter, they enable the concept of scalable, on-demand
resources:
Internal Services | 7
CI Servers Deploy Code, Not Ops
9
• Execute foo’s test suites (see the section on applica‐
tion stacks for more about this).
• If the tests fail, send an alert to the development
team and halt the process.
• If the test suite passes, deploy the code to a staging
or even production server.
Tools
Here are a few of the CI servers you might encounter:
Continuous Deployment | 11
The Codebase Is in Git
13
• There is an agreed-upon master repository, which is
often on a public service like GitHub or BitBucket,
or an internal server like GitLab or Mercurial.
• Each developer clones the master repository to his
or her local machine.
• The developer creates a new branch, usually for a
specific feature.
• The developer makes commits against the local copy.
• Once the feature is done, he or she merges the
branch back into the master branch and pushes the
change back to the master.
• Other developers pull from the master branch and
merge their branch.
• The merged copy preserves the full version history
of all the distributed copies.
In addition to these coordination functions, most version con‐
trol systems also offer a feature called a hook. A hook is a pro‐
cess that fires once a specific event, like a commit, happens to
the repository. Hooks can be defined in the repo itself, but also
in the hosting service. For example, GitHub lets you define
“service” hooks that are called whenever a specific event occurs.
These hooks are the tie-in to the continuous integration (CI
server).
Tools
Here are the key version control systems:
Tools | 15
The Entire Application Runs Locally
in Development
Tools
The following table summarizes tools you will encounter:
17
• VirtualBox. “VirtualBox is a powerful x86 and
AMD64/Intel64 Virtualization product for enter‐
prise as well as home use.” Free and open source!
This tool allows you to run a full image of another
operating system (called the “guest”) on your own
machine (called the “host”).
• VMware. One of the original virtualization solu‐
tions; Vagrant has a paid version that targets
VMware fusion.
• ngrok. ngrok allows you to share applications run‐
ning on your local machine to other users on the
Internet. IT works by setting up a tunnel to ngrok,
which then revers proxy to allow you to have a pub‐
lic URL. In the paid version (it’s a donation model
with a suggestion of $25, but you pan pay what you
want), you can have it proxy to a custom domain.
• Vagrant Cloud. A service from the creator of Vagrant
that allows you to share versioned Vagrant images.
A key idea (maybe the key idea) of DevOps is that the environ‐
ment in which your code will run should be modeled as code,
and not be some separate thing that is a black box. (And, as we
get a bit further down the stack, should be versioned with the
code as well.) It seems pretty basic, but the idea is that you
should have a “recipe” that allows you to recreate the environ‐
ment at any moment. Some of the key parts of managing the
environment include:
19
required versions of Ruby, Rails, bundler, and other
stack-specific dependencies. The same goes for any
other stack.
• Installation and configuration of the required backing
services. The 12 Factor App describes backing serv‐
ices as “any service the app consumes over the net‐
work as part of its normal operation. Examples
include datastores (such as MySQL or CouchDB),
messaging/queueing systems (such as RabbitMQ or
Beanstalkd), SMTP services for outbound email
(such as Postfix), and caching systems (such as
Memcached).” Backing services can also include
third-party services, like Amazon AWS (SQS, dyna‐
modb, etc.), GitHub, Twitter, and Parse. Ideally, the
“code for a twelve-factor app makes no distinction
between local and third party services.”
Tools
The following table lists some of the configuration and envi‐
ronment automation tools you might encounter:
23
other functions that are required to smoothly maintain a large
number of systems.
Tools
Here are some monitoring tools you might encounter:
Tools | 25
Tests Done in Code, Not by a QA
Department
Tools
The following table lists testing tools you’re likely to encounter:
27
Containerization for Production
Services
29
quite understand this yet but plan to dive in
soon.
— fleet. Fleet is a tool for managing processes on
a CoreOS cluster.
• Deis. Deis is a self-hosted PaaS platform based on
Docker and CoreOS. Basically, it allows you to create
your own Heroku-like service based on buildpacks
or “raw” Docker containers.
• Docker. Written in Go, Docker is an Open Source
project that provides a clean and simple way to cre‐
ate system images based on a known filesystem, layer
new elements onto those images, and then spin up
running instances of what you’ve done. For example,
you might start with a base images like “base/
ubuntu”, add a service like Redis, and then start the
image to have a running Redis instance. Docker
handles process management, networking, and other
services for you, allowing you to focus on adding
just the parts you need. There is also a company
called (conveniently enough) Docker that maintains
Docker, as well as providing a hosting service called
the Index, where you can publish and maintain your
images. Like GitHub, they have a “free for public/
paid for private” model.
• Flynn.io. Flynn, like Deis, provides a self-hosted
PaaS.
• geard is a tool for creating and managing Docker
containers in OpenShift, RedHast’s PaaS solution.
• kubernetes. Kubernetes is an open source version of
Google’s internal cluster management toolchain. You
can use Kubernetes to run your own Docker con‐
tainers on Google Compute Engine, Google’s cloud
platform.
33
In addition to human participants, team chats can include a
chatbot, which is a program that performs useful functions by
monitoring the chatroom for special commands. The chatbot,
which appears like anyone else in the room, can do routine
tasks such as kicking off a build, locking the production server,
reporting errors from the monitoring tools, or providing man‐
pages. And, programmers being programmers, the chatbot can
also do things that reflect the culture of the team, like showing
pictures of a pug, displaying a squirrel whenever you type “ship
it,” or providing responses in a Magic 8 Ball form when you ask
it questions. The chatbot usually reflects the culture of the team
Chat
These are some of the more popular chat services and resour‐
ces:
• Campfire
• HipChat
• Slack
• Google Chat
• The Emoji Cheatsheet is a fun resource that lists text
shortcuts that correspond to the emoji characters
used in many chat services. For example, using the
code “:boom:” creates a small explosion icon when
it’s rendered in chat.
Chatbots
These are resources for creating chatbots:
Chat | 35
• ChatOps at GitHub is a video explaining the
chatbot-based ops workflow at GitHub.
37
Survey
39