A canary release environment is an environment in which you can test the routine on one or more Dynamic Route for CDN (DCDN) nodes before you publish the routine to DCDN nodes all around the world. This helps minimize the impacts of unknown vulnerabilities on your business.
Features
The canary release environment is provided to help you minimize the impacts of possible failures when you publish new routines or routine updates. Canary release environments are divided based on regions, and you can control how you roll out your routines. You can select the regions in which canary release environments are deployed. For example, you can select Beijing, Fujian, Hunan, and Guangdong as the canary release environments. After you configure the canary release environments, you can select a canary release environment to publish a version of code or configuration. For example, you can publish the code to the Beijing region. The published code or configuration takes effect only for edge nodes in the Beijing region. It also only takes effect for the client requests that are scheduled to edge nodes in the Beijing region. After the code or configuration is published to the canary release environments in the specified regions, you can monitor the status of your business and feedback from users in the regions. If no issues are present, you can expand the scope of canary release or publish the code or configuration to the production environment.
After you add a node to the canary release environment, the node is no longer included in the production environment, as shown in the preceding figure. Each time you want to publish a new or updated code, you must separately publish it to the canary release environment. For example, you published the first version of your code to the production environment, and then you configure Beijing, Fujian, Hunan, and Guangdong as the regions where canary release environments are deployed. The nodes in these four regions are isolated from the production environment. When you publish the second version of the code to the production environment, the edge nodes in the four canary release regions still run the first version of the code. You need to separately publish the second version of the code to the Beijing, Fujian, Hunan, and Guangdong regions. Then, all online nodes will run the code.
To make full use of the canary release environment, we recommend that you publish your code to the test environment first, then the canary release environment, and finally the production environment every time you publish new or updated code.
Configure a canary release environment
- Log on to the Alibaba Cloud CDN console or DCDN console. Note A routine requires a domain name to provide services to the client. The domain name can be a CDN accelerated domain name or a DCDN accelerated domain name. Log on to the console of the service to which your domain name is added.
- In the left-side navigation pane, click EdgeRoutine.
- Select a routine name and click Details. In the Canary Release Environment (Optional) section, click Add Canary Release Environment. Note
- After you add regions to the canary release environment, the nodes in these regions are isolated from the production environment. The configurations of the canary release environment are applied to these nodes.
- When a new version of code is published to the production environment, the new version must also be published to all the nodes in the canary release environment to ensure that both environments run the same version of the code.
Parameter Description Region Select the region for canary release. Repeat this step to add two or more regions based on your business requirements. Note Alibaba Cloud provides 35 regions across the globe, allowing you to tailor the canary release environment to your business.Routine Specification - CPU Time Slice for Individual Requests: 5 ms, Maximum Real Time: 120s, Memory: 128 MB.
- CPU Time Slice for Individual Requests: 50 ms, Maximum Real Time: 120s, Memory: 128 MB.
- CPU Time Slice for Individual Requests: 100 ms, Maximum Real Time: 120s, Memory: 128 MB.
Note The fees vary based on routine specifications. For more information, see Billing rules.Routine Version After you add a canary release environment, the canary release environment runs the same version of the code as the production environment by default. Domain Name Whitelist The list of domain names that can be associated with the EdgeRoutine. For example, if you set Domain Name Whitelist to example.com, only requests from example.com can trigger the routine. Requests from other domain names are rejected by the routine. By default, Domain Name Whitelist is empty. Requests from all domain names can be associated with the routine. Wildcard domain names are supported. - Click OK.
Use the canary release environment
- When you publish a version of a routine, you can select a canary release environment that you configured in the Configure a canary release environment section and publish the version to the nodes in the regions of the canary release environment. Note If you select to publish version 1624328628932318493 of the code to Fujian and Chongqing, this version takes effect only for the edge nodes in Fujian and Chongqing. Only user requests that are scheduled to these two regions can trigger version 1624328628932318493 of the code.
- If you want to publish the code to all online nodes after you verify the performance of the code in the canary release environments, you must select the production environment and all the canary release environments so that the code can be published on all online nodes.