QA to sous-Chef
-
Upload
sajnikanth-suriyanarayanan -
Category
Technology
-
view
646 -
download
0
description
Transcript of QA to sous-Chef
![Page 1: QA to sous-Chef](https://reader034.fdocuments.in/reader034/viewer/2022052522/554a3322b4c90526578b552c/html5/thumbnails/1.jpg)
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](https://reader034.fdocuments.in/reader034/viewer/2022052522/554a3322b4c90526578b552c/html5/thumbnails/2.jpg)
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](https://reader034.fdocuments.in/reader034/viewer/2022052522/554a3322b4c90526578b552c/html5/thumbnails/3.jpg)
● 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](https://reader034.fdocuments.in/reader034/viewer/2022052522/554a3322b4c90526578b552c/html5/thumbnails/4.jpg)
Contents● Background● Problem● Vagrant + bash● Vagrant + Chef● Demo● Lessons Learned
![Page 5: QA to sous-Chef](https://reader034.fdocuments.in/reader034/viewer/2022052522/554a3322b4c90526578b552c/html5/thumbnails/5.jpg)
BackgroundAs Test Engineer, I usually:
● write test scripts● merge pull requests● deploy code● test changes
![Page 6: QA to sous-Chef](https://reader034.fdocuments.in/reader034/viewer/2022052522/554a3322b4c90526578b552c/html5/thumbnails/6.jpg)
ProblemCurrent project is brand new. So:
● write test scripts● merge pull requests● deploy code (where to?)● test changes
![Page 7: QA to sous-Chef](https://reader034.fdocuments.in/reader034/viewer/2022052522/554a3322b4c90526578b552c/html5/thumbnails/7.jpg)
● 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](https://reader034.fdocuments.in/reader034/viewer/2022052522/554a3322b4c90526578b552c/html5/thumbnails/8.jpg)
Vagrant + bash
● Reproducible● Portable● Isolated; room for experimentation● Use Bash to install apps 'automatically'
![Page 9: QA to sous-Chef](https://reader034.fdocuments.in/reader034/viewer/2022052522/554a3322b4c90526578b552c/html5/thumbnails/9.jpg)
Vagrant + bash ...Changing / maintaining bash scripts?
![Page 10: QA to sous-Chef](https://reader034.fdocuments.in/reader034/viewer/2022052522/554a3322b4c90526578b552c/html5/thumbnails/10.jpg)
Vagrant + ChefApprehensions:● Ruby● Steep learning curve
○ hosted chef or chef solo○ knife○ opscode○ cookbooks○ recipe○ omnibus○ information overload!!
![Page 11: QA to sous-Chef](https://reader034.fdocuments.in/reader034/viewer/2022052522/554a3322b4c90526578b552c/html5/thumbnails/11.jpg)
Forget it!Let’s get our hands dirty
![Page 12: QA to sous-Chef](https://reader034.fdocuments.in/reader034/viewer/2022052522/554a3322b4c90526578b552c/html5/thumbnails/12.jpg)
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](https://reader034.fdocuments.in/reader034/viewer/2022052522/554a3322b4c90526578b552c/html5/thumbnails/13.jpg)
vagrant init
Demo - Initialize vagrant
![Page 14: QA to sous-Chef](https://reader034.fdocuments.in/reader034/viewer/2022052522/554a3322b4c90526578b552c/html5/thumbnails/14.jpg)
Demo - Create Cookbooksmkdir ./cookbooksknife cookbook site download nginxUnarchive and delete tar
![Page 15: QA to sous-Chef](https://reader034.fdocuments.in/reader034/viewer/2022052522/554a3322b4c90526578b552c/html5/thumbnails/15.jpg)
Demo - Update Vagrantfile
![Page 16: QA to sous-Chef](https://reader034.fdocuments.in/reader034/viewer/2022052522/554a3322b4c90526578b552c/html5/thumbnails/16.jpg)
Demo - Let’s cookvagrant up
![Page 17: QA to sous-Chef](https://reader034.fdocuments.in/reader034/viewer/2022052522/554a3322b4c90526578b552c/html5/thumbnails/17.jpg)
Demo - Results?
![Page 18: QA to sous-Chef](https://reader034.fdocuments.in/reader034/viewer/2022052522/554a3322b4c90526578b552c/html5/thumbnails/18.jpg)
Demo - Download apt cookbookknife cookbook site download apt
![Page 19: QA to sous-Chef](https://reader034.fdocuments.in/reader034/viewer/2022052522/554a3322b4c90526578b552c/html5/thumbnails/19.jpg)
Demo - Update Vagrantfile
![Page 20: QA to sous-Chef](https://reader034.fdocuments.in/reader034/viewer/2022052522/554a3322b4c90526578b552c/html5/thumbnails/20.jpg)
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](https://reader034.fdocuments.in/reader034/viewer/2022052522/554a3322b4c90526578b552c/html5/thumbnails/21.jpg)
Demo - Download cookbooks
![Page 22: QA to sous-Chef](https://reader034.fdocuments.in/reader034/viewer/2022052522/554a3322b4c90526578b552c/html5/thumbnails/22.jpg)
Demo - Update Vagrantfile
![Page 23: QA to sous-Chef](https://reader034.fdocuments.in/reader034/viewer/2022052522/554a3322b4c90526578b552c/html5/thumbnails/23.jpg)
Hungry Already?
![Page 24: QA to sous-Chef](https://reader034.fdocuments.in/reader034/viewer/2022052522/554a3322b4c90526578b552c/html5/thumbnails/24.jpg)
Demo - and againvagrant up
![Page 25: QA to sous-Chef](https://reader034.fdocuments.in/reader034/viewer/2022052522/554a3322b4c90526578b552c/html5/thumbnails/25.jpg)
Easy way to manage cookbooks
gem install berkshelfvagrant plugin install vagrant-berkshelf
Demo - enter Berkshelf
![Page 26: QA to sous-Chef](https://reader034.fdocuments.in/reader034/viewer/2022052522/554a3322b4c90526578b552c/html5/thumbnails/26.jpg)
cookbook 'nginx'
Demo - Berksfile
![Page 27: QA to sous-Chef](https://reader034.fdocuments.in/reader034/viewer/2022052522/554a3322b4c90526578b552c/html5/thumbnails/27.jpg)
berks install
Demo - using berkshelf
~/.berkshelf/cookbooks/
![Page 28: QA to sous-Chef](https://reader034.fdocuments.in/reader034/viewer/2022052522/554a3322b4c90526578b552c/html5/thumbnails/28.jpg)
Demo - update Vagrantfileupdate Vagrantfile to use berkshelfvagrant reload
![Page 29: QA to sous-Chef](https://reader034.fdocuments.in/reader034/viewer/2022052522/554a3322b4c90526578b552c/html5/thumbnails/29.jpg)
Demo - Results
![Page 30: QA to sous-Chef](https://reader034.fdocuments.in/reader034/viewer/2022052522/554a3322b4c90526578b552c/html5/thumbnails/30.jpg)
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](https://reader034.fdocuments.in/reader034/viewer/2022052522/554a3322b4c90526578b552c/html5/thumbnails/31.jpg)
3 Important lessons learned while using chef
● RTFM● RTFM● RTFM
Lessons Learned
Questions?