SlideShare une entreprise Scribd logo
1  sur  15
Télécharger pour lire hors ligne
Ricardo Sanchez
                @ricardojsanchez
    rsanchez.jayhawk@gmail.com
svDevOps Meetup – August 3, 2010
 Operations  Architect for PlayHaven
 Started with Ruby/Rails in late 2008
 Networking guy prior to that
  • Linux/Unix, kernel+user software development
  • C/C++, Routers/Switches, …
 ShortRuby Intro
 Ruby projects
 Ruby Lab
 Created   by Yukihiro “Matz” Matsumoto
 First release 1995, renassaince 2005
 Influenced by Python, Perl, and Lisp
 Focus on simplicity, productivity, and
  developer happiness
 Principle of least surprise
 Many interpreters
  • MRI, YARV, Jruby, Rubinius, IronRuby, REE, MacRuby,
   MagLev, …
 “Rubyist” are
              passionate and friendly
 people (Culture)
 Object-Oriented
    With inheritance, mixins, and metaclasses
 Interpreted
 Dynamic  typing and Duck typing
 Everything is an object, no primitives
 and many more “conventions”
 Created  by DHH (released 2004)
 Web application framework
 Model-View-Controller (MVC) pattern
 Stable 2.3.8, Beta 3.0 RC (just released)
 Principles
  • Convention over Configuration (CoC)
  • Don‟t Repeat Yourself (DRY)
 REST   (Representational State Transfer)
Database
            Router              Controller               Model
                                                          Model
 HTTP      Controller              Action
             Action                 Action                  Model
Request
           Parameters              Action




                                    View
                        <h2>List of items:
  HTTP                   <% @items.each do |item| %>
Response                   <li> Item: <%= item %></li>
                         <% end %>
                        </h2>
 Request  made from browser to URL
  http://localhost:3000/users/show/1
 Rails receives request on port 3000
  • Server invokes dispatcher (routing)
     :controller = users, :action = show, :id = 1
  • Action fetches model object from database
  • Action renders view which generates HTML
 Rails   sends response (HTML page) back
 ActiveRecord
 ActionController
 ActionView
 ActionMailer
 ActiveSupport
…   is all morphing as Rails3 is introduced
   Command line tool
    • Install multiple ruby interpreters/versions
       E.g.: ruby (1.8.6-p399, 1.8.7-p187, …); jruby, rubinius
    • Manage sets of gems („gemsets‟)
    • Perform operations over installed interpreters/gemsets
   Avail for all *nix systems (require „bash‟)
   Quick examples (no sudo needed!)
    •   $ rvm install ruby-1.9.2, jruby  Install
    •   $ rvm use 1.9.1  Switching
    •   $ rvm gemset use rails3  Managing Gems
    •   $ rvm 1.8.7, 1.9.1, jruby tests  Running tests
    •   $ rvm 1.8.7, 1.9.1 rake do:all  Running rake task
   http://rvm.beginrescueend.com
 Tool for building and distributing
  virtualized development environments
 Uses Oracle‟s VirtualBox
 Main features
  •   Automated provisioning using chef
  •   Forward port to host machine
  •   Full SSH access to created environments
  •   Shared folders between host/guest(s)
  •   Package environments into distributable boxes
 Great for distributable dev/qa environments
 To install: # gem install vagrant
 http://vagrantup.com
 Task automation tool on remote servers
 Features
    • Restart particular service on multiple servers once
       $ cap HOSTS=„www-1,www-2‟
        COMMAND=„/etc/init.d/apache2 restart” invoke
    • Check state of service/resource (memory,cpu) that is not
     monitored
      $ cap HOSTS=„www-1,www-2‟ COMMAND=„grep MemTotal
       /proc/meminfo‟ invoke
    • Run command in multiple servers and monitor output
    • Systems deployment tasks (e.g., Rails deployments)
 To install: # gem install capistrano
 http://capify.org
 Problem: how to manage many servers
 Solution: consolidate access to infrastructure data for
  all nodes („systems integration‟)
 Chef provides configuration, integration, and
  operations as code (written in Ruby)
    • Treat infrastructure like software development projects
   Modes: solo, client/server
   Concepts
    • Nodes, Roles, Cookbooks, Recipes, Resources, Attributes
   Opscode offerings
    • Chef - Server Configuration Management Tool (API & DSL)
    • Opscode Platform (hosted chef server)
   http://www.opscode.com
 Books
   • Programming Ruby 1.9
   • The Ruby Programming Language
   • Practical Ruby for Systems Administration
   • Everyday Scripting with Ruby
 Online Learning
   • http://rubylearning.org (Free course)
   • http://github.com/edgecase/ruby_koans (FUN)
 Blogs
   • http://rubyinside.com
   • http://rubyflow.com
 Installation   (all platforms)
  • http://www.wiki.devchix.com/index.php?title=Work
    shop_Installation_Notes
     Ruby, RubyGems
     Editor (your choice)
 Exercise
  • Open irb
     $ irb
     >> puts “Hello world”
  • Save previous line on hello.rb, chmod +x, and run
     $ ruby hello.rb

