Updated on 2024-09-27 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 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, where s is the ones place of the 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

      1. Move the cursor to the weather-1.0.0.jar software package.
      2. Click .
      3. Select the weather-beta-2.0.0.jar software package that has been uploaded when 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, where s is the ones place of the second in the timestamp. For example, if the timestamp is 2022.0803.104321, the version number is 2022.0803.10431.

  8. Set mandatory parameters by referring to the following table. Retain the default values for other parameters.

    Parameter

    Description

    Deployment Architecture

    1. Click Select.
    2. Select Type 2: Registers the service with the microservice center (microservice B implements dark launch).
    3. Click OK.

    Dark Launch Policy

    Select Traffic ratio-based.

    Traffic Ratio

    • Traffic Ratio: percentage of traffic directed to the new version. Set it to 50.
    • Current Traffic Ratio: percentage of traffic directed to the current version. It is automatically set to 50.

    Instances Deployed for Dark Launch

    Select Canary (increase, then decrease instances).

    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 ServiceComb 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)