All Products
Search
Document Center

Application Deployment

Last Updated: Jul 15, 2020

Classic Application Service (CAS) provides application deployment and rollback features. You can edit dependencies, adjust ECS instance groups, and select deployment policies for applications to be deployed.

Prerequisites

  • The application is bound to an initialized ECS instance.
  • The application has a deployment package.
  • The application is bound to an SLB instance or an ECS instance group under the SLB instance to use grayscale traffic routing.
  • A DingTalk group is configured through Settings > Notification to receive real-time deployment notifications.

Procedure

To deploy an application, following these steps:

  1. Go to the Deployment Ticket page.
  2. View data on the Deployment Ticket page.
  3. Create and execute a deployment ticket.
  4. Operate the deployment ticket.
  5. Roll back the deployment.

Go to the Deployment Ticket page

Log on to the SOFAStack console and choose DevOps > Classic Application Service > Application Deploy in the left-side navigation pane. Click Deployment Ticket under Application Deploy in the left-side navigation submenu. The Deployment Ticket page appears.

View data on the Deployment Ticket page

The Deployment Ticket page displays deployment tickets in the Not Deployed, Deploying, Blocked, To Be Confirmed, Succeeded, and Failed states.

  • Area 1: displays overall information about deployment tickets. If you click any state in this section, deployment tickets in this state appear in section 3. By default, section 3 displays all deployment tickets.

  • Area 2: allows you to specify filter conditions to filter deployment tickets. After you specify filter conditions and click the search icon, deployment tickets that meet the filter conditions appear in section 3.

  • Area 3: displays information about deployment tickets.

Create and execute a deployment ticket

