SlideShare a Scribd company logo
1 of 30
Download to read offline
Improving the deployment Process
Step by Step
About me
Daniel Fahlke (aka Flyingmana)
● Working as a Software Engineer with Magento and PHP
● Doing lots of open Source
● Helps maintaining the OpenMage-LTS Fork
● http://flyingmana.name/
● https://github.com/Flyingmana
● https://twitter.com/Flyingmana
● https://www.patreon.com/Flyingmana
● https://github.com/OpenMage/magento-lts
About my Workplace (simplified version)
https://www.valmano.de/
We sell Watches and Jewelry
About my Workplace (simplified version)
https://www.valmano.de/
We sell Watches and Jewelry
TV series teached me,
Watches are the best anniversary present for long term employees.
Deploying with Git
Great, you are not deploying with FTP/SFTP anymore
● Faster switching between version
● Nearly atomar switch (latency between first and last changed file)
○ Error rate of ~0.3%
● No Fear of on server only “workarounds”
What Error Rate?!!!!
● Request Starts
● Request did load a lot of classes
● Files Change
● Loads another class
● New Class uses method which did not exist in already loaded classes
○ ERROR!!
But OpCache
● Request Starts
● Request did load classes from Opcache
● Files Change
● Loads another class from Opcache
● Loads changed template which did not exist before
● New Template uses method which did not exist in already loaded classes
○ ERROR!!
But OpCache
● Request Starts
● Request did load classes from Opcache
● Files Change
● Loads another class from Opcache
● Loads changed template which did not exist before
● New Template uses method which did not exist in already loaded classes
○ ERROR!!
I forgot the exact case, why this is not covered from opcache, but it still happens
sometimes
How to solve this kind of errors
Prevent files being changed while requests are active in the project folder.
Blue / Green Deployment
Basic Idea is, you have your project twice on the Filesystem
● An active one, and an inactive one
● This can be a symlink which is used as project root
○ If the first file is loaded in magento, most is loaded relative to this file, not to the docroot
● Or full instances of FPM servers
○ which are switched over by a webserver config
● Works also with NodeJS Apps
Take Servers temporary out of loadbalancer
Works only if you have multiple servers
● Take server out of loadbalancer
● Deploy changes
● Put server back in
● Take Next server
But Database Migrations
● Somehow new Code tends to fail, when you dont run the DB migrations
But Database Migrations
● Somehow new Code tends to fail, when you dont run the DB migrations
● Or worse, old Code fails after the DB migration were run.
But Database Migrations
● Somehow new Code tends to fail, when you dont run the DB migrations
● Or worse, old Code fails after the DB migration were run.
!!!!Maintainance Mode!!!!
But Database Migrations
● Somehow new Code tends to fail, when you dont run the DB migrations
● Or worse, old Code fails after the DB migration were run.
!!!!Maintainance Mode!!!! Means you failed
Best Practice of DB Migrations
● Make your Code work - always
○ Add proper handling so it still works before the migration is done
○ Try to avoid DB changes, which break old code
■ You should be able to roll back a whole week
■ You should deploy more then once a week
■ If something is terrible broken for a week already, dont roll back, push forward
○ Run DB migrations as last step of deployment
■ Maybe even after a first check if everything still works
Best Practice of DB Migrations
● Make your Code work - always
○ Add proper handling so it still works before the migration is done
○ Try to avoid DB changes, which break old code
■ You should be able to roll back a whole week
■ You should deploy more then once a week
■ If something is terrible broken for a week already, dont roll back, push forward
○ Run DB migrations as last step of deployment
■ Maybe even after a first check if everything still works
● Complain to module vendors if they dont follow best practice
○ Tell them about the additional work it did cause for you
○ But be nice
○ And help them with suggestions
How to measure a deployment
● Time between Triggering and finishing deployment
● Time between a failed deployment and a finished rollback
● Error rate & Downtime
● Average Grade of Fear in the Team doing a deployment on Friday at 17:00
○ And also The Max()
○ Having no Fear and a 2 hour downtime after deployment results in minus points
●
● Time between Triggering and finishing deployment
Not even seconds with git, so why switch?
● Sass
● Babel
● Code Generation
● Composer
● Time between Triggering and finishing deployment
Not even seconds with git, so why switch?
● Sass
● Babel
● Code Generation
● Composer
Because you also have a Build step, which is not covered by Git
● Time between Triggering and finishing deployment
Depends a lot on the Build process
Solution:
● Move the Build process out of the deployment
● Create build artifacts
○ Composer_vendor_$hash.tgz
○ node_modules_$hash.tgz
○ ….
● Add them via single downloads over the local network
● Time between a failed deployment and a finished rollback
In case you have a Blue / Green deployment,
Independent of build process < ~15sec
This is more a risk value, which therefore should be as low as possible.
● Additional health checks during deployment
○ Simulate basic requests
○ Maybe have health check URLs
● Having a CI or Staging setup can help catch problems even before
● Investigate problems afterwards and find automated solutions
○ Never blame the person who hit deploy
● Error rate & Downtime
Fearing deployment
Fear in this case is a good sign for something not working reliable.
While the previous points should help, there is also a human component always.
● People can only manage a certain amount of changes at once
● Trusting a tool is not happening from one day to another
○ Split changes up into smaller parts
○ Spread them over several weeks
○ Involve them in implementing the changes
Build the Composer Vendor artifact
Use the artifact on deploy
There is no one-size-fits-all solution
There are lot of existing solutions
● Capistrano
● Deployer
● Robo
● Ansible
And probably a reason why you dont use one of them already.
The learnings
● Take small steps
● Reducing build time is easier than it seems
○ Build artifacts are just another kind of (permanent) cache
● Make DB migrations harmless
● Simple php scripts are NOT bad practice
Thank You for listening
In case you want to also say Thank you, support me on Patreon.
https://www.patreon.com/Flyingmana
I also take Requests for next Topics I should present about.
Improve the deployment process step by step

