using devops tools to achieve continuous...
TRANSCRIPT
Using DevOps Tools to Achieve Continuous Integration
2 RACKSPACE® HOSTING | WWW.RACKSPACE.COM
Speakers
Kyle Kelley Developer Support Engineer
@rgbkrk
2
Ryan Richard, RHCA DevOps Automation Team Lead
@rackninja
3 RACKSPACE® HOSTING | WWW.RACKSPACE.COM 3
First, a precursor
4 RACKSPACE® HOSTING | WWW.RACKSPACE.COM
Why are we here?
• We are all building up similar systems • Similar configurations, minor tweaks • Want:
• More time for applications and business • Less time doing SysOps
5 RACKSPACE® HOSTING | WWW.RACKSPACE.COM
Keep Deploying!
• Let’s keep that product going • Let’s keep delivering!
6 RACKSPACE® HOSTING | WWW.RACKSPACE.COM
What can we do?
• Write tests • Use Continuous Integration • Use version control, particularly git
7 RACKSPACE® HOSTING | WWW.RACKSPACE.COM
Let’s Test!
8 RACKSPACE® HOSTING | WWW.RACKSPACE.COM
RACKSPACE® HOSTING | WWW.RACKSPACE.COM RACKSPACE® HOSTING | WWW.RACKSPACE.COM
10 RACKSPACE® HOSTING | WWW.RACKSPACE.COM
Object Placeholder
Downtime
• It’s going to happen • Assume failure • Have a rollback strategy - for your application
11
Testing with Open Source Tools
RACKSPACE® HOSTING | WWW.RACKSPACE.COM RACKSPACE® HOSTING | WWW.RACKSPACE.COM 12 RACKSPACE® HOSTING | WWW.RACKSPACE.COM
13 RACKSPACE® HOSTING | WWW.RACKSPACE.COM RACKSPACE® HOSTING | WWW.RACKSPACE.COM RACKSPACE® HOSTING | WWW.RACKSPACE.COM
Minimal .travis.yml
language: python python: – “2.6” – “2.7” – “3.2” – “3.3” # install dependencies install: “pip install .” # run tests script: nosetests
14 RACKSPACE® HOSTING | WWW.RACKSPACE.COM RACKSPACE® HOSTING | WWW.RACKSPACE.COM RACKSPACE® HOSTING | WWW.RACKSPACE.COM 17 RACKSPACE® HOSTING | WWW.RACKSPACE.COM 17 RACKSPACE® HOSTING | WWW.RACKSPACE.COM
15
Need more build power?
17 RACKSPACE® HOSTING | WWW.RACKSPACE.COM 17
How the DevOps Automation Service tests our cookbooks
18 RACKSPACE® HOSTING | WWW.RACKSPACE.COM
Practical examples with Chef
• Our pipeline for testing cookbooks
• Testing your chef powered infrastructure
Our CI pipeline for Chef cookbooks
CI server Jenkins
Our CI pipeline for Chef cookbooks
CI server Jenkins
Workflow Rake
Our CI pipeline for Chef cookbooks
CI server Jenkins
Workflow Rake
Ruby Syntax/lint
Our CI pipeline for Chef cookbooks
CI server Jenkins
Workflow Rake
Ruby Syntax/lint
Chef Syntax/lint Foodcritic
Our CI pipeline for Chef cookbooks
CI server Jenkins
Workflow Rake
Ruby Syntax/lint
Chef Syntax/lint Foodcritic Unit test Chefspec
Our CI pipeline for Chef cookbooks
CI server Jenkins
Workflow Rake
Ruby Syntax/lint
Chef Syntax/lint Foodcritic Unit test Chefspec
Functional tests Test-kitchen + serverspec
Our CI pipeline for Chef cookbooks
CI server Jenkins
Workflow Rake
Ruby Syntax/lint
Chef Syntax/lint Foodcritic Unit test Chefspec
Functional tests Test-kitchen + serverspec
Thor
Human/automated
Post Steps
Final
26 RACKSPACE® HOSTING | WWW.RACKSPACE.COM
Two modes of application delivery
Webhook Cookbook
Python Mongo Supervisord
• Build an application cookbook that can deploy latest version of the application/artifact (chef specific)
27 RACKSPACE® HOSTING | WWW.RACKSPACE.COM
Two modes of application delivery
Webhook Cookbook
Python Mongo Supervisord
• Build an application cookbook that can deploy latest version of the application/artifact (chef specific)
• External workflow for application delivery • (Capistrano, fabric, etc).
Application Cookbook Workflow
CI server Jenkins
Workflow Rake
Ruby Syntax/lint
Chef Syntax/lint Foodcritic Unit test Chefspec
Application Cookbook Workflow
CI server Jenkins
Workflow Rake
Ruby Syntax/lint
Chef Syntax/lint Foodcritic Unit test Chefspec
Functional tests Test-kitchen + serverspec Do not destroy instance
Application Cookbook Workflow
CI server Jenkins
Workflow Rake
Ruby Syntax/lint
Chef Syntax/lint Foodcritic Unit test Chefspec
Functional tests Test-kitchen + serverspec Do not destroy instance
Jenkins steps or additional jobs: Integration tests, load tests, user tests, etc
Human/automated
Post Steps
Final
Deployment Workflow Model
CI server Jenkins
Chef Workflow Test-kitchen + serverspec Do not destroy instance
Deployment Workflow Model
CI server Jenkins
Chef Workflow Test-kitchen + serverspec Do not destroy instance
Additional Jobs Deployment workflow executed
Deployment Workflow Model
CI server Jenkins
Chef Workflow Test-kitchen + serverspec Do not destroy instance
Additional Jobs Deployment workflow executed
Integration tests, load tests, user tests, etc. Additional Jobs
Deployment Workflow Model
CI server Jenkins
Chef Workflow
Final Human/automated
Test-kitchen + serverspec Do not destroy instance
Additional Jobs Deployment workflow executed
Integration tests, load tests, user tests, etc. Additional Jobs
RACKSPACE® HOSTING | 1 FANATICAL PLACE | SAN ANTONIO, TX 78218 US SALES: 1-800-961-2888 | US SUPPORT: 1-800-961-4454 | WWW.RACKSPACE.COM
RACKSPACE® HOSTING | © RACKSPACE US, INC. | RACKSPACE® AND FANATICAL SUPPORT® ARE SERVICE MARKS OF RACKSPACE US, INC. REGISTERED IN THE UNITED STATES AND OTHER COUNTRIES. | WWW.RACKSPACE.COM RACKSPACE® HOSTING | © RACKSPACE US, INC. | RACKSPACE® AND FANATICAL SUPPORT® ARE SERVICE MARKS OF RACKSPACE US, INC. REGISTERED IN THE UNITED STATES AND OTHER COUNTRIES. | WWW.RACKSPACE.COM
THANK YOU