On the Deployment Ticket page, click Create. The page for creating a deployment ticket appears. To create a deployment ticket, you need to edit basic information, edit advanced information, and preview and submit the deployment ticket.

  1. Edit basic information, including the following parameters:

    • Title: the title of the deployment ticket. Enter a custom name.
    • Type: the deployment method.

      Note: Blue-green deployment is supported only in a workspace that has two data centers.

    • Group Policy: the policy for grouping ECS instances in the deployment ticket. Valid values: Quick Group, Group by Cell, Per Server, and All in One.
    • Add Beta Group: specifies whether to use a beta group. If you turn on this switch, a special beta group is set during deployment. The system selects an ECS instance from each data center and adds it to the beta group. The application is deployed to the ECS instances in the beta group before being deployed to the first ECS instance group, that is, ECS instance group 1.

    After the application is deployed to the beta group, the system automatically suspends application deployment. The system owner or PE needs to confirm the application deployment. If the application deployment is normal, click Confirm Beta Group to continue with the application deployment by ECS instance group. Beta grouping and custom grouping policies take effect simultaneously. They are equally effective grouping factors. When you create a deployment ticket, the Add Beta Group switch is turned on by default. In this case, a beta group is set for each application in the deployment ticket. If you do not need a beta group, turn off this switch.

    • Enable Grayscale Routing: specifies whether to enable grayscale traffic routing for the deployment ticket. For deployment tickets with the Use Grayscale Traffic Routing switch turned on, the system does not perform SLB traffic routing after application deployment by ECS instance group is completed. You can adjust the SLB traffic weight of ECS instances. All ECS instance groups in the deployment ticket have the beta group feature. You need to click OK to finish application deployment in each ECS instance group.

      Important notes: You can adjust the SLB traffic weight only for ECS instances on which the application is deployed. For ECS instances on which the application is not successfully deployed, you can only view the SLB traffic weight data. During application deployment, you can adjust the traffic weight for all ECS instance groups on which the application is deployed. After the application deployment is completed, you cannot adjust the traffic weight.

    • Set SLB Routing Weight: specifies whether to use the traffic weight that you set to replace the snapshot weight for traffic routing after the application deployment is completed.

    • Enable DingTalk Message: specifies whether to enable DingTalk notification for the deployment ticket. To trace the deployment in real time, turn on the Enable DingTalk Message switch to subscribe to the deployment information about applications in the deployment ticket, including the application deployment in beta groups. Before the subscription, you need to register a DingTalk chatbot account. Then, choose Settings > Notification in the left-side navigation pane and add the DingTalk chatbot account as the recipient of deployment notifications on the page that appears. Otherwise, the DingTalk notification feature is invalid.

    • Cell: the cell for deploying application services. Select at least one cell.

    • Application list: Select applications in the Available Application list and click > Add to add the application to the Selected Application list.

      Note: Only applications with deployment packages can be selected. To delete a selected application, select the application in Selected applications and click < Delete.

    If you do not need to edit the deployment policy, deployment parameters, or dependencies between multiple applications, click Quick Create to deploy the application.

  2. Edit advanced information.

    • Install Buildpack from Cache: specifies whether to install the buildpack from the cache.

      Note: Only applications that use buildpack 2.0 support this feature.

    • Upgrade/Downgrade Buildpack: specifies whether to enable the buildpack upgrade or downgrade feature. If you enable this feature, you can change the buildpack version. However, you cannot change the buildpack.

    • Deployment Parameters: the parameters to be added to the deployment ticket. You can add parameters by using one of the following methods:

      • Add to All Application: The same parameters are added for all applications.
      • Add to Specific Application: Parameters are added for a specific application.
      • Add in Batch: Parameters are added in batches in the [Parameter name]=[Parameter value] format. The parameter name can only contain uppercase letters, lowercase letters, digits, underscores (_), hyphens (-), and periods (.). Use a space or line feed to separate parameter setting pairs, for example, k1=v1 k2=v2.
    • Dependency: If you select two or more applications, you need to specify the dependency between applications. If the applications do not have dependencies, skip this parameter.

    You can use one of the following methods to add dependencies:

    • Add One by One: In the Dependencies column of an application, enter the names of applications that the current application depends on. For example, if application tmp depends on application testapp, enter testapp in the Dependencies column of tmp. If application tmp depends on multiple applications, enter the application names in the Dependencies column one by one.

    • Quick Add: This method is not recommended. You can use expressions similar to Application name 1>Application name 2,Application name 3>Application name 4 to specify the dependencies between applications.

      Note: Each application name in an expression must be unique. The application on the left of > depends on the application on the right, and there are no spaces preceding or following >. Use a comma (,) to separate two expressions.

      Cyclic dependencies are not allowed. That is, applications cannot depend on each other. For example, if application A depends on application B, then application B cannot depend on application A. If a cyclic dependency exists, an error message will appear when you click Next, indicating that a cyclic dependency exists. In this case, you need to edit the dependency again.

  3. Click Next. The Preview page appears.

  4. Preview and submit deployment information.

    The Preview page displays all deployment information for you to confirm.

    If you add dependencies in the Edit Advanced Info tab, the system automatically groups the applications based on the dependencies. Applications that do not depend on any other applications are added to group A1, applications that depend on applications in group A1 are added to group A2, and so on. During application deployment, the system first deploys applications in group A1 and then deploys applications in group A2 and other groups in sequence.

    To change the application deployment sequence, click Previous and re-edit the dependencies between applications. After you confirm the deployment information, click Create. A deployment ticket is created. The details page of the deployment ticket appears.

Operate the deployment ticket

Go to the Deploy Ticket Details page, as shown in the following figure.

Deploy Ticket Details

  • Area 1: displays basic information about the deployment ticket, including the deployment ticket title, deployment ticket ID, deployment status, deployment progress, and number of applications.

  • Area 2: allows you to operate the deployment ticket based on the deployment status. For example, you can re-initialize the deployment ticket, deploy all applications, cancel the deployment ticket, start to deploy applications, and edit the deployment sequence of applications. After you cancel a deployment ticket, you can no longer operate the deployment ticket. When deployment starts, the system first deploys applications in group A1 or B1, that is, applications that do not depend on other applications, and then deploys applications in other groups based on application dependencies.

  • Area 3: allows you to filter applications by deployment status. This area also displays the number of applications in each state.

  • Area 4: displays the deployment progress and status of all applications. If you select a state in area 3, this area displays the applications in the selected state. You can click Start Group to deploy applications in a specific group. Start Group is available for a group only when applications in the group do not depend on other applications, or all the applications that the applications in the group depend on are deployed.

Edit the deployment sequence of applications

On the Deploy Ticket Details page, click Edit APP Ticket in area 2. The Edit APP Ticket page appears.

  • Move applications: You can drag applications to target groups to edit the deployment sequence of the applications.

  • Add an application group for concurrent deployment: You can add an application group for concurrent deployment, and then move applications to the group. For example, you can click Add APP Group to add group B1 and then move applications to group B1.

  • Add a serial collection: You can click New Serial Collection to add a serial collection and then move applications to the collection.

  • Delete a serial collection: You can click Delete Group next to a serial collection to delete the collection. If all serial collections in an application group are deleted, the application group is deleted.

