SlideShare a Scribd company logo
1 of 46
Download to read offline
THE ROAD TO CONTINUOUS
DEPLOYMENT - A CASE STUDY
MICHIEL ROOK
THE ROAD TO CONTINUOUS DEPLOYMENT - A CASE STUDY
ABOUT ME
▸ Java, PHP & Scala contractor
▸ PHP since ’99
▸ Maintainer of Phing
▸ Dutch Web Alliance
▸ http://www.linkedin.com/in/
michieltcs
▸ @michieltcs
THE ROAD TO CONTINUOUS DEPLOYMENT - A CASE STUDY
THIS TALK
▸ Background
▸ The approach
▸ Process / standards
▸ Build pipelines
▸ Results & lessons learned
THE ROAD TO CONTINUOUS DEPLOYMENT - A CASE STUDY
THE SYSTEM - SAN DIEGO
▸ ... or the Big Ball Of Mud
▸ Large legacy monolith
▸ Generates significant income
▸ Slow
▸ Complex, lots of moving parts
▸ Technical debt
SAN DIEGO
FRONTEND
MYSQL
DB
SAN DIEGO
BACKEND
LOAD BALANCERS / VARNISH
ITBANEN INTERMEDIAIR NATIONALEVACATUREBANK
SAN DIEGO
FRONTEND
SAN DIEGO
FRONTEND
SAN DIEGO
FRONTEND
SAN DIEGO
BACKEND
SAN DIEGO
BACKEND
SAN DIEGO
BACKEND
MEMCACHE FTP
EXT.
SERVICES
SOLR
THE ROAD TO CONTINUOUS DEPLOYMENT - A CASE STUDY
THE SYSTEM - SAN DIEGO
▸ 2.5% code coverage
▸ Fragile tests
▸ Low velocity
▸ Frequent outages / bugs / issues
▸ Frustrated team
▸ Low confidence modifying existing code
REFACTOR? REBUILD?
A NEW STACK
THE ROAD TO CONTINUOUS DEPLOYMENT - A CASE STUDY
THE STACK
THE ROAD TO CONTINUOUS DEPLOYMENT - A CASE STUDY
APPROACH
▸ Strangler pattern
▸ Proxy to switch between old/new
▸ Migrate individual pages
ORIGINAL
MONOLITH
PROXY
SERVICE
ORIGINAL
MONOLITH
ORIGINAL
MONOLITH
SERVICE SERVICE
SERVICE
PROXY
DB
DB
DB
DB
DB DB
THE ROAD TO CONTINUOUS DEPLOYMENT - A CASE STUDY
APPROACH
▸ Services per domain object (job, jobseeker, ...)
▸ Services behind load balancers
▸ Access legacy db’s
▸ Continuous deployment
▸ Containers
▸ Frontends are services
SAN DIEGO
ELASTIC
SEARCHLEGACY
DB
JOB
SERVICE
RMQ
ITBANEN INTERMEDIAIR NATIONALEVACATUREBANK
MONGO
DB
ITBANEN
JOBSEEKER
SERVICE
NVBINTERMEDIAI
THE ROAD TO CONTINUOUS DEPLOYMENT - A CASE STUDY
PROXY
# Serve job detail page from new code

RewriteRule ^/vacature/.* /app.php [L,PT]



# Proxy php files to php5-fpm

ProxyPassMatch ^/(app.php(/.*)?)$ fcgi://127.0.0.1:9000/opt/webapp/web/$1



# Proxy everything else to SanDiego

ProxyPass / ${SAN_DIEGO__URL} nocanon

ProxyPassReverse / ${SAN_DIEGO__URL}