More Related Content

What's hot

WordPress Local Environments VVV
WordPress Local Environments   VVVWordPress Local Environments   VVV
WordPress Local Environments VVVAli Basheer
 
Why You Should Start Using Docker
Why You Should Start Using DockerWhy You Should Start Using Docker
Why You Should Start Using DockerAlexandru Bolboaca
 
Continuous Delivery in Practice (extended)
Continuous Delivery in Practice (extended)Continuous Delivery in Practice (extended)
Continuous Delivery in Practice (extended)Tzach Zohar
 
Gearman: A Job Server made for Scale
Gearman: A Job Server made for ScaleGearman: A Job Server made for Scale
Gearman: A Job Server made for ScaleMike Willbanks
 
Khanh-Nguyen - Gearman - distributed process solution
Khanh-Nguyen - Gearman - distributed process solutionKhanh-Nguyen - Gearman - distributed process solution
Khanh-Nguyen - Gearman - distributed process solutionJavaScript Meetup HCMC
 
The Continuous Delivery process
The Continuous Delivery processThe Continuous Delivery process
The Continuous Delivery processXPeppers
 
PuppetConf 2015 - Testing - Richard Pijnenburg
PuppetConf 2015 - Testing - Richard PijnenburgPuppetConf 2015 - Testing - Richard Pijnenburg
PuppetConf 2015 - Testing - Richard PijnenburgRichard Pijnenburg
 
140 releases per month
140 releases per month140 releases per month
140 releases per monthManuel Vacelet
 
PHP Conference Brasil 2013 - Virtualização e Provisionamento de Ambientes c...
PHP Conference Brasil 2013 - Virtualização e Provisionamento de Ambientes c...PHP Conference Brasil 2013 - Virtualização e Provisionamento de Ambientes c...
PHP Conference Brasil 2013 - Virtualização e Provisionamento de Ambientes c...Lucas Arruda
 
Tuenti Release Workflow v1.1
Tuenti Release Workflow v1.1Tuenti Release Workflow v1.1
Tuenti Release Workflow v1.1Tuenti
 
icebreakerwithdevops-150218112943-conversion-gate02
icebreakerwithdevops-150218112943-conversion-gate02icebreakerwithdevops-150218112943-conversion-gate02
icebreakerwithdevops-150218112943-conversion-gate02Manohar Kumar
 
From naive to agile - software engineering approach
From naive to agile - software engineering approachFrom naive to agile - software engineering approach
From naive to agile - software engineering approachStayman Hou
 
Distributed Queue System using Gearman
Distributed Queue System using GearmanDistributed Queue System using Gearman
Distributed Queue System using GearmanEric Cho
 
Deploying node.js at scale - Maraschi, Collina - Codemotion Amsterdam 2016
Deploying node.js at scale - Maraschi, Collina - Codemotion Amsterdam 2016Deploying node.js at scale - Maraschi, Collina - Codemotion Amsterdam 2016
Deploying node.js at scale - Maraschi, Collina - Codemotion Amsterdam 2016Codemotion
 
open source product management (feat. npm)
open source product management (feat. npm)open source product management (feat. npm)
open source product management (feat. npm)Forrest Norvell
 