Contenu connexe

Tendances

Steamlining your puppet development workflow
Steamlining your puppet development workflowSteamlining your puppet development workflow
Steamlining your puppet development workflowTomas Doran
 
Sonata Block Bundle - sfPot March 2014
Sonata Block Bundle - sfPot March 2014Sonata Block Bundle - sfPot March 2014
Sonata Block Bundle - sfPot March 2014th0masr
 
Ruby eventmachine pres at rubybdx
Ruby eventmachine pres at rubybdxRuby eventmachine pres at rubybdx
Ruby eventmachine pres at rubybdxMathieu Elie
 
Ansible 2.0 - How to use Ansible to automate your applications in AWS.
Ansible 2.0 - How to use Ansible to automate your applications in AWS.Ansible 2.0 - How to use Ansible to automate your applications in AWS.
Ansible 2.0 - How to use Ansible to automate your applications in AWS.Idan Tohami
 
The SaltStack Pub Crawl - Fosscomm 2016
The SaltStack Pub Crawl - Fosscomm 2016The SaltStack Pub Crawl - Fosscomm 2016
The SaltStack Pub Crawl - Fosscomm 2016effie mouzeli
 
Deploying PHP Applications with Ansible
Deploying PHP Applications with AnsibleDeploying PHP Applications with Ansible
Deploying PHP Applications with AnsibleOrestes Carracedo
 
Puppet Availability and Performance at 100K Nodes - PuppetConf 2014
Puppet Availability and Performance at 100K Nodes - PuppetConf 2014Puppet Availability and Performance at 100K Nodes - PuppetConf 2014
Puppet Availability and Performance at 100K Nodes - PuppetConf 2014Puppet
 
Network Automation: Ansible 102
Network Automation: Ansible 102Network Automation: Ansible 102
Network Automation: Ansible 102APNIC
 
OpenNebula and SaltStack - OpenNebulaConf 2013
OpenNebula and SaltStack - OpenNebulaConf 2013OpenNebula and SaltStack - OpenNebulaConf 2013
OpenNebula and SaltStack - OpenNebulaConf 2013databus.pro
 
Provisioning iOS CI Server with Ansible
Provisioning iOS CI Server with AnsibleProvisioning iOS CI Server with Ansible
Provisioning iOS CI Server with AnsibleShashikant Jagtap
 
Advanced front-end automation with npm scripts
Advanced front-end automation with npm scriptsAdvanced front-end automation with npm scripts
Advanced front-end automation with npm scriptsk88hudson
 
Building a smarter application stack - service discovery and wiring for Docker
Building a smarter application stack - service discovery and wiring for DockerBuilding a smarter application stack - service discovery and wiring for Docker
Building a smarter application stack - service discovery and wiring for DockerTomas Doran
 
Ansible presentation
Ansible presentationAnsible presentation
Ansible presentationSuresh Kumar
 
An introduction to the Symfony CMF - creating a CMS on top of Symfony
An introduction to the Symfony CMF - creating a CMS on top of Symfony An introduction to the Symfony CMF - creating a CMS on top of Symfony
An introduction to the Symfony CMF - creating a CMS on top of Symfony Roel Sint
 