ProxyPreserveHost On
THE ROAD TO CONTINUOUS DEPLOYMENT - A CASE STUDY
FEATURE TOGGLES, A/B TESTS
PROCESS
THE ROAD TO CONTINUOUS DEPLOYMENT - A CASE STUDY
PROCESS
▸ Scrum, 1 week sprints
▸ TDD / BDD
▸ Definition of Done
▸ Team mindset / experience
▸ Focus on value
▸ Replace old features with new (legacy becomes obsolete)
CONTINUOUS EVERYTHING
DEV TEST ACCEPTANCE PRODUCTION
DEV TEST ACCEPTANCE PRODUCTION
CONTINUOUS DELIVERY
CONTINUOUS DEPLOYMENT
ONLY COMMIT TO MASTER
PAIR PROGRAMMING
BOY SCOUT RULE
QUALITY GATES
100% CODE COVERAGE
DASHBOARDS
BUILD
PIPELINES
AUTOMATE REPEATABLE THINGS
THE ROAD TO CONTINUOUS DEPLOYMENT - A CASE STUDY
AUTOMATION
▸ Builds
▸ Testing
▸ Deployments
▸ Orchestration
▸ Config management
EVERY COMMIT GOES TO
PRODUCTION
THE ROAD TO CONTINUOUS DEPLOYMENT - A CASE STUDY
DEFENSE IN DEPTH
UNIT TESTS
SCENARIOS
INTEGRATION
SMOKE / PERF.
TESTS
MANUAL
TESTING?
THE ROAD TO CONTINUOUS DEPLOYMENT - A CASE STUDY
UNIT TESTS
public function testGetById(){

$expectedJob = $this->getJob();



$this->jobRepository->getById($expectedJob->getId())

->shouldBeCalled()

->willReturn($expectedJob);



$this->assertEquals(

$expectedJob,

$this->jobService->getById($expectedJob->getId()

);

}
THE ROAD TO CONTINUOUS DEPLOYMENT - A CASE STUDY
SCENARIOS
Scenario: As an API user I need to be able to retrieve a job

Given there is a valid job

When I retrieve a valid job

Then I should get a valid job resource
THE ROAD TO CONTINUOUS DEPLOYMENT - A CASE STUDY
BUILDING
<project name="JobService" default="build">

<target name="build">

<delete file="jobservice.tar" quiet="true"/>

<tar destfile="jobservice.tar">

<fileset dir="src">

<include name="*.php"/>

</fileset>

</tar>

</target>

</project>
THE ROAD TO CONTINUOUS DEPLOYMENT - A CASE STUDY
DOCKER
FROM php:7.0-apache
ADD vhost.conf /etc/apache2/sites-available/000-default.conf
ADD jobservice.tar /opt/webapp
RUN chown -R www-data:www-data /opt/webapp
THE ROAD TO CONTINUOUS DEPLOYMENT - A CASE STUDY
DEPLOYING
PULL IMAGE
REMOVE FROM LOAD BALANCER
STOP CONTAINER
START NEW CONTAINER
WAIT FOR PORT
SMOKE TESTS / HEALTH CHECKS
ADD TO LOAD BALANCER
THE ROAD TO CONTINUOUS DEPLOYMENT - A CASE STUDY
DEPLOYING
- name: remove instance from load balancer

haproxy: state=disabled host={{ inventory_hostname }} backend=jobservice

delegate_to: "{{ item }}"

with_items: groups.haproxy



- name: stop & remove old container

docker:

name: jobservice

state: absent

image: jobservice



- name: start container

docker:

name: jobservice

state: present

image: jobservice:{{ BUILD_NUMBER }}

ports:

- "8080:8080"
THE ROAD TO CONTINUOUS DEPLOYMENT - A CASE STUDY
DEPLOYING
- name: perform health check

uri:

url: http://localhost:8080/_health

status_code: 200

timeout: 30

return_content: true

changed_when: False

register: result

until: result.content is defined and result.content.find("jobservice") != -1

retries: 10

delay: 3



- name: add instance to load balancer

haproxy: state=enabled host={{ inventory_hostname }} backend=jobservice

delegate_to: "{{ item }}"

with_items: groups.haproxy
THE ROAD TO CONTINUOUS DEPLOYMENT - A CASE STUDY
BUILD PIPELINE
node {

stage 'Run tests'

sh "phpunit"

sh "behat"



stage 'Build docker image'

sh "phing build"

sh "docker build -t jobservice:${env.BUILD_NUMBER} ."

sh "docker push jobservice:${env.BUILD_NUMBER}"



stage 'Deploy acceptance'

sh "ansible-playbook -e BUILD_NUMBER=${env.BUILD_NUMBER} -i acc deploy.yml"



stage 'Deploy production'

sh "ansible-playbook -e BUILD_NUMBER=${env.BUILD_NUMBER} -i prod deploy.yml"

}
THE ROAD TO CONTINUOUS DEPLOYMENT - A CASE STUDY
BUILD PIPELINE
FEEDBACK!
RESULTS
THE ROAD TO CONTINUOUS DEPLOYMENT - A CASE STUDY
RESULTS
▸ Total build time per service < 10 minutes
▸ Significantly improved page load times
▸ Improved audience stats (time on page, pages per session,
session duration, traffic, seo ranking, etc)
▸ Increased confidence and velocity
▸ Experimented with new tech/stacks (angular, jvm,
eventsourcing)
▸ More fun
THE ROAD TO CONTINUOUS DEPLOYMENT - A CASE STUDY
LESSONS LEARNED
▸ Team acceptance
▸ Change is hard
▸ Overhead of weekly sprint; requires discipline
▸ Docker orchestration
▸ Issues with traffic between Amazon <-> on-premise
datacenter
▸ Javascript testing
THE ROAD TO CONTINUOUS DEPLOYMENT - A CASE STUDY
LESSONS LEARNED
▸ Experience with new tech
▸ Stability of build pipelines
▸ Management/leadership buy-in
▸ Not enough focus on replacing legacy application
THE ROAD TO CONTINUOUS DEPLOYMENT - A CASE STUDY
QUESTIONS & DISCUSSION
Please leave feedback at https://joind.in/talk/4dab5
Thank you!

More Related Content

Viewers also liked

AWS re:Invent 2016: Infrastructure Continuous Delivery Using AWS CloudFormati...
AWS re:Invent 2016: Infrastructure Continuous Delivery Using AWS CloudFormati...AWS re:Invent 2016: Infrastructure Continuous Delivery Using AWS CloudFormati...
AWS re:Invent 2016: Infrastructure Continuous Delivery Using AWS CloudFormati...Amazon Web Services
 
DevOps, Continuous Integration and Deployment on AWS
DevOps, Continuous Integration and Deployment on AWSDevOps, Continuous Integration and Deployment on AWS
DevOps, Continuous Integration and Deployment on AWSAmazon Web Services
 
Continuous Integration and Deployment Best Practices on AWS (ARC307) | AWS re...
Continuous Integration and Deployment Best Practices on AWS (ARC307) | AWS re...Continuous Integration and Deployment Best Practices on AWS (ARC307) | AWS re...
Continuous Integration and Deployment Best Practices on AWS (ARC307) | AWS re...Amazon Web Services
 
継続的インテグレーションとテストの話
継続的インテグレーションとテストの話継続的インテグレーションとテストの話
継続的インテグレーションとテストの話Preferred Networks
 
CIサーバを制圧せよ! - プロジェクトメトリクスと自動化技術の活用よる混乱の収拾と「最強」の組織の育成
CIサーバを制圧せよ! - プロジェクトメトリクスと自動化技術の活用よる混乱の収拾と「最強」の組織の育成CIサーバを制圧せよ! - プロジェクトメトリクスと自動化技術の活用よる混乱の収拾と「最強」の組織の育成
CIサーバを制圧せよ! - プロジェクトメトリクスと自動化技術の活用よる混乱の収拾と「最強」の組織の育成Rakuten Group, Inc.
 
DevOps, Continuous Integration and Deployment on AWS: Putting Money Back into...
DevOps, Continuous Integration and Deployment on AWS: Putting Money Back into...DevOps, Continuous Integration and Deployment on AWS: Putting Money Back into...
DevOps, Continuous Integration and Deployment on AWS: Putting Money Back into...Amazon Web Services
 
DevOps at Amazon: A Look at Our Tools and Processes
DevOps at Amazon: A Look at Our Tools and ProcessesDevOps at Amazon: A Look at Our Tools and Processes
DevOps at Amazon: A Look at Our Tools and ProcessesAmazon Web Services
 
継続的インテグレーションの過去・現在・そして未来 〜ヌーラボの事例と共に考える〜
継続的インテグレーションの過去・現在・そして未来 〜ヌーラボの事例と共に考える〜継続的インテグレーションの過去・現在・そして未来 〜ヌーラボの事例と共に考える〜
継続的インテグレーションの過去・現在・そして未来 〜ヌーラボの事例と共に考える〜ikikko
 
DevOps and Continuous Delivery Reference Architectures (including Nexus and o...
DevOps and Continuous Delivery Reference Architectures (including Nexus and o...DevOps and Continuous Delivery Reference Architectures (including Nexus and o...
DevOps and Continuous Delivery Reference Architectures (including Nexus and o...Sonatype
 
10+ Deploys Per Day: Dev and Ops Cooperation at Flickr
10+ Deploys Per Day: Dev and Ops Cooperation at Flickr10+ Deploys Per Day: Dev and Ops Cooperation at Flickr
10+ Deploys Per Day: Dev and Ops Cooperation at FlickrJohn Allspaw
 

Viewers also liked (11)

AWS re:Invent 2016: Infrastructure Continuous Delivery Using AWS CloudFormati...
AWS re:Invent 2016: Infrastructure Continuous Delivery Using AWS CloudFormati...AWS re:Invent 2016: Infrastructure Continuous Delivery Using AWS CloudFormati...
AWS re:Invent 2016: Infrastructure Continuous Delivery Using AWS CloudFormati...
 
DevOps, Continuous Integration and Deployment on AWS
DevOps, Continuous Integration and Deployment on AWSDevOps, Continuous Integration and Deployment on AWS
DevOps, Continuous Integration and Deployment on AWS
 
Continuous Integration and Deployment Best Practices on AWS (ARC307) | AWS re...
Continuous Integration and Deployment Best Practices on AWS (ARC307) | AWS re...Continuous Integration and Deployment Best Practices on AWS (ARC307) | AWS re...
Continuous Integration and Deployment Best Practices on AWS (ARC307) | AWS re...
 
継続的インテグレーションとテストの話
継続的インテグレーションとテストの話継続的インテグレーションとテストの話
継続的インテグレーションとテストの話
 
CIサーバを制圧せよ! - プロジェクトメトリクスと自動化技術の活用よる混乱の収拾と「最強」の組織の育成
CIサーバを制圧せよ! - プロジェクトメトリクスと自動化技術の活用よる混乱の収拾と「最強」の組織の育成CIサーバを制圧せよ! - プロジェクトメトリクスと自動化技術の活用よる混乱の収拾と「最強」の組織の育成
CIサーバを制圧せよ! - プロジェクトメトリクスと自動化技術の活用よる混乱の収拾と「最強」の組織の育成
 
DevOps and AWS
DevOps and AWSDevOps and AWS
DevOps and AWS
 
DevOps, Continuous Integration and Deployment on AWS: Putting Money Back into...
DevOps, Continuous Integration and Deployment on AWS: Putting Money Back into...DevOps, Continuous Integration and Deployment on AWS: Putting Money Back into...
DevOps, Continuous Integration and Deployment on AWS: Putting Money Back into...
 
DevOps at Amazon: A Look at Our Tools and Processes
DevOps at Amazon: A Look at Our Tools and ProcessesDevOps at Amazon: A Look at Our Tools and Processes
DevOps at Amazon: A Look at Our Tools and Processes
 
継続的インテグレーションの過去・現在・そして未来 〜ヌーラボの事例と共に考える〜
継続的インテグレーションの過去・現在・そして未来 〜ヌーラボの事例と共に考える〜継続的インテグレーションの過去・現在・そして未来 〜ヌーラボの事例と共に考える〜
継続的インテグレーションの過去・現在・そして未来 〜ヌーラボの事例と共に考える〜
 
DevOps and Continuous Delivery Reference Architectures (including Nexus and o...
DevOps and Continuous Delivery Reference Architectures (including Nexus and o...DevOps and Continuous Delivery Reference Architectures (including Nexus and o...
DevOps and Continuous Delivery Reference Architectures (including Nexus and o...
 
10+ Deploys Per Day: Dev and Ops Cooperation at Flickr
10+ Deploys Per Day: Dev and Ops Cooperation at Flickr10+ Deploys Per Day: Dev and Ops Cooperation at Flickr
10+ Deploys Per Day: Dev and Ops Cooperation at Flickr
 

Similar to The road to continuous deployment: a case study (DPC16)

The road to continuous deployment (DomCode September 2016)
The road to continuous deployment (DomCode September 2016)The road to continuous deployment (DomCode September 2016)
The road to continuous deployment (DomCode September 2016)Michiel Rook
 
The Road to Continuous Deployment
The Road to Continuous Deployment The Road to Continuous Deployment
The Road to Continuous Deployment Sonatype
 
Faster PHP apps using Queues and Workers
Faster PHP apps using Queues and WorkersFaster PHP apps using Queues and Workers
Faster PHP apps using Queues and WorkersRichard Baker
 
Altitude San Francisco 2018: Programming the Edge
Altitude San Francisco 2018: Programming the EdgeAltitude San Francisco 2018: Programming the Edge
Altitude San Francisco 2018: Programming the EdgeFastly
 
Altitude San Francisco 2018: Testing with Fastly Workshop
Altitude San Francisco 2018: Testing with Fastly WorkshopAltitude San Francisco 2018: Testing with Fastly Workshop
Altitude San Francisco 2018: Testing with Fastly WorkshopFastly
 
AtlasCamp 2014: Building a Production Ready Connect Add-on
AtlasCamp 2014: Building a Production Ready Connect Add-onAtlasCamp 2014: Building a Production Ready Connect Add-on
AtlasCamp 2014: Building a Production Ready Connect Add-onAtlassian
 
From framework coupled code to #microservices through #DDD /by @codelytv
From framework coupled code to #microservices through #DDD /by @codelytvFrom framework coupled code to #microservices through #DDD /by @codelytv
From framework coupled code to #microservices through #DDD /by @codelytvCodelyTV
 
Mykhailo Bodnarchuk "The history of the Codeception project"
Mykhailo Bodnarchuk "The history of the Codeception project"Mykhailo Bodnarchuk "The history of the Codeception project"
Mykhailo Bodnarchuk "The history of the Codeception project"Fwdays
 
Modern day jvm controversies
Modern day jvm controversiesModern day jvm controversies
Modern day jvm controversiesVictorSzoltysek
 
War between Tools and Design 2016
War between Tools and Design 2016War between Tools and Design 2016
War between Tools and Design 2016Mark Windholtz
 
PuppetConf 2016: Best Practices for Puppet in the Cloud – Randall Hunt, Amazo...
PuppetConf 2016: Best Practices for Puppet in the Cloud – Randall Hunt, Amazo...PuppetConf 2016: Best Practices for Puppet in the Cloud – Randall Hunt, Amazo...
PuppetConf 2016: Best Practices for Puppet in the Cloud – Randall Hunt, Amazo...Puppet
 
Bring the light in your Always FREE Oracle Cloud
Bring the light in your Always FREE Oracle CloudBring the light in your Always FREE Oracle Cloud
Bring the light in your Always FREE Oracle CloudDimitri Gielis
 
Docker dev, test & production (afas)
Docker  dev, test & production (afas)Docker  dev, test & production (afas)
Docker dev, test & production (afas)Wouter Lagerweij
 
Bringing the JAMstack to the Enterprise
Bringing the JAMstack to the EnterpriseBringing the JAMstack to the Enterprise
Bringing the JAMstack to the EnterpriseJamund Ferguson
 
EWD 3 Training Course Part 5a: First Steps in Building a QEWD Application
EWD 3 Training Course Part 5a: First Steps in Building a QEWD ApplicationEWD 3 Training Course Part 5a: First Steps in Building a QEWD Application
EWD 3 Training Course Part 5a: First Steps in Building a QEWD ApplicationRob Tweed
 
Zero to Continuous Delivery on Google Cloud
Zero to Continuous Delivery on Google CloudZero to Continuous Delivery on Google Cloud
Zero to Continuous Delivery on Google CloudJames Heggs
 
Choosing a Javascript Framework
Choosing a Javascript FrameworkChoosing a Javascript Framework
Choosing a Javascript FrameworkAll Things Open
 
Drupalcon 2023 - How Drupal builds your pages.pdf
Drupalcon 2023 - How Drupal builds your pages.pdfDrupalcon 2023 - How Drupal builds your pages.pdf
Drupalcon 2023 - How Drupal builds your pages.pdfLuca Lusso
 
2023 - Drupalcon - How Drupal builds your pages
2023 - Drupalcon - How Drupal builds your pages2023 - Drupalcon - How Drupal builds your pages
2023 - Drupalcon - How Drupal builds your pagessparkfabrik
 
Infrastructure = code - 1 year later
Infrastructure = code - 1 year laterInfrastructure = code - 1 year later
Infrastructure = code - 1 year laterChristian Ortner
 

Similar to The road to continuous deployment: a case study (DPC16) (20)

The road to continuous deployment (DomCode September 2016)
The road to continuous deployment (DomCode September 2016)The road to continuous deployment (DomCode September 2016)
The road to continuous deployment (DomCode September 2016)
 
The Road to Continuous Deployment
The Road to Continuous Deployment The Road to Continuous Deployment
The Road to Continuous Deployment
 
Faster PHP apps using Queues and Workers
Faster PHP apps using Queues and WorkersFaster PHP apps using Queues and Workers
Faster PHP apps using Queues and Workers
 
Altitude San Francisco 2018: Programming the Edge
Altitude San Francisco 2018: Programming the EdgeAltitude San Francisco 2018: Programming the Edge
Altitude San Francisco 2018: Programming the Edge
 
Altitude San Francisco 2018: Testing with Fastly Workshop
Altitude San Francisco 2018: Testing with Fastly WorkshopAltitude San Francisco 2018: Testing with Fastly Workshop
Altitude San Francisco 2018: Testing with Fastly Workshop
 
AtlasCamp 2014: Building a Production Ready Connect Add-on
AtlasCamp 2014: Building a Production Ready Connect Add-onAtlasCamp 2014: Building a Production Ready Connect Add-on
AtlasCamp 2014: Building a Production Ready Connect Add-on
 
From framework coupled code to #microservices through #DDD /by @codelytv
From framework coupled code to #microservices through #DDD /by @codelytvFrom framework coupled code to #microservices through #DDD /by @codelytv
From framework coupled code to #microservices through #DDD /by @codelytv
 
Mykhailo Bodnarchuk "The history of the Codeception project"
Mykhailo Bodnarchuk "The history of the Codeception project"Mykhailo Bodnarchuk "The history of the Codeception project"
Mykhailo Bodnarchuk "The history of the Codeception project"
 
Modern day jvm controversies
Modern day jvm controversiesModern day jvm controversies
Modern day jvm controversies
 
War between Tools and Design 2016
War between Tools and Design 2016War between Tools and Design 2016
War between Tools and Design 2016
 
PuppetConf 2016: Best Practices for Puppet in the Cloud – Randall Hunt, Amazo...
PuppetConf 2016: Best Practices for Puppet in the Cloud – Randall Hunt, Amazo...PuppetConf 2016: Best Practices for Puppet in the Cloud – Randall Hunt, Amazo...
PuppetConf 2016: Best Practices for Puppet in the Cloud – Randall Hunt, Amazo...
 
Bring the light in your Always FREE Oracle Cloud
Bring the light in your Always FREE Oracle CloudBring the light in your Always FREE Oracle Cloud
Bring the light in your Always FREE Oracle Cloud
 
Docker dev, test & production (afas)
Docker  dev, test & production (afas)Docker  dev, test & production (afas)
Docker dev, test & production (afas)
 
Bringing the JAMstack to the Enterprise
Bringing the JAMstack to the EnterpriseBringing the JAMstack to the Enterprise
Bringing the JAMstack to the Enterprise
 
EWD 3 Training Course Part 5a: First Steps in Building a QEWD Application
EWD 3 Training Course Part 5a: First Steps in Building a QEWD ApplicationEWD 3 Training Course Part 5a: First Steps in Building a QEWD Application
EWD 3 Training Course Part 5a: First Steps in Building a QEWD Application
 
Zero to Continuous Delivery on Google Cloud
Zero to Continuous Delivery on Google CloudZero to Continuous Delivery on Google Cloud
Zero to Continuous Delivery on Google Cloud
 
Choosing a Javascript Framework
Choosing a Javascript FrameworkChoosing a Javascript Framework
Choosing a Javascript Framework
 
Drupalcon 2023 - How Drupal builds your pages.pdf
Drupalcon 2023 - How Drupal builds your pages.pdfDrupalcon 2023 - How Drupal builds your pages.pdf
Drupalcon 2023 - How Drupal builds your pages.pdf
 
2023 - Drupalcon - How Drupal builds your pages
2023 - Drupalcon - How Drupal builds your pages2023 - Drupalcon - How Drupal builds your pages
2023 - Drupalcon - How Drupal builds your pages
 
Infrastructure = code - 1 year later
Infrastructure = code - 1 year laterInfrastructure = code - 1 year later
Infrastructure = code - 1 year later
 

Recently uploaded

What’s New in VictoriaMetrics: Q1 2024 Updates
What’s New in VictoriaMetrics: Q1 2024 UpdatesWhat’s New in VictoriaMetrics: Q1 2024 Updates
What’s New in VictoriaMetrics: Q1 2024 UpdatesVictoriaMetrics
 
Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...
Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...
Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...confluent
 
Real-time Tracking and Monitoring with Cargo Cloud Solutions.pptx
Real-time Tracking and Monitoring with Cargo Cloud Solutions.pptxReal-time Tracking and Monitoring with Cargo Cloud Solutions.pptx
Real-time Tracking and Monitoring with Cargo Cloud Solutions.pptxRTS corp
 
Post Quantum Cryptography – The Impact on Identity
Post Quantum Cryptography – The Impact on IdentityPost Quantum Cryptography – The Impact on Identity
Post Quantum Cryptography – The Impact on Identityteam-WIBU
 
A healthy diet for your Java application Devoxx France.pdf
A healthy diet for your Java application Devoxx France.pdfA healthy diet for your Java application Devoxx France.pdf
A healthy diet for your Java application Devoxx France.pdfMarharyta Nedzelska
 
OpenChain Education Work Group Monthly Meeting - 2024-04-10 - Full Recording
OpenChain Education Work Group Monthly Meeting - 2024-04-10 - Full RecordingOpenChain Education Work Group Monthly Meeting - 2024-04-10 - Full Recording
OpenChain Education Work Group Monthly Meeting - 2024-04-10 - Full RecordingShane Coughlan
 
Not a Kubernetes fan? The state of PaaS in 2024
Not a Kubernetes fan? The state of PaaS in 2024Not a Kubernetes fan? The state of PaaS in 2024
Not a Kubernetes fan? The state of PaaS in 2024Anthony Dahanne
 
Best Angular 17 Classroom & Online training - Naresh IT
Best Angular 17 Classroom & Online training - Naresh ITBest Angular 17 Classroom & Online training - Naresh IT
Best Angular 17 Classroom & Online training - Naresh ITmanoharjgpsolutions
 
Odoo 14 - eLearning Module In Odoo 14 Enterprise
Odoo 14 - eLearning Module In Odoo 14 EnterpriseOdoo 14 - eLearning Module In Odoo 14 Enterprise
Odoo 14 - eLearning Module In Odoo 14 Enterprisepreethippts
 
SoftTeco - Software Development Company Profile
SoftTeco - Software Development Company ProfileSoftTeco - Software Development Company Profile
SoftTeco - Software Development Company Profileakrivarotava
 
SpotFlow: Tracking Method Calls and States at Runtime
SpotFlow: Tracking Method Calls and States at RuntimeSpotFlow: Tracking Method Calls and States at Runtime
SpotFlow: Tracking Method Calls and States at Runtimeandrehoraa
 
SensoDat: Simulation-based Sensor Dataset of Self-driving Cars
SensoDat: Simulation-based Sensor Dataset of Self-driving CarsSensoDat: Simulation-based Sensor Dataset of Self-driving Cars
SensoDat: Simulation-based Sensor Dataset of Self-driving CarsChristian Birchler
 
Simplifying Microservices & Apps - The art of effortless development - Meetup...
Simplifying Microservices & Apps - The art of effortless development - Meetup...Simplifying Microservices & Apps - The art of effortless development - Meetup...
Simplifying Microservices & Apps - The art of effortless development - Meetup...Rob Geurden
 
JavaLand 2024 - Going serverless with Quarkus GraalVM native images and AWS L...
JavaLand 2024 - Going serverless with Quarkus GraalVM native images and AWS L...JavaLand 2024 - Going serverless with Quarkus GraalVM native images and AWS L...
JavaLand 2024 - Going serverless with Quarkus GraalVM native images and AWS L...Bert Jan Schrijver
 
Effectively Troubleshoot 9 Types of OutOfMemoryError
Effectively Troubleshoot 9 Types of OutOfMemoryErrorEffectively Troubleshoot 9 Types of OutOfMemoryError
Effectively Troubleshoot 9 Types of OutOfMemoryErrorTier1 app
 
OpenChain AI Study Group - Europe and Asia Recap - 2024-04-11 - Full Recording
OpenChain AI Study Group - Europe and Asia Recap - 2024-04-11 - Full RecordingOpenChain AI Study Group - Europe and Asia Recap - 2024-04-11 - Full Recording
OpenChain AI Study Group - Europe and Asia Recap - 2024-04-11 - Full RecordingShane Coughlan
 
Comparing Linux OS Image Update Models - EOSS 2024.pdf
Comparing Linux OS Image Update Models - EOSS 2024.pdfComparing Linux OS Image Update Models - EOSS 2024.pdf
Comparing Linux OS Image Update Models - EOSS 2024.pdfDrew Moseley
 
Salesforce Implementation Services PPT By ABSYZ
Salesforce Implementation Services PPT By ABSYZSalesforce Implementation Services PPT By ABSYZ
Salesforce Implementation Services PPT By ABSYZABSYZ Inc
 
Introduction to Firebase Workshop Slides
Introduction to Firebase Workshop SlidesIntroduction to Firebase Workshop Slides
Introduction to Firebase Workshop Slidesvaideheekore1
 
Revolutionizing the Digital Transformation Office - Leveraging OnePlan’s AI a...
Revolutionizing the Digital Transformation Office - Leveraging OnePlan’s AI a...Revolutionizing the Digital Transformation Office - Leveraging OnePlan’s AI a...
Revolutionizing the Digital Transformation Office - Leveraging OnePlan’s AI a...OnePlan Solutions
 

Recently uploaded (20)

What’s New in VictoriaMetrics: Q1 2024 Updates
What’s New in VictoriaMetrics: Q1 2024 UpdatesWhat’s New in VictoriaMetrics: Q1 2024 Updates
What’s New in VictoriaMetrics: Q1 2024 Updates
 
Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...
Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...
Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...
 
Real-time Tracking and Monitoring with Cargo Cloud Solutions.pptx
Real-time Tracking and Monitoring with Cargo Cloud Solutions.pptxReal-time Tracking and Monitoring with Cargo Cloud Solutions.pptx
Real-time Tracking and Monitoring with Cargo Cloud Solutions.pptx
 
Post Quantum Cryptography – The Impact on Identity
Post Quantum Cryptography – The Impact on IdentityPost Quantum Cryptography – The Impact on Identity
Post Quantum Cryptography – The Impact on Identity
 
A healthy diet for your Java application Devoxx France.pdf
A healthy diet for your Java application Devoxx France.pdfA healthy diet for your Java application Devoxx France.pdf
A healthy diet for your Java application Devoxx France.pdf
 
OpenChain Education Work Group Monthly Meeting - 2024-04-10 - Full Recording
OpenChain Education Work Group Monthly Meeting - 2024-04-10 - Full RecordingOpenChain Education Work Group Monthly Meeting - 2024-04-10 - Full Recording
OpenChain Education Work Group Monthly Meeting - 2024-04-10 - Full Recording
 
Not a Kubernetes fan? The state of PaaS in 2024
Not a Kubernetes fan? The state of PaaS in 2024Not a Kubernetes fan? The state of PaaS in 2024
Not a Kubernetes fan? The state of PaaS in 2024
 
Best Angular 17 Classroom & Online training - Naresh IT
Best Angular 17 Classroom & Online training - Naresh ITBest Angular 17 Classroom & Online training - Naresh IT
Best Angular 17 Classroom & Online training - Naresh IT
 
Odoo 14 - eLearning Module In Odoo 14 Enterprise
Odoo 14 - eLearning Module In Odoo 14 EnterpriseOdoo 14 - eLearning Module In Odoo 14 Enterprise
Odoo 14 - eLearning Module In Odoo 14 Enterprise
 
SoftTeco - Software Development Company Profile
SoftTeco - Software Development Company ProfileSoftTeco - Software Development Company Profile
SoftTeco - Software Development Company Profile
 
SpotFlow: Tracking Method Calls and States at Runtime
SpotFlow: Tracking Method Calls and States at RuntimeSpotFlow: Tracking Method Calls and States at Runtime
SpotFlow: Tracking Method Calls and States at Runtime
 
SensoDat: Simulation-based Sensor Dataset of Self-driving Cars
SensoDat: Simulation-based Sensor Dataset of Self-driving CarsSensoDat: Simulation-based Sensor Dataset of Self-driving Cars
SensoDat: Simulation-based Sensor Dataset of Self-driving Cars
 
Simplifying Microservices & Apps - The art of effortless development - Meetup...
Simplifying Microservices & Apps - The art of effortless development - Meetup...Simplifying Microservices & Apps - The art of effortless development - Meetup...
Simplifying Microservices & Apps - The art of effortless development - Meetup...
 
JavaLand 2024 - Going serverless with Quarkus GraalVM native images and AWS L...
JavaLand 2024 - Going serverless with Quarkus GraalVM native images and AWS L...JavaLand 2024 - Going serverless with Quarkus GraalVM native images and AWS L...
JavaLand 2024 - Going serverless with Quarkus GraalVM native images and AWS L...
 
Effectively Troubleshoot 9 Types of OutOfMemoryError
Effectively Troubleshoot 9 Types of OutOfMemoryErrorEffectively Troubleshoot 9 Types of OutOfMemoryError
Effectively Troubleshoot 9 Types of OutOfMemoryError
 
OpenChain AI Study Group - Europe and Asia Recap - 2024-04-11 - Full Recording
OpenChain AI Study Group - Europe and Asia Recap - 2024-04-11 - Full RecordingOpenChain AI Study Group - Europe and Asia Recap - 2024-04-11 - Full Recording
OpenChain AI Study Group - Europe and Asia Recap - 2024-04-11 - Full Recording
 
Comparing Linux OS Image Update Models - EOSS 2024.pdf
Comparing Linux OS Image Update Models - EOSS 2024.pdfComparing Linux OS Image Update Models - EOSS 2024.pdf
Comparing Linux OS Image Update Models - EOSS 2024.pdf
 
Salesforce Implementation Services PPT By ABSYZ
Salesforce Implementation Services PPT By ABSYZSalesforce Implementation Services PPT By ABSYZ
Salesforce Implementation Services PPT By ABSYZ
 
Introduction to Firebase Workshop Slides
Introduction to Firebase Workshop SlidesIntroduction to Firebase Workshop Slides
Introduction to Firebase Workshop Slides
 
Revolutionizing the Digital Transformation Office - Leveraging OnePlan’s AI a...
Revolutionizing the Digital Transformation Office - Leveraging OnePlan’s AI a...Revolutionizing the Digital Transformation Office - Leveraging OnePlan’s AI a...
Revolutionizing the Digital Transformation Office - Leveraging OnePlan’s AI a...
 

The road to continuous deployment: a case study (DPC16)

  • 1. THE ROAD TO CONTINUOUS DEPLOYMENT - A CASE STUDY MICHIEL ROOK
  • 2. THE ROAD TO CONTINUOUS DEPLOYMENT - A CASE STUDY ABOUT ME ▸ Java, PHP & Scala contractor ▸ PHP since ’99 ▸ Maintainer of Phing ▸ Dutch Web Alliance ▸ http://www.linkedin.com/in/ michieltcs ▸ @michieltcs
  • 3. THE ROAD TO CONTINUOUS DEPLOYMENT - A CASE STUDY THIS TALK ▸ Background ▸ The approach ▸ Process / standards ▸ Build pipelines ▸ Results & lessons learned
  • 4.
  • 5. THE ROAD TO CONTINUOUS DEPLOYMENT - A CASE STUDY THE SYSTEM - SAN DIEGO ▸ ... or the Big Ball Of Mud ▸ Large legacy monolith ▸ Generates significant income ▸ Slow ▸ Complex, lots of moving parts ▸ Technical debt
  • 6. SAN DIEGO FRONTEND MYSQL DB SAN DIEGO BACKEND LOAD BALANCERS / VARNISH ITBANEN INTERMEDIAIR NATIONALEVACATUREBANK SAN DIEGO FRONTEND SAN DIEGO FRONTEND SAN DIEGO FRONTEND SAN DIEGO BACKEND SAN DIEGO BACKEND SAN DIEGO BACKEND MEMCACHE FTP EXT. SERVICES SOLR
  • 7. THE ROAD TO CONTINUOUS DEPLOYMENT - A CASE STUDY THE SYSTEM - SAN DIEGO ▸ 2.5% code coverage ▸ Fragile tests ▸ Low velocity ▸ Frequent outages / bugs / issues ▸ Frustrated team ▸ Low confidence modifying existing code
  • 10. THE ROAD TO CONTINUOUS DEPLOYMENT - A CASE STUDY THE STACK
  • 11. THE ROAD TO CONTINUOUS DEPLOYMENT - A CASE STUDY APPROACH ▸ Strangler pattern ▸ Proxy to switch between old/new ▸ Migrate individual pages
  • 13. THE ROAD TO CONTINUOUS DEPLOYMENT - A CASE STUDY APPROACH ▸ Services per domain object (job, jobseeker, ...) ▸ Services behind load balancers ▸ Access legacy db’s ▸ Continuous deployment ▸ Containers ▸ Frontends are services
  • 14. SAN DIEGO ELASTIC SEARCHLEGACY DB JOB SERVICE RMQ ITBANEN INTERMEDIAIR NATIONALEVACATUREBANK MONGO DB ITBANEN JOBSEEKER SERVICE NVBINTERMEDIAI
  • 15. THE ROAD TO CONTINUOUS DEPLOYMENT - A CASE STUDY PROXY # Serve job detail page from new code
 RewriteRule ^/vacature/.* /app.php [L,PT]
 
 # Proxy php files to php5-fpm
 ProxyPassMatch ^/(app.php(/.*)?)$ fcgi://127.0.0.1:9000/opt/webapp/web/$1
 
 # Proxy everything else to SanDiego
 ProxyPass / ${SAN_DIEGO__URL} nocanon
 ProxyPassReverse / ${SAN_DIEGO__URL}
 ProxyPreserveHost On
  • 16. THE ROAD TO CONTINUOUS DEPLOYMENT - A CASE STUDY FEATURE TOGGLES, A/B TESTS
  • 18. THE ROAD TO CONTINUOUS DEPLOYMENT - A CASE STUDY PROCESS ▸ Scrum, 1 week sprints ▸ TDD / BDD ▸ Definition of Done ▸ Team mindset / experience ▸ Focus on value ▸ Replace old features with new (legacy becomes obsolete)
  • 20. DEV TEST ACCEPTANCE PRODUCTION DEV TEST ACCEPTANCE PRODUCTION CONTINUOUS DELIVERY CONTINUOUS DEPLOYMENT
  • 21. ONLY COMMIT TO MASTER
  • 29. THE ROAD TO CONTINUOUS DEPLOYMENT - A CASE STUDY AUTOMATION ▸ Builds ▸ Testing ▸ Deployments ▸ Orchestration ▸ Config management
  • 30. EVERY COMMIT GOES TO PRODUCTION
  • 31. THE ROAD TO CONTINUOUS DEPLOYMENT - A CASE STUDY DEFENSE IN DEPTH UNIT TESTS SCENARIOS INTEGRATION SMOKE / PERF. TESTS MANUAL TESTING?
  • 32. THE ROAD TO CONTINUOUS DEPLOYMENT - A CASE STUDY UNIT TESTS public function testGetById(){
 $expectedJob = $this->getJob();
 
 $this->jobRepository->getById($expectedJob->getId())
 ->shouldBeCalled()
 ->willReturn($expectedJob);
 
 $this->assertEquals(
 $expectedJob,
 $this->jobService->getById($expectedJob->getId()
 );
 }
  • 33. THE ROAD TO CONTINUOUS DEPLOYMENT - A CASE STUDY SCENARIOS Scenario: As an API user I need to be able to retrieve a job
 Given there is a valid job
 When I retrieve a valid job
 Then I should get a valid job resource
  • 34. THE ROAD TO CONTINUOUS DEPLOYMENT - A CASE STUDY BUILDING <project name="JobService" default="build">
 <target name="build">
 <delete file="jobservice.tar" quiet="true"/>
 <tar destfile="jobservice.tar">
 <fileset dir="src">
 <include name="*.php"/>
 </fileset>
 </tar>
 </target>
 </project>
  • 35. THE ROAD TO CONTINUOUS DEPLOYMENT - A CASE STUDY DOCKER FROM php:7.0-apache ADD vhost.conf /etc/apache2/sites-available/000-default.conf ADD jobservice.tar /opt/webapp RUN chown -R www-data:www-data /opt/webapp
  • 36. THE ROAD TO CONTINUOUS DEPLOYMENT - A CASE STUDY DEPLOYING PULL IMAGE REMOVE FROM LOAD BALANCER STOP CONTAINER START NEW CONTAINER WAIT FOR PORT SMOKE TESTS / HEALTH CHECKS ADD TO LOAD BALANCER
  • 37. THE ROAD TO CONTINUOUS DEPLOYMENT - A CASE STUDY DEPLOYING - name: remove instance from load balancer
 haproxy: state=disabled host={{ inventory_hostname }} backend=jobservice
 delegate_to: "{{ item }}"
 with_items: groups.haproxy
 
 - name: stop & remove old container
 docker:
 name: jobservice
 state: absent
 image: jobservice
 
 - name: start container
 docker:
 name: jobservice
 state: present
 image: jobservice:{{ BUILD_NUMBER }}
 ports:
 - "8080:8080"
  • 38. THE ROAD TO CONTINUOUS DEPLOYMENT - A CASE STUDY DEPLOYING - name: perform health check
 uri:
 url: http://localhost:8080/_health
 status_code: 200
 timeout: 30
 return_content: true
 changed_when: False
 register: result
 until: result.content is defined and result.content.find("jobservice") != -1
 retries: 10
 delay: 3
 
 - name: add instance to load balancer
 haproxy: state=enabled host={{ inventory_hostname }} backend=jobservice
 delegate_to: "{{ item }}"
 with_items: groups.haproxy
  • 39. THE ROAD TO CONTINUOUS DEPLOYMENT - A CASE STUDY BUILD PIPELINE node {
 stage 'Run tests'
 sh "phpunit"
 sh "behat"
 
 stage 'Build docker image'
 sh "phing build"
 sh "docker build -t jobservice:${env.BUILD_NUMBER} ."
 sh "docker push jobservice:${env.BUILD_NUMBER}"
 
 stage 'Deploy acceptance'
 sh "ansible-playbook -e BUILD_NUMBER=${env.BUILD_NUMBER} -i acc deploy.yml"
 
 stage 'Deploy production'
 sh "ansible-playbook -e BUILD_NUMBER=${env.BUILD_NUMBER} -i prod deploy.yml"
 }
  • 40. THE ROAD TO CONTINUOUS DEPLOYMENT - A CASE STUDY BUILD PIPELINE
  • 43. THE ROAD TO CONTINUOUS DEPLOYMENT - A CASE STUDY RESULTS ▸ Total build time per service < 10 minutes ▸ Significantly improved page load times ▸ Improved audience stats (time on page, pages per session, session duration, traffic, seo ranking, etc) ▸ Increased confidence and velocity ▸ Experimented with new tech/stacks (angular, jvm, eventsourcing) ▸ More fun
  • 44. THE ROAD TO CONTINUOUS DEPLOYMENT - A CASE STUDY LESSONS LEARNED ▸ Team acceptance ▸ Change is hard ▸ Overhead of weekly sprint; requires discipline ▸ Docker orchestration ▸ Issues with traffic between Amazon <-> on-premise datacenter ▸ Javascript testing
  • 45. THE ROAD TO CONTINUOUS DEPLOYMENT - A CASE STUDY LESSONS LEARNED ▸ Experience with new tech ▸ Stability of build pipelines ▸ Management/leadership buy-in ▸ Not enough focus on replacing legacy application
  • 46. THE ROAD TO CONTINUOUS DEPLOYMENT - A CASE STUDY QUESTIONS & DISCUSSION Please leave feedback at https://joind.in/talk/4dab5 Thank you!