SlideShare a Scribd company logo
1 of 36
Download to read offline
Deploying and Releasing Applications
       Continuous Delivery, Chap. 10

                Xuebin MA
Introduction
•   Releasing software into production and deploying to testing
    environment

    •   Can be done at the same deployment process but
        configuration files and ability of roll back are different

•   How to create and follow a deployment strategy

•   Blue-green deployments and canary releasing are introduced
    for zero-downtime releases and rollbacks

•   Ae a part of deployment pipeline implementation

    •   which version in which environment, who authorized the
        deployment and what changes have be made to application

•   Emergency fixes, upgrade plan...
Create a release strategy
•   How?

    •   All stakeholders meet up > get common understanding
        concerning the deployment and operations > create the
        release strategy > update and maintain

•   Followings should be considered at the first version of
    release strategy at the beginning of project

    •   Parties in charge of deployments to each environment, as
        well as in charge of the release

    •   An asset and configuration management strategy

    •   A description of the technology used for deployment. This
        should be agreed upon by both the operations and
        development teams

    •   A plan for implementing the deployment pipeline
Create a release strategy
•   An enumeration of the environments available for
    acceptance, capacity, integration, and user acceptance testing,
    and the process by which builds will be moved through these
    environments

•   A description of the processes to be followed for deployment
    into testing and production environments, such as change
    requests to be opened and approvals that need to be granted.

•   Requirements for monitoring the application, including any
    APIs or services the application should use to notify the
    operations team of its state.

•   A discussion of the method by which the application’s deploy-
    time and runtime configuration will be managed, and how this
    relates to the automated deployment process.
Create a release strategy
•   Description of the integration with any external systems. At
    what stage and how are they tested as part of a release?
    How do the operations personnel communicate with the
    provider in the event of a problem?

•   Details of logging so that operations personnel can
    determine the application’s state and identify any error
    conditions.

•   A disaster recovery plan so that the application’s state can be
    recovered following a disaster.

•   The service-level agreements for the software, which will
    determine whether the application will require techniques
    like failover and other high-availability strategies.
Create a release strategy

•   Production sizing and capacity planning: How much data will
    your live application create? How many log files or databases
    will you need? How much bandwidth and disk space will you
    need? What latency are clients expecting?

•   An archiving strategy so that production data that is no
    longer needed can be kept for auditing or support purposes.

•   How the initial deployment to production works.

•   How fixing defects and applying patches to the production
    environment will be handled.

•   How upgrades to the production environment will be
    handled, including data migration.
Create a release strategy

•   Why?

    •   Be a source of both functional and nonfunctional
        requirements for both software development and for
        design, configuration, and commissioning of hardware
        environment

•   Others

    •   the release strategy should be added and changed during
        the project progresses

    •   vital component is the release plan describing how releases
        are performed
The release plan
•   Release plan: automated scripts, documents or other
    procedures for reliable and repeatable deployment:

•   Comparing to deployment strategy

    •   The steps required to deploy the application for the first
        time

    •   How to smoke-test the application and any services it uses
        as part of the deployment process

    •   The steps required to back out the deployment should it
        go wrong

    •   The steps required to back up and restore the application’s
        state application’s state
The release plan
•   The steps required to upgrade the application without
    destroying the application’s state

•   The steps to restart or redeploy the application should it
    fail

•   The location of the logs and a description of the
    information they contain

•   The methods of monitoring the application

•   The steps to perform any data migrations that are
    necessary as part of the release

•   An issue log of problems from previous deployments, and
    their solutions
Releasing products
•   More should be considered for software product

    •   Pricing model

    •   Licensing strategy

    •   Copyright issues around third-party technologies used

    •   Packaging

    •   Marketing materials-print, web-based, podcasts, blogs, press
        releases, conferences

    •   Production documentation

    •   Installers

    •   Preparing sales and support teams
The first deployment

•   The first deployment should be in the first iteration

•   Principal goals of the first iteration is to get the early stages
    of our deployment pipeline running and be able to deploy and
    demonstrate somethings

    •   deployment pipeline’s commit stage

    •   production-like environment to deploy to

    •   An automated process that takes the binaries created by
        your commit stage and deploys them into the environment

    •   A simple smoke test that verifies that the deployment
        worked and the application is running