Using Crowdsourced Testing to Turbocharge your Development Team
Using Crowdsourced Testing to Turbocharge your Development TeamUsing Crowdsourced Testing to Turbocharge your Development Team
Using Crowdsourced Testing to Turbocharge your Development TeamRainforest QA
 
Introduction to DevOps. Continuous Integration by Myroslav Dmytrus
Introduction to DevOps. Continuous Integration by Myroslav Dmytrus Introduction to DevOps. Continuous Integration by Myroslav Dmytrus
Introduction to DevOps. Continuous Integration by Myroslav Dmytrus Binary Studio
 
Felt - Front end load testing
Felt - Front end load testingFelt - Front end load testing
Felt - Front end load testingSamuel Vandamme
 

What's hot (20)

WordPress Local Environments VVV
WordPress Local Environments   VVVWordPress Local Environments   VVV
WordPress Local Environments VVV
 
Why You Should Start Using Docker
Why You Should Start Using DockerWhy You Should Start Using Docker
Why You Should Start Using Docker
 
Continuous Delivery in Practice (extended)
Continuous Delivery in Practice (extended)Continuous Delivery in Practice (extended)
Continuous Delivery in Practice (extended)
 
Gearman: A Job Server made for Scale
Gearman: A Job Server made for ScaleGearman: A Job Server made for Scale
Gearman: A Job Server made for Scale
 
OpenNTF Essentials
OpenNTF EssentialsOpenNTF Essentials
OpenNTF Essentials
 
Khanh-Nguyen - Gearman - distributed process solution
Khanh-Nguyen - Gearman - distributed process solutionKhanh-Nguyen - Gearman - distributed process solution
Khanh-Nguyen - Gearman - distributed process solution
 
The Continuous Delivery process
The Continuous Delivery processThe Continuous Delivery process
The Continuous Delivery process
 
PuppetConf 2015 - Testing - Richard Pijnenburg
PuppetConf 2015 - Testing - Richard PijnenburgPuppetConf 2015 - Testing - Richard Pijnenburg
PuppetConf 2015 - Testing - Richard Pijnenburg
 
140 releases per month
140 releases per month140 releases per month
140 releases per month
 
PHP Conference Brasil 2013 - Virtualização e Provisionamento de Ambientes c...
PHP Conference Brasil 2013 - Virtualização e Provisionamento de Ambientes c...PHP Conference Brasil 2013 - Virtualização e Provisionamento de Ambientes c...
PHP Conference Brasil 2013 - Virtualização e Provisionamento de Ambientes c...
 
Tuenti Release Workflow v1.1
Tuenti Release Workflow v1.1Tuenti Release Workflow v1.1
Tuenti Release Workflow v1.1
 
icebreakerwithdevops-150218112943-conversion-gate02
icebreakerwithdevops-150218112943-conversion-gate02icebreakerwithdevops-150218112943-conversion-gate02
icebreakerwithdevops-150218112943-conversion-gate02
 
From naive to agile - software engineering approach
From naive to agile - software engineering approachFrom naive to agile - software engineering approach
From naive to agile - software engineering approach
 
Distributed Queue System using Gearman
Distributed Queue System using GearmanDistributed Queue System using Gearman
Distributed Queue System using Gearman
 
Deploying node.js at scale - Maraschi, Collina - Codemotion Amsterdam 2016
Deploying node.js at scale - Maraschi, Collina - Codemotion Amsterdam 2016Deploying node.js at scale - Maraschi, Collina - Codemotion Amsterdam 2016
Deploying node.js at scale - Maraschi, Collina - Codemotion Amsterdam 2016
 
open source product management (feat. npm)
open source product management (feat. npm)open source product management (feat. npm)
open source product management (feat. npm)
 
Using Crowdsourced Testing to Turbocharge your Development Team
Using Crowdsourced Testing to Turbocharge your Development TeamUsing Crowdsourced Testing to Turbocharge your Development Team
Using Crowdsourced Testing to Turbocharge your Development Team
 
Introduction to DevOps. Continuous Integration by Myroslav Dmytrus
Introduction to DevOps. Continuous Integration by Myroslav Dmytrus Introduction to DevOps. Continuous Integration by Myroslav Dmytrus
Introduction to DevOps. Continuous Integration by Myroslav Dmytrus
 
Felt - Front end load testing
Felt - Front end load testingFelt - Front end load testing
Felt - Front end load testing
 
Gearman
GearmanGearman
Gearman
 

Similar to Improve the deployment process step by step

Devops, the future is here, it's just not evenly distributed yet.
Devops, the future is here, it's just not evenly distributed yet.Devops, the future is here, it's just not evenly distributed yet.
Devops, the future is here, it's just not evenly distributed yet.Kris Buytaert
 
