Slide 1

Slide 1 text

Continuous Deployment to Build Trust CHRIS WELDON SENIOR CONSULTANT IMPROVING ENTERPRISES

Slide 2

Slide 2 text

Chris Weldon u  Senior Consultant u  Microsoft MVP u  Slings Code in C# and PHP u  Systems Administrator devops u  [email protected] u  @neraath

Slide 3

Slide 3 text

And now for something completely different

Slide 4

Slide 4 text

As a conference presenter, I would like a web site with upcoming conferences, so I can stay in-the-know on the conference circuit.

Slide 5

Slide 5 text

As a conference presenter, I would like to see a list of upcoming conferences, so that I know what to submit presentations for.

Slide 6

Slide 6 text

Our Journey Current Continuous Deployments

Slide 7

Slide 7 text

In Business

Slide 8

Slide 8 text

We Develop Software

Slide 9

Slide 9 text

When developing software…

Slide 10

Slide 10 text

We often try as a team…

Slide 11

Slide 11 text

But are often racing the clock…

Slide 12

Slide 12 text

So we rush Apps to Production.

Slide 13

Slide 13 text

This cycle repeats and we make Frequent Changes to Production.

Slide 14

Slide 14 text

And Our Apps Repeatedly Break

Slide 15

Slide 15 text

When stuff breaks… The business gets mad!

Slide 16

Slide 16 text

They start to see us as “rogues”

Slide 17

Slide 17 text

And institute gates to stop this “bad” activity

Slide 18

Slide 18 text

Gates are typically nothing more than

Slide 19

Slide 19 text

Why?

Slide 20

Slide 20 text

It’s about Trust.

Slide 21

Slide 21 text

How do we rebuild trust?

Slide 22

Slide 22 text

Back to basics.

Slide 23

Slide 23 text

We write software to support the business.

Slide 24

Slide 24 text

Or software is the business.

Slide 25

Slide 25 text

We need to adapt to changes in business needs.

Slide 26

Slide 26 text

We need to (rapidly) fix bugs.

Slide 27

Slide 27 text

We properly test first.

Slide 28

Slide 28 text

In order to maintain stability…

Slide 29

Slide 29 text

…we should have slow, continuous evolution of features.

Slide 30

Slide 30 text

So how do we support these goals?

Slide 31

Slide 31 text

Strive for technical excellence!

Slide 32

Slide 32 text

Remember to test!

Slide 33

Slide 33 text

We should constantly integrate all changes back into mainline.

Slide 34

Slide 34 text

requent Deployments Amount of Change Inf F

Slide 35

Slide 35 text

Automate Deployments

Slide 36

Slide 36 text

Our Journey Current Continuous Deployments Automation

Slide 37

Slide 37 text

Technical Excellence

Slide 38

Slide 38 text

Let’s talk about your databases…

Slide 39

Slide 39 text

As a conference organizer, I would like conferences I create to persist beyond my session so that other users can see upcoming conferences.

Slide 40

Slide 40 text

Is your DBA’s idea of SQL Management pitching him a SQL script to run?

Slide 41

Slide 41 text

That’s not automation.

Slide 42

Slide 42 text

Solution: Migrations u  Entity Framework Code-First Migrations u  Migrator.NET u  RoundhousE u  And many more…

Slide 43

Slide 43 text

Migrations Demo Demo

Slide 44

Slide 44 text

Configuration Management

Slide 45

Slide 45 text

As a systems administrator, I would like enable caching of conferences from the database so that we can minimize the impact of querying the database.

Slide 46

Slide 46 text

Scenario: Multiple web applications u  CritterMatch Core Business Libraries (CMCBL) u  CritterMatch.com depends on: u  log4net v1.0.6 u  Entity Framework v4 u  ASP.Net Web API v1.0.0 u  CMCBL v1.0.0 u  CritterMatch Business Services depends on: u  log4net v1.2.1 u  Entity Framework v5 u  ASP.Net Web API v1.2.2 u  CMCBL v1.1.0

Slide 47

Slide 47 text