Production like environment
•   Development and production environment

    •   Try to build the same or similar environment, use
        virtualization and chicken-counting

    •   chicken-counting: if 250 web servers, 2 should be enough to
        represent the significant process boundaries

•   Production like environment

    •   same operating system

    •   same software installed (none development toolchain like IDE)

    •   be managed the same way as production environment

    •   for client-installed software: UAT environment should be
        representative of clients’ hardware statistics
Modeling your release process and promoting builds



•   With the grow of application, deployment pipeline
    implementation becomes complex and test and release process
    should be modeled considering the following:

    •   What stage a build has to go through in order to be released

    •   What the required gates or approval are

    •   For each gate, who has the authority to approve a build
        passing through that gate
ur release process. We discussed value stream mapping as a way to
            Example test and release process diagram
 ur release process in Chapter 5, “Anatomy of the Deployment



      Integration          integration
                                            Acceptance   QA sign-off
                         testing sign-off
        testing                gate           testing      gate




         User              customer                       Operations
      acceptance            sign-off         Staging     sign off-gate   Production
        testing               gate




 Figure 10.1        An example test and release process diagram


’ve created this diagram, you can create placeholders for each part
ase process in the tool you use for managing deployments. Go and
Managing the test and release process


•   Model and manage deployment process

•   Create placeholder for each part

•   Used for approval of people responsible for approvals

•   Manage information about which builds have passed all previous
    stages and whether are ready for next stage.

    •   Choose one build and press a deploy button (promotion)

•   Get everybody involved in the delivery process to manage their
    own works after promotion, pull system
Tools

•   GO

    •   Agile Release management

    •   http://www.thoughtworks-studios.com/go-agile-release-
        management

•   AntHill Pro (DevOps Platform)

    •   http://www.urbancode.com/html/default.html

•   Other Agile management tools

    •   IceScrum: http://www.icescrum.org/

    •   Jira: http://www.atlassian.com/ja/software/jira/overview
Test and deploy workflow


•   Can select which version to deploy to test environment

•   Prepare environment and associated infrastructure

•   Deploy the application’s binaries.

•   Configure the application

•   Prepare or migrate any data managed by the application

•   Smoke-test the deployment

•   Perform the testing

•   Approve promotion if test passed. if not, record why
Promoting configuration


•   Configuration of environment and application should be promoted

•   Managing promotion of configuration associated with an
    application is complex

    •   Don’t want to promote all the configuration after test at SIT
        database or a test double of external service

•   One way is use smoke test to verify that you are pointing at the
    right things

•   In case of service-oriented architectures and componentized
    applications, all the services and components should be promoted
    together
Orchestration




•   Environment shared between several applications

    •   Extra care trying not to disturb the operation of any other
        applications in the environment

    •   If applications depend on each other, integration testing
        environment is ensure the new versions of each application
        cooperate with each other well
Deployments to staging environments

•   Ensure your production, capacity testing, and staging environments
    are commissioned. In particular, on a green field project, have your
    production environment ready some time before the release, and
    deploy to it as part of your pipeline.

•   Have an automated process for configuring your environment,
    including networks, external services, and infrastructure.

•   Ensure the deployment process is adequately smoke-tested

•   Measure the warm-up period for your application. This is especially
    applicable if your application uses caching. Incorporate this into
    your deployment plan.

•   Test integration with external systems.You don’t want your
    application’s release to be the first time you run against the real
    external systems
Deployments to staging environments



•   If possible, get your application into its production environment
    well before release. If “release” can be as simple as reconfiguring
    some router to direct traffic from a holding page to your
    production environment, so much the better. This technique,
    known as blue-green deployment, is described a little later in this
    chapter.

•   If possible, try rolling your system out to a small group of users
    before you roll it out to everybody. This technique is known as
    canary releasing, and is also described later in this chapter

•   Deploy every change that passes acceptance tests to your staging
    environment (although not necessarily to production).
Rollback by redeploying previous good version



•   Good:

    •   low risk if you don’t have automated rollback but deploy
        process

    •   deployment process is much more well tested than rollback

