Skip to content

Latest commit

 

History

History
1592 lines (963 loc) · 23.5 KB

File metadata and controls

1592 lines (963 loc) · 23.5 KB

slidenumbers: true

=======

[fit] Effective Devops:

[fit] Collaboration and Tools

Jennifer Davis & Katherine Daniels


Jennifer Davis

  • Automation Engineer, Chef
  • Co-author of "Effective Devops"
  • DevOpsDays SV Organizer
  • Sparkly Devops Princess
  • CoffeeOps Organizer

fit fit fit


Katherine Daniels

  • Web Operations Engineer, Etsy
  • Co-author of "Effective Devops"
  • DevopsDays NYC Organizer
  • Ladies Who Linux NYC Organizer
  • Ship Show Podcast Co-host

fit fit fit


Communication

#EffectiveDevops

^ J, K


Feedback

  • Constructive feedback
    • What did you find helpful?
    • What would you like to see more/less of?
    • Was there anything you found unclear?

^ K


Schedule

  • Introduction to teams, devops principles
  • 10:30-11am Morning Break
  • Visualization of work, Git, Infrastructure automation
  • 12:30-1:30pm Lunch

^ J


Schedule

  • Testing infrastucture automation and other changes
  • 3-3:30pm Afternoon Break
  • Measuring, monitoring, and wrap-up

^ J


Network Connectivity

Network Name: Conference_Private Access Code: velocity2015


Expectations

  • Safe space to share experiences, learn from each other
  • Code of Conduct
  • Learn effective workflows for using and testing source control and configuration management

^ K


Team Introductions

  • Meet your team!
  • Identify your team's...
  • Speaker
  • Gatekeeper
  • Notetaker

Time: 10 minutes

fit

^ K: Because of time, 2 minutes per speaker, gatekeeper should also time speaker


fit

^ J


What is Devops

  • Technical cultural weave that shapes how we work, and why

^ J,K


Folk Models

  • general popularly understood meaning particular to a socio-cultural grouping but which has not been formally defined or standardized.

^ K


Why Devops?

^ J,K


High Performing Devops Teams

are more agile

30X more frequent deployments

8000X faster lead times than peers

2014 PuppetLabs State of DevOps Survey

^ J


High Performing Devops Teams

are more reliable

2X change success rate

12X faster mean time to recovery (MTTR)

2014 PuppetLabs State of DevOps Survey

^ J


Five Pillars of Effective Devops

  • Collaboration
  • Hiring
  • Affinity
  • Tools
  • Scaling

^ K


Collaboration

  • Individuals Working Together

^ K


Hiring

  • Choosing Individuals

^ K


Affinity

  • From Individuals to Teams

^ K


Tools

  • Choosing and Using them

^ K


Scaling

  • Growing and Decreasing

^ K


Collaboration and Tools

^ J: Not enough time to cover all pillars. Not enough time to go into great depth which is why we are writing a book! We're going to focus on elements of collaboration and tools today. We'll be doing "Hiring and Tools" at Velocity NY.


Recognizing your Devops Narrative


The Devops Compact

  • shared mutual understanding
  • established boundaries

fit fit

^ J,K: Book example (bad first, then good)


Stormtrooper Syndrome

  • Agency
  • Adaptability: Role adherence

^ J


Learned Helplessness

^ K: When people are conditioned through environment that they have no control, will not act to change condition, example


A life becomes meaningful when one sees himself or herself as an actor within the context of a story.

-- George Howard

^ K: Work is meaningful when people see themselves as active participants. Sharing story is critical part of building resilience.


Swift Trust

  • Skillful self disclosure
  • What you share, how you share it
  • Collective tasks vs personal agendas

^ J


Team

  • Common purpose
  • Defined beliefs
  • Empowered

^ J


Small vs Large teams

  • Large teams - roles may be highly segregated
  • Small teams - one person may be responsible for many roles

^ K