Devops at Startup Weekend BXL
Devops at Startup Weekend BXLDevops at Startup Weekend BXL
Devops at Startup Weekend BXLKris Buytaert
 
Monitoring and automation
Monitoring and automationMonitoring and automation
Monitoring and automationRicardo Bánffy
 
Laptop Devops: Putting Modern Infrastructure Automation to Work For Local Dev...
Laptop Devops: Putting Modern Infrastructure Automation to Work For Local Dev...Laptop Devops: Putting Modern Infrastructure Automation to Work For Local Dev...
Laptop Devops: Putting Modern Infrastructure Automation to Work For Local Dev...Thoughtworks
 
Cloud Native CI/CD with Spring Cloud Pipelines
Cloud Native CI/CD with Spring Cloud PipelinesCloud Native CI/CD with Spring Cloud Pipelines
Cloud Native CI/CD with Spring Cloud PipelinesLars Rosenquist
 
Cloud Native CI/CD with Spring Cloud Pipelines
Cloud Native CI/CD with Spring Cloud PipelinesCloud Native CI/CD with Spring Cloud Pipelines
Cloud Native CI/CD with Spring Cloud PipelinesLars Rosenquist
 
Continuous Deployment
Continuous DeploymentContinuous Deployment
Continuous DeploymentSmartling
 
Passing the Joel Test in the PHP World (phpbnl10)
Passing the Joel Test in the PHP World (phpbnl10)Passing the Joel Test in the PHP World (phpbnl10)
Passing the Joel Test in the PHP World (phpbnl10)Lorna Mitchell
 
Devops, Secops, Opsec, DevSec *ops *.* ?
Devops, Secops, Opsec, DevSec *ops *.* ?Devops, Secops, Opsec, DevSec *ops *.* ?
Devops, Secops, Opsec, DevSec *ops *.* ?Kris Buytaert
 
Continuous Deployment Applied at MyHeritage
Continuous Deployment Applied at MyHeritageContinuous Deployment Applied at MyHeritage
Continuous Deployment Applied at MyHeritageRan Levy
 
Behaviour Testing and Continuous Integration with Drupal
Behaviour Testing and Continuous Integration with DrupalBehaviour Testing and Continuous Integration with Drupal
Behaviour Testing and Continuous Integration with Drupalsmithmilner
 
Instant LAMP Stack with Vagrant and Puppet
Instant LAMP Stack with Vagrant and PuppetInstant LAMP Stack with Vagrant and Puppet
Instant LAMP Stack with Vagrant and PuppetPatrick Lee
 
Secure your Secrets and Settings in ColdFusion
Secure your Secrets and Settings in ColdFusionSecure your Secrets and Settings in ColdFusion
Secure your Secrets and Settings in ColdFusionOrtus Solutions, Corp
 
Devops Devops Devops, at Froscon
Devops Devops Devops, at FrosconDevops Devops Devops, at Froscon
Devops Devops Devops, at FrosconKris Buytaert
 
The Final Frontier, Automating Dynamic Security Testing
The Final Frontier, Automating Dynamic Security TestingThe Final Frontier, Automating Dynamic Security Testing
The Final Frontier, Automating Dynamic Security TestingMatt Tesauro
 
Deploying software at Scale
Deploying software at ScaleDeploying software at Scale
Deploying software at ScaleKris Buytaert
 
Mulesoft Meetup Milano #9 - Batch Processing and CI/CD
Mulesoft Meetup Milano #9 - Batch Processing and CI/CDMulesoft Meetup Milano #9 - Batch Processing and CI/CD
Mulesoft Meetup Milano #9 - Batch Processing and CI/CDGonzalo Marcos Ansoain
 
How fast can you onboard a new team member with VAGRANT ?
How fast can you onboard a new team member with VAGRANT ?How fast can you onboard a new team member with VAGRANT ?
How fast can you onboard a new team member with VAGRANT ?Vivek Parihar
 

Similar to Improve the deployment process step by step (20)

Devops, the future is here, it's just not evenly distributed yet.
Devops, the future is here, it's just not evenly distributed yet.Devops, the future is here, it's just not evenly distributed yet.
Devops, the future is here, it's just not evenly distributed yet.
 
Devops at Startup Weekend BXL
Devops at Startup Weekend BXLDevops at Startup Weekend BXL
Devops at Startup Weekend BXL
 
Monitoring and automation
Monitoring and automationMonitoring and automation
Monitoring and automation
 
