Ruby Toolbox for DevOps

Aa0358f6740f1bf02911e5300e08e800?s=47 Richard Lee
December 08, 2012

Ruby Toolbox for DevOps

Presented at RubyConf Taiwan 2012.

Aa0358f6740f1bf02911e5300e08e800?s=128

Richard Lee

December 08, 2012
Tweet

Transcript

  1. Ruby Toolbox for DevOps Richard Lee (@dlakty)

  2. self.intro do |richard|

  3. 6.years.ago

  4. 5.years.ago

  5. 2.years.ago

  6. 2.years.ago

  7. 1.year.ago

  8. end

  9. None
  10. Huh? A Recipe Sharing Website?

  11. Huh? A Recipe Sharing Website? Social Network

  12. Website Operation API Mobile Products

  13. Website Recipe Content Management Social Features Q&A for Cook

  14. Website Operation

  15. Operation Server Infrastructure Monitoring Analysis

  16. Website Operation Mobile Products

  17. Mobile Products iPhone / iPad Android Mobile Web! > 50%

    Traffic!
  18. Website Operation API Mobile Products

  19. API RESTFul JSON API Multi Device Authentication Push Notification

  20. Website Operation API Mobile Products

  21. DevOps

  22. What?

  23. Website Operation API Mobile Products Developer

  24. Website Operation API Mobile Products Operator

  25. Website Operation API Mobile Products DevOp

  26. DevOps Learning tools / techniques of Helps Your Startup

  27. Development Continuous Integration Server Provisioning Deployment Monitoring polydice.workflow do |w|

  28. Code Actually nothing special here. Current stack: Rails 3.2 Ruby

    1.9.3 RSpec Redis MySQL memcached
  29. Continuous Integration

  30. Continuous Testing Document generation Code quality testing Deploy and more!

  31. So, give me a Ruby CI Server!

  32. Travis CI is not currently a good fit for closed

    in-house installations
  33. Do you really know what a CI server usually do?

  34. Continuous Testing Document generation Code quality testing Deploy and more!

    Not black magic Write your rake tasks!
  35. CI Server Received push hooks Run some scripts Send notifications

    & Show reports
  36. Jenkins Everywhere

  37. Janky for Help! A Sinatra app as JSON bridge Built

    on Jenkins Controlled by Hubot Designed for / by GitHub
  38. None
  39. None
  40. Tips: Your every project needs a scripts folder

  41. scripts/ bootstrap cibuild

  42. Sever Provisioning

  43. chef + vargrant = awesome!

  44. Why this is important? I can do that manually!

  45. None
  46. Save your time for fixing up problems.

  47. Machines in Chef Client Node API client for provisioning and

    management. Your any controlled servers.
  48. Objects in Chef Cookbook Data bag Certain steps to install

    / configure resources on nodes Data storages for cookbook to configure resources. (Encrypted / Unencrypted)
  49. Our Cookbook For Capistrano

  50. Role The bridge between cookbooks & node. Define a run

    list for node. Some example: Web role’s run list :[“nginx”, “rails”] Database role’s run list :[“mysql”]
  51. Our Base Role

  52. Provisioning EC2

  53. Why ?

  54. Chef v.s. Puppet Basically the same thing / idea Puppet

    uses customized DSL for cookbook Chef just uses Ruby
  55. Vagrant VirtualBox VM from command line Integration with Chef /

    Puppet
  56. Vagrantfile Configure which roles to run. Then, > vagrant up

  57. Deployment

  58. We use No surprise, right?

  59. Lots of tweaks Git-based deployment Speed up Campfire notification

  60. Git-based deployment

  61. Campfire notification

  62. Lots of details. Ask me if you’re interested.

  63. Monitoring

  64. Unit test => Developer Monitoring => Operator

  65. god lograge

  66. god Process monitoring Restart process for certain conditions Really important

    for unicorn Integrated with Capistrano
  67. Super easy Configuration

  68. lograge Turn your multiline logs into one line Dec 08

    13:18:11 web1 rails: method=GET path=/recipes/14628 format=html controller=recipes action=show status=200.00 duration=296.24 view=177.28 db=96.89 redis=1.38 tire=0.00 ip=111.250.xxx.xxx referer=http://icook.tw/ recipes/fulltext_search?query=%E7%B3%96%E9%86%8B%E6%8E%92%E9%AA%A8 Good for grep & analysis
  69. lograge custom options Add as much things for monitoring as

    possible!
  70. Conclusion

  71. Ruby is expressive.

  72. Tons of DSLs for solving different problems.

  73. Make developers happy.

  74. Make operators happy.

  75. Make your customers happy. boss investors

  76. None
  77. Email: dlackty@gmail.com Twitter & GitHub & App.net: @dlackty Thank You!

    We’re hiring!
  78. Q & A?