Red Hat Satellite 6 - Automation with Puppet
Red Hat Satellite 6 - Automation with PuppetRed Hat Satellite 6 - Automation with Puppet
Red Hat Satellite 6 - Automation with PuppetMichael Lessard
 
Puppet for dummies - ZendCon 2011 Edition
Puppet for dummies - ZendCon 2011 EditionPuppet for dummies - ZendCon 2011 Edition
Puppet for dummies - ZendCon 2011 EditionJoshua Thijssen
 
Spot Trading - A case study in continuous delivery for mission critical finan...
Spot Trading - A case study in continuous delivery for mission critical finan...Spot Trading - A case study in continuous delivery for mission critical finan...
Spot Trading - A case study in continuous delivery for mission critical finan...SaltStack
 
ruby + websocket + haproxy
ruby + websocket + haproxyruby + websocket + haproxy
ruby + websocket + haproxyMathieu Elie
 

Tendances (20)

Steamlining your puppet development workflow
Steamlining your puppet development workflowSteamlining your puppet development workflow
Steamlining your puppet development workflow
 
Sonata Block Bundle - sfPot March 2014
Sonata Block Bundle - sfPot March 2014Sonata Block Bundle - sfPot March 2014
Sonata Block Bundle - sfPot March 2014
 
Ruby eventmachine pres at rubybdx
Ruby eventmachine pres at rubybdxRuby eventmachine pres at rubybdx
Ruby eventmachine pres at rubybdx
 
Ansible 2.0 - How to use Ansible to automate your applications in AWS.
Ansible 2.0 - How to use Ansible to automate your applications in AWS.Ansible 2.0 - How to use Ansible to automate your applications in AWS.
Ansible 2.0 - How to use Ansible to automate your applications in AWS.
 
The SaltStack Pub Crawl - Fosscomm 2016
The SaltStack Pub Crawl - Fosscomm 2016The SaltStack Pub Crawl - Fosscomm 2016
The SaltStack Pub Crawl - Fosscomm 2016
 
Deploying PHP Applications with Ansible
Deploying PHP Applications with AnsibleDeploying PHP Applications with Ansible
Deploying PHP Applications with Ansible
 
Puppet Availability and Performance at 100K Nodes - PuppetConf 2014
Puppet Availability and Performance at 100K Nodes - PuppetConf 2014Puppet Availability and Performance at 100K Nodes - PuppetConf 2014
Puppet Availability and Performance at 100K Nodes - PuppetConf 2014
 
Network Automation: Ansible 102
Network Automation: Ansible 102Network Automation: Ansible 102
Network Automation: Ansible 102
 
OpenNebula and SaltStack - OpenNebulaConf 2013
OpenNebula and SaltStack - OpenNebulaConf 2013OpenNebula and SaltStack - OpenNebulaConf 2013
OpenNebula and SaltStack - OpenNebulaConf 2013
 
Provisioning iOS CI Server with Ansible
Provisioning iOS CI Server with AnsibleProvisioning iOS CI Server with Ansible
Provisioning iOS CI Server with Ansible
 
Advanced front-end automation with npm scripts
Advanced front-end automation with npm scriptsAdvanced front-end automation with npm scripts
Advanced front-end automation with npm scripts
 
Building a smarter application stack - service discovery and wiring for Docker
Building a smarter application stack - service discovery and wiring for DockerBuilding a smarter application stack - service discovery and wiring for Docker
Building a smarter application stack - service discovery and wiring for Docker
 
Ansible presentation
Ansible presentationAnsible presentation
Ansible presentation
 
An introduction to the Symfony CMF - creating a CMS on top of Symfony
An introduction to the Symfony CMF - creating a CMS on top of Symfony An introduction to the Symfony CMF - creating a CMS on top of Symfony
An introduction to the Symfony CMF - creating a CMS on top of Symfony
 
Red Hat Satellite 6 - Automation with Puppet
Red Hat Satellite 6 - Automation with PuppetRed Hat Satellite 6 - Automation with Puppet
Red Hat Satellite 6 - Automation with Puppet
 
