Slide 1

Slide 1 text

Infrastructure as Ruby Code Augusto Becciu

Slide 2

Slide 2 text

Who am I? • @abecciu {github, twitter} • Hacker • Startups guy • Cur: CTO at • Prev: Dev / Ops Engineer at

Slide 3

Slide 3 text

Who are you?

Slide 4

Slide 4 text

Traditional Sysadmin • Manual (mostly) • Lack of process • Bunch of shell and perl scripts • Fear of change • Monolithic architectures • Durable bare metal hardware • Vertical scalability

Slide 5

Slide 5 text

No content

Slide 6

Slide 6 text

The Cloud Computing Evolution • Service Oriented Architectures • Horizontal Scalability • Transition to virtualized ephemeral resources • Instant provisioning • OMG APIs !!!

Slide 7

Slide 7 text

Infrastructure as code Apply software engineering practices to systems administration and operation.

Slide 8

Slide 8 text

Infrastructure as code • Automation • Repeatability • Agility • Scalability Apply software engineering practices to systems administration and operation.

Slide 9

Slide 9 text

“Enable the reconstruction of the business from nothing but a source code repository, an application data backup, and bare metal resources” Jesse Robins describes the goal brilliantly:

Slide 10

Slide 10 text

Hello Chef • Configuration management • Systems integration • Idempotence • Declarative and imperative • Ruby everywhere

Slide 11

Slide 11 text

No content

Slide 12

Slide 12 text

Let’s deploy RubyConfAR’s website!

Slide 13

Slide 13 text

We need to... • Install packages • Create directories • Create users • Get the code • Install gems • Run migrations • Run the app server

Slide 14

Slide 14 text

No content

Slide 15

Slide 15 text

No content

Slide 16

Slide 16 text

No content

Slide 17

Slide 17 text

No content

Slide 18

Slide 18 text

No content

Slide 19

Slide 19 text

No content

Slide 20

Slide 20 text

No content

Slide 21

Slide 21 text

Recipe

Slide 22

Slide 22 text

Attributes

Slide 23

Slide 23 text

Recipe

Slide 24

Slide 24 text

No content

Slide 25

Slide 25 text

No content

Slide 26

Slide 26 text

No content

Slide 27

Slide 27 text

No content

Slide 28

Slide 28 text

No content

Slide 29

Slide 29 text

No content

Slide 30

Slide 30 text

Syntax Check $ knife cookbook test rubyconfar

Slide 31

Slide 31 text

Static Analysis $ gem install foodcritic $ foodcritic rubyconfar http://acrmp.github.com/foodcritic/

Slide 32

Slide 32 text

Unit Testing $ gem install rspec $ gem install chefspec $ rspec --color rubyconfar https://github.com/acrmp/chefspec https://github.com/acrmp/chefspec

Slide 33

Slide 33 text

Unit Testing

Slide 34

Slide 34 text

Integration Testing $ gem install minitest-chef-handler https://github.com/calavera/minitest-chef-handler https://github.com/btm/minitest-handler-cookbook

Slide 35

Slide 35 text

Integration Testing

Slide 36

Slide 36 text

Acceptance Testing $ gem install cucumber-nagios $ cucumber-nagios-gen project rubyconfar $ cd rubyconfar $ ./bin/cucumber-nagios features/ http://auxesis.github.com/cucumber-nagios/

Slide 37

Slide 37 text

Acceptance Testing

Slide 38

Slide 38 text

No content

Slide 39

Slide 39 text

Cloud Provisioning

Slide 40

Slide 40 text

Vagrant http://vagrantup.com/

Slide 41

Slide 41 text

Vagrant

Slide 42

Slide 42 text

Vagrant $ vagrant box add precise64 http://files.vagrantup.com/precise64.box $ vagrant up $ vagrant provision $ vagrant destroy

Slide 43

Slide 43 text

$ gem install knife-ec2 $ knife ec2 server create -I ami-2e845d33 -f t1.micro -r ‘recipe[rubyconfar]’ $ knife ec2 server delete instance_id

Slide 44

Slide 44 text

The Ruby cloud services library http://fog.io

Slide 45

Slide 45 text

No content

Slide 46

Slide 46 text

Automate ALL the things!

Slide 47

Slide 47 text

Build your own awesome tools, it’s easy! + + gli Net::SSH + http://net-ssh.rubyforge.org/ http://davetron5000.github.com/gli/

Slide 48

Slide 48 text

Thanks! is hiring! http://restorando.com/joinus