After editing the application deployment sequence, click Complete to return to the Deploy Ticket Details page.

View application deployment details

On the Deploy Ticket Details page, click an application name in area 4. The Application Deployment Details page appears, as shown in the following figure.

View application deployment details

  • Area 1: displays basic application information, including the application name, application ID, deployment package version, deployment status, deployment progress, deployment type, ECS instance grouping policy, number of ECS instances, and number of groups. If multiple applications exist, you can switch between different applications.
  • Area 2: allows you to operate applications. For example, you can deploy applications, cancel application deployment, synchronize ECS instance information, and adjust groups.
    • Deploy: If you click Deploy, the system starts to deploy the current application.
    • Cancel APP Deployment: If you click Cancel APP Deployment, you can no longer operate the application. However, the deployment ticket status is not affected by the application.
    • Change Group Order: You can add or delete ECS instance groups and move ECS instances between groups to adjust the sequence for deploying an application to different ECS instance groups.
    • Sync Server: This button appears when ECS instance information needs to be synchronized. For example, if ECS instances are added, deleted, or brought online or offline after a deployment ticket is created, the ECS instance information needs to be synchronized.
  • Area 3: displays the number of ECS instances in each state. This area also allows you to filter ECS instances by status.
  • Area 4: displays ECS instance groups, ECS instance deployment status, and deployment details. You can view deployment details and cancel groups. If you select a state in area 3, this area displays information about the ECS instances in the selected state.
    • Details: For ECS instance groups in which applications have been deployed, are being deployed, or fail to be deployed, you can view the application deployment details, including the progress, status, execution time, and failure cause.

Adjust ECS instance groups

On the Application Deployment Details page, click Change Group Order in area 2. The Change Group Order page appears.

The Change Group Order page allows you to regroup ECS instances, delete ECS instance groups, and move ECS instances to specific groups.

  • Re-Group: Re-select an ECS instance grouping policy to group ECS instances.

  • Delete Group: Click Delete Group on the right of a group to delete the group. ECS instances in the group are moved to the Ungrouped group. The application will not be deployed to ECS instances in the Ungrouped group.

  • Move Group: You can move an ECS instance to a specific group.

After adjusting the ECS instance groups, click Compete to return to the Application Deployment Details page.

Configure SLB grayscale traffic routing

If an application is bound to an SLB instance or an ECS instance group under the SLB instance before deployment, you can select Enable Grayscale Routing when you create a deployment ticket.

If you select Enable Grayscale Traffic Routing, the system does not restore the traffic weight of ECS instances based on the snapshot traffic after the application is deployed on a single ECS instance. Instead, you need to manually adjust the traffic weight to implement grayscale traffic routing for ECS instances on which the application is successfully deployed.

You can click Adjust Weight to adjust the traffic weight as prompted. Traffic weight adjustment takes effect only on ECS instances on which application deployment is successful. For ECS instances on which application deployment fails, the traffic weight remains 0 and you cannot modify it.

Subscribe to DingTalk notifications

You can subscribe to DingTalk notifications that are sent when application deployment starts or finishes.

In the left-side navigation pane, choose Settings > Notification to specify a DingTalk notification recipient.

When you create a deployment ticket, you can determine whether to turn on the Enable DingTalk Message switch to subscribe to DingTalk notifications. If no DingTalk notification recipient is specified, you cannot turn on the switch.

Roll back applications

On the APP Deployment Details page, you can roll back the applications that are being deployed or fail to be deployed.

Click Rollback. The Rollback APP dialog box appears.

Rollback condition: You can roll back an application only when the application has other successfully deployed deployment packages in addition to the current version. Otherwise, the prompt shown in the preceding dialog box appears when you attempt to roll back the application.

If other successfully deployed deployment packages exist, a dialog box appears when you attempt to roll back the application.

In the preceding dialog box, set Rollback Reason, select the group policy, and click OK. The APP Deployment Details page appears, and the system automatically rolls back the application.

On the Rollback Details tab, you can view the rollback progress and details.

On the Last Deployment tab, you can view deployment information before the rollback.