Puppet for dummies - ZendCon 2011 Edition
Puppet for dummies - ZendCon 2011 EditionPuppet for dummies - ZendCon 2011 Edition
Puppet for dummies - ZendCon 2011 Edition
 
Spot Trading - A case study in continuous delivery for mission critical finan...
Spot Trading - A case study in continuous delivery for mission critical finan...Spot Trading - A case study in continuous delivery for mission critical finan...
Spot Trading - A case study in continuous delivery for mission critical finan...
 
Ansible - A 'crowd' introduction
Ansible - A 'crowd' introductionAnsible - A 'crowd' introduction
Ansible - A 'crowd' introduction
 
ruby + websocket + haproxy
ruby + websocket + haproxyruby + websocket + haproxy
ruby + websocket + haproxy
 
SVN essentials
SVN essentialsSVN essentials
SVN essentials
 

Similaire à Ricardo Sanchez - Ruby projects of interest for devops

Ruby on-rails-101-presentation-slides-for-a-five-day-introductory-course-1194...
Ruby on-rails-101-presentation-slides-for-a-five-day-introductory-course-1194...Ruby on-rails-101-presentation-slides-for-a-five-day-introductory-course-1194...
Ruby on-rails-101-presentation-slides-for-a-five-day-introductory-course-1194...Nilesh Panchal
 
Jasig rubyon rails
Jasig rubyon railsJasig rubyon rails
Jasig rubyon rails_zaMmer_
 
Jasig rubyon rails
Jasig rubyon railsJasig rubyon rails
Jasig rubyon rails_zaMmer_
 
Ruby on Rails : 簡介與入門
Ruby on Rails : 簡介與入門Ruby on Rails : 簡介與入門
Ruby on Rails : 簡介與入門Wen-Tien Chang
 
From Java to Ruby...and Back
From Java to Ruby...and BackFrom Java to Ruby...and Back
From Java to Ruby...and BackAnil Hemrajani
 
An introduction to Rails 3
An introduction to Rails 3An introduction to Rails 3
An introduction to Rails 3Blazing Cloud
 
Groovy & Grails eXchange 2012 vert.x presentation
Groovy & Grails eXchange 2012 vert.x presentationGroovy & Grails eXchange 2012 vert.x presentation
Groovy & Grails eXchange 2012 vert.x presentationStuart (Pid) Williams
 
Ruby on Rails All Hands Meeting
Ruby on Rails All Hands MeetingRuby on Rails All Hands Meeting
Ruby on Rails All Hands MeetingDan Davis
 
Demystifying Ruby on Rails
Demystifying Ruby on Rails Demystifying Ruby on Rails
Demystifying Ruby on Rails Johan Pretorius
 
Play Framework and Activator
Play Framework and ActivatorPlay Framework and Activator
Play Framework and ActivatorKevin Webber
 
Learning to code for startup mvp session 3
Learning to code for startup mvp session 3Learning to code for startup mvp session 3
Learning to code for startup mvp session 3Henry S
 
44CON 2014 - Pentesting NoSQL DB's Using NoSQL Exploitation Framework, Franci...
44CON 2014 - Pentesting NoSQL DB's Using NoSQL Exploitation Framework, Franci...44CON 2014 - Pentesting NoSQL DB's Using NoSQL Exploitation Framework, Franci...
44CON 2014 - Pentesting NoSQL DB's Using NoSQL Exploitation Framework, Franci...44CON
 
Introduction to Laravel Framework (5.2)
Introduction to Laravel Framework (5.2)Introduction to Laravel Framework (5.2)
Introduction to Laravel Framework (5.2)Viral Solani
 
Lecture #5 Introduction to rails
Lecture #5 Introduction to railsLecture #5 Introduction to rails
Lecture #5 Introduction to railsEvgeniy Hinyuk
 
Introduction to Rails by Evgeniy Hinyuk
Introduction to Rails by Evgeniy HinyukIntroduction to Rails by Evgeniy Hinyuk
Introduction to Rails by Evgeniy HinyukPivorak MeetUp
 
Integration in the age of DevOps
Integration in the age of DevOpsIntegration in the age of DevOps
Integration in the age of DevOpsAlbert Wong
 
