A canary release environment is an environment in which you can test the routine on one or more nodes before you publish the routine to nodes all around the world. This helps minimize the impact of unknown vulnerabilities on your business.
The canary release environment is provided to help you minimize the impact 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 to use as the canary release environments. 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 the version 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 version 2 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 version 2 of the code in 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/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 in which your domain name resides.
- In the left-side navigation pane, choose EdgeRoutine.
- Select a routine name and click Details. In the Canary Release Environment (Optional) section , click Add Canary Release Environment.
- After you add regions to the canary release environment, the nodes in these regions are isolated from the production environment. The configuration of the canary release environment is applied to these nodes.
- When a new version 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
Note The fees vary based on routine specifications. For more information, see Billing.
- 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.
Routine version Enter the version of the routine that you have developed. Domain name whitelist The list of domain names that can be associated with the ER. For example, if you set example.com, only requests from example.com can trigger the routine. Requests from other domain names are rejected by the routine. By default, the Domain Name Whitelist is empty. Requests from all domain names can be associated with the routine. Wildcard domains 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
Note If you select Fujian and Chongqing to publish version 1624328628932318493 of the code, 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.
- When 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 is published on all online nodes.