using devops tools to achieve continuous...

35
Using DevOps Tools to Achieve Continuous Integration

Upload: vothu

Post on 09-Mar-2018

224 views

Category:

Documents


4 download

TRANSCRIPT

Page 1: Using DevOps Tools to Achieve Continuous Integrationddf912383141a8d7bbe4-e053e711fc85de3290f121ef0f0e3a1f.r87.cf1... · Jenkins CI server Rake Workflow Ruby Syntax/lint Foodcritic

Using DevOps Tools to Achieve Continuous Integration

Page 2: Using DevOps Tools to Achieve Continuous Integrationddf912383141a8d7bbe4-e053e711fc85de3290f121ef0f0e3a1f.r87.cf1... · Jenkins CI server Rake Workflow Ruby Syntax/lint Foodcritic

2 RACKSPACE® HOSTING | WWW.RACKSPACE.COM

Speakers

Kyle Kelley Developer Support Engineer

@rgbkrk

2

Ryan Richard, RHCA DevOps Automation Team Lead

@rackninja

Page 3: Using DevOps Tools to Achieve Continuous Integrationddf912383141a8d7bbe4-e053e711fc85de3290f121ef0f0e3a1f.r87.cf1... · Jenkins CI server Rake Workflow Ruby Syntax/lint Foodcritic

3 RACKSPACE® HOSTING | WWW.RACKSPACE.COM 3

First, a precursor

Page 4: Using DevOps Tools to Achieve Continuous Integrationddf912383141a8d7bbe4-e053e711fc85de3290f121ef0f0e3a1f.r87.cf1... · Jenkins CI server Rake Workflow Ruby Syntax/lint Foodcritic

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

Page 5: Using DevOps Tools to Achieve Continuous Integrationddf912383141a8d7bbe4-e053e711fc85de3290f121ef0f0e3a1f.r87.cf1... · Jenkins CI server Rake Workflow Ruby Syntax/lint Foodcritic

5 RACKSPACE® HOSTING | WWW.RACKSPACE.COM

Keep Deploying!

• Let’s keep that product going • Let’s keep delivering!

Page 6: Using DevOps Tools to Achieve Continuous Integrationddf912383141a8d7bbe4-e053e711fc85de3290f121ef0f0e3a1f.r87.cf1... · Jenkins CI server Rake Workflow Ruby Syntax/lint Foodcritic

6 RACKSPACE® HOSTING | WWW.RACKSPACE.COM

What can we do?

• Write tests • Use Continuous Integration • Use version control, particularly git

Page 7: Using DevOps Tools to Achieve Continuous Integrationddf912383141a8d7bbe4-e053e711fc85de3290f121ef0f0e3a1f.r87.cf1... · Jenkins CI server Rake Workflow Ruby Syntax/lint Foodcritic

7 RACKSPACE® HOSTING | WWW.RACKSPACE.COM

Let’s Test!

Page 8: Using DevOps Tools to Achieve Continuous Integrationddf912383141a8d7bbe4-e053e711fc85de3290f121ef0f0e3a1f.r87.cf1... · Jenkins CI server Rake Workflow Ruby Syntax/lint Foodcritic

8 RACKSPACE® HOSTING | WWW.RACKSPACE.COM

Page 9: Using DevOps Tools to Achieve Continuous Integrationddf912383141a8d7bbe4-e053e711fc85de3290f121ef0f0e3a1f.r87.cf1... · Jenkins CI server Rake Workflow Ruby Syntax/lint Foodcritic

RACKSPACE® HOSTING | WWW.RACKSPACE.COM RACKSPACE® HOSTING | WWW.RACKSPACE.COM

Page 10: Using DevOps Tools to Achieve Continuous Integrationddf912383141a8d7bbe4-e053e711fc85de3290f121ef0f0e3a1f.r87.cf1... · Jenkins CI server Rake Workflow Ruby Syntax/lint Foodcritic

10 RACKSPACE® HOSTING | WWW.RACKSPACE.COM

Object Placeholder

Downtime

• It’s going to happen • Assume failure • Have a rollback strategy - for your application

