SlideShare une entreprise Scribd logo
1  sur  89
So You Want To Go Faster?
A Journey to Continuous Deployment
• 10+ years software
development experience
• Work at Excella Consulting
(~5 years)
• I love testing, all things
agile, cats
• If any of those things
interest you…
About Me
Dan Davis
Agile + Cats Cats that can test
More About Me
We deploy to production about 4-5 times per day!
How do you signal to turn right?What’s a turn signal?
How do I get to Continuous Deployment?
How do I get to Continuous Deployment?
• Tools / Techniques
• Cultural Changes
• Warning: I’m going to gloss over Tools / Techniques
Continuous Deployment
Basics
Continuous Deployment
“Every commit triggers a deployment
to production”
Continuous Deployment?
Code
Repository
Deploy to
Production
• Works, but how fast?
• Top Speed: limited by…
– how frequently I check the repository
– how quickly I can perform the deployment
• Probably not a great process IMHO
Not really Continuous Deployment
Code
Repository
Deploy to
Production
• Need some kind of automation
How can we go faster?
Code
Repository
Deploy to
Production
Bottlenecks
Automation Tools
• 3 basic characteristics
• Execute a script / code (in a task/job)
• Trigger task/job
– On demand
– On a timer
– On an event, like a code commit
• Start other jobs / tasks when completed
– Avoid one big script, create logical separations
– Assembly line, but for code!
Automation Tools
+Automation, good process yet?
Code
Repository
Deploy to
Production
Should we just let any commit go to production?
(on commit)
Deploy to
Production
Approval Process
What informs the approval process?
Approved?
Code
Repository
Add in Testing
Deploy to
Production
Post-deploy
Testing
Approved?
Non-production Environment
Deploy to
Production
Deploy to non-
production
Post-deploy
Testing
Approved?
Let’s Rearrange…
Pipeline Outline
Deploy to
non-
production
Acceptance
Test
Deploy to
production
How do I get servers to run this code?
Setting up Infrastructure
How do I keep track of what’s been approved?
Provision
Non-prod
server
Deploy to
non-
production
Acceptance
Test
Provision
Production
Deploy to
production
Deploy to
production
Creating Build Artifacts
Can I test sooner than post-deploy?
Artifact
Repo
Provision
Non-prod
server
Deploy to
non-
production
Acceptance
Test
Provision
Production
Deploy to
production
Create Build
Artifacts
Run Unit Tests
Provision
Non-prod
server
Deploy to
non-
production
Acceptance
Test
Provision
Production
Deploy to
production
Create Build
Artifacts
Unit Tests /
Static
Analysis
How do I know it continues to work after I deploy?
Monitoring
Provision
Non-prod
server
Deploy to
non-
production
Acceptance
Test
Provision
Production
Deploy to
production
Create Build
Artifacts
Unit Tests /
Static
Analysis
Monitoring
Generic Pipeline
• This is the basic machinery
• Speed is an important variable
– Depending on speed we may choose different tools
• Continuous Deployment is a speed, not a process or tool
– To achieve that speed, we have to work up to it
– Think of it like shifting gears
Unit Test /
Static
Analysis
Create a
build artifact
Provision
Non-prod
server
Deploy to
non-
production
Acceptance
Test
Provision
Production
Deploy to
production
Monitoring
• Once Per Month
• Once Per Sprint (2 weeks)
• Once Per Week
• Every 2-3 days
• Every Commit (multiple
times per day)
5 Gears of Production Deployment
1st Gear
(Deploying once a month)
• Basic Continuous Integration
– Run unit tests when code is committed
• Manual Elements
– Acceptance Testing performed by a QA team
– Deployments performed by a deployment engineer
– Servers are manually provisioned as needed
1st Gear Teams
Unit Test /
Static
Analysis
Create a
build artifact
Provision
Non-prod
server
Deploy to
non-
production
Acceptance
Test
Provision
Production
Deploy to
production
Monitoring
• Deployments prone to failure
– Knowledge siloed in handful of people
• Deployments require downtime
– Must be done on weekends or late at night (with little support)
• Lack of consistency between environments
– Leads to deployment problems and bugs
1st Gear Pain Points
Do You Want To Go
Faster?
(Deploying Every Sprint)
• Agile! Scrum!
– Potentially Shippable Product Increment!
Shifting to Sprintly Deployments
• Main Limiting Factor: Deployment failure rate
– High failure rate will prevent you from speeding up…
• Focus on
– Standardizing the deployment process (though automation)
– Building out a pipeline
– Learning from build failures
2nd Gear Focus Areas
Unit Test /
Static
Analysis
Create a
build artifact
Provision
Non-prod
server
Deploy to
non-
production
Acceptance
Test
Provision
Production
Deploy to
production
Monitoring
Automating Deployments
Fabric
Powerful Configuration
Management Tools
Deployment Scripting Frameworks
• Basic SSH wrappers around shell commands
Fabric / Capistrano
Server
Command
Command
Command
Manual
Execution
Server
Command
Command
CommandFabric /
Capistrano
File
Version
Control
Benefits
• Simple approach, one step
above shell scripts
• Low learning curve
• Does just enough…
– Multi-host deployment
– Organize into roles
• Great for lightweight
automation
• Now we can establish a basic pipeline
• Next Challenge: only deploy from pipeline
• When pipeline breaks, prevents deployments until fixed
• FAQ: Why should I care about failures in the pipeline?
2nd Gear Cultural Changes
Unit Test /
Static
Analysis
Create a
build artifact
Provision
Non-prod
server
Deploy to
non-
production
Acceptance
Test
Provision
Production
Deploy to
production
Monitoring
• When you see the check engine
light, what do you do?
– Take it to mechanic
– Don’t keep driving!
– Letting it fester will only make
it worse!
• Treat your pipeline like your car!
– When it breaks fix it with a
sense of urgency
– Minimize the possible changes
that caused it to break in the
first place
Pipeline Failures
• Now have a somewhat reliable build process
– Our build engineers should be a lot happier
– Easier to recruit new people for deployments
• Lots of manual steps, but should be fast enough to
deploy every sprint…
The power of 2nd gear
Unit Test /
Static
Analysis
Create a
build artifact
Provision
Non-prod
server
Deploy to
non-
production
Acceptance
Test
Provision
Production
Deploy to
production
Monitoring
So You Want To Go Faster?
(Deploying every week)
• Main Limiting Factor: Environments
– Deploy once per week: start thinking about impact of downtime
• Focus On
– Improving consistency between environments
– Standing up infrastructure
– Eliminating reasons to SSH to servers
Shifting into 3rd gear
Provision
Non-prod
server
Deploy to
non-
production
Acceptance
Test
Provision
Production
Deploy to
production
Create Build
Artifacts
Unit Tests /
Static
Analysis
Monitoring
• Deployments often require service interruption
– Stop processes/services
– Drain queues
– Update packages
• Can try to reduce deployment time, but not worth it
• Better Approach: Blue/Green Deployment
Why Downtime Matters
Blue/Green Deployment
Server A
Server A
Server A
V1 Code
Load Balancer
The internet
V2 Code
Blue/Green Deployment
Server A
Server A
Server A
V1 Code
Load Balancer
The internet
Server B
Server B
Server B
V2 Code
Blue/Green Deployment
Server A
Server A
Server C
V3 Code
Load Balancer
The internet
Server B
Server B
Server B
V2 Code
Infrastructure as Code
Orchestrators
Machine Images
Users?
Packages?
Ports?
Services?
Configuration Management Tools
Mutable Infrastructure
• Apply changes to a
running server
• Bring a server into
compliance
Base Image + Configurations
• Shift in mindset: Infrastructure as Code
– Virtualization means no more owning physical servers
– No more dedicated hardware
Culture Changes
Yes, this is a thing you can buy…
• Orchestrator + Config mgmt + Deployment
• Reliable deployments with no downtime!
– Consistency between environments
– Blue/Green deployments
• Can even start deploying to non-prod more frequently
• Team should settle into a pretty good groove with
weekly deployments
Power of 3rd Gear!
Provision
Non-prod
server
Deploy to
non-
production
Acceptance
Test
Provision
Production
Deploy to
production
Create Build
Artifacts
Unit Tests /
Static
Analysis
Monitoring
Do you want to go faster?
(Deploying every 2-3 days)
• Ironically, one of the
hardest gears
• Traditionally manual
processes become
unsustainable
• More cultural battling than
technology
Shifting into 4th gear
• Main Limiting Factor: Unready / Unfinished code
– Barely enough time to develop
– No time to manually test
• Focus On
– Improving confidence in automated testing
– Eliminating manual testing
– Using Feature Toggles
Shifting into 4th gear
Provision
Non-prod
server
Deploy to
non-
production
Acceptance
Test
Provision
Production
Deploy to
production
Create Build
Artifacts
Unit Tests /
Static
Analysis
Monitoring
One Week Deployment Cycle
Coding Coding Coding
Testing / Bug
Fixing
Deployment /
Happy Hour
Day 1 Day 2 Day 3 Day 4 Day 5
(Tu)(Wed)
2 – 3 Day Deployment Cycle
Coding
Testing / Bug
Fixing
Deploy
ment?
Day 1 Day 2 Day 3
Bottleneck
We must eliminate the “code freeze” period before deployment
• Acceptance Testing (i.e. New Functionality)
• Regression Testing (i.e. Old Functionality)
• Both are highly predictable
– Great candidates for automation
Cutting down testing time
Tools for Automating Acceptance Tests
“Web Driver”
• Mimics the actions of a
user in a browser
• Who writes the automation code?
– Testers don’t typically have the skillset
– Developers are better suited for it
• Developers must now write feature code AND test
code?
– Is that fair?
Culture
• Engineers Day
• Deeper appreciation for
what you build
• Encourage
thoughtfulness about
how to design parts
Automotive Engineers
• Developers should have a stake in the quality of the final
product
– Developers should learn what types of bugs get through and
how to prevent them
• Encourage mindfulness of code
– Hard to test? Find ways to make it easier
• Promote a better collaboration with Product Owner
– Work closer with acceptance criteria
Developers Responsible for Quality
Feedback Cycle
Developers
Write
Code
Deploy
Code
QA Team
Tests Code
No longer going to have an explicit “Testing” Phase
2 – 3 Day Deployment Cycle
Coding /
Continuous Testing
Deploy
ment?
Day 1 Day 2 Day 3
Is 2.5 days enough time to develop a useful feature?
• Can’t complete in everything 2-3 days
• Catch 22: Can’t merge it until all stories are completed
• Maybe we should slow down…
Useful Functionality
Useful Feature
Story 1 Story 2 Story 3 Story 4
• A little bit of conditional logic that can enable/disable
functionality
• Often stored in a cache or database
Feature Toggles
Feature Toggles
Non-Prod Production
Deploying With Feature Toggles
Non-Prod Production
Story
1
Story
2
Story
3
Story
4
Story
1
Story
2
Story
3
Story
4
• Decoupling code deployment with releasing
functionality
– At previous speeds, deploying to production meant turning on
functionality
– Replaced with turning on a feature toggle
• Culture Change: Deploying to production is an
unremarkable event
– The same scrutiny is no longer needed
– “Rollbacks” are now effortless, just un-toggle
Culture Change
• Automated our testing process to reduce testing time to
minutes
• Using feature toggles allows our team to work extremely
efficiently
– Ship what’s ready, keep working on what’s not
• Should be able to comfortably deploy every 2-3 days
– There’s very little in the way of going faster…
The Power of 4th Gear
Provision
Non-prod
server
Deploy to
non-
production
Acceptance
Test
Provision
Production
Deploy to
production
Create Build
Artifacts
Unit Tests /
Static
Analysis
Monitoring
Do you want to go faster?
(Deploying on Every Commit!)
the most fast???
^
• Main Limiting Factors: Efficiency
– Creating new infrastructure is slow
– Push button deploys are getting in the way
• Focus On
– Shore up testing with monitoring and alerting
– Immutable Infrastructure
– Flip the switch to automatically deploy to production
Shifting into 5th gear
Provision
Non-prod
server
Deploy to
non-
production
Acceptance
Test
Provision
Production
Deploy to
production
Create Build
Artifacts
Unit Tests /
Static
Analysis
Monitoring
• Spending a lot of time configuring servers
Immutable Infrastructure
All Configs
Base OS
New Server
Code
Image
• Spending a lot of time configuring servers
Immutable Infrastructure
All Configs
Base OS
New Server
Image
Code
Image w/
Code (v1.0)
Immutable Infrastructure
Image w/
code (v1.0)
Non-Prod
Production
Very Fast
• New code means building a new image
– Creates a “build artifact”
• Rather than updating, just destroy and recreate
Immutable Infrastructure
• Even with perfect deployments, gap in our testing
• What happens after we deploy?
– A flood of users might hit the server all at once
– A memory leak could start sapping performance
– Networking could fail
Monitoring / Alerting
• Alerts: when certain conditions are met, send a
notification
• If we see a sudden spike in errors
– Alert the developers
– Let the Product Owner know
– CC the security team
• Be proactive!
– Don’t just wait for users to tell you it’s broken
Monitoring / Alerting
What’s left?
Provision
Non-prod
server
Deploy to
non-
production
Acceptance
Test
Provision
Production
Deploy to
production
Create Build
Artifacts
Unit Tests /
Static
Analysis
Monitoring
• Cultural Challenge: Is it ok
to automatically deploy to
production??
Culture Change
• Continuous Deployment takes Bravery
– Trust that your automated tests will catch show stopper bugs
– Dedicate yourself to fixing bugs quickly (because you can)
• Continuous Deployment is a speed, there are trade-offs
– Only achievable with a dedicated and competent team
• You’re not the first
– I run a team at Excella that is doing this
– We built on the shoulders of others before us
Culture Change
So take a deep breath…
Provision
Non-prod
server
Deploy to
non-
production
Acceptance
Test
Provision
Production
Deploy to
production
Create Build
Artifacts
Unit Tests /
Static
Analysis
Monitoring
Continuous Deployment!
Do you want to go faster?
• Once every commit deploys to
production, you may start to redline
• Limited by
– # of commits per day
– Longest step in pipeline
• Most teams won’t hit upper limit
– ~5 min / step == 100 deployments
(8 hour day)
• Consider breaking into microservices
Going Faster
Final Thoughts
• Fastest Route
• Scenic Route
• Drive the Speed Limit
• Speed like crazy
• How you get there is up to you…
Final Thoughts
Questions?

