Slide 1

Slide 1 text

Ruby Toolbox for DevOps Richard Lee (@dlakty)

Slide 2

Slide 2 text

self.intro do |richard|

Slide 3

Slide 3 text

6.years.ago

Slide 4

Slide 4 text

5.years.ago

Slide 5

Slide 5 text

2.years.ago

Slide 6

Slide 6 text

2.years.ago

Slide 7

Slide 7 text

1.year.ago

Slide 8

Slide 8 text

end

Slide 9

Slide 9 text

No content

Slide 10

Slide 10 text

Huh? A Recipe Sharing Website?

Slide 11

Slide 11 text

Huh? A Recipe Sharing Website? Social Network

Slide 12

Slide 12 text

Website Operation API Mobile Products

Slide 13

Slide 13 text

Website Recipe Content Management Social Features Q&A for Cook

Slide 14

Slide 14 text

Website Operation

Slide 15

Slide 15 text

Operation Server Infrastructure Monitoring Analysis

Slide 16

Slide 16 text

Website Operation Mobile Products

Slide 17

Slide 17 text

Mobile Products iPhone / iPad Android Mobile Web! > 50% Traffic!

Slide 18

Slide 18 text

Website Operation API Mobile Products

Slide 19

Slide 19 text

API RESTFul JSON API Multi Device Authentication Push Notification

Slide 20

Slide 20 text

Website Operation API Mobile Products

Slide 21

Slide 21 text

DevOps

Slide 22

Slide 22 text

What?

Slide 23

Slide 23 text

Website Operation API Mobile Products Developer

Slide 24

Slide 24 text

Website Operation API Mobile Products Operator

Slide 25

Slide 25 text

Website Operation API Mobile Products DevOp

Slide 26

Slide 26 text

DevOps Learning tools / techniques of Helps Your Startup

Slide 27

Slide 27 text

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

Slide 28

Slide 28 text

Code Actually nothing special here. Current stack: Rails 3.2 Ruby 1.9.3 RSpec Redis MySQL memcached

Slide 29

Slide 29 text

Continuous Integration

Slide 30

Slide 30 text

Continuous Testing Document generation Code quality testing Deploy and more!

Slide 31

Slide 31 text

So, give me a Ruby CI Server!

Slide 32

Slide 32 text

Travis CI is not currently a good fit for closed in-house installations

Slide 33

Slide 33 text

Do you really know what a CI server usually do?

Slide 34

Slide 34 text

Continuous Testing Document generation Code quality testing Deploy and more! Not black magic Write your rake tasks!

Slide 35

Slide 35 text

CI Server Received push hooks Run some scripts Send notifications & Show reports

Slide 36

Slide 36 text

Jenkins Everywhere

Slide 37

Slide 37 text

Janky for Help! A Sinatra app as JSON bridge Built on Jenkins Controlled by Hubot Designed for / by GitHub

Slide 38

Slide 38 text

No content

Slide 39

Slide 39 text

No content

Slide 40

Slide 40 text

Tips: Your every project needs a scripts folder

Slide 41

Slide 41 text

scripts/ bootstrap cibuild

Slide 42

Slide 42 text

Sever Provisioning

Slide 43

Slide 43 text

chef + vargrant = awesome!

Slide 44

Slide 44 text

Why this is important? I can do that manually!

Slide 45

Slide 45 text

No content

Slide 46

Slide 46 text

Save your time for fixing up problems.

Slide 47

Slide 47 text

Machines in Chef Client Node API client for provisioning and management. Your any controlled servers.

Slide 48

Slide 48 text

Objects in Chef Cookbook Data bag Certain steps to install / configure resources on nodes Data storages for cookbook to configure resources. (Encrypted / Unencrypted)

Slide 49

Slide 49 text

Our Cookbook For Capistrano

Slide 50

Slide 50 text

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”]

Slide 51

Slide 51 text

Our Base Role

Slide 52

Slide 52 text

Provisioning EC2

Slide 53

Slide 53 text

Why ?

Slide 54

Slide 54 text

Chef v.s. Puppet Basically the same thing / idea Puppet uses customized DSL for cookbook Chef just uses Ruby

Slide 55

Slide 55 text

Vagrant VirtualBox VM from command line Integration with Chef / Puppet

Slide 56

Slide 56 text

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

Slide 57

Slide 57 text

Deployment

Slide 58

Slide 58 text

We use No surprise, right?

Slide 59

Slide 59 text

Lots of tweaks Git-based deployment Speed up Campfire notification

Slide 60

Slide 60 text

Git-based deployment

Slide 61

Slide 61 text

Campfire notification

Slide 62

Slide 62 text

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

Slide 63

Slide 63 text

Monitoring

Slide 64

Slide 64 text

Unit test => Developer Monitoring => Operator

Slide 65

Slide 65 text

god lograge

Slide 66

Slide 66 text

god Process monitoring Restart process for certain conditions Really important for unicorn Integrated with Capistrano

Slide 67

Slide 67 text

Super easy Configuration

Slide 68

Slide 68 text

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

Slide 69

Slide 69 text

lograge custom options Add as much things for monitoring as possible!

Slide 70

Slide 70 text

Conclusion

Slide 71

Slide 71 text

Ruby is expressive.

Slide 72

Slide 72 text

Tons of DSLs for solving different problems.

Slide 73

Slide 73 text

Make developers happy.

Slide 74

Slide 74 text

Make operators happy.

Slide 75

Slide 75 text

Make your customers happy. boss investors

Slide 76

Slide 76 text

No content

Slide 77

Slide 77 text

Email: [email protected] Twitter & GitHub & App.net: @dlackty Thank You! We’re hiring!

Slide 78

Slide 78 text

Q & A?