using devops tools to achieve continuous integration
DESCRIPTION
Quick software release is a core business process at fast growing organizations. Yet, on many teams this important process is manual or semi-automated — an approach that's painful, risky, costly and time consuming. Using DevOps tools to implement Continuous Integration can dramatically improve your software delivery pipeline. Follow along with the webinar recording at http://youtu.be/u8PdgQvoSVo featuring @rgbkrk @rackninja from the Rackspace DevOps Automation Team and learn how to effectively deliver applications on API-driven infrastructure. Additional resources available at: http://www.rackspace.com/devops/ https://github.com/rackspace-cookbooks https://github.com/rackspace-cookbooks/contributing http://misheska.com/blog/2013/06/16/getting-started-writing-chef-cookbooks-the-berkshelf-way/ http://docs.ansible.com/intro_getting_started.html https://travis-ci.org/ http://travis-ci.com/TRANSCRIPT
Using DevOps Tools to Achieve Continuous Integration
2RACKSPACE® HOSTING | WWW.RACKSPACE.COM
Speakers
Kyle KelleyDeveloper Support Engineer
@rgbkrk
2
Ryan Richard, RHCADevOps Automation Team
Lead
@rackninja
3RACKSPACE® HOSTING | WWW.RACKSPACE.COM 3
First, a precursor
4RACKSPACE® 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
5RACKSPACE® HOSTING | WWW.RACKSPACE.COM
Keep Deploying!
•Let’s keep that product going
•Let’s keep delivering!
6RACKSPACE® HOSTING | WWW.RACKSPACE.COM
What can we do?
•Write tests
•Use Continuous Integration
•Use version control, particularly git
7RACKSPACE® HOSTING | WWW.RACKSPACE.COM
Let’s Test!
8RACKSPACE® HOSTING | WWW.RACKSPACE.COM
RACKSPACE® HOSTING | WWW.RACKSPACE.COM RACKSPACE® HOSTING | WWW.RACKSPACE.COM
10RACKSPACE® 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 12RACKSPACE® HOSTING | WWW.RACKSPACE.COM
13RACKSPACE® 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
14RACKSPACE® HOSTING | WWW.RACKSPACE.COM RACKSPACE® HOSTING | WWW.RACKSPACE.COM RACKSPACE® HOSTING | WWW.RACKSPACE.COM 17RACKSPACE® HOSTING | WWW.RACKSPACE.COM 17RACKSPACE® HOSTING | WWW.RACKSPACE.COM
15
Need more build power?
17RACKSPACE® HOSTING | WWW.RACKSPACE.COM 17
How the DevOps Automation Service tests our cookbooks
18RACKSPACE® 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 serverJenkins
Our CI pipeline for Chef cookbooks
CI serverJenkins
WorkflowRake
Our CI pipeline for Chef cookbooks
CI serverJenkins
WorkflowRake
Ruby Syntax/lint
Our CI pipeline for Chef cookbooks
CI serverJenkins
WorkflowRake
Ruby Syntax/lint
Chef Syntax/lintFoodcritic
Our CI pipeline for Chef cookbooks
CI serverJenkins
WorkflowRake
Ruby Syntax/lint
Chef Syntax/lintFoodcritic
Unit testChefspec
Our CI pipeline for Chef cookbooks
CI serverJenkins
WorkflowRake
Ruby Syntax/lint
Chef Syntax/lintFoodcritic
Unit testChefspec
Functional testsTest-kitchen + serverspec
Our CI pipeline for Chef cookbooks
CI serverJenkins
WorkflowRake
Ruby Syntax/lint
Chef Syntax/lintFoodcritic
Unit testChefspec
Functional testsTest-kitchen + serverspec
Thor
Human/automated
Post Steps
Final
26RACKSPACE® HOSTING | WWW.RACKSPACE.COM
Two modes of application delivery
Webhook Cookbook
Python MongoSupervisord
• Build an application cookbook that can deploy latest version of the application/artifact (chef specific)
27RACKSPACE® HOSTING | WWW.RACKSPACE.COM
Two modes of application delivery
Webhook Cookbook
Python MongoSupervisord
• 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 serverJenkins
WorkflowRake
Ruby Syntax/lint
Chef Syntax/lintFoodcritic
Unit testChefspec
Application Cookbook Workflow
CI serverJenkins
WorkflowRake
Ruby Syntax/lint
Chef Syntax/lintFoodcritic
Unit testChefspec
Functional testsTest-kitchen + serverspecDo not destroy instance
Application Cookbook Workflow
CI serverJenkins
WorkflowRake
Ruby Syntax/lint
Chef Syntax/lintFoodcritic
Unit testChefspec
Functional testsTest-kitchen + serverspecDo not destroy instance
Jenkins steps or additional jobs:Integration tests, load tests, user tests, etc
Human/automated
Post Steps
Final
Deployment Workflow Model
CI serverJenkins
Chef WorkflowTest-kitchen + serverspecDo not destroy instance
Deployment Workflow Model
CI serverJenkins
Chef WorkflowTest-kitchen + serverspecDo not destroy instance
Additional JobsDeployment workflow executed
Deployment Workflow Model
CI serverJenkins
Chef WorkflowTest-kitchen + serverspecDo not destroy instance
Additional JobsDeployment workflow executed
Integration tests, load tests, user tests, etc. Additional Jobs
Deployment Workflow Model
CI serverJenkins
Chef Workflow
FinalHuman/automated
Test-kitchen + serverspecDo not destroy instance
Additional JobsDeployment 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.COMRACKSPACE® 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