•   Demerit

    •   Has downtime as time of redeploy the old version is nonzero

    •   Make it hared to debug what went wrong

    •   May lose data created since last deployment
Zero-Downtime Releases




•   Zero-downtime release, hot deployment

•   Key to zero-downtime release is decoupling the various parts of
    release so they can happen independently as far as possible

•   It is easy for static resources and web-based services, but it is
    harder for resources like DB
This is one of the most powerful techniques we know for managing releases. The
                        Blue-Green Deployments
idea is to have two identical versions of your production environment, which
we’ll call blue and green.


                                  Web server    Application server   Database server

                                  Green slice      Green slice       Green database
         Users    Router

                                   Blue slice       Blue slice        Blue database




                           Figure 10.2 Blue-green deployments


   In the example in Figure 10.2, users of the system are routed to the green envi-
     •
ronment,Deploy to blue environment, let it warm up -> run to release a new
           which is the currently designated production. We want smoke tests to
version of the application. So we deploy it toversion by changing the router
          check it works -> move the new the blue environment, and let the
          configuration
application warm up (you can do this as much as you like). This does not in any
way affect the operation of the green environment. We can run smoke tests against
     •
the blue environment to goes wrong, change router When to green
          If somethings check it is working properly. back we’re ready, moving
          environment
to the new version is as simple as changing the router configuration to point to
the blue environment instead of the green environment. The blue environment
thus becomes production. This switchover can typically be performed in much
less than a second.
Database switch at Blue-Green deployment




•   Data migration may be needed if schema is changed

    •   One: Put application into read-only mode before switchover,
        copy green db, restore into blue db, perform migration, switch,
        change to read-write mode

    •   Two: design the application so that you can migrate the db
        independently of the upgrade process
Blue-Green deployment and budget



•   Low budget:

    •   Have two copies of application runs side by side on the same
        environment

    •   use virtualization

•   Sufficient budget

    •   Blue and green environment can be completely separate replicas

    •   Using staging and production environment as blue and green
        environment
Canary releasing




•   Why canary releasing?

    •   Only have one version of software in production at a time
        makes easier to manage bug fixes and indeed infrastructure in
        general

    •   However, it presents and impediment to test as defects pop up
        in production

    •   To create a meaningful capacity testing environment is
        impossible if we have extremely large production environment
jority of users. This is a great way to reduce the risk of releasing a new version.
                                Canary releasing
                                             Users




                                            Router



                               Most users            Small set of users



                         Version x                             Version x+1




                           Figure 10.3      Canary releasing
Canary releasing
•   Benefits:

    •   Make rolling back easy

    •   A/B testing can be done by routing some users to new version
        and some to the old

    •   You can check if the application meets capacity requirement
        gradually

•   Others

    •   not only way for A/B test; runtime configuration setting to
        change behavior

    •   Hard to use for user install soft on own computer

    •   Impose further constraints on DB upgrades

    •   Limit few versions of application in production
Emergency fixes


•   Do not, under any circumstances, subvert your process, even when
    critical defect is discovered and has to be fixed

•   Have to go through the same build, deploy, test and release process
    as any other change. In other works, run every emergency fix
    through standard deployment pipeline

•   If not,

    •   The change will lead to regression and exacerbate the problem

    •   Change is often not recorded and environment ends up in an
        unknown state

•   Check the emergency fix is wether or not is needed, roll back is
    another choice
Emergency fixes

•   Considerations about dealing with defect in production

    •   Never do them late at night, and always pair with somebody
        else.

    •   Make sure you have tested your emergency fix process.

    •   Only under extreme circumstances circumvent the usual
        process for making changes to your application.

    •   Make sure you have tested making an emergency fix using your
        staging environment.

    •   Sometimes it’s better to roll back to the previous version than
        to deploy a fix. Do some analysis to work out what the best
        solution is. Consider what happens if you lose data or face
        integration or orchestration problems.
Continuous deployment


•   If it hurts, do it more often => Take the pipeline and make
    deployment to production automatic

    •   automated unit tests, component tests, acceptance tests
        covering entire application

•   Continuous deployment can be combined with canary release