.NET Architects Day - DNAD 2011
.NET Architects Day - DNAD 2011.NET Architects Day - DNAD 2011
.NET Architects Day - DNAD 2011Fabio Akita
 

Similaire à Ricardo Sanchez - Ruby projects of interest for devops (20)

Ruby on-rails-101-presentation-slides-for-a-five-day-introductory-course-1194...
Ruby on-rails-101-presentation-slides-for-a-five-day-introductory-course-1194...Ruby on-rails-101-presentation-slides-for-a-five-day-introductory-course-1194...
Ruby on-rails-101-presentation-slides-for-a-five-day-introductory-course-1194...
 
Jasig rubyon rails
Jasig rubyon railsJasig rubyon rails
Jasig rubyon rails
 
Jasig rubyon rails
Jasig rubyon railsJasig rubyon rails
Jasig rubyon rails
 
Supa fast Ruby + Rails
Supa fast Ruby + RailsSupa fast Ruby + Rails
Supa fast Ruby + Rails
 
Ruby on Rails : 簡介與入門
Ruby on Rails : 簡介與入門Ruby on Rails : 簡介與入門
Ruby on Rails : 簡介與入門
 
From Java to Ruby...and Back
From Java to Ruby...and BackFrom Java to Ruby...and Back
From Java to Ruby...and Back
 
An introduction to Rails 3
An introduction to Rails 3An introduction to Rails 3
An introduction to Rails 3
 
Groovy & Grails eXchange 2012 vert.x presentation
Groovy & Grails eXchange 2012 vert.x presentationGroovy & Grails eXchange 2012 vert.x presentation
Groovy & Grails eXchange 2012 vert.x presentation
 
Ruby on Rails All Hands Meeting
Ruby on Rails All Hands MeetingRuby on Rails All Hands Meeting
Ruby on Rails All Hands Meeting
 
Demystifying Ruby on Rails
Demystifying Ruby on Rails Demystifying Ruby on Rails
Demystifying Ruby on Rails
 
Play Framework and Activator
Play Framework and ActivatorPlay Framework and Activator
Play Framework and Activator
 
Learning to code for startup mvp session 3
Learning to code for startup mvp session 3Learning to code for startup mvp session 3
Learning to code for startup mvp session 3
 
44CON 2014 - Pentesting NoSQL DB's Using NoSQL Exploitation Framework, Franci...
44CON 2014 - Pentesting NoSQL DB's Using NoSQL Exploitation Framework, Franci...44CON 2014 - Pentesting NoSQL DB's Using NoSQL Exploitation Framework, Franci...
44CON 2014 - Pentesting NoSQL DB's Using NoSQL Exploitation Framework, Franci...
 
Introduction to Laravel Framework (5.2)
Introduction to Laravel Framework (5.2)Introduction to Laravel Framework (5.2)
Introduction to Laravel Framework (5.2)
 
Lecture #5 Introduction to rails
Lecture #5 Introduction to railsLecture #5 Introduction to rails
Lecture #5 Introduction to rails
 
Introduction to Rails by Evgeniy Hinyuk
Introduction to Rails by Evgeniy HinyukIntroduction to Rails by Evgeniy Hinyuk
Introduction to Rails by Evgeniy Hinyuk
 
Sinatra
SinatraSinatra
Sinatra
 
Rails Performance
Rails PerformanceRails Performance
Rails Performance
 
Integration in the age of DevOps
Integration in the age of DevOpsIntegration in the age of DevOps
Integration in the age of DevOps
 
.NET Architects Day - DNAD 2011
.NET Architects Day - DNAD 2011.NET Architects Day - DNAD 2011
.NET Architects Day - DNAD 2011
 