Git sourcecontrolpreso
Git sourcecontrolpresoGit sourcecontrolpreso
Git sourcecontrolpreso
 
Laptop Devops: Putting Modern Infrastructure Automation to Work For Local Dev...
Laptop Devops: Putting Modern Infrastructure Automation to Work For Local Dev...Laptop Devops: Putting Modern Infrastructure Automation to Work For Local Dev...
Laptop Devops: Putting Modern Infrastructure Automation to Work For Local Dev...
 
Cloud Native CI/CD with Spring Cloud Pipelines
Cloud Native CI/CD with Spring Cloud PipelinesCloud Native CI/CD with Spring Cloud Pipelines
Cloud Native CI/CD with Spring Cloud Pipelines
 
Cloud Native CI/CD with Spring Cloud Pipelines
Cloud Native CI/CD with Spring Cloud PipelinesCloud Native CI/CD with Spring Cloud Pipelines
Cloud Native CI/CD with Spring Cloud Pipelines
 
Continuous Deployment
Continuous DeploymentContinuous Deployment
Continuous Deployment
 
Devops For Drupal
Devops  For DrupalDevops  For Drupal
Devops For Drupal
 
Passing the Joel Test in the PHP World (phpbnl10)
Passing the Joel Test in the PHP World (phpbnl10)Passing the Joel Test in the PHP World (phpbnl10)
Passing the Joel Test in the PHP World (phpbnl10)
 
Devops, Secops, Opsec, DevSec *ops *.* ?
Devops, Secops, Opsec, DevSec *ops *.* ?Devops, Secops, Opsec, DevSec *ops *.* ?
Devops, Secops, Opsec, DevSec *ops *.* ?
 
Continuous Deployment Applied at MyHeritage
Continuous Deployment Applied at MyHeritageContinuous Deployment Applied at MyHeritage
Continuous Deployment Applied at MyHeritage
 
Behaviour Testing and Continuous Integration with Drupal
Behaviour Testing and Continuous Integration with DrupalBehaviour Testing and Continuous Integration with Drupal
Behaviour Testing and Continuous Integration with Drupal
 
Instant LAMP Stack with Vagrant and Puppet
Instant LAMP Stack with Vagrant and PuppetInstant LAMP Stack with Vagrant and Puppet
Instant LAMP Stack with Vagrant and Puppet
 
Secure your Secrets and Settings in ColdFusion
Secure your Secrets and Settings in ColdFusionSecure your Secrets and Settings in ColdFusion
Secure your Secrets and Settings in ColdFusion
 
Devops Devops Devops, at Froscon
Devops Devops Devops, at FrosconDevops Devops Devops, at Froscon
Devops Devops Devops, at Froscon
 
The Final Frontier, Automating Dynamic Security Testing
The Final Frontier, Automating Dynamic Security TestingThe Final Frontier, Automating Dynamic Security Testing
The Final Frontier, Automating Dynamic Security Testing
 
Deploying software at Scale
Deploying software at ScaleDeploying software at Scale
Deploying software at Scale
 
Mulesoft Meetup Milano #9 - Batch Processing and CI/CD
Mulesoft Meetup Milano #9 - Batch Processing and CI/CDMulesoft Meetup Milano #9 - Batch Processing and CI/CD
Mulesoft Meetup Milano #9 - Batch Processing and CI/CD
 
How fast can you onboard a new team member with VAGRANT ?
How fast can you onboard a new team member with VAGRANT ?How fast can you onboard a new team member with VAGRANT ?
How fast can you onboard a new team member with VAGRANT ?
 

Recently uploaded

Software and Systems Engineering Standards: Verification and Validation of Sy...
Software and Systems Engineering Standards: Verification and Validation of Sy...Software and Systems Engineering Standards: Verification and Validation of Sy...
Software and Systems Engineering Standards: Verification and Validation of Sy...VICTOR MAESTRE RAMIREZ
 
Virtual memory management in Operating System
Virtual memory management in Operating SystemVirtual memory management in Operating System
Virtual memory management in Operating SystemRashmi Bhat
 
US Department of Education FAFSA Week of Action
US Department of Education FAFSA Week of ActionUS Department of Education FAFSA Week of Action
US Department of Education FAFSA Week of ActionMebane Rash
 
Engineering Drawing section of solid
Engineering Drawing     section of solidEngineering Drawing     section of solid
Engineering Drawing section of solidnamansinghjarodiya
 
Correctly Loading Incremental Data at Scale
Correctly Loading Incremental Data at ScaleCorrectly Loading Incremental Data at Scale
Correctly Loading Incremental Data at ScaleAlluxio, Inc.
 