Contenu connexe

Tendances

Bringing CD to the DoD
Bringing CD to the DoDBringing CD to the DoD
Bringing CD to the DoD
Gene Gotimer
 
The Hard Problems of Continuous Deployment
The Hard Problems of Continuous DeploymentThe Hard Problems of Continuous Deployment
The Hard Problems of Continuous Deployment
Timothy Fitz
 
Continuous delivery @ hi q
Continuous delivery @ hi qContinuous delivery @ hi q
Continuous delivery @ hi q
Tomas Riha
 

Tendances (20)

Best Practices for Database Deployments
Best Practices for Database DeploymentsBest Practices for Database Deployments
Best Practices for Database Deployments
 
Boston MeetUp 10.10
Boston MeetUp 10.10Boston MeetUp 10.10
Boston MeetUp 10.10
 
Lap around ALM with Visual Studio and TFS 2013
Lap around ALM with Visual Studio and TFS 2013Lap around ALM with Visual Studio and TFS 2013
Lap around ALM with Visual Studio and TFS 2013
 
Database Deployment Pipeline - SQL In The City Workshop 2014
Database Deployment Pipeline - SQL In The City Workshop 2014Database Deployment Pipeline - SQL In The City Workshop 2014
Database Deployment Pipeline - SQL In The City Workshop 2014
 