•   Continuous deployment isn’t for everyone, as some new features
    are not wanted to be released to production

•   By release every change, amount of risk is limited to the risk
    inherent in one change

•   Continuous deployment force we to do the right thing: build,
    deploy, test and release process
Continuously releasing user-installed software



•   Issues to consider for client-installed software

    •   Managing the upgrade experience

    •   Migrating binaries, data, and configuration

    •   Testing the upgrade process

    •   Getting crash reports from users
Upgrade plan


•   Support different versions of software is difficult, so we need to
    make upgrade as painless as possible

•   Upgrade plan
    1. Have your software check for new versions and prompt the user
       to download and upgrade to the latest version
    2. Download in the background and prompt for installation
    3. Download in the background and silently upgrade the next time
       the application is restarted

•   1,2 seems attractive but wrong as users can choose not to upgrade
Upgrade plan

•   Correct solution:

    •   Make upgrade process bullet proof and upgrade silently

    •   Prompt to user if corrective action needs to be taken

•   Sometimes, you don’y want your software upgrade silently
    because of poor network and so on...

    •   User can turn off automatic upgrades

•   Migrating binaries, data and configuration: keep old ones until
    upgrade successful

•   Be able to upgrade from any version to any other version

•   Test upgrade process as part of deployment pipeline

•   Be able to report crashes back to development team
Tips and tricks
•   People who do the deployment should be involved in creating
    the deployment process

•   Log deployment activities: log all files for debug

•   Don't delete the old files, move them

•   Deployment is the whole team's responsibility: any member
    should do

•   Server application should not have GUIs: the machine must have
    had a user logged in and the UI showing. Reboot, accidental or
    due to upgrades will log the user out, and the server will stop.

•   Have a warm-up period for a new deployment (canary release)

•   Fail fast

•   Don't make changes directly on the production environment

More Related Content

What's hot

Maven Presentation - SureFire vs FailSafe
Maven Presentation - SureFire vs FailSafeMaven Presentation - SureFire vs FailSafe
Maven Presentation - SureFire vs FailSafe
Holasz Kati
 

What's hot (20)

Introduction to GitHub Actions
Introduction to GitHub ActionsIntroduction to GitHub Actions
Introduction to GitHub Actions
 
Jenkins CI presentation
Jenkins CI presentationJenkins CI presentation
Jenkins CI presentation
 
Introduction to CI/CD
Introduction to CI/CDIntroduction to CI/CD
Introduction to CI/CD
 
Introducing GitLab (June 2018)
Introducing GitLab (June 2018)Introducing GitLab (June 2018)
Introducing GitLab (June 2018)
 
(Declarative) Jenkins Pipelines
(Declarative) Jenkins Pipelines(Declarative) Jenkins Pipelines
(Declarative) Jenkins Pipelines
 
JIRA 업무 생산성 향상 및 프로젝트 관리
JIRA 업무 생산성 향상 및 프로젝트 관리JIRA 업무 생산성 향상 및 프로젝트 관리
JIRA 업무 생산성 향상 및 프로젝트 관리
 
Jenkins Pipelines
Jenkins PipelinesJenkins Pipelines
Jenkins Pipelines
 
Git branching strategies
Git branching strategiesGit branching strategies
Git branching strategies
 
CI and CD with Jenkins
CI and CD with JenkinsCI and CD with Jenkins
CI and CD with Jenkins
 
Maven Basics - Explained
Maven Basics - ExplainedMaven Basics - Explained
Maven Basics - Explained
 
Container based CI/CD on GitHub Actions
Container based CI/CD on GitHub ActionsContainer based CI/CD on GitHub Actions
Container based CI/CD on GitHub Actions
 
Jenkins tutorial for beginners
Jenkins tutorial for beginnersJenkins tutorial for beginners
Jenkins tutorial for beginners
 
Jenkins Introduction
Jenkins IntroductionJenkins Introduction
Jenkins Introduction
 
CICD Pipeline Using Github Actions
CICD Pipeline Using Github ActionsCICD Pipeline Using Github Actions
CICD Pipeline Using Github Actions
 
Gitlab flow
Gitlab flowGitlab flow
Gitlab flow
 
