Continuous Delivery: implementation considerations Léon Hagenaars-Keus lhagenaars@sogyo.nl Edwin van Dillen evdillen@sogyo.nl
SOFTWARE INNOVATORS Done = Released
What is Continuous Delivery all about? SOFTWARE INNOVATORS 3
At first there was a machine Dev is operator, operator is dev SOFTWARE INNOVATORS Source: What is DevOps? By Mike Loukides 4
Dev versus ops The first reaction to a bug or issue: Ops: It s not my machines, it s your code Dev: It s not my code, it s your machines SOFTWARE INNOVATORS Source: 10+ Deploys Per Day: Dev and Ops Cooperation at Flickr 5
Dev and Ops Operations doesn t go away, it becomes part of development. The infrastructure doesn t go away, it moves into the code By James Urquhart SOFTWARE INNOVATORS Source: What is DevOps? By Mike Loukides 6
DevOps and Continuous Delivery DEV Agile (SCRUM,..) High frequently change Ops Strong procedure (ITIL, ASL, ) Stable production environment Continuous Delivery Embrace change in a high quality driven environment SOFTWARE INNOVATORS 7
Who is in control of Ops D T A P Dev SOFTWARE INNOVATORS 8
What is continuous delivery Reduce the cost, time and risk of delivering incremental changes to users Jez Humble Author of Continuous Delivery
What should be the benefits Shorter time to market Smaller batches of change, more grip Faster user feedback Show them the results instead of specs Contributes to the increase of overall quality Automation versus manual process Reduced risk of release If it hurts, do it more often SOFTWARE INNOVATORS Source: introducing continuous delivery in the Enterprise by XebiaLabs 10
Anti-Pattern: Deploying software manually Signs are: Extensive and detailed documentation Reliance on manual testing Frequent calls to the dev team why it s gone wrong Frequent corrections to the release process Releases that take more than 5 minutes Releases that are unpredictable in their outcome SOFTWARE INNOVATORS Source: Continuous Delivery by Jez Humble, e.a. 12
Anti-Pattern: Deploying to a production-like environment only after development is complete Signs are: The system has been tested on dev machines Releasing is the first time operation people interact with the new release A production like environment is not available or hard to get access to Little to no collaboration between Dev and Operations or Deployers SOFTWARE INNOVATORS Source: Continuous Delivery by Jez Humble, e.a. 13
Anti-Pattern: Manual configuration management of production environment Signs are: Many successful deployments to staging but deploying to production fails The operations team take a long time to prepare an environment for a release You can not step back to an earlier configuration/version Configuration is carried out by modifying it directly on the production systems SOFTWARE INNOVATORS Source: Continuous Delivery by Jez Humble, e.a. 14
Howto: Continuous Delivery SOFTWARE INNOVATORS 16
Software pipeline D T A P SOFTWARE INNOVATORS 17
Growth of software projects Source code Unit Tests Test server Acceptance Production Load test server Continuous Build Continuous Test Continuous Deploy Continuous Delivery Continuous Integration SOFTWARE INNOVATORS 18
Flow of software change Source code Integrate Test Release SOFTWARE INNOVATORS 19
Code ownership Source code Integrate Test Release Everyone owns the code The developers The product owner Operations If stuff breaks everyone is responsible Trunk is the mainline, trunk must work SOFTWARE INNOVATORS 20
CD in DATP Single environment No, branches just the trunk! Build in feature flags Turn off and on features for the user Run features without users knowing about it They are in production and the environment is configured SOFTWARE INNOVATORS Dark Launching 21
Continuous Integration Source code Integrate Test Release At every check-in: Check-out Sign the deployables with build and revision number Build the code Run the unit-tests Run the code analysis If the build fails: Inform the team Revert the change If build succeeds Tag Trigger deploy SOFTWARE INNOVATORS 22
Examples of CI tools Source code Integrate Test Release More at http://en.wikipedia.org/wiki/comparison_of_continuous_integration_software SOFTWARE INNOVATORS 23
When is a build successful? Source code Integrate Test Release The moment it builds it is successful It is successful when: All the latest sources are checked out of the SCM Every file is compiled from scratch The resulting object files are linked and deployed for execution The system is started and suite of tests is run against the system If all these steps execute without error or human intervention and every test passes, then we have a successful build! Smoke test : switch it on and see if smoke comes out McConnell 24
Automated deploy Source code Integrate Test Release At every check-in, deploy to test, including automated upgrade Dev is done if test environment still works If test breaks: Revert the test machine to before deploy Alter the automated upgrade to keep test alive Check in the changed automate upgrade Result: automated deploy to acceptance or production does not break the environment If it hurts do it more often SOFTWARE INNOVATORS 25
Testing Source code Integrate Test Release Unit testing NUnit, JUnit, QUnit, PyUnit Specification testing Specflow, JBehave Application testing Selenium (Web & javascript), NUnit.Forms Load testing JMeter, LoadRunner, Firebenchmarks SOFTWARE INNOVATORS 26
Infrastucture responsibility Source code Integrate Test Release You, the developer are responsible for your code working on the live environment You, the developer are responsible for deployment to this live environment SOFTWARE INNOVATORS 27
Infrastucture responsibility Source code Integrate Test Release You, the systems admin are responsible for your the live environment running the code You, the systems admin are responsible for the differences between the live environment and various staging facilities SOFTWARE INNOVATORS 28
Benefits Source code Integrate Test Release Dependencies on environment specifics will be found when introduced, not when deployed to live. Deploy has been tested at test and at acceptance, therefor will work on live. SOFTWARE INNOVATORS 29
Delivery tools Source code Integrate Test Release Continuous Delivery Automation SmartCloud Continuous Delivery SOFTWARE INNOVATORS 30
Continuous delivery requires Continuous integration A single code repository Automated testing Acceptance Nonfunctional requirements Automated deployment Configuration Management Continuous imporving process SOFTWARE INNOVATORS 31
Lessons Learned: Rules of continuous delivery Done = released DRY (don t repeat yourself) Releasable over new features Fail fast If you break it, you fix it Deploy often Quality built in A deploy must maintain a workable state Acceptance test: intention, not implementation SOFTWARE INNOVATORS 32 Scoure: based upon Humble
Fast feedback of failure SOFTWARE INNOVATORS 33
Asking various devs Why we haven t implemented CD? : The code is not in our repository The production server is not in our control Operations won t give us x We haven t got the time We haven t got round to it The project is too small We haven t What was your first response to TDD? SOFTWARE INNOVATORS 34
ContextOf: Continuous Delivery SOFTWARE INNOVATORS 36
Dimensions on the software live cycle Proces Infrastructuur Software Design Organisatie 37
Softw are Scope of continuous Proces delivery Infrastructuur Design Organisatie D T A P SOFTWARE INNOVATORS 38
Softw are CD in DATP Proces DevOps Infrastructuur Design Organisatie 1. Extend Development into production 2. Create production feedback into development 3. Embed development into IT operations 4. Embed IT operations into development SOFTWARE INNOVATORS 39 Source: Top 11 Things You Need to Know About DevOps, by Gene Kim
Softw are Continuous delivery Proces Infrastructuur Design Organisatie The world of SCRUM and DevOps Product owner owns features owns incidents and problems Will you make incidents part of the backlog SOFTWARE INNOVATORS 40
SOFTWARE INNOVATORS Final thoughts
Continuous Delivery and the marriage of Dev and ops Agile was instrumental in Development regaining the trust in the business but it unintentionally left IT Operations behind. DevOps is a way for the business to regain trust in the entire IT organization as a whole. Clyde Logue, founder of StreamStep SOFTWARE INNOVATORS 42
By Andreas Rehn, e.l. SOFTWARE INNOVATORS 43 Source: http://www.infoq.com/articles/continuous-delivery-maturity-model
Yes it is comprehensive Start by building a small feature Automate testing it And deploy throughout the areas of target Think big, start small. Continuously improve SOFTWARE INNOVATORS 44
Some interesting sources http://itrevolution.com/blog/ THE TOP 11 THINGS YOU NEED TO KNOW ABOUT DEVOPS http://itrevolution.com/11devops http://blip.tv/oreilly-velocity-conference/velocity-09-johnallspaw-10-deploys-per-day-dev-and-ops-cooperationat-flickr-2297883 Continuous Delivery Jez Humble and David Farley SOFTWARE INNOVATORS 45
SOFTWARE INNOVATORS Done = Released
Contact Léon Hagenaars-Keus Edwin van Dillen lhagenaars@sogyo.nl evdillen@sogyo.nl 030 220 22 16 06 22 50 62 33 Web: www.sogyo.nl Blog: www.software innovators.nl SOFTWARE INNOVATORS 47