continuous delivery & machine learning · confidential software deployment success is…....

51
Continuous Delivery & Machine Learning Oliver Rees harness.io harness

Upload: others

Post on 26-May-2020

6 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Continuous Delivery & Machine Learning · Confidential Software Deployment Success is…. “Application is up so everything is fine” “Homepage Works” “Not seeing any alerts”

Continuous Delivery &

Machine Learning

Oliver Reesharness.ioharness

Page 2: Continuous Delivery & Machine Learning · Confidential Software Deployment Success is…. “Application is up so everything is fine” “Homepage Works” “Not seeing any alerts”

Who am I?

Senior Sales Engineer

Lead Systems Engineer

Operations

Developer

Page 3: Continuous Delivery & Machine Learning · Confidential Software Deployment Success is…. “Application is up so everything is fine” “Homepage Works” “Not seeing any alerts”
Page 4: Continuous Delivery & Machine Learning · Confidential Software Deployment Success is…. “Application is up so everything is fine” “Homepage Works” “Not seeing any alerts”

Copyright © Harness 2018 Confidential 4

100,000 Components & 100s Engineers

99.9% assembled correctly =100 POF’s

Page 5: Continuous Delivery & Machine Learning · Confidential Software Deployment Success is…. “Application is up so everything is fine” “Homepage Works” “Not seeing any alerts”

Brand Recognition & Revenue

Win Races

Fast & Reliable Car (3 engines per season)

Ideas & Innovation

Continuous Delivery & Time-To-Market

Copyright © Harness 2018 Confidential 5

What is Winning in Formula 1?

Page 6: Continuous Delivery & Machine Learning · Confidential Software Deployment Success is…. “Application is up so everything is fine” “Homepage Works” “Not seeing any alerts”

Copyright © Harness 2018 Confidential 6

Chief Engineer

Change is Constant

50+ New Parts Per Race

Page 7: Continuous Delivery & Machine Learning · Confidential Software Deployment Success is…. “Application is up so everything is fine” “Homepage Works” “Not seeing any alerts”

Copyright © Harness 2018 Confidential 7

Formula 1 Deployment Pipeline

Idea Driver

Verify

Automated

Test

Automated

Build

Semi-Automated

Rollback

Automated

Deploy

Automated

NewPart Mins MinsDays Mins

Wind Tunnel

Simulator

Data Science

CAD

3D Printing

Telemetry

Data Science

Page 8: Continuous Delivery & Machine Learning · Confidential Software Deployment Success is…. “Application is up so everything is fine” “Homepage Works” “Not seeing any alerts”

Copyright © Harness 2018 Confidential 8

Software Deployment Pipeline

CodeCustomer

Verify

Manual

Test

Kinda-Automated

Build

Automated

Rollback

Manual

#WTF

Deploy

Manual

Custom

Scripts

Custom

Scripts

Custom

Scripts

HoursMins Hours/DaysChange

Page 9: Continuous Delivery & Machine Learning · Confidential Software Deployment Success is…. “Application is up so everything is fine” “Homepage Works” “Not seeing any alerts”

F1 Teams Know the Exact Impact of Every Part/Change

“Increased downforce by 2 points”

“That new front wing is worth 2 tenths”

Verification & Impact is How Teams Win Races

Cars will be ~2 seconds faster by end of season

Copyright © Harness 2018 Confidential 9

One BIG Difference (vs. Software Delivery)

Page 10: Continuous Delivery & Machine Learning · Confidential Software Deployment Success is…. “Application is up so everything is fine” “Homepage Works” “Not seeing any alerts”

Copyright © Harness 2018 Confidential 10

Testing & Verification is Critical

Page 11: Continuous Delivery & Machine Learning · Confidential Software Deployment Success is…. “Application is up so everything is fine” “Homepage Works” “Not seeing any alerts”

Copyright © Harness 2018 Confidential 11

Measuring Impact is Also Critical

Page 12: Continuous Delivery & Machine Learning · Confidential Software Deployment Success is…. “Application is up so everything is fine” “Homepage Works” “Not seeing any alerts”

100,000+ Components, 100s Sensors

TBs of Metrics & Logs over a race weekend

Automation, Context & Feedback is King

Data Science, ML & Modeling

Insight in Minutes vs. Hours or Days

Copyright © Harness 2018 Confidential 12

Telemetry From a Formula 1 Car

Page 13: Continuous Delivery & Machine Learning · Confidential Software Deployment Success is…. “Application is up so everything is fine” “Homepage Works” “Not seeing any alerts”