Cultivating Empathy

  • Collect stories
  • Listen
  • Circle back

^ K: this is how you transform a group into a team


Smarter Teams Build Better Value1

  • Lots of Communication
  • Contribute equally to team's discussions
  • Theory of Mind
  • Increased diversity

^ J


Critical Habits for Teams

  • Code Review
  • Pairing

^ K


Code Review

  • Max 90 minutes in one setting

^ K


Pairing

  • Agile software development
  • 2 people work together on 1 workstation
  • Driver - writes code
  • Observer - reviews each line
  • Roles switch frequently

^ J


Types of Pairing

  • Expert-expert
  • Expert-novice
  • Novice-novice

^ J

^ When experts pair, work gets done quickly, new innovation not always obtained, depending on skill overlap because not questioning accepted standards of doing things.

^ When expert and novice pair, can be very good or very bad. if expert isn't patient and does all the typing, novice learns helplessness and slow to get anything done. if expert is patient can involve growth for both as novice helps expert to question standards.

^ When novices pair, can work together to learn and achieve more than a novice working on their own. If no understanding in pair, and fire-fighting schedules can lead to poor practices implemented into production higher technical debt.


Discussion: Team Intro

  • What are motivations?
  • What are current beliefs?
  • What are current skills? Gaps in skills? Time: 15 minutes

fit

^ J


Share: Team Intro

  • Team Name:
  • Common Motivations?
  • Skills? Gaps?

^ K


Fluxx

  • Game about change.
  • Rules change as you play.
  • Goal changes frequently.

^ J


Fluxx

  • Starts out with 1 Rule - Draw 1, Play 1
  • Find this card (white backing)
  • Place card in the middle of table

^ J


Fluxx

  • Shuffle deck
  • Deal 3 cards to each player

^ J


Fluxx

  • First player is the person to left of Dealer.
  • Start out following the Draw 1, Play 1 rule until overridden by new rules.

^ J


Fluxx

4 types of cards

  • Goal - pink
  • Keeper - green played in front of you
  • Action - blue used once and discarded
  • Rule - yellow

fit

^ J


Fluxx - On your turn

  • Draw the number of cards currently required.
  • Play the number of cards currently required.
  • Discard down to hand limit (if any hand limit).
  • Discard down to keeper limit (if any keeper limit).

^ J


Fluxx

  • Winner is the first to meet the current Goal condition.

Time: 15 minutes

fit

^ K


Retrospective

Change is inevitable.

^ K


Importance of Games

  • Build resilience
  • Build collaboration (or competition)
  • Roles change

^ J


Specific to Fluxx

  • Frustration of constant changing goals
  • Completed "work", lost value
  • Visualization of goals, everyone in alignment

^ J

^ THIS SHOULD BE JUST BEFORE THE FIRST BREAK AT 10:30


Visualization of Work

  • Bug/issue queue
  • Kanban

^ K


Kanban

  • Start with what you do now
  • Agree to incremental, evolutionary change
  • Respect
  • Everyone is a leader

^ K: Model what you're currently doing: how does work get done, what states do things get into, how do things get blocked ^ Everyone on the team is empowered to pull things, to suggest change, to create their stories


Kanban Practices

  • Visualize
  • Limit WIP
  • Manage flow
  • Make policies explicit
  • Implement feedback loops

^ K


Visualize

  • Intent
  • Alignment
  • Coherence

^ K (tie back to Fluxx)


