qa to sous-chef

31
QA to sous-Chef Sajnikanth Suriyanarayanan Presented at Devops Summit on 27th March 2014 & at DevopsSG on 2nd October 2013

Upload: sajnikanth-suriyanarayanan

Post on 06-May-2015

645 views

Category:

Technology


0 download

DESCRIPTION

This is my experience as a black box test engineer venturing into Devops using Chef. I cover the following topics during the course of my presentation - Why Chef, Pre-requisites, Cooking on a vagrant VM and conclude with an introduction to Berkshelf.

TRANSCRIPT

Page 1: QA to sous-Chef

QA to sous-ChefSajnikanth Suriyanarayanan

Presented at Devops Summit on 27th March 2014& at DevopsSG on 2nd October 2013

Page 2: QA to sous-Chef

About Me● Coastal GeoScientist and Civil Engineer● 10+ years in Software Quality Assurance

and Functional Testing● HP Certified Professional in Quality Center● Lead Quality Assurance at Vistaprint● http://sajnikanth.com

Page 3: QA to sous-Chef

● I’m a beginner● May not be the standard way

● introduction to vagrant● introduction to chef provisioning● introduction to berkshelf

Disclaimer & Take-Away

Page 4: QA to sous-Chef

Contents● Background● Problem● Vagrant + bash● Vagrant + Chef● Demo● Lessons Learned

Page 5: QA to sous-Chef

BackgroundAs Test Engineer, I usually:

● write test scripts● merge pull requests● deploy code● test changes

Page 6: QA to sous-Chef

ProblemCurrent project is brand new. So:

● write test scripts● merge pull requests● deploy code (where to?)● test changes

Page 7: QA to sous-Chef

● App lives locally● Experiment with technologies (mysql or

mongoDB; apache or nginx;)● Unstable environment

Problem ...

A server should be like a phoenix, regularly rising from the ashes - Martin Fowler

Page 8: QA to sous-Chef

Vagrant + bash

● Reproducible● Portable● Isolated; room for experimentation● Use Bash to install apps 'automatically'

Page 9: QA to sous-Chef

Vagrant + bash ...Changing / maintaining bash scripts?

Page 10: QA to sous-Chef

Vagrant + ChefApprehensions:● Ruby● Steep learning curve

○ hosted chef or chef solo○ knife○ opscode○ cookbooks○ recipe○ omnibus○ information overload!!

Page 11: QA to sous-Chef

Forget it!Let’s get our hands dirty

Page 12: QA to sous-Chef

Install nginx on vagrant VM using Chef

Pre-Requisites● VirtualBox● vagrant installed● vagrant omnibus● vagrant guest additions● knife

Demo

Page 13: QA to sous-Chef

vagrant init

Demo - Initialize vagrant

Page 14: QA to sous-Chef

Demo - Create Cookbooksmkdir ./cookbooksknife cookbook site download nginxUnarchive and delete tar

Page 15: QA to sous-Chef

Demo - Update Vagrantfile

Page 16: QA to sous-Chef

Demo - Let’s cookvagrant up

Page 17: QA to sous-Chef

Demo - Results?

Page 18: QA to sous-Chef

Demo - Download apt cookbookknife cookbook site download apt

Page 19: QA to sous-Chef

Demo - Update Vagrantfile

Page 20: QA to sous-Chef

Demo - We try againvagrant up

Cookbook bluepill not foundCookbook rsyslog not foundCookbook build-essential not foundCookbook ohai not foundCookbook runit not foundCookbook yum not foundCookbook yum-epel not found

Page 21: QA to sous-Chef

Demo - Download cookbooks

Page 22: QA to sous-Chef

Demo - Update Vagrantfile

Page 23: QA to sous-Chef

Hungry Already?

Page 24: QA to sous-Chef

Demo - and againvagrant up

Page 25: QA to sous-Chef

Easy way to manage cookbooks

gem install berkshelfvagrant plugin install vagrant-berkshelf

Demo - enter Berkshelf

Page 26: QA to sous-Chef

cookbook 'nginx'

Demo - Berksfile

Page 27: QA to sous-Chef

berks install

Demo - using berkshelf

~/.berkshelf/cookbooks/

Page 28: QA to sous-Chef

Demo - update Vagrantfileupdate Vagrantfile to use berkshelfvagrant reload

Page 29: QA to sous-Chef

Demo - Results

Page 30: QA to sous-Chef

Demo - Resources

● Presentation link - http://j.mp/devops-summit● Demo repo - https://github.com/sajnikanth/chef-berkshelf-demo● Chef Tutorials

○ http://nathenharvey.com/blog/2012/12/06/learning-chef-part-1/○ https://learnchef.opscode.com/quickstart/

● Berkshelf Introduction - http://youtu.be/hYt0E84kYUI

Page 31: QA to sous-Chef

3 Important lessons learned while using chef

● RTFM● RTFM● RTFM

Lessons Learned

Questions?