Copyright © Harness 2018 Confidential 13

Automated Verification

New

Baseline

Page 14: Continuous Delivery & Machine Learning · Confidential Software Deployment Success is…. “Application is up so everything is fine” “Homepage Works” “Not seeing any alerts”

Confidential

Software Deployment Success is….

“Application is up so everything is

fine”

“HomepageWorks”

“Not seeing any alerts”

“No-one has complained yet”

Page 15: Continuous Delivery & Machine Learning · Confidential Software Deployment Success is…. “Application is up so everything is fine” “Homepage Works” “Not seeing any alerts”

Copyright © Harness 2018 Confidential 16

Deploying & Verifying Apps…

Page 16: Continuous Delivery & Machine Learning · Confidential Software Deployment Success is…. “Application is up so everything is fine” “Homepage Works” “Not seeing any alerts”

Copyright © Harness 2018 Confidential 17

Deploying & Verifying Apps…

Page 17: Continuous Delivery & Machine Learning · Confidential Software Deployment Success is…. “Application is up so everything is fine” “Homepage Works” “Not seeing any alerts”

Copyright © Harness 2019 Confidential 18

Continuous Delivery = Automate Everything

Dev

Stage 1

Static Code Analysis

Unit Tests

Integration Tests

Depend/license Tests

Deployment Pipeline

CustomerCode

QA

Stage 2

Smoke Tests

Regression Tests

Security Tests

Browser Tests

Load/Perf Tests

OnSuccess

Production

Stage 3

Availability Tests

Performance Tests

Quality Tests

Security Tests

Canary VerificationOn

Success

OnCommit

How?

Page 18: Continuous Delivery & Machine Learning · Confidential Software Deployment Success is…. “Application is up so everything is fine” “Homepage Works” “Not seeing any alerts”

Copyright © Harness 2018 Confidential 19

Enter Machine Learning

Page 19: Continuous Delivery & Machine Learning · Confidential Software Deployment Success is…. “Application is up so everything is fine” “Homepage Works” “Not seeing any alerts”

Copyright © Harness 2018 Confidential 20

Disclaimer: Machine Learning Is Not A Silver Bullet

(But its better at doing some things better than humans)

Page 20: Continuous Delivery & Machine Learning · Confidential Software Deployment Success is…. “Application is up so everything is fine” “Homepage Works” “Not seeing any alerts”

Copyright © Harness 2019 Confidential 21

Pop Quiz: Who Identifies Anomalies Faster?

Humans or Machines?

Page 21: Continuous Delivery & Machine Learning · Confidential Software Deployment Success is…. “Application is up so everything is fine” “Homepage Works” “Not seeing any alerts”

Copyright © Harness 2018 Confidential 22

Machine Learning 101

❖ Unsupervised Machine Learning❖ Algorithms identify meaning and context of data on its own❖ E.g. Natural Language Processing (NLP), Neural Nets

❖ Supervised Machine Learning❖ Algorithms require human assistance❖ Neural Feedback (Ignore, Dismiss, Ratings, Yes, No)

❖ NOT….Rules❖ Regex, Thresholds, Configuration or Standard Deviation!

Page 22: Continuous Delivery & Machine Learning · Confidential Software Deployment Success is…. “Application is up so everything is fine” “Homepage Works” “Not seeing any alerts”

Copyright © Harness 2019 Confidential 23

Harness - Applying Machine Learning to CD

Performance

Quality

Security

Availability

Deploy

Rollback

ContinuousVerification

Performance

Quality

Business

Availability

UnsupervisedMachine Learning

Automate Deployment Test/Verify/Rollback

$ Revenue / Throughput

Page 23: Continuous Delivery & Machine Learning · Confidential Software Deployment Success is…. “Application is up so everything is fine” “Homepage Works” “Not seeing any alerts”

Copyright © Harness 2019 Confidential 24

Control and Test Data

❖ Control Data❖ Previous Tests (QA)

❖ Previous Deployments (Prod)

❖ Previous Canary Releases (Prod)

❖ Test Data❖ New Tests

❖ New Deployments

❖ New Canary Releases

Page 24: Continuous Delivery & Machine Learning · Confidential Software Deployment Success is…. “Application is up so everything is fine” “Homepage Works” “Not seeing any alerts”

Copyright © Harness 2019

Detecting Performance Anomalies

Custom Business Metrics

Page 25: Continuous Delivery & Machine Learning · Confidential Software Deployment Success is…. “Application is up so everything is fine” “Homepage Works” “Not seeing any alerts”

Copyright © Harness 2018 Confidential 26