Leandro Melendez - Switching Performance Left & Right
Leandro Melendez - Switching Performance Left & RightLeandro Melendez - Switching Performance Left & Right
Leandro Melendez - Switching Performance Left & Right
 
Agile Engineering Best Practices by Richard Cheng
Agile Engineering Best Practices by Richard ChengAgile Engineering Best Practices by Richard Cheng
Agile Engineering Best Practices by Richard Cheng
 
Bringing CD to the DoD
Bringing CD to the DoDBringing CD to the DoD
Bringing CD to the DoD
 
Automate Everything! (No stress development/Tallinn)
Automate Everything! (No stress development/Tallinn)Automate Everything! (No stress development/Tallinn)
Automate Everything! (No stress development/Tallinn)
 
Devops, Secops, Opsec, DevSec *ops *.* ?
Devops, Secops, Opsec, DevSec *ops *.* ?Devops, Secops, Opsec, DevSec *ops *.* ?
Devops, Secops, Opsec, DevSec *ops *.* ?
 
The Hard Problems of Continuous Deployment
The Hard Problems of Continuous DeploymentThe Hard Problems of Continuous Deployment
The Hard Problems of Continuous Deployment
 
Continuous Integration as a Way of Life
Continuous Integration as a Way of LifeContinuous Integration as a Way of Life
Continuous Integration as a Way of Life
 