AngularJS Architecture
AngularJS ArchitectureAngularJS Architecture
AngularJS Architecture
 
Jenkins CI
Jenkins CIJenkins CI
Jenkins CI
 
Gitlab, GitOps & ArgoCD
Gitlab, GitOps & ArgoCDGitlab, GitOps & ArgoCD
Gitlab, GitOps & ArgoCD
 
Maven Presentation - SureFire vs FailSafe
Maven Presentation - SureFire vs FailSafeMaven Presentation - SureFire vs FailSafe
Maven Presentation - SureFire vs FailSafe
 
Testing with JUnit 5 and Spring
Testing with JUnit 5 and SpringTesting with JUnit 5 and Spring
Testing with JUnit 5 and Spring
 

Similar to Deploying and releasing applications

Software test management
Software test managementSoftware test management
Software test management
Vishad Garg
 
Process model rup
Process model rupProcess model rup
Process model rup
Aryan Ajmer
 

Similar to Deploying and releasing applications (20)

Ncerc rlmca202 adm m3 ssm
Ncerc rlmca202  adm m3 ssmNcerc rlmca202  adm m3 ssm
Ncerc rlmca202 adm m3 ssm
 
Software Development
Software DevelopmentSoftware Development
Software Development
 
Journey to the center of DevOps - v6
Journey to the center of DevOps - v6Journey to the center of DevOps - v6
Journey to the center of DevOps - v6
 
what-is-devops.ppt
what-is-devops.pptwhat-is-devops.ppt
what-is-devops.ppt
 
Software test management
Software test managementSoftware test management
Software test management
 
Continuous Integration for Salesforce1 Platform
Continuous Integration for Salesforce1 PlatformContinuous Integration for Salesforce1 Platform
Continuous Integration for Salesforce1 Platform
 
The QA/Testing Process
The QA/Testing ProcessThe QA/Testing Process
The QA/Testing Process
 
Serena Release Management approach and solutions
Serena Release Management approach and solutionsSerena Release Management approach and solutions
Serena Release Management approach and solutions
 
Salesforce Continuous Integration with AutoRABIT
Salesforce Continuous Integration with AutoRABITSalesforce Continuous Integration with AutoRABIT
Salesforce Continuous Integration with AutoRABIT
 
software testing
 software testing software testing
software testing
 
How to go from waterfall app dev to secure agile development in 2 weeks
How to go from waterfall app dev to secure agile development in 2 weeks How to go from waterfall app dev to secure agile development in 2 weeks
How to go from waterfall app dev to secure agile development in 2 weeks
 
Testing in the new age of DevOps
Testing in the new age of DevOpsTesting in the new age of DevOps
Testing in the new age of DevOps
 
Process model rup
Process model rupProcess model rup
Process model rup
 
System development
System developmentSystem development
System development
 
Creating Functional Testing Strategy.pptx
Creating Functional Testing Strategy.pptxCreating Functional Testing Strategy.pptx
Creating Functional Testing Strategy.pptx
 
Preparing for DevOps
Preparing for DevOpsPreparing for DevOps
Preparing for DevOps
 
Testing throughout the software life cycle - Testing & Implementation
Testing throughout the software life cycle - Testing & ImplementationTesting throughout the software life cycle - Testing & Implementation
Testing throughout the software life cycle - Testing & Implementation
 
Musharraf_Syed_Resume
Musharraf_Syed_ResumeMusharraf_Syed_Resume
Musharraf_Syed_Resume
 
Intoduction to software engineering part 2
Intoduction to software engineering part 2Intoduction to software engineering part 2
Intoduction to software engineering part 2
 
Upgrading or migrating to a higher AEM version - Planning and process
Upgrading or migrating to a higher AEM version - Planning and processUpgrading or migrating to a higher AEM version - Planning and process
Upgrading or migrating to a higher AEM version - Planning and process
 

Recently uploaded

Recently uploaded (20)

Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
HTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation StrategiesHTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation Strategies
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 