Automate and Verify Application Deployments

Performance Good

Page 26: Continuous Delivery & Machine Learning · Confidential Software Deployment Success is…. “Application is up so everything is fine” “Homepage Works” “Not seeing any alerts”

Copyright © Harness 2018 Confidential 27

Performance Regression

Page 27: Continuous Delivery & Machine Learning · Confidential Software Deployment Success is…. “Application is up so everything is fine” “Homepage Works” “Not seeing any alerts”

Copyright © Harness 2018 Confidential 28

Revenue Regression

Page 28: Continuous Delivery & Machine Learning · Confidential Software Deployment Success is…. “Application is up so everything is fine” “Homepage Works” “Not seeing any alerts”

Metric = Timestamp + Name + Value

E.g. “1/1/19 10:01:34, CPU, 99.9%”

This is what Dynatrace, AppDynamics, New Relic, Datadog and Prometheus Provides

Copyright © Harness 2018 Confidential 29

Analyze Time-Series Metrics from APM/Monitoring

Page 29: Continuous Delivery & Machine Learning · Confidential Software Deployment Success is…. “Application is up so everything is fine” “Homepage Works” “Not seeing any alerts”

Symbolic Aggregate approXimation (SAX)

Copyright © Harness 2018 Confidential 30

Machine Learning Algorithms Used (time-series)

https://jmotif.github.io/sax-vsm_site/morea/algorithm/SAX.html

Page 30: Continuous Delivery & Machine Learning · Confidential Software Deployment Success is…. “Application is up so everything is fine” “Homepage Works” “Not seeing any alerts”

Copyright © Harness 2018 Confidential 31

Machine Learning Algorithms Used (time-series)

Hidden Markov Models

https://en.wikipedia.org/wiki/Hidden_Markov_model

Predict when data is incomplete

Page 31: Continuous Delivery & Machine Learning · Confidential Software Deployment Success is…. “Application is up so everything is fine” “Homepage Works” “Not seeing any alerts”

Copyright © Harness 2019

Detecting Quality Anomalies

Page 32: Continuous Delivery & Machine Learning · Confidential Software Deployment Success is…. “Application is up so everything is fine” “Homepage Works” “Not seeing any alerts”

Copyright © Harness 2019

Log Providers

Custom Log

Provider

Page 33: Continuous Delivery & Machine Learning · Confidential Software Deployment Success is…. “Application is up so everything is fine” “Homepage Works” “Not seeing any alerts”

Copyright © Harness 2018 Confidential 34

Stack Trace

Error Regressions

Quality Regression

Page 34: Continuous Delivery & Machine Learning · Confidential Software Deployment Success is…. “Application is up so everything is fine” “Homepage Works” “Not seeing any alerts”

Copyright © Harness 2018 Confidential 35

Automate Verification (Unstructured Events)

Usual crap AnomaliesUsual crapAnomalies

Page 35: Continuous Delivery & Machine Learning · Confidential Software Deployment Success is…. “Application is up so everything is fine” “Homepage Works” “Not seeing any alerts”

Event = Timestamp + Message (N attributes)

[timestamp],[severity],[message],[attribute 1], …

Analyze Splunk, ELK, Sumo Logic Data

Apply Natural Language Processing (NLP)

Copyright © Harness 2018 Confidential 36

Tokenize Attributes from Events

Page 36: Continuous Delivery & Machine Learning · Confidential Software Deployment Success is…. “Application is up so everything is fine” “Homepage Works” “Not seeing any alerts”

Copyright © Harness 2018 Confidential 37

Entropy (Frequency of Attributes)

0 1

High EntropyLow Entropy

Page 37: Continuous Delivery & Machine Learning · Confidential Software Deployment Success is…. “Application is up so everything is fine” “Homepage Works” “Not seeing any alerts”

Copyright © Harness 2018 Confidential 38

KMeans Clustering

Group EventsBy

Natural Language Similarity

Page 38: Continuous Delivery & Machine Learning · Confidential Software Deployment Success is…. “Application is up so everything is fine” “Homepage Works” “Not seeing any alerts”

Copyright © Harness 2018 Confidential 39

Jaccard & Cosine Distance

Page 39: Continuous Delivery & Machine Learning · Confidential Software Deployment Success is…. “Application is up so everything is fine” “Homepage Works” “Not seeing any alerts”

Application Log File has 100 Events

10 of those are NullPointerExceptions (Cluster)

NullPointerExceptions are thrown in 10 different places in the application (different positions relative to each other)

Com.app.package.classA

Com.app.package.classB