Page 11: Using DevOps Tools to Achieve Continuous Integrationddf912383141a8d7bbe4-e053e711fc85de3290f121ef0f0e3a1f.r87.cf1... · Jenkins CI server Rake Workflow Ruby Syntax/lint Foodcritic

11

Testing with Open Source Tools

Page 12: Using DevOps Tools to Achieve Continuous Integrationddf912383141a8d7bbe4-e053e711fc85de3290f121ef0f0e3a1f.r87.cf1... · Jenkins CI server Rake Workflow Ruby Syntax/lint Foodcritic

RACKSPACE® HOSTING | WWW.RACKSPACE.COM RACKSPACE® HOSTING | WWW.RACKSPACE.COM 12 RACKSPACE® HOSTING | WWW.RACKSPACE.COM

Page 13: Using DevOps Tools to Achieve Continuous Integrationddf912383141a8d7bbe4-e053e711fc85de3290f121ef0f0e3a1f.r87.cf1... · Jenkins CI server Rake Workflow Ruby Syntax/lint Foodcritic

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  

Page 14: Using DevOps Tools to Achieve Continuous Integrationddf912383141a8d7bbe4-e053e711fc85de3290f121ef0f0e3a1f.r87.cf1... · Jenkins CI server Rake Workflow Ruby Syntax/lint Foodcritic

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

Page 15: Using DevOps Tools to Achieve Continuous Integrationddf912383141a8d7bbe4-e053e711fc85de3290f121ef0f0e3a1f.r87.cf1... · Jenkins CI server Rake Workflow Ruby Syntax/lint Foodcritic

15

Need more build power?

Page 16: Using DevOps Tools to Achieve Continuous Integrationddf912383141a8d7bbe4-e053e711fc85de3290f121ef0f0e3a1f.r87.cf1... · Jenkins CI server Rake Workflow Ruby Syntax/lint Foodcritic
Page 17: Using DevOps Tools to Achieve Continuous Integrationddf912383141a8d7bbe4-e053e711fc85de3290f121ef0f0e3a1f.r87.cf1... · Jenkins CI server Rake Workflow Ruby Syntax/lint Foodcritic

17 RACKSPACE® HOSTING | WWW.RACKSPACE.COM 17

How the DevOps Automation Service tests our cookbooks

Page 18: Using DevOps Tools to Achieve Continuous Integrationddf912383141a8d7bbe4-e053e711fc85de3290f121ef0f0e3a1f.r87.cf1... · Jenkins CI server Rake Workflow Ruby Syntax/lint Foodcritic

18 RACKSPACE® HOSTING | WWW.RACKSPACE.COM

Practical examples with Chef

• Our pipeline for testing cookbooks

• Testing your chef powered infrastructure

Page 19: Using DevOps Tools to Achieve Continuous Integrationddf912383141a8d7bbe4-e053e711fc85de3290f121ef0f0e3a1f.r87.cf1... · Jenkins CI server Rake Workflow Ruby Syntax/lint Foodcritic

Our CI pipeline for Chef cookbooks

CI server Jenkins

Page 20: Using DevOps Tools to Achieve Continuous Integrationddf912383141a8d7bbe4-e053e711fc85de3290f121ef0f0e3a1f.r87.cf1... · Jenkins CI server Rake Workflow Ruby Syntax/lint Foodcritic

Our CI pipeline for Chef cookbooks

CI server Jenkins

Workflow Rake

Page 21: Using DevOps Tools to Achieve Continuous Integrationddf912383141a8d7bbe4-e053e711fc85de3290f121ef0f0e3a1f.r87.cf1... · Jenkins CI server Rake Workflow Ruby Syntax/lint Foodcritic

Our CI pipeline for Chef cookbooks

CI server Jenkins

Workflow Rake

Ruby Syntax/lint

Page 22: Using DevOps Tools to Achieve Continuous Integrationddf912383141a8d7bbe4-e053e711fc85de3290f121ef0f0e3a1f.r87.cf1... · Jenkins CI server Rake Workflow Ruby Syntax/lint Foodcritic

Our CI pipeline for Chef cookbooks

CI server Jenkins

Workflow Rake

Ruby Syntax/lint

Chef Syntax/lint Foodcritic