Limit WIP

  • Pull (don't push)

^ K


Manage Flow

  • Monitor/measure/report
  • Incremental change

^ K


Make Policies Explicit

  • Document processes
  • Group signoff

^ K


Implement Feedback Loops

  • Collaboration
  • Retrospectives

^ K (tie back to fluxx)


Intro JoeNGo

^ J

^ The company has decided to implement a "JoeNGo" web site that will allow for individuals to find a local coffeeshop and meet up friends who have available time on an ad-hoc basis.

^ Your company currently uses LAMP stack for other applications. Your team needs to decide based on experience whether to extend off of current standards or introduce new technology into your stack.

^ You need to plan, implement, and deploy infrastructure code that will allow rapid iteration on the site while also incorporating visual assests from designers, feedback from marketing and sales, while monitoring the costs of the solution.


Application Deployment Planning

Deming Cycle

  • Plan: Identify and Analyze problem
  • Do: Develop and Test potential solution
  • Check: Measuring effectiveness
  • Act: Implement solution

^ J


Application Deployment Planning

  • (L)inux
  • (A)pache
  • (M)ySQL
  • (P)HP, Perl, or Python

^ J


Group Discussion

Time: 15 minutes

fit

^ J


Devops Tools

  • Establish local development environment
  • Version control
  • Manual -> Automation -> Continuous
  • Artifacts
  • Infrastructure
  • Sandbox
  • Test and Build
  • Monitoring

^ J


Local Development Environment (LDE)

  • Consistent set of tools across the team
  • Ability to quickly onboard new engineers

^ K


Provisioned Node - LDE

  • AWS instance node
  • Chef DK
  • Test Kitchen
  • Ruby
  • ChefSpec, ServerSpec
  • Git

^ K


Nodes

Countoff

http://bit.ly/1Fg9rxs

^ J


[fit] Configuration Management

  • Process of identifying, managing, monitoring, and auditing a product through its entire life including the processes, documentation, people, tools, software, and systems.

^ J


Version Control

  • Records changes to files or sets of files stored within the system
  • Enable revisions
  • Integrity checking
  • Collaboration

^ J


Artifact Repository

  • Secure
  • Trusted
  • Stable
  • Accessible
  • Versioned

^ K (artifactory, nexus, yum, package.io, rubbygems)


[fit] Introduction to Git and Workflows

^ K


Isolated Development Environments

  • Not automatically updated
  • Manually pull upstream commits

^ K


Workspace Environment

$ git init
$ git add .

adds all files and directories to version control

^ K


Commit

$ git commit -m "message about commit" -a

^ K


All these changes are local! How do you collaborate?

^ K


Show all remotes

$ git remote -v

^ K


Add remote server

$ git remote add NAME URL

^ K


Update changes to remote directory

$ git push REPONAME BRANCH

^ K


View the branches

$ git branch -a

^ K


Creating the branches

$ git checkout -b BRANCHNAME

^ K


Merging branches

$ git merge BRANCH

^ K


git fetch

  • import commits, from remote to local

git checkout master git log origin/master git merge origin/master

^ K


Different workflows

  • feature branch
  • gitflow
  • forking
  • centralized

^ K


Pull Requests

  • collaboration prior to integration
  • discussion
  • follow up commits
  • selfie gifs1

^ K


git pull

git pull REMOTE

^ K


git pull --rebase

  • ensure linear history by preventing unnecessary merge commits

^ K


git push remote branch

  • transfer commits from a local repo to a remote repo.
  • counterpart to git fetch

^ K


fit


Assignment 1

Effective Devops

http://bit.ly/1JVuLh4

Time: 15 minutes

fit

^ K


fit


Infrastructure

  • Aggregate of applications, configurations, access control, data, compute nodes, network, storage, processes, and people.

^ J


Infrastructure Automation

  • Systems that reduce the burden on people to manage services and increase the quality, accuracy and precision of a service to the consumers of a service

^ J


Infrastructure Automation Tools

  • Chef
  • Puppet
  • Ansible
  • Salt
  • CFEngine

^ J


Introduction to Chef

^ J, Baking Cookies


Resources

  • Ingredients of infrastructure
  • Basic building blocks

fit


Resource Declaration

RESOURCETYPE "RESOURCE_NAME" do
  PARAMETER PARAMETER_VALUE
end

Example Resource Type - package

A package to be installed:

package "httpd" do
  action :install
end

Example Resource Type - service

A service that should be started:

service "httpd" do
  supports :restart => :true
  action [:enable, :start]
end

Resources

A resource is a statement of policy that:

  • Describes the desired state for an element
  • Specifies a resource type---such as package, template, or service
  • Lists additional details (also known as parameters), as necessary
  • Are grouped into recipes

Recipes

  • Collection of ordered resources
  • Combination of ruby and Chef DSL

Cookbooks

  • Thematic
  • Collection of recipes and other supporting files

Roles

  • Abstraction describing function of system
  • Name
  • Description
  • Run list (ordered list of recipes and roles)

Run List

  • Ordered list of recipes and roles
  • Specific to a node

Nodes

  • Machine (virtual, physical, cloud server, or other device) that is managed by Chef

Environments

  • Abstraction models workflow
  • Name
  • Description
  • Cookbook version pinning

Supermarket

  • Community site with a number of cookbooks
  • Read before using in your environment

Chef DK

  • Chef development kit
  • Includes a number of utilities and software to facilitate cookbook creation
  • Free download off of the website

Berkshelf

  • Dependency management
  • Included with Chef DK

Test Kitchen

  • Included with Chef DK
  • Sandbox automation
  • Test harness

Test Kitchen

  • Execute code on one or more platforms
  • Driver plugins supporting various cloud and virtualization providers

.kitchen.yml

  • driver
  • provisioner
  • platforms
  • suites

.kitchen.yml driver

  • virtualization or cloud provider

Example: vagrant, docker


.kitchen.yml provisioner

  • application to configure the node

Example: chef_zero


.kitchen.yml platforms

  • target operating systems

Example: centos-6.5


.kitchen.yml suites

  • target configurations

Example:

 name:default
   run_list:
   - recipe[apache::default]
   attributes:

Kitchen commands (1/2)

  • kitchen init
  • kitchen list
  • kitchen create
  • kitchen converge

Kitchen commands (2/2)

  • kitchen verify
  • kitchen destroy
  • kitchen test

Docker

  • Images
  • Registries
  • Containers

fit


Assignment 2

Time: 20 minutes

fit

^ THIS SHOULD BE RIGHT BEFORE LUNCH ^ J


fit


Managing Risk

  • Test
  • Small frequent releases

Linting

  • Ensure code adheres to styles and conventions
  • Weave expectations into development
  • Encourages collaboration

Testing

  • Documenting objectives and intent
  • Measuring "done"

Code Correctness

  • foodcritic
  • rubocop

Integration Tests

  • ServerSpec

Rubocop


Rubocop Example

$ rubocop cookbooks/COOKBOOK1 cookbooks/COOKBOOK2 cookbooks/COOKBOOK4

Reading Rubocop Output

Inspecting 8 files
CWCWCCCC
  • . means that the file contains no issues
  • C means a issue with convention
  • W means a warning
  • E means an error
  • F means an fatal error

Disabling Rubocop cops

Any configuration in .rubocop.yml is disabled.

To disable string literals:

StringLiterals:
  Enabled: false

Foodcritic


Foodcritic Example

$ foodcritic cookbooks/setup

Reading Foodcritic Output

FC008: Generated cookbook metadata needs updating: ./metadata.rb:2

ServerSpec

  • Tests to verify servers functionality
  • Resource types
  • Package, service, user, and many others
  • Integrates with Test Kitchen
  • http://serverspec.org

ServerSpec Generic Form

describe "<subject>" do
  it "<description>" do
    expect(thing).to eq result
  end
end

ServerSpec Potential Tests

  • Is the service running?
  • Is the port accessible?
  • Is the expected content being served?

ServerSpec Example

describe 'apache' do
 it "is installed" do
   expect(package 'httpd').to be_installed
 end
 it "is running" do
   expect(service 'httpd').to be_running
 end
end

Reading ServerSpec Output

app::default
  httpd service is running

Finished in 0.26429 seconds (files took 0.7166 seconds to load)
1 example, 0 failures

fit


Assignment 3

Time: 10 minutes

fit


fit


Retrospective on Assignment 3

Time: 15 minutes

fit


fit


Assignment 4

Time: 20 minutes

fit

^ THIS WILL BE RIGHT BEFORE THE AFTERNOON BREAK


fit


Automated Test and Build


Test, Monitor, or Diagnostic2

  1. Where is it going to run?
  2. When is it going to run?
  3. How often will it run?
  4. Who is going to consume the result?
  5. What is the entity going to do with it?

^ J


[fit] Measuring Impact and Value of Change

^ K


Impact of Change


Impact on Availability

  • Overall site/app availability
  • Individual service availability

Availability Monitoring

  • Uptime:
  • Pingdom, Monitis, Uptrends, etc
  • Vertical Line Technology:
  • Availability after deploys/changes

fit


Eventinator


fit


Service Availability

  • Nagios: Service-level monitoring and alerting
  • Nagios-herald: Alert context
  • OpsWeekly: Historical alert data

Nagios


define command {
    command_name    check_mongodb_query
    command_line    $USER1$/nagios-plugin-mongodb/check_mongodb.py 
		    -H $HOSTADDRESS$ -A $ARG1$ -P $ARG2$ 
		    -W $ARG3$ -C $ARG4$ -q $ARG5$
}

define service {
    use                     generic-service
    hostgroup_name          Mongo Servers
    service_description     Mongo Connect Check
    check_command           check_mongodb!connect!27017!2!4
}

define servicedependency{
    host_name                       WWW1
    service_description             Apache Web Server
    dependent_host_name             WWW1
    dependent_service_description   Main Web Site
    execution_failure_criteria      n
    notification_failure_criteria   w,u,c
}

Nagios-herald


fit


OpsWeekly


fit


fit


fit


fit


Impact on Quality

  • Service quality (SLAs)
  • Visibility of quality

Statsd


>>> import statsd
>>>
>>> timer = statsd.Timer('MyApplication')
>>>
>>> timer.start()
>>> # do something here
>>> timer.stop('SomeTimer')

>>> import statsd
>>>
>>> counter = statsd.Counter('MyApplication')
>>> # do something here
>>> counter += 1

>>> import statsd
>>>
>>> average = statsd.Average('MyApplication', connection)
>>> # do something here
>>> average.send('SomeName', 'somekey:%d'.format(value))

Graphite


Value of Change


Value of Availability

  • Better for customers
  • Better for employees (internal services)
  • Fewer pages

Value of Quality

  • Deploys take less time
  • Also better for customers
  • More visibility into issues

fit


Assignment 5

Time: 20 minutes

fit


fit


[fit] Retrospective 🕟


Review

  • Recognizing your Devops Narrative
  • Application Deployment Planning
  • Infrastructure as code
  • Introducing repeatable, testable change
  • Measuring impact and value of change

^ Devops compact, Empathy, Learned Helplessness, Telling your story

^ Planning your application, Deming Cycle, don't just start solving things

^ Devops tools, including infrastructure as code

^ Testing

^ Monitoring, measuring impact and value of change


Next Steps

  • Manual, Automation to Continuous "X"
  • Be the storylistener and storyteller in your org
  • Effective Devops available in Early Release

Slides


[fit] Thank you! ❤️

fit


Further Resources

Footnotes

  1. Engel, David et al. 'Reading The Mind In The Eyes Or Reading Between The Lines? Theory Of Mind Predicts Collective Intelligence Equally Well Online And Face-To-Face'. PLoS ONE 9.12 (2014): e115212. Web. 26 May 2015. 2

  2. Lam, Yvonne. 'Sysadvent: Day 5 - How To Talk About Monitors, Tests, And Diagnostics'. Sysadvent.blogspot.com. N.p., 2014. Web. 26 May 2015.