Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Ops at Emcien

Ops at Emcien

Lessons learned in 18 months doing DevOps at a small software shop. Presented at the January 2014 meeting of the DevOpsATL meetup group.

Avatar for Eric Richardson

Eric Richardson

January 16, 2014
Tweet

More Decks by Eric Richardson

Other Decks in Technology

Transcript

  1. About Me Grew up on a Commodore 64 1998: Learned

    Perl to write a web forum application Founded a neighborhood news site for Downtown L.A. that grew into a weekly print paper While working at Southern California Public Radio, learned Node.js to write a new audio server for the station’s live streams Moved to Atlanta and joined Emcien in June of 2012
  2. About Emcien We create software for automated pattern discovery, helping

    businesses find value in their data Founded in 2002 ~20 people; six in Engineering Four main products, mostly Ruby on Rails around an engine written in C
  3. What We Had Two dozen or so EC2 instances, all

    built up by hand or by homegrown attempts at automation No consistent method for managing services No centralized reporting for server and app health All Rails environment and deployment configuration stored inside the app repositories Environments that all assumed they controlled the entire server
  4. What We Wanted Bulletproof deployments Better monitoring and visibility into

    operations Elastic architecture to scale up and down with load … and make it all cheaper
  5. What Didn’t We Have? Dedicated sysadmins DBAs Any ability to

    slow down development and devote resources to infrastructure
  6. How Do You Start? Dream big: Think about the system

    you really want Start small: Identify pain points and prioritize Look at the business case Find tools that fit with your existing technology stack Don’t be afraid to write your own glue Just get started
  7. Focus on Pain Points No repeatable way to build new

    environments No way for non-developers to deploy Deployments were an adventure Did we restart Delayed Jobs? Did we install Phantom JS?
  8. Baby Steps: Chef Start to experiment with Chef Build a

    base AMI off of Ubuntu 12.04, with versions of Ruby and nginx/Passenger built and stashed Chef cookbooks to take that base AMI and set it up to run our apps Server gets a key, uses it to look up a databag item that says what environments should be built out
  9. Baby Steps: “hubot deploy” Hubot script to check out repository

    and run Capistrano deployment commands Hardcoded apps and environments Fully built repo / bundle required for deploy
  10. Progress! Chef cookbooks and our pre-built AMI make sure that

    our servers get built out the same every time Non-developers could now deploy to dev and testing environments via Hubot Deployments are more reliable
  11. What did we learn? Versions you bake onto an AMI

    go out of date quickly Forking your Chef cookbooks starts you down a path toward heartache Management loves reliable deployments
  12. What Now? Refer back to your wish list. What needs

    to be updated from your new experience? Assess your pain points. What are the little things you can clean up? Use the goodwill from the first phase to get buy-in for a little bit more this time around
  13. Pain Points: Configuration Configuration is two places: in Chef databags

    and in the app repository Adding a new environment means creating commits in the repo, which makes the log dirty UI for manipulating environments in a databag is no fun
  14. Pain Points: Server Roles Each server’s Chef run list had

    to explicitly include the apps that we wanted to run Initial AMI / recipes had multiple Ruby versions installed, but could only use one at a time Phusion Passenger limitation lifted with 4.0
  15. Pain Points: Visibility Asking “what code is deployed on server

    X?” was still a manual check, so no at-a-glance view of status When values are scattered, it’s easy to get out-of-sync Management and the services group wants a dashboard for what code is deployed in production
  16. Common Themes Need a system to manage configurations and state

    What environments should be deployed on each server? What code and configuration should be deployed on each environment? Need a common application config file format
  17. Selling the Business Case First pitched at a November 2012

    “Lunch and Learn”: One-stop-shop for metrics about how Emcien’s servers and applications are performing Making provisioning environments a simpler (and eventually self-service) task frees up engineering time Throw-away environments allow for better testing and better development cycles
  18. Use the Existing Foundation Configuration Management: Chef Use the parts

    you like (cookbooks and recipes), but replace the parts you don’t (data bags, lack of reporting in Open Source server) Deployment: Capistrano Build cap configs on-the-fly, leverage existing knowledge and deploy tasks
  19. One Step at a Time December, 2012: Got started on

    MCP as part of an effort to move off of Amazon’s RDS Needed a system to administer database backups Running our own database servers was going to save money, so I had a business benefit to use as a starting point
  20. One Step at a Time March, 2013: Built endpoints for

    distributing SSH public keys to servers March, 2013: Start to build out concepts of App and Environment July, 2013: First deployments via MCP
  21. Today: Emcien’s Dashboard MCP is in charge of: Environment configuration

    Deployment Database Backups Chef Cookbook Uploads Chef Run Logging CI Server
  22. Iterate Chef Cookbooks Query app / environment information from MCP,

    not databag Report back as environments are built Keep track of what environments we see
  23. Take Advantage of DevOps Tools and apps need to meet

    in the middle MCP: Build a tool around our existing apps MasterConfig: Alter the apps to make life easier for operations
  24. One Config File == Agile Load environment, database and New

    Relic config from a single JSON file New environments no longer mean changes in the repository
  25. Visibility into Past Deploys Being able to see what revisions

    were deployed and when, as well as all deploy output, is a win
  26. Chat integration is still cool A passive window into operations

    is a great way to keep tabs on the big picture
  27. Big Picture Lessons Don’t try to boil the ocean. Identify

    your pain points and limit the scope of your solutions to what you can do successfully. Don’t be afraid to mix your tools. There’s nothing wrong with picking and choosing the parts you like. Find the right mix for your company and your team. Look at the business case. Find spots where DevOps can create value. Demonstrate little wins to get more buy-in for later projects. Find ways to get other groups excited about what you’re building.