Page 23: Using DevOps Tools to Achieve Continuous Integrationddf912383141a8d7bbe4-e053e711fc85de3290f121ef0f0e3a1f.r87.cf1... · Jenkins CI server Rake Workflow Ruby Syntax/lint Foodcritic

Our CI pipeline for Chef cookbooks

CI server Jenkins

Workflow Rake

Ruby Syntax/lint

Chef Syntax/lint Foodcritic Unit test Chefspec

Page 24: Using DevOps Tools to Achieve Continuous Integrationddf912383141a8d7bbe4-e053e711fc85de3290f121ef0f0e3a1f.r87.cf1... · Jenkins CI server Rake Workflow Ruby Syntax/lint Foodcritic

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

Page 25: Using DevOps Tools to Achieve Continuous Integrationddf912383141a8d7bbe4-e053e711fc85de3290f121ef0f0e3a1f.r87.cf1... · Jenkins CI server Rake Workflow Ruby Syntax/lint Foodcritic

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

Page 26: Using DevOps Tools to Achieve Continuous Integrationddf912383141a8d7bbe4-e053e711fc85de3290f121ef0f0e3a1f.r87.cf1... · Jenkins CI server Rake Workflow Ruby Syntax/lint Foodcritic

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)

Page 27: Using DevOps Tools to Achieve Continuous Integrationddf912383141a8d7bbe4-e053e711fc85de3290f121ef0f0e3a1f.r87.cf1... · Jenkins CI server Rake Workflow Ruby Syntax/lint Foodcritic

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).

Page 28: Using DevOps Tools to Achieve Continuous Integrationddf912383141a8d7bbe4-e053e711fc85de3290f121ef0f0e3a1f.r87.cf1... · Jenkins CI server Rake Workflow Ruby Syntax/lint Foodcritic

Application Cookbook Workflow

CI server Jenkins

Workflow Rake

Ruby Syntax/lint

Chef Syntax/lint Foodcritic Unit test Chefspec

Page 29: Using DevOps Tools to Achieve Continuous Integrationddf912383141a8d7bbe4-e053e711fc85de3290f121ef0f0e3a1f.r87.cf1... · Jenkins CI server Rake Workflow Ruby Syntax/lint Foodcritic

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

Page 30: Using DevOps Tools to Achieve Continuous Integrationddf912383141a8d7bbe4-e053e711fc85de3290f121ef0f0e3a1f.r87.cf1... · Jenkins CI server Rake Workflow Ruby Syntax/lint Foodcritic

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

Page 31: Using DevOps Tools to Achieve Continuous Integrationddf912383141a8d7bbe4-e053e711fc85de3290f121ef0f0e3a1f.r87.cf1... · Jenkins CI server Rake Workflow Ruby Syntax/lint Foodcritic

Deployment Workflow Model

CI server Jenkins

Chef Workflow Test-kitchen + serverspec Do not destroy instance

Page 32: Using DevOps Tools to Achieve Continuous Integrationddf912383141a8d7bbe4-e053e711fc85de3290f121ef0f0e3a1f.r87.cf1... · Jenkins CI server Rake Workflow Ruby Syntax/lint Foodcritic

Deployment Workflow Model

CI server Jenkins

Chef Workflow Test-kitchen + serverspec Do not destroy instance

Additional Jobs Deployment workflow executed

Page 33: Using DevOps Tools to Achieve Continuous Integrationddf912383141a8d7bbe4-e053e711fc85de3290f121ef0f0e3a1f.r87.cf1... · Jenkins CI server Rake Workflow Ruby Syntax/lint Foodcritic

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

Page 34: Using DevOps Tools to Achieve Continuous Integrationddf912383141a8d7bbe4-e053e711fc85de3290f121ef0f0e3a1f.r87.cf1... · Jenkins CI server Rake Workflow Ruby Syntax/lint Foodcritic

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

Page 35: Using DevOps Tools to Achieve Continuous Integrationddf912383141a8d7bbe4-e053e711fc85de3290f121ef0f0e3a1f.r87.cf1... · Jenkins CI server Rake Workflow Ruby Syntax/lint Foodcritic

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