An almost complete continuous delivery pipeline including configuration manag...
An almost complete continuous delivery pipeline including configuration manag...An almost complete continuous delivery pipeline including configuration manag...
An almost complete continuous delivery pipeline including configuration manag...
 
Continuous delivery @ hi q
Continuous delivery @ hi qContinuous delivery @ hi q
Continuous delivery @ hi q
 
Adding value in an agile context
Adding value in an agile contextAdding value in an agile context
Adding value in an agile context
 
Continuous Deployment of Rails Applications
Continuous Deployment of Rails ApplicationsContinuous Deployment of Rails Applications
Continuous Deployment of Rails Applications
 
Continuous Delivery Distilled
Continuous Delivery DistilledContinuous Delivery Distilled
Continuous Delivery Distilled
 
Drive Faster Quality Insights through Customized Test Automation - Part 2
Drive Faster Quality Insights through Customized Test Automation - Part 2Drive Faster Quality Insights through Customized Test Automation - Part 2
Drive Faster Quality Insights through Customized Test Automation - Part 2
 
CI/CD for mobile at HERE
CI/CD for mobile at HERECI/CD for mobile at HERE
CI/CD for mobile at HERE
 
Automated Database Deployment at SQL Rally
Automated Database Deployment at SQL RallyAutomated Database Deployment at SQL Rally
Automated Database Deployment at SQL Rally
 
