Using DevOps Tools to Achieve Continuous Integration
Speakers Kyle Kelley Developer Support Engineer @rgbkrk Ryan Richard, RHCA DevOps Automation Team Lead @rackninja RACKSPACE HOSTING WWW.RACKSPACE.COM 2 2
First, a precursor RACKSPACE HOSTING WWW.RACKSPACE.COM 3
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 RACKSPACE HOSTING WWW.RACKSPACE.COM 4
Keep Deploying! Let s keep that product going Let s keep delivering! RACKSPACE HOSTING WWW.RACKSPACE.COM 5
What can we do? Write tests Use Continuous Integration Use version control, particularly git RACKSPACE HOSTING WWW.RACKSPACE.COM 6
Let s Test! RACKSPACE HOSTING WWW.RACKSPACE.COM 7
RACKSPACE HOSTING WWW.RACKSPACE.COM 8
RACKSPACE HOSTING WWW.RACKSPACE.COM
Downtime Object Placeholder It s going to happen Assume failure Have a rollback strategy - for your application RACKSPACE HOSTING WWW.RACKSPACE.COM 10
Testing with Open Source Tools 11
RACKSPACE HOSTING WWW.RACKSPACE.COM 12
Minimal.travis.yml language: python python: 2.6 2.7 3.2 3.3 # install dependencies install: pip install. # run tests script: nosetests RACKSPACE HOSTING WWW.RACKSPACE.COM 13
RACKSPACE HOSTING WWW.RACKSPACE.COM RACKSPACE HOSTING WWW.RACKSPACE.COM 14 17
Need more build power? 15
How the DevOps Automation Service tests our cookbooks RACKSPACE HOSTING WWW.RACKSPACE.COM 17
Practical examples with Chef Our pipeline for testing cookbooks Testing your chef powered infrastructure RACKSPACE HOSTING WWW.RACKSPACE.COM 18
Our CI pipeline for Chef cookbooks Jenkins CI server
Our CI pipeline for Chef cookbooks Jenkins Rake CI server Workflow
Our CI pipeline for Chef cookbooks Jenkins Rake CI server Workflow Ruby Syntax/lint
Our CI pipeline for Chef cookbooks Jenkins Rake CI server Workflow Ruby Syntax/lint Foodcritic Chef Syntax/lint
Our CI pipeline for Chef cookbooks Jenkins Rake CI server Workflow Ruby Syntax/lint Foodcritic Chefspec Chef Syntax/lint Unit test
Our CI pipeline for Chef cookbooks Jenkins Rake CI server Workflow Ruby Syntax/lint Foodcritic Chefspec Test-kitchen + serverspec Chef Syntax/lint Unit test Functional tests
Our CI pipeline for Chef cookbooks Jenkins Rake CI server Workflow Ruby Syntax/lint Foodcritic Chefspec Test-kitchen + serverspec Thor Human/automated Chef Syntax/lint Unit test Functional tests Post Steps Final
Two modes of application delivery Build an application cookbook that can deploy latest version of the application/artifact (chef specific) Webhook Cookbook Python Supervisord Mongo RACKSPACE HOSTING WWW.RACKSPACE.COM 26
Two modes of application delivery Build an application cookbook that can deploy latest version of the application/artifact (chef specific) Webhook Cookbook Python Supervisord Mongo External workflow for application delivery (Capistrano, fabric, etc). RACKSPACE HOSTING WWW.RACKSPACE.COM 27
Application Cookbook Workflow Jenkins Rake CI server Workflow Ruby Syntax/lint Foodcritic Chefspec Chef Syntax/lint Unit test
Application Cookbook Workflow Jenkins Rake CI server Workflow Ruby Syntax/lint Foodcritic Chefspec Test-kitchen + serverspec Do not destroy instance Chef Syntax/lint Unit test Functional tests
Application Cookbook Workflow Jenkins Rake CI server Workflow Ruby Syntax/lint Foodcritic Chefspec Test-kitchen + serverspec Do not destroy instance Jenkins steps or additional jobs: Integration tests, load tests, user tests, etc Human/automated Chef Syntax/lint Unit test Functional tests Post Steps Final
Deployment Workflow Model Jenkins Test-kitchen + serverspec Do not destroy instance CI server Chef Workflow
Deployment Workflow Model Jenkins Test-kitchen + serverspec Do not destroy instance Deployment workflow executed CI server Chef Workflow Additional Jobs
Deployment Workflow Model Jenkins Test-kitchen + serverspec Do not destroy instance Deployment workflow executed Integration tests, load tests, user tests, etc. CI server Chef Workflow Additional Jobs Additional Jobs
Deployment Workflow Model Jenkins Test-kitchen + serverspec Do not destroy instance Deployment workflow executed Integration tests, load tests, user tests, etc. Human/automated CI server Chef Workflow Additional Jobs Additional Jobs Final
THANK YOU 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