Com.app.package.classC

Copyright © Harness 2018 Confidential 40

Simple Example

Page 40: Continuous Delivery & Machine Learning · Confidential Software Deployment Success is…. “Application is up so everything is fine” “Homepage Works” “Not seeing any alerts”

Copyright © Harness 2018 Confidential 41

Simple Example

NullPointerException

ArraryOutOfBoundsException

BusinessException

ClassNotFoundException

Page 41: Continuous Delivery & Machine Learning · Confidential Software Deployment Success is…. “Application is up so everything is fine” “Homepage Works” “Not seeing any alerts”

Copyright © Harness 2018 Confidential 42

KMeans Clustering isn’t Perfect

Event Data can contain noise(guids, urls, ip addresses, cookies, …)

Page 42: Continuous Delivery & Machine Learning · Confidential Software Deployment Success is…. “Application is up so everything is fine” “Homepage Works” “Not seeing any alerts”

Copyright © Harness 2018 Confidential 43

Use Trained Neural Nets to Reduce False Positives

Non-Neural Net

This is why EngineersDon’t Trust Machine Learning

Trained Neural Net

Page 43: Continuous Delivery & Machine Learning · Confidential Software Deployment Success is…. “Application is up so everything is fine” “Homepage Works” “Not seeing any alerts”

Copyright © Harness 2018 Confidential 44

Customer Example

$500m+ Revenue eCommerce Retailer

Page 44: Continuous Delivery & Machine Learning · Confidential Software Deployment Success is…. “Application is up so everything is fine” “Homepage Works” “Not seeing any alerts”

Copyright © Harness 2018 Confidential 45

Real Example: Build.com

Page 45: Continuous Delivery & Machine Learning · Confidential Software Deployment Success is…. “Application is up so everything is fine” “Homepage Works” “Not seeing any alerts”

Copyright © Harness 2018 Confidential 46

7 Stage Deployment Pipeline (prod failed)

Page 46: Continuous Delivery & Machine Learning · Confidential Software Deployment Success is…. “Application is up so everything is fine” “Homepage Works” “Not seeing any alerts”

Copyright © Harness 2018 Confidential 47

Deploy & Auto-Verify with New Relic & Sumo Logic

Page 47: Continuous Delivery & Machine Learning · Confidential Software Deployment Success is…. “Application is up so everything is fine” “Homepage Works” “Not seeing any alerts”

Copyright © Harness 2018 Confidential 48

4 New NullPointer Exceptions in Online System

Page 48: Continuous Delivery & Machine Learning · Confidential Software Deployment Success is…. “Application is up so everything is fine” “Homepage Works” “Not seeing any alerts”

Copyright © Harness 2018 Confidential 49

Rollback in 32 Seconds

Page 49: Continuous Delivery & Machine Learning · Confidential Software Deployment Success is…. “Application is up so everything is fine” “Homepage Works” “Not seeing any alerts”

Copyright © Harness 2019 Confidential 50

Traditional Continuous Delivery

Overall Visibility, Dashboards & ReportingCustom

Scripts

Verification

Custom

Scripts

Environment Variables & Pipeline Management

Custom

Scripts

Secrets, Auditing& Compliance

Custom

Scripts

Release Strategy

Custom

Scripts

BLUE/GREEN

Rollback

Custom

Scripts

Continuous Delivery

Continuous Integration

Code

Build & Test Artifacts

Artifact

Cloud Stacks

Custom

Scripts

On-Premises DC

InfrastructureProvisioning

Custom

Scripts

ChangeManagement

Custom

Emails

Page 50: Continuous Delivery & Machine Learning · Confidential Software Deployment Success is…. “Application is up so everything is fine” “Homepage Works” “Not seeing any alerts”

Copyright © Harness 2019 Confidential 51

Continuous Delivery With Harness

Verification

Environment Variables & Pipeline Management

Secrets, Auditing& Compliance

Release Strategy

BLUE/GREEN

Rollback

Continuous Integration

Code

Build & Test Artifacts

Artifact

Cloud Stacks

On-Premises DC

InfrastructureProvisioning

ChangeManagement

Continuous VerificationSmart Automation

Continuous Security

Overall Visibility, Dashboards & Reporting

Continuous Delivery As-A-Service

Page 51: Continuous Delivery & Machine Learning · Confidential Software Deployment Success is…. “Application is up so everything is fine” “Homepage Works” “Not seeing any alerts”

Copyright © Harness 2019 Confidential 52

Thank You

Free 15-Day Trial and Community Editionat www.harness.io

harness