Internet of things -Arshdeep Bahga .pptx
Internet of things -Arshdeep Bahga .pptxInternet of things -Arshdeep Bahga .pptx
Internet of things -Arshdeep Bahga .pptxVelmuruganTECE
 
multiple access in wireless communication
multiple access in wireless communicationmultiple access in wireless communication
multiple access in wireless communicationpanditadesh123
 
IVE Industry Focused Event - Defence Sector 2024
IVE Industry Focused Event - Defence Sector 2024IVE Industry Focused Event - Defence Sector 2024
IVE Industry Focused Event - Defence Sector 2024Mark Billinghurst
 
11. Properties of Liquid Fuels in Energy Engineering.pdf
11. Properties of Liquid Fuels in Energy Engineering.pdf11. Properties of Liquid Fuels in Energy Engineering.pdf
11. Properties of Liquid Fuels in Energy Engineering.pdfHafizMudaserAhmad
 
Industrial Safety Unit-IV workplace health and safety.ppt
Industrial Safety Unit-IV workplace health and safety.pptIndustrial Safety Unit-IV workplace health and safety.ppt
Industrial Safety Unit-IV workplace health and safety.pptNarmatha D
 
Earthing details of Electrical Substation
Earthing details of Electrical SubstationEarthing details of Electrical Substation
Earthing details of Electrical Substationstephanwindworld
 
Gurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort service
Gurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort serviceGurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort service
Gurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort servicejennyeacort
 
Past, Present and Future of Generative AI
Past, Present and Future of Generative AIPast, Present and Future of Generative AI
Past, Present and Future of Generative AIabhishek36461
 
Work Experience-Dalton Park.pptxfvvvvvvv
Work Experience-Dalton Park.pptxfvvvvvvvWork Experience-Dalton Park.pptxfvvvvvvv
Work Experience-Dalton Park.pptxfvvvvvvvLewisJB
 
Unit7-DC_Motors nkkjnsdkfnfcdfknfdgfggfg
Unit7-DC_Motors nkkjnsdkfnfcdfknfdgfggfgUnit7-DC_Motors nkkjnsdkfnfcdfknfdgfggfg
Unit7-DC_Motors nkkjnsdkfnfcdfknfdgfggfgsaravananr517913
 
Comparative study of High-rise Building Using ETABS,SAP200 and SAFE., SAFE an...
Comparative study of High-rise Building Using ETABS,SAP200 and SAFE., SAFE an...Comparative study of High-rise Building Using ETABS,SAP200 and SAFE., SAFE an...
Comparative study of High-rise Building Using ETABS,SAP200 and SAFE., SAFE an...Erbil Polytechnic University
 
UNIT III ANALOG ELECTRONICS (BASIC ELECTRONICS)
UNIT III ANALOG ELECTRONICS (BASIC ELECTRONICS)UNIT III ANALOG ELECTRONICS (BASIC ELECTRONICS)
UNIT III ANALOG ELECTRONICS (BASIC ELECTRONICS)Dr SOUNDIRARAJ N
 
Risk Management in Engineering Construction Project
Risk Management in Engineering Construction ProjectRisk Management in Engineering Construction Project
Risk Management in Engineering Construction ProjectErbil Polytechnic University
 

Recently uploaded (20)

young call girls in Green Park🔝 9953056974 🔝 escort Service
young call girls in Green Park🔝 9953056974 🔝 escort Serviceyoung call girls in Green Park🔝 9953056974 🔝 escort Service
young call girls in Green Park🔝 9953056974 🔝 escort Service
 
Software and Systems Engineering Standards: Verification and Validation of Sy...
Software and Systems Engineering Standards: Verification and Validation of Sy...Software and Systems Engineering Standards: Verification and Validation of Sy...
Software and Systems Engineering Standards: Verification and Validation of Sy...
 
Virtual memory management in Operating System
Virtual memory management in Operating SystemVirtual memory management in Operating System
Virtual memory management in Operating System
 
US Department of Education FAFSA Week of Action
US Department of Education FAFSA Week of ActionUS Department of Education FAFSA Week of Action
US Department of Education FAFSA Week of Action
 
Engineering Drawing section of solid
Engineering Drawing     section of solidEngineering Drawing     section of solid
Engineering Drawing section of solid
 
Correctly Loading Incremental Data at Scale
Correctly Loading Incremental Data at ScaleCorrectly Loading Incremental Data at Scale
Correctly Loading Incremental Data at Scale
 
Design and analysis of solar grass cutter.pdf
Design and analysis of solar grass cutter.pdfDesign and analysis of solar grass cutter.pdf
Design and analysis of solar grass cutter.pdf
 
