Updated on 2023-07-14 GMT+08:00

Dark Launch

The weather-beta microservice is a new version of the weather microservice and allows you to query the UV index. Before upgrading to weather-beta, a small number of requests are diverted to the later version for function verification. If the functions are normal, the earlier version will be brought offline. During the upgrade, customer requests should not be interrupted. During the deployment of the later version, traffic is not diverted to the later version. Before the earlier version is brought offline, traffic is migrated from the earlier version to the later version.

ServiceStage provides dark launch to achieve the preceding objectives.

This section describes how to deploy weather-beta using dark launch of ServiceStage.

  1. Log in to ServiceStage.
  2. Choose Application Management.
  3. Click an application (for example, weathermap). The Overview page is displayed.
  4. In the Component List area, click the target weather component. The component overview page is displayed.
  5. In the upper right corner of the page, click Upgrade.
  6. Select Dark Launch (Canary) and click Next.
  7. Configure the dark launch version based on how you deploy the weather forecast microservice.

    • If source code is used for deployment, set the following mandatory parameters. Retain the default values for other parameters.

      Parameter

      Description

      Command

      Select Default command or script.

      Dockerfile Address

      Enter

      ./weather-beta/

      Component Version

      Click Generate. By default, the version number is generated based on the time when you click Generate. The format is yyyy.mmdd.hhmms, in which s is the ones digit of second in the timestamp. For example, if the timestamp is 2022.0803.104321, the version number is 2022.0803.10431.

    • If a software package is used for deployment, set the following mandatory parameters. Retain the default values for other parameters.

      Parameter

      Description

      Upload Method

      Move the cursor to the name of the weather-1.0.0.jar software package, click , and select the weather-beta-2.0.0.jar software package uploaded in Downloading and Uploading Component Software Packages.

      Component Version

      Click Generate. By default, the version number is generated based on the time when you click Generate. The format is yyyy.mmdd.hhmms, in which s is the ones digit of second in the timestamp. For example, if the timestamp is 2022.0803.104321, the version number is 2022.0803.10431.

  8. Configure the dark launch policy by referring to the following table.

    Parameter

    Description

    Dark Launch Policy

    • Traffic Ratio: set this parameter to 50%.
    • Current Traffic Ratio: automatically adjusted to 50%.

    First Batch of Dark Launch Instances

    Set this parameter to 1.

    Deployment Batch with Remaining Instances

    Set this parameter to 1.

    Figure 1 Configuring the dark launch policy

  9. Click Upgrade.

    Wait until the component status changes from Upgrading/Rolling back the component to Releasing, indicating that the component is released in dark launch.

    After the dark launch is successful, the servicecomb.routeRule.weather configuration item is delivered to the microservice engine connected to the weather microservice.

    You can view the configuration item from Cloud Service Engine > Configuration Management.

  10. Ensure that the dark launch version is working properly.

    Access the application by referring to Accessing an Application and refresh the weather forecast page multiple times. The pages of the dark launch version and of the current version are periodically displayed based on the dark launch policy.

    Figure 2 Current version (without UV data)

    Figure 3 Dark launch version (with UV data)