Automate More with Selenium for your RWD
Automate More with Selenium for your RWDAutomate More with Selenium for your RWD
Automate More with Selenium for your RWD
 

Similaire à So you-want-to-go-faster

Introduction to continuous delivery
Introduction to continuous deliveryIntroduction to continuous delivery
Introduction to continuous delivery
OlympicSoftware
 
Introduction to-automated-testing
Introduction to-automated-testingIntroduction to-automated-testing
Introduction to-automated-testing
BestBrains
 

Similaire à So you-want-to-go-faster (20)

Road to Continuous Delivery - Wix.com
Road to Continuous Delivery - Wix.comRoad to Continuous Delivery - Wix.com
Road to Continuous Delivery - Wix.com
 
Continuous Delivery
Continuous DeliveryContinuous Delivery
Continuous Delivery
 
Continuous testing for continuous delivery
Continuous testing for continuous deliveryContinuous testing for continuous delivery
Continuous testing for continuous delivery
 
Introduction to continuous delivery
Introduction to continuous deliveryIntroduction to continuous delivery
Introduction to continuous delivery
 
Life Has Not Been That Rosy With Agile : Rahul Sudame
Life Has Not Been That Rosy With Agile : Rahul SudameLife Has Not Been That Rosy With Agile : Rahul Sudame
Life Has Not Been That Rosy With Agile : Rahul Sudame
 
Building Quality In in SAFe – The Testing Organization’s Perspective
Building Quality In in SAFe – The Testing Organization’s Perspective	  Building Quality In in SAFe – The Testing Organization’s Perspective
Building Quality In in SAFe – The Testing Organization’s Perspective
 
Continuous Performance Testing: The New Standard
Continuous Performance Testing: The New StandardContinuous Performance Testing: The New Standard
Continuous Performance Testing: The New Standard
 
(Agile) engineering best practices - What every project manager should know
(Agile) engineering best practices - What every project manager should know(Agile) engineering best practices - What every project manager should know
(Agile) engineering best practices - What every project manager should know
 
Introduction to Automated Testing
Introduction to Automated TestingIntroduction to Automated Testing
Introduction to Automated Testing
 
Introduction to-automated-testing
Introduction to-automated-testingIntroduction to-automated-testing
Introduction to-automated-testing
 
Solano Labs presented at MassTLC's automated testing
Solano Labs presented at MassTLC's automated testingSolano Labs presented at MassTLC's automated testing
Solano Labs presented at MassTLC's automated testing
 
Continuous Delivery Testing @HiQ
Continuous Delivery Testing @HiQContinuous Delivery Testing @HiQ
Continuous Delivery Testing @HiQ
 
Continuous Load Testing with CloudTest and Jenkins
Continuous Load Testing with CloudTest and JenkinsContinuous Load Testing with CloudTest and Jenkins
Continuous Load Testing with CloudTest and Jenkins
 
Automated testing san francisco oct 2013
Automated testing san francisco oct 2013Automated testing san francisco oct 2013
Automated testing san francisco oct 2013
 
Definition of Done and Product Backlog refinement
Definition of Done and Product Backlog refinementDefinition of Done and Product Backlog refinement
Definition of Done and Product Backlog refinement
 
Shorten Business Life Cycle Using DevOps
Shorten Business Life Cycle Using DevOpsShorten Business Life Cycle Using DevOps
Shorten Business Life Cycle Using DevOps
 
Agile Engineering Sparker GLASScon 2015
Agile Engineering Sparker GLASScon 2015Agile Engineering Sparker GLASScon 2015
Agile Engineering Sparker GLASScon 2015
 
Test Driven Development & CI/CD
Test Driven Development & CI/CDTest Driven Development & CI/CD
Test Driven Development & CI/CD
 
Continuous Development: Supporting a Release Model
Continuous Development: Supporting a Release ModelContinuous Development: Supporting a Release Model
Continuous Development: Supporting a Release Model
 
Agile Acceptance testing with Fitnesse
Agile Acceptance testing with FitnesseAgile Acceptance testing with Fitnesse
Agile Acceptance testing with Fitnesse
 