Internet of things -Arshdeep Bahga .pptx
Internet of things -Arshdeep Bahga .pptxInternet of things -Arshdeep Bahga .pptx
Internet of things -Arshdeep Bahga .pptx
 
multiple access in wireless communication
multiple access in wireless communicationmultiple access in wireless communication
multiple access in wireless communication
 
IVE Industry Focused Event - Defence Sector 2024
IVE Industry Focused Event - Defence Sector 2024IVE Industry Focused Event - Defence Sector 2024
IVE Industry Focused Event - Defence Sector 2024
 
11. Properties of Liquid Fuels in Energy Engineering.pdf
11. Properties of Liquid Fuels in Energy Engineering.pdf11. Properties of Liquid Fuels in Energy Engineering.pdf
11. Properties of Liquid Fuels in Energy Engineering.pdf
 
Industrial Safety Unit-IV workplace health and safety.ppt
Industrial Safety Unit-IV workplace health and safety.pptIndustrial Safety Unit-IV workplace health and safety.ppt
Industrial Safety Unit-IV workplace health and safety.ppt
 
Earthing details of Electrical Substation
Earthing details of Electrical SubstationEarthing details of Electrical Substation
Earthing details of Electrical Substation
 
Gurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort service
Gurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort serviceGurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort service
Gurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort service
 
Past, Present and Future of Generative AI
Past, Present and Future of Generative AIPast, Present and Future of Generative AI
Past, Present and Future of Generative AI
 
Work Experience-Dalton Park.pptxfvvvvvvv
Work Experience-Dalton Park.pptxfvvvvvvvWork Experience-Dalton Park.pptxfvvvvvvv
Work Experience-Dalton Park.pptxfvvvvvvv
 
Unit7-DC_Motors nkkjnsdkfnfcdfknfdgfggfg
Unit7-DC_Motors nkkjnsdkfnfcdfknfdgfggfgUnit7-DC_Motors nkkjnsdkfnfcdfknfdgfggfg
Unit7-DC_Motors nkkjnsdkfnfcdfknfdgfggfg
 
Comparative study of High-rise Building Using ETABS,SAP200 and SAFE., SAFE an...
Comparative study of High-rise Building Using ETABS,SAP200 and SAFE., SAFE an...Comparative study of High-rise Building Using ETABS,SAP200 and SAFE., SAFE an...
Comparative study of High-rise Building Using ETABS,SAP200 and SAFE., SAFE an...
 
UNIT III ANALOG ELECTRONICS (BASIC ELECTRONICS)
UNIT III ANALOG ELECTRONICS (BASIC ELECTRONICS)UNIT III ANALOG ELECTRONICS (BASIC ELECTRONICS)
UNIT III ANALOG ELECTRONICS (BASIC ELECTRONICS)
 
Risk Management in Engineering Construction Project
Risk Management in Engineering Construction ProjectRisk Management in Engineering Construction Project
Risk Management in Engineering Construction Project
 