NuGet

Slide 48

Slide 48 text

Scenario: Multiple web applications u  CritterMatch.com u  Developer Workstations u  Integration/QA u  Staging u  Production u  CritterMatch Business Services u  Developer Workstations u  Integration/QA u  Production – Client A u  Production – Client B

Slide 49

Slide 49 text

Configuration Management u  Configurations likely to change: u  Database Connection Strings u  Web Service Connection Endpoints u  Authorized Users? u  Requirements Management u  Different views or behaviors u  Dependency Injection? u  Often times a configuration change, too.

Slide 50

Slide 50 text

Configuration Management Strategies

Slide 51

Slide 51 text

Logging and Monitoring Strategies

Slide 52

Slide 52 text

Better Know a Framework

Slide 53

Slide 53 text

Monitor all teh things! u PIC: Dashboard rather than text u CPU, Memory, Disk I/O, Network I/O u Active Users, Requests per Second, Database Queries per Second u # of 200, 300, 400, 500-level requests per second u Heuristics

Slide 54

Slide 54 text

PIC: Alarm

Slide 55

Slide 55 text

PIC: Scaling

Slide 56

Slide 56 text

PIC: False Positive

Slide 57

Slide 57 text

Making Logging Useful to Ops & Engineering u  Ops needs to know: u  Network connection problems u  Load problems u  Service/dependency outages u  Consider surfacing events to event log for ops, leaving log files to devs u  Engineering needs to know: u  Everything that ops needs to know u  Performance

Slide 58

Slide 58 text

Debug is never for production u  Not constantly, that is. u  If you are trying to debug the production database query, you’re doing it wrong. u  If you are trying to figure out the object model being sent to the view, you’re doing it wrong. u  If you are trying to debug the workflow of your application, you’re doing it wrong. u  The highest level of constant production logging should be INFO. u  Info serves for interactions between customers and your site. u  Info surfaces information customers have requested, but never the interactions of your code.

Slide 59

Slide 59 text

Exception Management u  Don’t always surface exceptions to your Event Log if Ops is monitoring u  Boy Who Cried Wolf u  Be meticulous about which exceptions are surfaced out of your application u  Exceptions are expensive

Slide 60

Slide 60 text

Demo

Slide 61

Slide 61 text

Deployment Techniques

Slide 62

Slide 62 text

Continuous Deployment = Release to Production After Every Commit?

Slide 63

Slide 63 text

We don’t want to be rogues…

Slide 64

Slide 64 text

Release Management u  How to manage multiple environments? u  Builds for Each Environment u  Versioning

Slide 65

Slide 65 text

devops u  The collaboration, communication, and integration between developers and operations to reduce the friction of getting software releases into production.

Slide 66

Slide 66 text

Production Push/Pull

Slide 67

Slide 67 text

CI Push

Slide 68

Slide 68 text

But how do we establish trust?

Slide 69

Slide 69 text

Our Journey Current Continuous Deployments Automation Testability

Slide 70

Slide 70 text

Unit Tests?

Slide 71

Slide 71 text

What about your UI?

Slide 72

Slide 72 text

What about dependency or component failure?

Slide 73

Slide 73 text

No content

Slide 74

Slide 74 text

Smoke Tests!

Slide 75

Slide 75 text

Behavioral/Acceptance Tests

Slide 76

Slide 76 text

Still having trust issues?

Slide 77

Slide 77 text

Our Journey Current Continuous Deployments Automation Testability Manageable

Slide 78

Slide 78 text

Gated deployments

Slide 79

Slide 79 text

Rollback Techniques

Slide 80

Slide 80 text

Let’s see it!

Slide 81

Slide 81 text

Test labs

Slide 82

Slide 82 text

Behavior Driven Infrastructure

Slide 83

Slide 83 text

Our Journey Current Continuous Deployments Automation Testability Manageable

Slide 84

Slide 84 text

Recap

Slide 85

Slide 85 text

Q&A

Slide 86

Slide 86 text

Ratings, Please! http://spkr8.com/neraath