Ricardo Sanchez - Ruby projects of interest for devops

  • 1. Ricardo Sanchez @ricardojsanchez rsanchez.jayhawk@gmail.com svDevOps Meetup – August 3, 2010
  • 2.  Operations Architect for PlayHaven  Started with Ruby/Rails in late 2008  Networking guy prior to that • Linux/Unix, kernel+user software development • C/C++, Routers/Switches, …
  • 3.  ShortRuby Intro  Ruby projects  Ruby Lab
  • 4.  Created by Yukihiro “Matz” Matsumoto  First release 1995, renassaince 2005  Influenced by Python, Perl, and Lisp  Focus on simplicity, productivity, and developer happiness  Principle of least surprise  Many interpreters • MRI, YARV, Jruby, Rubinius, IronRuby, REE, MacRuby, MagLev, …  “Rubyist” are passionate and friendly people (Culture)
  • 5.  Object-Oriented  With inheritance, mixins, and metaclasses  Interpreted  Dynamic typing and Duck typing  Everything is an object, no primitives  and many more “conventions”
  • 6.  Created by DHH (released 2004)  Web application framework  Model-View-Controller (MVC) pattern  Stable 2.3.8, Beta 3.0 RC (just released)  Principles • Convention over Configuration (CoC) • Don‟t Repeat Yourself (DRY)  REST (Representational State Transfer)
  • 7. Database Router Controller Model Model HTTP Controller Action Action Action Model Request Parameters Action View <h2>List of items: HTTP <% @items.each do |item| %> Response <li> Item: <%= item %></li> <% end %> </h2>
  • 8.  Request made from browser to URL http://localhost:3000/users/show/1  Rails receives request on port 3000 • Server invokes dispatcher (routing)  :controller = users, :action = show, :id = 1 • Action fetches model object from database • Action renders view which generates HTML  Rails sends response (HTML page) back
  • 9.  ActiveRecord  ActionController  ActionView  ActionMailer  ActiveSupport … is all morphing as Rails3 is introduced
  • 10. Command line tool • Install multiple ruby interpreters/versions  E.g.: ruby (1.8.6-p399, 1.8.7-p187, …); jruby, rubinius • Manage sets of gems („gemsets‟) • Perform operations over installed interpreters/gemsets  Avail for all *nix systems (require „bash‟)  Quick examples (no sudo needed!) • $ rvm install ruby-1.9.2, jruby  Install • $ rvm use 1.9.1  Switching • $ rvm gemset use rails3  Managing Gems • $ rvm 1.8.7, 1.9.1, jruby tests  Running tests • $ rvm 1.8.7, 1.9.1 rake do:all  Running rake task  http://rvm.beginrescueend.com
  • 11.  Tool for building and distributing virtualized development environments  Uses Oracle‟s VirtualBox  Main features • Automated provisioning using chef • Forward port to host machine • Full SSH access to created environments • Shared folders between host/guest(s) • Package environments into distributable boxes  Great for distributable dev/qa environments  To install: # gem install vagrant  http://vagrantup.com
  • 12.  Task automation tool on remote servers  Features • Restart particular service on multiple servers once  $ cap HOSTS=„www-1,www-2‟ COMMAND=„/etc/init.d/apache2 restart” invoke • Check state of service/resource (memory,cpu) that is not monitored  $ cap HOSTS=„www-1,www-2‟ COMMAND=„grep MemTotal /proc/meminfo‟ invoke • Run command in multiple servers and monitor output • Systems deployment tasks (e.g., Rails deployments)  To install: # gem install capistrano  http://capify.org
  • 13.  Problem: how to manage many servers  Solution: consolidate access to infrastructure data for all nodes („systems integration‟)  Chef provides configuration, integration, and operations as code (written in Ruby) • Treat infrastructure like software development projects  Modes: solo, client/server  Concepts • Nodes, Roles, Cookbooks, Recipes, Resources, Attributes  Opscode offerings • Chef - Server Configuration Management Tool (API & DSL) • Opscode Platform (hosted chef server)  http://www.opscode.com
  • 14.  Books • Programming Ruby 1.9 • The Ruby Programming Language • Practical Ruby for Systems Administration • Everyday Scripting with Ruby  Online Learning • http://rubylearning.org (Free course) • http://github.com/edgecase/ruby_koans (FUN)  Blogs • http://rubyinside.com • http://rubyflow.com
  • 15.  Installation (all platforms) • http://www.wiki.devchix.com/index.php?title=Work shop_Installation_Notes  Ruby, RubyGems  Editor (your choice)  Exercise • Open irb  $ irb  >> puts “Hello world” • Save previous line on hello.rb, chmod +x, and run  $ ruby hello.rb