Improve the deployment process step by step

  • 1. Improving the deployment Process Step by Step
  • 2. About me Daniel Fahlke (aka Flyingmana) ● Working as a Software Engineer with Magento and PHP ● Doing lots of open Source ● Helps maintaining the OpenMage-LTS Fork ● http://flyingmana.name/ ● https://github.com/Flyingmana ● https://twitter.com/Flyingmana ● https://www.patreon.com/Flyingmana ● https://github.com/OpenMage/magento-lts
  • 3. About my Workplace (simplified version) https://www.valmano.de/ We sell Watches and Jewelry
  • 4. About my Workplace (simplified version) https://www.valmano.de/ We sell Watches and Jewelry TV series teached me, Watches are the best anniversary present for long term employees.
  • 5. Deploying with Git Great, you are not deploying with FTP/SFTP anymore ● Faster switching between version ● Nearly atomar switch (latency between first and last changed file) ○ Error rate of ~0.3% ● No Fear of on server only “workarounds”
  • 6. What Error Rate?!!!! ● Request Starts ● Request did load a lot of classes ● Files Change ● Loads another class ● New Class uses method which did not exist in already loaded classes ○ ERROR!!
  • 7. But OpCache ● Request Starts ● Request did load classes from Opcache ● Files Change ● Loads another class from Opcache ● Loads changed template which did not exist before ● New Template uses method which did not exist in already loaded classes ○ ERROR!!
  • 8. But OpCache ● Request Starts ● Request did load classes from Opcache ● Files Change ● Loads another class from Opcache ● Loads changed template which did not exist before ● New Template uses method which did not exist in already loaded classes ○ ERROR!! I forgot the exact case, why this is not covered from opcache, but it still happens sometimes
  • 9. How to solve this kind of errors Prevent files being changed while requests are active in the project folder.
  • 10. Blue / Green Deployment Basic Idea is, you have your project twice on the Filesystem ● An active one, and an inactive one ● This can be a symlink which is used as project root ○ If the first file is loaded in magento, most is loaded relative to this file, not to the docroot ● Or full instances of FPM servers ○ which are switched over by a webserver config ● Works also with NodeJS Apps
  • 11. Take Servers temporary out of loadbalancer Works only if you have multiple servers ● Take server out of loadbalancer ● Deploy changes ● Put server back in ● Take Next server
  • 12. But Database Migrations ● Somehow new Code tends to fail, when you dont run the DB migrations
  • 13. But Database Migrations ● Somehow new Code tends to fail, when you dont run the DB migrations ● Or worse, old Code fails after the DB migration were run.
  • 14. But Database Migrations ● Somehow new Code tends to fail, when you dont run the DB migrations ● Or worse, old Code fails after the DB migration were run. !!!!Maintainance Mode!!!!
  • 15. But Database Migrations ● Somehow new Code tends to fail, when you dont run the DB migrations ● Or worse, old Code fails after the DB migration were run. !!!!Maintainance Mode!!!! Means you failed
  • 16. Best Practice of DB Migrations ● Make your Code work - always ○ Add proper handling so it still works before the migration is done ○ Try to avoid DB changes, which break old code ■ You should be able to roll back a whole week ■ You should deploy more then once a week ■ If something is terrible broken for a week already, dont roll back, push forward ○ Run DB migrations as last step of deployment ■ Maybe even after a first check if everything still works
  • 17. Best Practice of DB Migrations ● Make your Code work - always ○ Add proper handling so it still works before the migration is done ○ Try to avoid DB changes, which break old code ■ You should be able to roll back a whole week ■ You should deploy more then once a week ■ If something is terrible broken for a week already, dont roll back, push forward ○ Run DB migrations as last step of deployment ■ Maybe even after a first check if everything still works ● Complain to module vendors if they dont follow best practice ○ Tell them about the additional work it did cause for you ○ But be nice ○ And help them with suggestions
  • 18. How to measure a deployment ● Time between Triggering and finishing deployment ● Time between a failed deployment and a finished rollback ● Error rate & Downtime ● Average Grade of Fear in the Team doing a deployment on Friday at 17:00 ○ And also The Max() ○ Having no Fear and a 2 hour downtime after deployment results in minus points ●
  • 19. ● Time between Triggering and finishing deployment Not even seconds with git, so why switch? ● Sass ● Babel ● Code Generation ● Composer
  • 20. ● Time between Triggering and finishing deployment Not even seconds with git, so why switch? ● Sass ● Babel ● Code Generation ● Composer Because you also have a Build step, which is not covered by Git
  • 21. ● Time between Triggering and finishing deployment Depends a lot on the Build process Solution: ● Move the Build process out of the deployment ● Create build artifacts ○ Composer_vendor_$hash.tgz ○ node_modules_$hash.tgz ○ …. ● Add them via single downloads over the local network
  • 22. ● Time between a failed deployment and a finished rollback In case you have a Blue / Green deployment, Independent of build process < ~15sec
  • 23. This is more a risk value, which therefore should be as low as possible. ● Additional health checks during deployment ○ Simulate basic requests ○ Maybe have health check URLs ● Having a CI or Staging setup can help catch problems even before ● Investigate problems afterwards and find automated solutions ○ Never blame the person who hit deploy ● Error rate & Downtime
  • 24. Fearing deployment Fear in this case is a good sign for something not working reliable. While the previous points should help, there is also a human component always. ● People can only manage a certain amount of changes at once ● Trusting a tool is not happening from one day to another ○ Split changes up into smaller parts ○ Spread them over several weeks ○ Involve them in implementing the changes
  • 25. Build the Composer Vendor artifact
  • 26. Use the artifact on deploy
  • 27. There is no one-size-fits-all solution There are lot of existing solutions ● Capistrano ● Deployer ● Robo ● Ansible And probably a reason why you dont use one of them already.
  • 28. The learnings ● Take small steps ● Reducing build time is easier than it seems ○ Build artifacts are just another kind of (permanent) cache ● Make DB migrations harmless ● Simple php scripts are NOT bad practice
  • 29. Thank You for listening In case you want to also say Thank you, support me on Patreon. https://www.patreon.com/Flyingmana I also take Requests for next Topics I should present about.