the road to continuous deployment
TRANSCRIPT
![Page 1: The Road to Continuous Deployment](https://reader031.vdocument.in/reader031/viewer/2022022412/58f1c2051a28ab40478b45cd/html5/thumbnails/1.jpg)
![Page 2: The Road to Continuous Deployment](https://reader031.vdocument.in/reader031/viewer/2022022412/58f1c2051a28ab40478b45cd/html5/thumbnails/2.jpg)
THE ROAD TO CONTINUOUS DEPLOYMENT - A CASE STUDY
MICHIEL ROOK
@michieltcs
![Page 3: The Road to Continuous Deployment](https://reader031.vdocument.in/reader031/viewer/2022022412/58f1c2051a28ab40478b45cd/html5/thumbnails/3.jpg)
![Page 4: The Road to Continuous Deployment](https://reader031.vdocument.in/reader031/viewer/2022022412/58f1c2051a28ab40478b45cd/html5/thumbnails/4.jpg)
THE SYSTEM - SAN DIEGO
▸ ... or the Big Ball Of Mud
▸ Large legacy monolith
▸ Generates significant income
▸ Slow & complex
▸ Technical debt
@michieltcs
![Page 5: The Road to Continuous Deployment](https://reader031.vdocument.in/reader031/viewer/2022022412/58f1c2051a28ab40478b45cd/html5/thumbnails/5.jpg)
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
@michieltcs
![Page 6: The Road to Continuous Deployment](https://reader031.vdocument.in/reader031/viewer/2022022412/58f1c2051a28ab40478b45cd/html5/thumbnails/6.jpg)
THE SYSTEM - SAN DIEGO
▸ Infrequent, manual releases
▸ Fragile tests
▸ Frequent outages & issues
▸ Frustrated team
▸ Low confidence modifying existing code
@michieltcs
![Page 7: The Road to Continuous Deployment](https://reader031.vdocument.in/reader031/viewer/2022022412/58f1c2051a28ab40478b45cd/html5/thumbnails/7.jpg)
GOALS
▸ Reduce issues
▸ Reduce cycle time
▸ Increase productivity
▸ Increase motivation
![Page 8: The Road to Continuous Deployment](https://reader031.vdocument.in/reader031/viewer/2022022412/58f1c2051a28ab40478b45cd/html5/thumbnails/8.jpg)
REFACTOR? REBUILD?
![Page 9: The Road to Continuous Deployment](https://reader031.vdocument.in/reader031/viewer/2022022412/58f1c2051a28ab40478b45cd/html5/thumbnails/9.jpg)
APPROACH
▸ Strangler pattern
▸ API first
▸ Services per domain object (job, jobseeker, ...)
▸ Migrate individual pages
@michieltcs
![Page 10: The Road to Continuous Deployment](https://reader031.vdocument.in/reader031/viewer/2022022412/58f1c2051a28ab40478b45cd/html5/thumbnails/10.jpg)
ORIGINAL MONOLITH
PROXY
SERVICEORIGINAL MONOLITH
ORIGINAL MONOLITH
SERVICE SERVICE
SERVICE
PROXY
DB
DBDB
DB
DB DB
@michieltcs
![Page 11: The Road to Continuous Deployment](https://reader031.vdocument.in/reader031/viewer/2022022412/58f1c2051a28ab40478b45cd/html5/thumbnails/11.jpg)
APPROACH
▸ Services behind load balancers
▸ Access legacy db’s
▸ Continuous deployment
▸ Docker containers
▸ Frontends are services
@michieltcs
![Page 12: The Road to Continuous Deployment](https://reader031.vdocument.in/reader031/viewer/2022022412/58f1c2051a28ab40478b45cd/html5/thumbnails/12.jpg)
CONTINUOUS EVERYTHING
![Page 13: The Road to Continuous Deployment](https://reader031.vdocument.in/reader031/viewer/2022022412/58f1c2051a28ab40478b45cd/html5/thumbnails/13.jpg)
DEV BUILD / TEST
CONTINUOUS INTEGRATION
@michieltcs
![Page 14: The Road to Continuous Deployment](https://reader031.vdocument.in/reader031/viewer/2022022412/58f1c2051a28ab40478b45cd/html5/thumbnails/14.jpg)
DEV BUILD / TEST ACCEPTANCE PRODUCTION
CONTINUOUS DELIVERY
@michieltcs
![Page 15: The Road to Continuous Deployment](https://reader031.vdocument.in/reader031/viewer/2022022412/58f1c2051a28ab40478b45cd/html5/thumbnails/15.jpg)
DEV BUILD / TEST STAGING PRODUCTION
CONTINUOUS DEPLOYMENT
@michieltcs
![Page 16: The Road to Continuous Deployment](https://reader031.vdocument.in/reader031/viewer/2022022412/58f1c2051a28ab40478b45cd/html5/thumbnails/16.jpg)
WHY CONTINUOUS DEPLOYMENT
▸ Small steps
▸ Early feedback
▸ Reduce cycle time
▸ Reduce risk
▸ Experiments!
@michieltcs
![Page 17: The Road to Continuous Deployment](https://reader031.vdocument.in/reader031/viewer/2022022412/58f1c2051a28ab40478b45cd/html5/thumbnails/17.jpg)
SUCCESSFUL TEAMS HAVE
@michieltcs
![Page 18: The Road to Continuous Deployment](https://reader031.vdocument.in/reader031/viewer/2022022412/58f1c2051a28ab40478b45cd/html5/thumbnails/18.jpg)
ONLY COMMIT TO MASTER
![Page 19: The Road to Continuous Deployment](https://reader031.vdocument.in/reader031/viewer/2022022412/58f1c2051a28ab40478b45cd/html5/thumbnails/19.jpg)
EVERY COMMIT GOES TO PRODUCTION
![Page 20: The Road to Continuous Deployment](https://reader031.vdocument.in/reader031/viewer/2022022412/58f1c2051a28ab40478b45cd/html5/thumbnails/20.jpg)
PAIR PROGRAMMING
![Page 21: The Road to Continuous Deployment](https://reader031.vdocument.in/reader031/viewer/2022022412/58f1c2051a28ab40478b45cd/html5/thumbnails/21.jpg)
QUALITY GATES
![Page 22: The Road to Continuous Deployment](https://reader031.vdocument.in/reader031/viewer/2022022412/58f1c2051a28ab40478b45cd/html5/thumbnails/22.jpg)
FEATURE TOGGLES, A/B TESTS
@michieltcs
![Page 23: The Road to Continuous Deployment](https://reader031.vdocument.in/reader031/viewer/2022022412/58f1c2051a28ab40478b45cd/html5/thumbnails/23.jpg)
DASHBOARDS
![Page 24: The Road to Continuous Deployment](https://reader031.vdocument.in/reader031/viewer/2022022412/58f1c2051a28ab40478b45cd/html5/thumbnails/24.jpg)
DEVOPS
![Page 25: The Road to Continuous Deployment](https://reader031.vdocument.in/reader031/viewer/2022022412/58f1c2051a28ab40478b45cd/html5/thumbnails/25.jpg)
AUTOMATE REPEATABLE THINGS
![Page 26: The Road to Continuous Deployment](https://reader031.vdocument.in/reader031/viewer/2022022412/58f1c2051a28ab40478b45cd/html5/thumbnails/26.jpg)
CONTINUOUS TESTING
![Page 27: The Road to Continuous Deployment](https://reader031.vdocument.in/reader031/viewer/2022022412/58f1c2051a28ab40478b45cd/html5/thumbnails/27.jpg)
CONTINUOUS TESTING
UNIT TESTS
INTEGRATION TESTS
ACCEPTANCE TESTS
UI TESTS
SMOKETESTS
Cost Speed
Exploratorytesting Monitoring
@michieltcs
![Page 28: The Road to Continuous Deployment](https://reader031.vdocument.in/reader031/viewer/2022022412/58f1c2051a28ab40478b45cd/html5/thumbnails/28.jpg)
PIPELINE AS CODE
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=${env.BUILD_NUMBER} -i acc deploy.yml" stage 'Deploy production' sh "ansible-playbook -e BUILD=${env.BUILD_NUMBER} -i prod deploy.yml" }
@michieltcs
![Page 29: The Road to Continuous Deployment](https://reader031.vdocument.in/reader031/viewer/2022022412/58f1c2051a28ab40478b45cd/html5/thumbnails/29.jpg)
DEPLOYING
PULL IMAGE
START NEW CONTAINER
WAIT FOR PORT
SMOKE TESTS / HEALTH CHECKS
ADD NEW CONTAINER TO LB
REMOVE OLD CONTAINER FROM LB
STOP OLD CONTAINER
docker pull
@michieltcs
![Page 30: The Road to Continuous Deployment](https://reader031.vdocument.in/reader031/viewer/2022022412/58f1c2051a28ab40478b45cd/html5/thumbnails/30.jpg)
DEPLOYING
PULL IMAGE
START NEW CONTAINER
WAIT FOR PORT
SMOKE TESTS / HEALTH CHECKS
ADD NEW CONTAINER TO LB
REMOVE OLD CONTAINER FROM LB
STOP OLD CONTAINER
docker run
@michieltcs
![Page 31: The Road to Continuous Deployment](https://reader031.vdocument.in/reader031/viewer/2022022412/58f1c2051a28ab40478b45cd/html5/thumbnails/31.jpg)
DEPLOYING
PULL IMAGE
START NEW CONTAINER
WAIT FOR PORT
SMOKE TESTS / HEALTH CHECKS
ADD NEW CONTAINER TO LB
REMOVE OLD CONTAINER FROM LB
STOP OLD CONTAINER
wait_for: port=8080 delay=5 timeout=15
@michieltcs
![Page 32: The Road to Continuous Deployment](https://reader031.vdocument.in/reader031/viewer/2022022412/58f1c2051a28ab40478b45cd/html5/thumbnails/32.jpg)
DEPLOYING
PULL IMAGE
START NEW CONTAINER
WAIT FOR PORT
SMOKE TESTS / HEALTH CHECKS
ADD NEW CONTAINER TO LB
REMOVE OLD CONTAINER FROM LB
STOP OLD CONTAINER
uri: url: http://localhost:8080/_health status_code: 200 timeout: 30
@michieltcs
![Page 33: The Road to Continuous Deployment](https://reader031.vdocument.in/reader031/viewer/2022022412/58f1c2051a28ab40478b45cd/html5/thumbnails/33.jpg)
DEPLOYING
PULL IMAGE
START NEW CONTAINER
WAIT FOR PORT
SMOKE TESTS / HEALTH CHECKS
ADD NEW CONTAINER TO LB
REMOVE OLD CONTAINER FROM LB
STOP OLD CONTAINER
template: src=haproxy.cfg.j2 dest=/etc/haproxy/haproxy.cfg
service: name=haproxy state=reloaded
@michieltcs
![Page 34: The Road to Continuous Deployment](https://reader031.vdocument.in/reader031/viewer/2022022412/58f1c2051a28ab40478b45cd/html5/thumbnails/34.jpg)
DEPLOYING
PULL IMAGE
START NEW CONTAINER
WAIT FOR PORT
SMOKE TESTS / HEALTH CHECKS
ADD NEW CONTAINER TO LB
REMOVE OLD CONTAINER FROM LB
STOP OLD CONTAINER
template: src=haproxy.cfg.j2 dest=/etc/haproxy/haproxy.cfg
service: name=haproxy state=reloaded
@michieltcs
![Page 35: The Road to Continuous Deployment](https://reader031.vdocument.in/reader031/viewer/2022022412/58f1c2051a28ab40478b45cd/html5/thumbnails/35.jpg)
DEPLOYING
PULL IMAGE
START NEW CONTAINER
WAIT FOR PORT
SMOKE TESTS / HEALTH CHECKS
ADD NEW CONTAINER TO LB
REMOVE OLD CONTAINER FROM LB
STOP OLD CONTAINER
docker stop
docker rm
@michieltcs
![Page 36: The Road to Continuous Deployment](https://reader031.vdocument.in/reader031/viewer/2022022412/58f1c2051a28ab40478b45cd/html5/thumbnails/36.jpg)
BUILD PIPELINE
@michieltcs
![Page 37: The Road to Continuous Deployment](https://reader031.vdocument.in/reader031/viewer/2022022412/58f1c2051a28ab40478b45cd/html5/thumbnails/37.jpg)
FEEDBACK!
![Page 38: The Road to Continuous Deployment](https://reader031.vdocument.in/reader031/viewer/2022022412/58f1c2051a28ab40478b45cd/html5/thumbnails/38.jpg)
RESULTS
![Page 39: The Road to Continuous Deployment](https://reader031.vdocument.in/reader031/viewer/2022022412/58f1c2051a28ab40478b45cd/html5/thumbnails/39.jpg)
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, event sourcing)
▸ More fun
@michieltcs
![Page 40: The Road to Continuous Deployment](https://reader031.vdocument.in/reader031/viewer/2022022412/58f1c2051a28ab40478b45cd/html5/thumbnails/40.jpg)
LESSONS LEARNED
▸ Team acceptance
▸ Change is hard
▸ Mentality / discipline
▸ Docker stability/orchestration
▸ Issues with traffic between Amazon <-> on-premise datacenter
@michieltcs
![Page 41: The Road to Continuous Deployment](https://reader031.vdocument.in/reader031/viewer/2022022412/58f1c2051a28ab40478b45cd/html5/thumbnails/41.jpg)
LESSONS LEARNED
▸ Experience with new tech
▸ Stability of build pipelines
▸ Business alignment
▸ Limit feature toggles
▸ Keep focus on replacing legacy application
@michieltcs
![Page 42: The Road to Continuous Deployment](https://reader031.vdocument.in/reader031/viewer/2022022412/58f1c2051a28ab40478b45cd/html5/thumbnails/42.jpg)
![Page 43: The Road to Continuous Deployment](https://reader031.vdocument.in/reader031/viewer/2022022412/58f1c2051a28ab40478b45cd/html5/thumbnails/43.jpg)
![Page 44: The Road to Continuous Deployment](https://reader031.vdocument.in/reader031/viewer/2022022412/58f1c2051a28ab40478b45cd/html5/thumbnails/44.jpg)
Turn-key Continuous Deployment
Zero downtime deployments
Modern, autoscaling infrastructure with built-in monitoring
Pipeline in five minutes