Deploying and releasing applications

  • 1. Deploying and Releasing Applications Continuous Delivery, Chap. 10 Xuebin MA
  • 2. Introduction • Releasing software into production and deploying to testing environment • Can be done at the same deployment process but configuration files and ability of roll back are different • How to create and follow a deployment strategy • Blue-green deployments and canary releasing are introduced for zero-downtime releases and rollbacks • Ae a part of deployment pipeline implementation • which version in which environment, who authorized the deployment and what changes have be made to application • Emergency fixes, upgrade plan...
  • 3. Create a release strategy • How? • All stakeholders meet up > get common understanding concerning the deployment and operations > create the release strategy > update and maintain • Followings should be considered at the first version of release strategy at the beginning of project • Parties in charge of deployments to each environment, as well as in charge of the release • An asset and configuration management strategy • A description of the technology used for deployment. This should be agreed upon by both the operations and development teams • A plan for implementing the deployment pipeline
  • 4. Create a release strategy • An enumeration of the environments available for acceptance, capacity, integration, and user acceptance testing, and the process by which builds will be moved through these environments • A description of the processes to be followed for deployment into testing and production environments, such as change requests to be opened and approvals that need to be granted. • Requirements for monitoring the application, including any APIs or services the application should use to notify the operations team of its state. • A discussion of the method by which the application’s deploy- time and runtime configuration will be managed, and how this relates to the automated deployment process.
  • 5. Create a release strategy • Description of the integration with any external systems. At what stage and how are they tested as part of a release? How do the operations personnel communicate with the provider in the event of a problem? • Details of logging so that operations personnel can determine the application’s state and identify any error conditions. • A disaster recovery plan so that the application’s state can be recovered following a disaster. • The service-level agreements for the software, which will determine whether the application will require techniques like failover and other high-availability strategies.
  • 6. Create a release strategy • Production sizing and capacity planning: How much data will your live application create? How many log files or databases will you need? How much bandwidth and disk space will you need? What latency are clients expecting? • An archiving strategy so that production data that is no longer needed can be kept for auditing or support purposes. • How the initial deployment to production works. • How fixing defects and applying patches to the production environment will be handled. • How upgrades to the production environment will be handled, including data migration.
  • 7. Create a release strategy • Why? • Be a source of both functional and nonfunctional requirements for both software development and for design, configuration, and commissioning of hardware environment • Others • the release strategy should be added and changed during the project progresses • vital component is the release plan describing how releases are performed
  • 8. The release plan • Release plan: automated scripts, documents or other procedures for reliable and repeatable deployment: • Comparing to deployment strategy • The steps required to deploy the application for the first time • How to smoke-test the application and any services it uses as part of the deployment process • The steps required to back out the deployment should it go wrong • The steps required to back up and restore the application’s state application’s state
  • 9. The release plan • The steps required to upgrade the application without destroying the application’s state • The steps to restart or redeploy the application should it fail • The location of the logs and a description of the information they contain • The methods of monitoring the application • The steps to perform any data migrations that are necessary as part of the release • An issue log of problems from previous deployments, and their solutions
  • 10. Releasing products • More should be considered for software product • Pricing model • Licensing strategy • Copyright issues around third-party technologies used • Packaging • Marketing materials-print, web-based, podcasts, blogs, press releases, conferences • Production documentation • Installers • Preparing sales and support teams
  • 11. The first deployment • The first deployment should be in the first iteration • Principal goals of the first iteration is to get the early stages of our deployment pipeline running and be able to deploy and demonstrate somethings • deployment pipeline’s commit stage • production-like environment to deploy to • An automated process that takes the binaries created by your commit stage and deploys them into the environment • A simple smoke test that verifies that the deployment worked and the application is running
  • 12. Production like environment • Development and production environment • Try to build the same or similar environment, use virtualization and chicken-counting • chicken-counting: if 250 web servers, 2 should be enough to represent the significant process boundaries • Production like environment • same operating system • same software installed (none development toolchain like IDE) • be managed the same way as production environment • for client-installed software: UAT environment should be representative of clients’ hardware statistics
  • 13. Modeling your release process and promoting builds • With the grow of application, deployment pipeline implementation becomes complex and test and release process should be modeled considering the following: • What stage a build has to go through in order to be released • What the required gates or approval are • For each gate, who has the authority to approve a build passing through that gate
  • 14. ur release process. We discussed value stream mapping as a way to Example test and release process diagram ur release process in Chapter 5, “Anatomy of the Deployment Integration integration Acceptance QA sign-off testing sign-off testing gate testing gate User customer Operations acceptance sign-off Staging sign off-gate Production testing gate Figure 10.1 An example test and release process diagram ’ve created this diagram, you can create placeholders for each part ase process in the tool you use for managing deployments. Go and
  • 15. Managing the test and release process • Model and manage deployment process • Create placeholder for each part • Used for approval of people responsible for approvals • Manage information about which builds have passed all previous stages and whether are ready for next stage. • Choose one build and press a deploy button (promotion) • Get everybody involved in the delivery process to manage their own works after promotion, pull system
  • 16. Tools • GO • Agile Release management • http://www.thoughtworks-studios.com/go-agile-release- management • AntHill Pro (DevOps Platform) • http://www.urbancode.com/html/default.html • Other Agile management tools • IceScrum: http://www.icescrum.org/ • Jira: http://www.atlassian.com/ja/software/jira/overview
  • 17. Test and deploy workflow • Can select which version to deploy to test environment • Prepare environment and associated infrastructure • Deploy the application’s binaries. • Configure the application • Prepare or migrate any data managed by the application • Smoke-test the deployment • Perform the testing • Approve promotion if test passed. if not, record why
  • 18. Promoting configuration • Configuration of environment and application should be promoted • Managing promotion of configuration associated with an application is complex • Don’t want to promote all the configuration after test at SIT database or a test double of external service • One way is use smoke test to verify that you are pointing at the right things • In case of service-oriented architectures and componentized applications, all the services and components should be promoted together
  • 19. Orchestration • Environment shared between several applications • Extra care trying not to disturb the operation of any other applications in the environment • If applications depend on each other, integration testing environment is ensure the new versions of each application cooperate with each other well
  • 20. Deployments to staging environments • Ensure your production, capacity testing, and staging environments are commissioned. In particular, on a green field project, have your production environment ready some time before the release, and deploy to it as part of your pipeline. • Have an automated process for configuring your environment, including networks, external services, and infrastructure. • Ensure the deployment process is adequately smoke-tested • Measure the warm-up period for your application. This is especially applicable if your application uses caching. Incorporate this into your deployment plan. • Test integration with external systems.You don’t want your application’s release to be the first time you run against the real external systems
  • 21. Deployments to staging environments • If possible, get your application into its production environment well before release. If “release” can be as simple as reconfiguring some router to direct traffic from a holding page to your production environment, so much the better. This technique, known as blue-green deployment, is described a little later in this chapter. • If possible, try rolling your system out to a small group of users before you roll it out to everybody. This technique is known as canary releasing, and is also described later in this chapter • Deploy every change that passes acceptance tests to your staging environment (although not necessarily to production).
  • 22. Rollback by redeploying previous good version • Good: • low risk if you don’t have automated rollback but deploy process • deployment process is much more well tested than rollback • Demerit • Has downtime as time of redeploy the old version is nonzero • Make it hared to debug what went wrong • May lose data created since last deployment
  • 23. Zero-Downtime Releases • Zero-downtime release, hot deployment • Key to zero-downtime release is decoupling the various parts of release so they can happen independently as far as possible • It is easy for static resources and web-based services, but it is harder for resources like DB
  • 24. This is one of the most powerful techniques we know for managing releases. The Blue-Green Deployments idea is to have two identical versions of your production environment, which we’ll call blue and green. Web server Application server Database server Green slice Green slice Green database Users Router Blue slice Blue slice Blue database Figure 10.2 Blue-green deployments In the example in Figure 10.2, users of the system are routed to the green envi- • ronment,Deploy to blue environment, let it warm up -> run to release a new which is the currently designated production. We want smoke tests to version of the application. So we deploy it toversion by changing the router check it works -> move the new the blue environment, and let the configuration application warm up (you can do this as much as you like). This does not in any way affect the operation of the green environment. We can run smoke tests against • the blue environment to goes wrong, change router When to green If somethings check it is working properly. back we’re ready, moving environment to the new version is as simple as changing the router configuration to point to the blue environment instead of the green environment. The blue environment thus becomes production. This switchover can typically be performed in much less than a second.
  • 25. Database switch at Blue-Green deployment • Data migration may be needed if schema is changed • One: Put application into read-only mode before switchover, copy green db, restore into blue db, perform migration, switch, change to read-write mode • Two: design the application so that you can migrate the db independently of the upgrade process
  • 26. Blue-Green deployment and budget • Low budget: • Have two copies of application runs side by side on the same environment • use virtualization • Sufficient budget • Blue and green environment can be completely separate replicas • Using staging and production environment as blue and green environment
  • 27. Canary releasing • Why canary releasing? • Only have one version of software in production at a time makes easier to manage bug fixes and indeed infrastructure in general • However, it presents and impediment to test as defects pop up in production • To create a meaningful capacity testing environment is impossible if we have extremely large production environment
  • 28. jority of users. This is a great way to reduce the risk of releasing a new version. Canary releasing Users Router Most users Small set of users Version x Version x+1 Figure 10.3 Canary releasing
  • 29. Canary releasing • Benefits: • Make rolling back easy • A/B testing can be done by routing some users to new version and some to the old • You can check if the application meets capacity requirement gradually • Others • not only way for A/B test; runtime configuration setting to change behavior • Hard to use for user install soft on own computer • Impose further constraints on DB upgrades • Limit few versions of application in production
  • 30. Emergency fixes • Do not, under any circumstances, subvert your process, even when critical defect is discovered and has to be fixed • Have to go through the same build, deploy, test and release process as any other change. In other works, run every emergency fix through standard deployment pipeline • If not, • The change will lead to regression and exacerbate the problem • Change is often not recorded and environment ends up in an unknown state • Check the emergency fix is wether or not is needed, roll back is another choice
  • 31. Emergency fixes • Considerations about dealing with defect in production • Never do them late at night, and always pair with somebody else. • Make sure you have tested your emergency fix process. • Only under extreme circumstances circumvent the usual process for making changes to your application. • Make sure you have tested making an emergency fix using your staging environment. • Sometimes it’s better to roll back to the previous version than to deploy a fix. Do some analysis to work out what the best solution is. Consider what happens if you lose data or face integration or orchestration problems.
  • 32. Continuous deployment • If it hurts, do it more often => Take the pipeline and make deployment to production automatic • automated unit tests, component tests, acceptance tests covering entire application • Continuous deployment can be combined with canary release • Continuous deployment isn’t for everyone, as some new features are not wanted to be released to production • By release every change, amount of risk is limited to the risk inherent in one change • Continuous deployment force we to do the right thing: build, deploy, test and release process
  • 33. Continuously releasing user-installed software • Issues to consider for client-installed software • Managing the upgrade experience • Migrating binaries, data, and configuration • Testing the upgrade process • Getting crash reports from users
  • 34. Upgrade plan • Support different versions of software is difficult, so we need to make upgrade as painless as possible • Upgrade plan 1. Have your software check for new versions and prompt the user to download and upgrade to the latest version 2. Download in the background and prompt for installation 3. Download in the background and silently upgrade the next time the application is restarted • 1,2 seems attractive but wrong as users can choose not to upgrade
  • 35. Upgrade plan • Correct solution: • Make upgrade process bullet proof and upgrade silently • Prompt to user if corrective action needs to be taken • Sometimes, you don’y want your software upgrade silently because of poor network and so on... • User can turn off automatic upgrades • Migrating binaries, data and configuration: keep old ones until upgrade successful • Be able to upgrade from any version to any other version • Test upgrade process as part of deployment pipeline • Be able to report crashes back to development team
  • 36. Tips and tricks • People who do the deployment should be involved in creating the deployment process • Log deployment activities: log all files for debug • Don't delete the old files, move them • Deployment is the whole team's responsibility: any member should do • Server application should not have GUIs: the machine must have had a user logged in and the UI showing. Reboot, accidental or due to upgrades will log the user out, and the server will stop. • Have a warm-up period for a new deployment (canary release) • Fail fast • Don't make changes directly on the production environment