Dernier

Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
WSO2
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Victor Rentea
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
panagenda
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
?#DUbAI#??##{{(☎️+971_581248768%)**%*]'#abortion pills for sale in dubai@
 

Dernier (20)

Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challenges
 
[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptx
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
Platformless Horizons for Digital Adaptability
Platformless Horizons for Digital AdaptabilityPlatformless Horizons for Digital Adaptability
Platformless Horizons for Digital Adaptability
 
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 

So you-want-to-go-faster

  • 1. So You Want To Go Faster? A Journey to Continuous Deployment
  • 2. • 10+ years software development experience • Work at Excella Consulting (~5 years) • I love testing, all things agile, cats • If any of those things interest you… About Me Dan Davis
  • 3. Agile + Cats Cats that can test
  • 4. More About Me We deploy to production about 4-5 times per day!
  • 5.
  • 6.
  • 7. How do you signal to turn right?What’s a turn signal?
  • 8. How do I get to Continuous Deployment?
  • 9.
  • 10. How do I get to Continuous Deployment? • Tools / Techniques • Cultural Changes • Warning: I’m going to gloss over Tools / Techniques
  • 12. Continuous Deployment “Every commit triggers a deployment to production”
  • 14. • Works, but how fast? • Top Speed: limited by… – how frequently I check the repository – how quickly I can perform the deployment • Probably not a great process IMHO Not really Continuous Deployment Code Repository Deploy to Production
  • 15. • Need some kind of automation How can we go faster? Code Repository Deploy to Production Bottlenecks
  • 16. Automation Tools • 3 basic characteristics • Execute a script / code (in a task/job) • Trigger task/job – On demand – On a timer – On an event, like a code commit • Start other jobs / tasks when completed – Avoid one big script, create logical separations – Assembly line, but for code!
  • 18. +Automation, good process yet? Code Repository Deploy to Production Should we just let any commit go to production? (on commit)
  • 19. Deploy to Production Approval Process What informs the approval process? Approved? Code Repository
  • 20. Add in Testing Deploy to Production Post-deploy Testing Approved?
  • 21. Non-production Environment Deploy to Production Deploy to non- production Post-deploy Testing Approved? Let’s Rearrange…
  • 22. Pipeline Outline Deploy to non- production Acceptance Test Deploy to production How do I get servers to run this code?
  • 23. Setting up Infrastructure How do I keep track of what’s been approved? Provision Non-prod server Deploy to non- production Acceptance Test Provision Production Deploy to production Deploy to production
  • 24. Creating Build Artifacts Can I test sooner than post-deploy? Artifact Repo Provision Non-prod server Deploy to non- production Acceptance Test Provision Production Deploy to production Create Build Artifacts
  • 25. Run Unit Tests Provision Non-prod server Deploy to non- production Acceptance Test Provision Production Deploy to production Create Build Artifacts Unit Tests / Static Analysis How do I know it continues to work after I deploy?
  • 27. Generic Pipeline • This is the basic machinery • Speed is an important variable – Depending on speed we may choose different tools • Continuous Deployment is a speed, not a process or tool – To achieve that speed, we have to work up to it – Think of it like shifting gears Unit Test / Static Analysis Create a build artifact Provision Non-prod server Deploy to non- production Acceptance Test Provision Production Deploy to production Monitoring
  • 28. • Once Per Month • Once Per Sprint (2 weeks) • Once Per Week • Every 2-3 days • Every Commit (multiple times per day) 5 Gears of Production Deployment
  • 30. • Basic Continuous Integration – Run unit tests when code is committed • Manual Elements – Acceptance Testing performed by a QA team – Deployments performed by a deployment engineer – Servers are manually provisioned as needed 1st Gear Teams Unit Test / Static Analysis Create a build artifact Provision Non-prod server Deploy to non- production Acceptance Test Provision Production Deploy to production Monitoring
  • 31. • Deployments prone to failure – Knowledge siloed in handful of people • Deployments require downtime – Must be done on weekends or late at night (with little support) • Lack of consistency between environments – Leads to deployment problems and bugs 1st Gear Pain Points
  • 32. Do You Want To Go Faster? (Deploying Every Sprint)
  • 33. • Agile! Scrum! – Potentially Shippable Product Increment! Shifting to Sprintly Deployments
  • 34. • Main Limiting Factor: Deployment failure rate – High failure rate will prevent you from speeding up… • Focus on – Standardizing the deployment process (though automation) – Building out a pipeline – Learning from build failures 2nd Gear Focus Areas Unit Test / Static Analysis Create a build artifact Provision Non-prod server Deploy to non- production Acceptance Test Provision Production Deploy to production Monitoring
  • 36. • Basic SSH wrappers around shell commands Fabric / Capistrano Server Command Command Command Manual Execution Server Command Command CommandFabric / Capistrano File Version Control
  • 37. Benefits • Simple approach, one step above shell scripts • Low learning curve • Does just enough… – Multi-host deployment – Organize into roles • Great for lightweight automation
  • 38. • Now we can establish a basic pipeline • Next Challenge: only deploy from pipeline • When pipeline breaks, prevents deployments until fixed • FAQ: Why should I care about failures in the pipeline? 2nd Gear Cultural Changes Unit Test / Static Analysis Create a build artifact Provision Non-prod server Deploy to non- production Acceptance Test Provision Production Deploy to production Monitoring
  • 39. • When you see the check engine light, what do you do? – Take it to mechanic – Don’t keep driving! – Letting it fester will only make it worse! • Treat your pipeline like your car! – When it breaks fix it with a sense of urgency – Minimize the possible changes that caused it to break in the first place Pipeline Failures
  • 40. • Now have a somewhat reliable build process – Our build engineers should be a lot happier – Easier to recruit new people for deployments • Lots of manual steps, but should be fast enough to deploy every sprint… The power of 2nd gear Unit Test / Static Analysis Create a build artifact Provision Non-prod server Deploy to non- production Acceptance Test Provision Production Deploy to production Monitoring
  • 41. So You Want To Go Faster? (Deploying every week)
  • 42. • Main Limiting Factor: Environments – Deploy once per week: start thinking about impact of downtime • Focus On – Improving consistency between environments – Standing up infrastructure – Eliminating reasons to SSH to servers Shifting into 3rd gear Provision Non-prod server Deploy to non- production Acceptance Test Provision Production Deploy to production Create Build Artifacts Unit Tests / Static Analysis Monitoring
  • 43. • Deployments often require service interruption – Stop processes/services – Drain queues – Update packages • Can try to reduce deployment time, but not worth it • Better Approach: Blue/Green Deployment Why Downtime Matters
  • 44. Blue/Green Deployment Server A Server A Server A V1 Code Load Balancer The internet V2 Code
  • 45. Blue/Green Deployment Server A Server A Server A V1 Code Load Balancer The internet Server B Server B Server B V2 Code
  • 46. Blue/Green Deployment Server A Server A Server C V3 Code Load Balancer The internet Server B Server B Server B V2 Code
  • 49. Configuration Management Tools Mutable Infrastructure • Apply changes to a running server • Bring a server into compliance Base Image + Configurations
  • 50. • Shift in mindset: Infrastructure as Code – Virtualization means no more owning physical servers – No more dedicated hardware Culture Changes Yes, this is a thing you can buy…
  • 51. • Orchestrator + Config mgmt + Deployment • Reliable deployments with no downtime! – Consistency between environments – Blue/Green deployments • Can even start deploying to non-prod more frequently • Team should settle into a pretty good groove with weekly deployments Power of 3rd Gear! Provision Non-prod server Deploy to non- production Acceptance Test Provision Production Deploy to production Create Build Artifacts Unit Tests / Static Analysis Monitoring
  • 52. Do you want to go faster? (Deploying every 2-3 days)
  • 53. • Ironically, one of the hardest gears • Traditionally manual processes become unsustainable • More cultural battling than technology Shifting into 4th gear
  • 54. • Main Limiting Factor: Unready / Unfinished code – Barely enough time to develop – No time to manually test • Focus On – Improving confidence in automated testing – Eliminating manual testing – Using Feature Toggles Shifting into 4th gear Provision Non-prod server Deploy to non- production Acceptance Test Provision Production Deploy to production Create Build Artifacts Unit Tests / Static Analysis Monitoring
  • 55. One Week Deployment Cycle Coding Coding Coding Testing / Bug Fixing Deployment / Happy Hour Day 1 Day 2 Day 3 Day 4 Day 5 (Tu)(Wed)
  • 56. 2 – 3 Day Deployment Cycle Coding Testing / Bug Fixing Deploy ment? Day 1 Day 2 Day 3 Bottleneck We must eliminate the “code freeze” period before deployment
  • 57. • Acceptance Testing (i.e. New Functionality) • Regression Testing (i.e. Old Functionality) • Both are highly predictable – Great candidates for automation Cutting down testing time
  • 58. Tools for Automating Acceptance Tests “Web Driver” • Mimics the actions of a user in a browser
  • 59. • Who writes the automation code? – Testers don’t typically have the skillset – Developers are better suited for it • Developers must now write feature code AND test code? – Is that fair? Culture
  • 60. • Engineers Day • Deeper appreciation for what you build • Encourage thoughtfulness about how to design parts Automotive Engineers
  • 61. • Developers should have a stake in the quality of the final product – Developers should learn what types of bugs get through and how to prevent them • Encourage mindfulness of code – Hard to test? Find ways to make it easier • Promote a better collaboration with Product Owner – Work closer with acceptance criteria Developers Responsible for Quality
  • 62. Feedback Cycle Developers Write Code Deploy Code QA Team Tests Code No longer going to have an explicit “Testing” Phase
  • 63. 2 – 3 Day Deployment Cycle Coding / Continuous Testing Deploy ment? Day 1 Day 2 Day 3 Is 2.5 days enough time to develop a useful feature?
  • 64. • Can’t complete in everything 2-3 days • Catch 22: Can’t merge it until all stories are completed • Maybe we should slow down… Useful Functionality Useful Feature Story 1 Story 2 Story 3 Story 4
  • 65. • A little bit of conditional logic that can enable/disable functionality • Often stored in a cache or database Feature Toggles
  • 67. Deploying With Feature Toggles Non-Prod Production Story 1 Story 2 Story 3 Story 4 Story 1 Story 2 Story 3 Story 4
  • 68. • Decoupling code deployment with releasing functionality – At previous speeds, deploying to production meant turning on functionality – Replaced with turning on a feature toggle • Culture Change: Deploying to production is an unremarkable event – The same scrutiny is no longer needed – “Rollbacks” are now effortless, just un-toggle Culture Change
  • 69. • Automated our testing process to reduce testing time to minutes • Using feature toggles allows our team to work extremely efficiently – Ship what’s ready, keep working on what’s not • Should be able to comfortably deploy every 2-3 days – There’s very little in the way of going faster… The Power of 4th Gear Provision Non-prod server Deploy to non- production Acceptance Test Provision Production Deploy to production Create Build Artifacts Unit Tests / Static Analysis Monitoring
  • 70. Do you want to go faster? (Deploying on Every Commit!) the most fast??? ^
  • 71. • Main Limiting Factors: Efficiency – Creating new infrastructure is slow – Push button deploys are getting in the way • Focus On – Shore up testing with monitoring and alerting – Immutable Infrastructure – Flip the switch to automatically deploy to production Shifting into 5th gear Provision Non-prod server Deploy to non- production Acceptance Test Provision Production Deploy to production Create Build Artifacts Unit Tests / Static Analysis Monitoring
  • 72. • Spending a lot of time configuring servers Immutable Infrastructure All Configs Base OS New Server Code Image
  • 73. • Spending a lot of time configuring servers Immutable Infrastructure All Configs Base OS New Server Image Code Image w/ Code (v1.0)
  • 74. Immutable Infrastructure Image w/ code (v1.0) Non-Prod Production Very Fast
  • 75. • New code means building a new image – Creates a “build artifact” • Rather than updating, just destroy and recreate Immutable Infrastructure
  • 76. • Even with perfect deployments, gap in our testing • What happens after we deploy? – A flood of users might hit the server all at once – A memory leak could start sapping performance – Networking could fail Monitoring / Alerting
  • 77. • Alerts: when certain conditions are met, send a notification • If we see a sudden spike in errors – Alert the developers – Let the Product Owner know – CC the security team • Be proactive! – Don’t just wait for users to tell you it’s broken Monitoring / Alerting
  • 78. What’s left? Provision Non-prod server Deploy to non- production Acceptance Test Provision Production Deploy to production Create Build Artifacts Unit Tests / Static Analysis Monitoring
  • 79. • Cultural Challenge: Is it ok to automatically deploy to production?? Culture Change
  • 80. • Continuous Deployment takes Bravery – Trust that your automated tests will catch show stopper bugs – Dedicate yourself to fixing bugs quickly (because you can) • Continuous Deployment is a speed, there are trade-offs – Only achievable with a dedicated and competent team • You’re not the first – I run a team at Excella that is doing this – We built on the shoulders of others before us Culture Change
  • 81. So take a deep breath…
  • 84. Do you want to go faster?
  • 85.
  • 86. • Once every commit deploys to production, you may start to redline • Limited by – # of commits per day – Longest step in pipeline • Most teams won’t hit upper limit – ~5 min / step == 100 deployments (8 hour day) • Consider breaking into microservices Going Faster
  • 88. • Fastest Route • Scenic Route • Drive the Speed Limit • Speed like crazy • How you get there is up to you… Final Thoughts