Application gray release method and storage medium
By creating a first application replica controller on the container cloud platform and adjusting the number of containers, the application canary release is realized, which solves the problem of increased resource and labor costs in the existing technology and realizes automated canary release without additional resource and labor costs.
Patent Information
- Application Number
- CN202510975059.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-07-15
- Publication Date
- 2025-10-28
AI Technical Summary
Existing application canary release solutions require additional dedicated resources and increased labor costs, leading to increased complexity in resource management and maintenance costs.
By creating a first application replica controller on the container cloud platform, adjusting the number of the first and second containers, and utilizing the same set of resources to achieve application canary releases, the system can automatically respond to canary release events, reducing manual operations.
It enables one-click application canary release without increasing additional resources and labor costs, reducing resource management and maintenance costs.
Smart Images

Figure CN120848944A_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present invention relate to the field of application deployment technology, and in particular to an application canary deployment method and storage medium. Background Technology
[0002] Currently, the application is deployed using a canary release scheme.
[0003] However, current application canary release solutions, such as the canary release solution, require additional dedicated resources and manual operation for the release process. In other words, implementing application canary release currently requires additional resource and labor costs, which urgently needs to be addressed. Summary of the Invention
[0004] This invention provides an application canary release method and storage medium to achieve application canary release without increasing additional resources and labor costs.
[0005] According to one aspect of the present invention, an application canary release method is provided, applied to a canary release control server. The method may include: in response to a canary release event for an application, obtaining the current first version and the second version to be updated to of the application, and obtaining the traffic weights corresponding to the first and second versions, wherein the application is deployed in a second container on a container cloud platform, and the application is updated from the first version to the second version under the control of a second application replica controller corresponding to the second container; creating a first application replica controller, and calling the first application replica controller according to the number of second containers, so as to create a corresponding number of first containers through the first application replica controller, wherein the first application replica controller and the second application replica controller correspond to the same set of resources on the container cloud platform, and the first version of the application is deployed in the first container; determining a quantity adjustment target according to the number of first containers and the traffic weight, and calling the second application replica controller according to the quantity adjustment target, so as to adjust the number of second containers through the second application replica controller, so that all traffic related to the application introduced through the resources is evenly distributed to each first container and each second container, thereby realizing the canary release of the application.
[0006] According to another aspect of the present invention, an application canary deployment method is provided, applied to a container cloud platform. After creating a corresponding number of first containers and adjusting the number of second containers according to the application canary deployment method provided in any embodiment of the present invention, the method may include: in response to traffic for the application, determining a target container for the corresponding traffic from each of the first containers and each of the second containers based on a load balancing principle, wherein the application is deployed in the first container in the form of a first version and in the second container in the form of a second version; introducing traffic into the target container to realize the canary deployment of the application by responding to the traffic through the application deployed in the target container.
[0007] According to another aspect of the present invention, an application canary release system is provided, which may include: a canary release control server and a container cloud platform; wherein, the canary release control server is used to execute the application canary release method provided in any embodiment of the present invention, and the container cloud platform is used to execute the application canary release method provided in any embodiment of the present invention.
[0008] According to another aspect of the present invention, a computer-readable storage medium is provided having computer instructions stored thereon for causing a processor to execute and implement the application grayscale release method provided in any embodiment of the present invention.
[0009] The technical solution of this invention is applied to a canary release control server. In response to a canary release event for an application, it obtains the current first version and the second version to be updated to, as well as the traffic weights corresponding to the first and second versions. The application is deployed in a second container on a container cloud platform. Under the control of the second application replica controller corresponding to the second container, the application is updated from the first version to the second version. Then, a first application replica controller is created, and the first application replica controller is called according to the number of second containers to create a corresponding number of first containers. The first application replica controller and the second application replica controller correspond to the same set of resources on the container cloud platform. The first container deploys the first version of the application, which enables the creation of first containers with the first version of the application deployed during the canary release of the application. Finally, the quantity adjustment target is determined according to the number of first containers and the traffic weights, and the second application replica controller is called according to the quantity adjustment target to adjust the number of second containers so that all traffic related to the application introduced through resources is evenly distributed to each first container and each second container, thereby realizing the canary release of the application. The above technical solution, by adjusting the number of the second container, allows for the canary release of the application without adding extra resources. Only one set of resources is needed to achieve the canary release of the application. Furthermore, it can automatically perform the canary release of the application in response to the canary release event, thereby achieving one-click application canary release without adding extra manual costs. Thus, it can achieve application canary release without adding extra resources and manual costs.
[0010] It should be understood that the description in this section is not intended to identify key or important features of the embodiments of the present invention, nor is it intended to limit the scope of the invention. Other features of the invention will become readily apparent from the following description. Attached Figure Description
[0011] To more clearly illustrate the technical solutions in the embodiments of the present invention, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0012] Figure 1 This is a flowchart of an application canary release method provided according to an embodiment of the present invention;
[0013] Figure 2 This is a schematic diagram of an optional example of an application canary release method provided according to an embodiment of the present invention;
[0014] Figure 3 This is a flowchart of another application canary release method provided by an embodiment of the present invention;
[0015] Figure 4 This is a schematic diagram of a traffic load balancing method for canary deployment provided according to an embodiment of the present invention;
[0016] Figure 5 This is a schematic diagram of another traffic balancing load to a container in an application canary release method provided according to an embodiment of the present invention;
[0017] Figure 6 This is a structural block diagram of an application grayscale publishing system provided according to an embodiment of the present invention;
[0018] Figure 7 This is a structural block diagram of an application grayscale publishing device provided according to an embodiment of the present invention;
[0019] Figure 8 This is a structural block diagram of another grayscale publishing device provided according to an embodiment of the present invention;
[0020] Figure 9 This is a schematic diagram of the structure of an electronic device that implements the grayscale release method of this invention. Detailed Implementation
[0021] To enable those skilled in the art to better understand the present invention, the technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings of the embodiments of the present invention. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort should fall within the scope of protection of the present invention.
[0022] It should be noted that the terms "first," "second," etc., in the specification, claims, and accompanying drawings of this invention are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that embodiments of the invention described herein can be implemented in orders other than those illustrated or described herein. The same applies to "target," "original," etc., and will not be repeated here. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.
[0023] Before introducing the embodiments of the present invention, we will first provide an exemplary description of the application scenarios of application canary release, the implementation process of the current solutions for application canary release, and the reasons why they require additional resources and labor costs. This will help us better understand why the solution proposed in the embodiments of the present invention can achieve application canary release without increasing additional resources and labor costs.
[0024] Against the backdrop of the booming development of cloud-native technologies, container cloud platforms based on container scheduling frameworks have become important operating platforms for carrying cloud-native technology stacks. Under the cloud-native architecture, application update operations can be automatically completed by its inherent rolling release mechanism. That is, the full update and switch of applications is completed in one rolling process. The rolling process first starts a small number of new version application instances, and after the application instances are ready, the corresponding number of old application instances are stopped. The above process is repeated until all application instances are updated. In other words, it completes the full update of application instances by gradually replacing old version application instances. This application release scheme can provide zero downtime capability and ensure that there are always ready application instances. However, a one-time rollout presents compatibility issues due to the temporary coexistence of old and new application versions, and the lack of a verification process during release means that business function updates are completed in one go. If a problem occurs, the application's service will be affected. In other words, the updated application will be fully rolled back in case of an anomaly, which will cause service interruption and is slow. In cases where the availability requirements of some applications are high and business interruption should be avoided as much as possible, the rollback process will cause a long service interruption, which will seriously affect the availability of the service. In addition, currently, it is usually required to expose functional anomalies and other problems during the gray-scale phase.
[0025] To address the aforementioned issues with full updates, a canary release mechanism has been introduced in practical application update scenarios. This mechanism involves selectively releasing new application instances to designated user groups, verifying their performance, and then updating all application instances only after successful verification. Currently, a commonly used and mature application canary release solution is the canary release solution provided by the cloud platform's built-in traffic routing component. The canary release solution is a gradual approach, better suited for applications requiring business verification and prioritizing business continuity. It uses traffic weights to segment traffic, enabling canary releases. In other words, the canary release solution deploys new application instances, imports a small percentage of traffic to verify and monitor the functionality and performance of the new application instances, and gradually increases the traffic percentage if no issues are found, until all application instances are fully replaced. While the canary deployment solution is feature-rich and can progressively verify the functionality and stability of new application instances by gradually increasing the traffic ratio of new version application instances, and can also quickly roll back applications by adjusting traffic, its deployment architecture requires additional dedicated resources for canary deployment in the cloud platform compared to a one-time rolling deployment. In particular, as the number of application modules increases, all modules require additional dedicated resources, and manual canary deployment operations such as manually establishing service mappings and application replica controllers are required during deployment. From a resource management perspective, this increases maintenance costs and operational complexity, meaning that the canary deployment solution requires additional resource and labor costs.
[0026] To address this, the embodiments of the present invention perform application canary releases by adjusting the number of the second containers. This allows for application canary releases without requiring additional resources; only one set of resources is needed. Furthermore, it can automatically perform application canary releases in response to canary release events, achieving one-click application canary releases without incurring additional manual costs. This will be explained in detail below.
[0027] Figure 1 This is a flowchart of an application canary deployment method provided in an embodiment of the present invention. This embodiment is applicable to application canary deployment scenarios. The method can be executed by the application canary deployment device provided in this embodiment of the present invention. This device can be implemented in software and / or hardware, and can be integrated into an electronic device, which can be various user terminals or servers.
[0028] See also Figure 1 The method of this invention is applied to a canary release control server, and the method specifically includes the following steps:
[0029] S110. In response to a canary release event for the application, obtain the current first version and the second version to be updated to for the application, as well as the traffic weights corresponding to the first and second versions. The application is deployed in the second container of the container cloud platform, and under the control of the second application replica controller corresponding to the second container, the application is updated from the first version to the second version.
[0030] It should be noted that the application canary release process and the corresponding resource creation operations in this embodiment of the invention are managed by the canary release control server's canary release mechanism. That is, the application canary release in this embodiment of the invention is applied to the canary release control server, which can be understood as a server used to control the application canary release. The application canary release process in this embodiment of the invention can be controlled and managed by a cloud-native canary release control program on the canary release control server. When a canary release is required, the canary release control program is started and configured so that it can use the cloud platform event listening mechanism to listen for resource changes and perform corresponding operations and controls for the application canary release through event-driven mechanisms.
[0031] In this context, "application" can be understood as an application that is to be released in a canary release phase.
[0032] A canary release event can be understood as an event that indicates the canary release of an application. A canary release event may include, for example, the state before the update and the state after the update. That is, it may include, for example, the first version identifier corresponding to the first version and the second version identifier corresponding to the second version, so that the first version and the second version can be obtained through the first version identifier and the second version identifier.
[0033] The first version can be understood as applying the current version.
[0034] The second version is the version that requires updating the first version; for example, the second version is the version V2 updated from the first version V1.
[0035] In this embodiment of the invention, a first version and a second version can be obtained in response to a grayscale release event. The acquisition of the second version can be determined, for example, by the release parameters (e.g., version identifiers such as V2) included in the grayscale release event.
[0036] Traffic weight can be understood as the weight of the gray traffic received by the second version of the application during a gray release, or it can be understood as the weight of the gray traffic received by the second version of the application during a gray release.
[0037] In this embodiment of the invention, traffic weights can be obtained.
[0038] A container cloud platform can be understood as a highly available container scheduling cluster built on a container scheduling engine. In this embodiment of the invention, the container cloud platform is used as a cloud platform for deploying containers.
[0039] The second container can be understood as a container under the control of its corresponding second application replica controller, where the deployed application is updated from the first version to the second version.
[0040] It is important to note that an application replica controller can be understood as a controller that can define and ensure that a specified number of containers are always running normally in the container cloud platform. It can support updating the application version in the container through rolling releases. The application replica controller can be deployed in the container cloud platform. Correspondingly, a second application replica controller can be understood as a controller that can define and ensure that a specified number of second containers are always running normally in the container cloud platform. Furthermore, the first application replica controller mentioned below can be understood as a controller that can define and ensure that a specified number of first containers are always running normally in the container cloud platform.
[0041] In this embodiment of the invention, under the control of the second application replica controller, the specific process of updating the application from the first version to the second version may be as follows: the rolling update mechanism of the second application replica controller (which may be the update mechanism built into the container cloud platform) starts working to update and replace the version of the application in the second container from the first version V1 to the second version V2; during the update process, one container may be updated first, and after its update is completed, another container may be updated.
[0042] S120. Create a first application replica controller and call the first application replica controller according to the number of second containers to create a corresponding number of first containers through the first application replica controller. The first application replica controller and the second application replica controller correspond to the same set of resources on the container cloud platform, and the first version of the application is deployed in the first container.
[0043] The first container can be understood as a container created by the first application replica controller, under which the deployed application is the first version.
[0044] Resource comprehensibility is an abstraction of all manageable objects in a container cloud platform, used to describe the state and behavior of components such as applications and / or services.
[0045] Understandably, since the application in the second container is updated from version 1 to version 2 under the control of the second application replica controller, after the update, the second container only contains version 2 of the application and not version 1. To achieve canary release of the application, in this embodiment of the invention, a formal environment can be created to run version 1 of the application. That is, a first application replica controller can be created. For example, the first application replica controller can be created based on the state before the update (e.g., at least one of the states including the number of second containers and version 1, etc.), and then the first application replica controller can be called based on the number of second containers to create the corresponding number of first containers. It should be noted that the process of creating the first application replica controller is automatic and does not require additional manual cost to create the first application replica controller.
[0046] In this embodiment of the invention, the first application replica controller and the second application replica controller correspond to the same set of resources on the container cloud platform, that is, the first application replica controller can be created without adding additional resources.
[0047] Optionally, resources include gateways and / or service mappings.
[0048] In this context, a gateway can be understood as a key device or software component used to connect different networks or protocols. In this embodiment of the invention, a gateway can be used to load balance all traffic introduced for an application to each first container and each second container.
[0049] Service mapping can be understood as a core mechanism that dynamically associates service requests with specific service instances or processing logic. In this embodiment of the invention, service mapping can be used to load balance all traffic of the application to each first container and each second container.
[0050] In this embodiment of the invention, resources may include gateways and / or service mappings to enable application canary releases without the need for additional gateways and / or service mappings.
[0051] S130. Determine the quantity adjustment target based on the number of first containers and traffic weight, and call the second application replica controller according to the quantity adjustment target to adjust the number of second containers through the second application replica controller so that all traffic related to the application introduced through resources is evenly distributed to each first container and each second container, thereby realizing the canary release of the application.
[0052] The quantity adjustment target can be understood as the target quantity to which the demand will adjust the quantity of the second container.
[0053] Total traffic can be understood as all the traffic received by the application during a canary release, or as all the traffic responded to by the application.
[0054] In this embodiment of the invention, the second application replica controller can be invoked according to the quantity adjustment target to adjust the number of the second containers. That is, for example, the number of the second containers controlled by the second application replica controller can be adjusted according to the quantity adjustment target so that all traffic introduced through resources is evenly distributed to each first container and each second container, thereby realizing the canary release of the application.
[0055] In this embodiment of the invention, in response to a full update event, a traffic weight adjustment event, or a rollback event, the ratio between the number of the first container and the number of the second container can be adjusted through the corresponding event, so as to quickly complete the full update, grayscale ratio adjustment, or rollback of the application version.
[0056] Compared to solutions that are opaque to developers during the application release process, the solution in this invention is a transparent application canary release solution. During the canary release process, the establishment of the canary environment and the configuration of traffic are completely managed and controlled by the canary release control server. Developers only need to perform normal application rolling updates to automatically complete the canary release, realizing one-click application canary release without adding extra resources, thereby achieving application canary release without adding extra resources and labor costs.
[0057] The technical solution of this invention is applied to a canary release control server. In response to a canary release event for an application, it obtains the current first version and the second version to be updated to, as well as the traffic weights corresponding to the first and second versions. The application is deployed in a second container on a container cloud platform. Under the control of the second application replica controller corresponding to the second container, the application is updated from the first version to the second version. Then, a first application replica controller is created, and the first application replica controller is called according to the number of second containers to create a corresponding number of first containers. The first application replica controller and the second application replica controller correspond to the same set of resources on the container cloud platform. The first container deploys the first version of the application, which enables the creation of first containers with the first version of the application deployed during the canary release of the application. Finally, the quantity adjustment target is determined according to the number of first containers and the traffic weights, and the second application replica controller is called according to the quantity adjustment target to adjust the number of second containers so that all traffic related to the application introduced through resources is evenly distributed to each first container and each second container, thereby realizing the canary release of the application. The above technical solution, by adjusting the number of the second container, allows for the canary release of the application without adding extra resources. Only one set of resources is needed to achieve the canary release of the application. Furthermore, it can automatically perform the canary release of the application in response to the canary release event, thereby achieving one-click application canary release without adding extra manual costs. Thus, it can achieve application canary release without adding extra resources and manual costs.
[0058] An optional technical solution, applying a canary release method, further includes: obtaining a pre-configured application replica controller identifier, wherein the application replica controller identifier is an identifier of a second application replica controller; responding to a canary release event for the application, including: responding to the canary release event when a canary release event corresponding to the application replica controller identifier is detected.
[0059] The application replica controller identifier can be understood as the identifier of a pre-configured second application replica controller.
[0060] In this embodiment of the invention, the canary release control server can focus only on the canary release event of the corresponding second application replica controller, ignoring other events. That is, the canary release control server can listen to the second application replica controller corresponding to the application replica controller identifier, and respond to the canary release event upon detecting one corresponding to that identifier. This technical solution, by responding only to the canary release event corresponding to the second application replica controller upon detecting it, achieves a response only to the canary release event corresponding to the second application replica controller, avoiding the waste of resources caused by responding to events corresponding to other application replica controllers.
[0061] Based on the above solution, another optional technical solution is that the canary release event is an event triggered by the container cloud platform when it detects a version update operation. The version update operation is an operation to update the version of the application corresponding to the second application replica controller.
[0062] The version update operation can be understood as an operation to update the version of the application corresponding to the second application replica controller.
[0063] In this embodiment of the invention, the canary release event can be an event triggered by the container cloud platform when it detects a version update operation. The version update operation is an operation to update the version of the application corresponding to the second application replica controller. This can realize the response only to the canary release event triggered when the version update operation corresponding to the second application replica controller is performed, avoiding the waste of resources caused by responding to other operations.
[0064] Another optional technical solution is to use traffic weight to represent the proportion of traffic responded by the second version of the application in the total traffic. The quantity adjustment target is determined based on the number of first containers and traffic weight, including: obtaining a first difference between a preset value and traffic weight; obtaining a ratio between the number of first containers and the first difference; and obtaining a quantity adjustment target based on a second difference between the ratio and the number of first containers.
[0065] The preset value can be understood as the sum of the preset traffic weight and the proportion of traffic from the first version of the application response in the total traffic.
[0066] The first difference can be understood as the difference between the preset value and the traffic weight, which can represent the proportion of the traffic of the first version of the application response in the total traffic.
[0067] The ratio can be understood as the ratio between the number of first containers and the first difference, which can represent the total number of containers required.
[0068] The second difference can be understood as the difference between the ratio and the quantity of the first container. It can represent the quantity of the second container after demand adjustment, that is, the quantity adjustment target.
[0069] For example, the preset quantity can be 1, the traffic weight is 25%, and the number of the first container is 3. Then, the first difference between the preset value and the traffic weight is 75%, the ratio between the number of the first container and the first difference is 4, and finally, based on the second difference between the ratio and the number of the first container, the quantity adjustment target is 1.
[0070] In this embodiment of the invention, a first difference between a preset value and a traffic weight can be obtained, then the ratio between the number of first containers and the first difference can be obtained, and finally, based on the second difference between the ratio and the number of first containers, a quantity adjustment target can be obtained, thus obtaining a quantity adjustment target that matches the traffic weight.
[0071] To better understand the technical solutions of the above embodiments of the present invention, an optional example is provided herein. For example, see... Figure 2 As a user operating on resource objects, you can trigger instructions to release applications through the container cloud platform. Based on these instructions, the cloud platform can release canary release events for applications deployed in the second container corresponding to the second application replica controller. Parameters such as the application replica controller identifier and traffic weight can be pre-configured so that the canary release control program in the canary release control server can respond to the canary release event by obtaining the application replica controller identifier and traffic weight, and then obtaining the first and second versions. It can then create a first application replica controller and call it according to the number of second containers to create the corresponding number of first containers. Based on the number of first containers and traffic weight, it can determine the quantity adjustment target and call the second application replica controller to adjust the number of second containers, so that all traffic is evenly distributed among the first and second containers, thus achieving the canary release of the application.
[0072] Figure 3 This is a flowchart of another application canary deployment method provided in this embodiment of the invention. This embodiment is applicable to application canary deployment scenarios. The method can be executed by the application canary deployment device provided in this embodiment of the invention. This device can be implemented in software and / or hardware, and can be integrated into an electronic device, which can be various user terminals or servers.
[0073] See Figure 3 The method of this invention is applied to a container cloud platform, and the method specifically includes the following steps:
[0074] S210. After creating a corresponding number of first containers and adjusting the number of second containers according to the application canary release method provided in any embodiment of the present invention, in response to the traffic for the application, based on the load balancing principle, a target container for the corresponding traffic is determined from each of the first containers and each of the second containers, wherein the application is deployed in the first container in the form of a first version and in the second container in the form of a second version.
[0075] The load balancing principle can be understood as the principle of reasonably allocating traffic to containers. For example, the load balancing principle can adopt the round-robin principle.
[0076] The target container can be understood as the container into which the demand brings traffic.
[0077] In this embodiment of the invention, in response to the traffic for the application, a target container can be determined from each first container and each second container based on the principle of load balancing. For example, each first container and each second container can be treated as a whole, that is, each first container and each second container can be treated as a container, and the target container can be determined from each container (for example, the container with the least load can be determined as the target container).
[0078] Understandably, in response to traffic to the application, the version of the application in the second container has been updated from the first version to the second version. Therefore, the application is deployed in the first container as the first version and in the second container as the second version.
[0079] S220. Traffic is introduced into the target container to enable the application to be released in a canary manner by responding to the traffic through the application deployed in the target container.
[0080] In this embodiment of the invention, the application in the target container is the application that can respond to traffic. Therefore, traffic can be introduced into the target container so that the application deployed in the target container can respond to the traffic, thereby realizing the canary release of the application.
[0081] The technical solution of this invention is applied to a container cloud platform. After creating a corresponding number of first containers and adjusting the number of second containers according to the application canary release method provided in any embodiment of this invention, in response to application traffic, based on the principle of load balancing, a target container for the corresponding traffic is determined from each of the first and second containers. The application is deployed in the first container in a first version and in the second container in a second version. Traffic is then introduced into the target container so that the application deployed in the target container responds to the traffic, thereby achieving the canary release of the application. This technical solution, by adjusting the number of second containers, allows for application canary release without adding additional resources; only one set of resources is needed. Furthermore, it can automatically perform application canary release in response to canary release events, achieving one-click application canary release without additional manual costs. Therefore, it enables application canary release without increasing additional resources or manual costs.
[0082] An optional technical solution involves deploying a first application replica controller, a second application replica controller, and a service mapping on a container cloud platform. The first container is controlled by the first application replica controller, and the second container is controlled by the second application replica controller. The first and second application replica controllers correspond to the same service mapping, and the labels corresponding to each first container and each second container are identical to the labels defined in the service mapping. This ensures that all application traffic is introduced from the service mapping and then evenly distributed to each first container and each second container.
[0083] It should be noted that the first application replica controller and the second application replica controller correspond to the same service mapping. That is, in this embodiment of the invention, the grayscale environment corresponding to the second container can be integrated into the existing service mapping, thereby realizing application grayscale release without increasing the additional manual cost of creating service mapping or preparing dedicated service mapping resources.
[0084] For example, see Figure 4 The first container is controlled by the first application replica controller, and the second container (the application in the second container has been rolled over from version V1 to version V2) is controlled by the second application replica controller. In other words, each container is controlled by its corresponding application replica controller. Labels are defined in the service mapping, and each container (each first container and each second container) corresponds to the same label defined in the service mapping. This allows the gateway to load balance all application-related traffic from the service mapping to containers with the same label. It's important to note that each container can also have its own corresponding container label (e.g., ...). Figure 4 The "pod-template-hash=6b9fb65979" in the template is used to distinguish different containers.
[0085] Optionally, a gateway is also deployed on the container cloud platform. The service mapping corresponds to only one gateway, so that the application canary release can be realized without the need to increase the manual cost of creating a gateway or prepare dedicated gateway resources.
[0086] In this embodiment of the invention, a first application replica controller, a second application replica controller, and a service mapping are deployed on a container cloud platform. A first container is controlled by the first application replica controller, and a second container is controlled by the second application replica controller. The first and second application replica controllers correspond to the same service mapping, and the labels corresponding to each first container and each second container are identical to the labels defined in the service mapping. This ensures that all traffic related to the application is introduced through the service mapping and then evenly distributed to each first and second container. This technical solution, by ensuring that the container labels are identical to the labels defined in the service mapping, allows the same service mapping to introduce all traffic and evenly distribute it to each first and second container. This eliminates the need for additional manual costs in creating service mappings and the need to prepare dedicated service mapping resources, thus enabling application canary deployments.
[0087] To better understand the technical solutions of the above embodiments of the present invention, the application canary release schemes in related solutions and the application canary release schemes of the technical solutions of the present invention will be described exemplarily here, so as to better understand why the solutions proposed in the embodiments of the present invention can achieve application canary release without adding additional resources. For example, in the related solutions, the first application replica controller corresponds to a set of service mappings and gateways, and the second application replica controller corresponds to another set of service mappings and gateways. The related solutions can respond to application traffic, obtain traffic weights, and distribute traffic according to the traffic weights to obtain first traffic and second traffic. One set of service mappings and gateways directs the first traffic into the container controlled by the first application replica controller corresponding to the first set of service mappings and gateways, and the other set of service mappings and gateways directs the second traffic into the container controlled by the second application replica controller corresponding to the other set of service mappings and gateways. This solution requires the deployment of two sets of service mappings and gateways; otherwise, it is difficult to achieve application canary release according to traffic weights.
[0088] The technical solution of this invention adjusts the number of second containers based on traffic weights. After adjusting the number of second containers, the ratio between the number of first containers and the number of second containers corresponds to the traffic weights, that is, the ratio between the number of first containers and the number of second containers reflects the traffic weight allocation. Furthermore, in response to traffic for applications, based on the principle of load balancing, a target container for the corresponding traffic is determined from each first container and each second container. At this time, the probability that the target container is a first container or a second container satisfies the traffic weight allocation. Based on this, traffic is introduced into the target container so that the application deployed in the target container responds to the traffic. This enables the canary release of applications according to traffic weights. In other words, the technical solution of this invention only requires one set of formal environment resources including service mapping and gateways, without the need for two sets of service mapping and gateways for traffic splitting. It can achieve canary release of applications according to traffic weights, reducing resource management and maintenance costs, thereby realizing canary release of applications without adding additional resources.
[0089] To better understand the technical solutions of the above embodiments of the present invention, an optional example is provided here. Exemplarily, when the canary release control program detects a canary release event, it responds to the event by obtaining a first version and a second version, as well as a traffic weight; it triggers a rolling update of the second application replica controller, so that under the control of the second application replica controller, the application is updated from the first version to the second version; the canary release control program automatically creates a first application replica controller and calls the first application replica controller according to the number of second containers, so that a corresponding number of first containers are created in the canary release control program through the first application replica controller. At this time, the environment in which the first containers are located is the production environment, and the environment in which the second containers are located is the canary environment; the number of second containers is adjusted according to the number of first containers and the traffic weight; see [link to relevant documentation]. Figure 5 Each first container and each second container have the same labels as those defined in the service mapping (each container can also have its own corresponding container label). Based on this, the container cloud platform can respond to application traffic by introducing all application traffic through the same set of gateways and service mappings and then balancing the load to the target containers in each first container and each second container, so as to realize the canary release of the application through the application response traffic deployed in the target containers.
[0090] Figure 6 This is a structural block diagram of an application canary release system provided in an embodiment of the present invention. This embodiment is applicable to situations involving canary release.
[0091] See Figure 6 The canary release system of this invention includes: a canary release control server 310 and a container cloud platform 320; wherein,
[0092] The canary release control server 310 is used to execute the application canary release method provided in any embodiment of the present invention, and the container cloud platform 320 is used to execute the application canary release method provided in any embodiment of the present invention.
[0093] In this embodiment of the invention, besides applying canary deployments, operations such as creating, editing, and deleting applications can also be performed using the architecture of the application canary deployment system of this embodiment. That is, different processing logic can be set according to the event type of different events. The corresponding event is triggered through the container cloud platform 320, and the canary deployment control server 310 captures and monitors the event through interface subscription, performing the corresponding processing logic according to the event type. Based on this, the aforementioned editing operation is a modification operation, and application canary deployment can be understood as a modification operation. Application canary deployment involves triggering a canary deployment event through the container cloud platform 320, and the canary deployment control server 310 captures and monitors the canary deployment event through interface subscription, performing the application canary deployment processing logic according to the event type of the canary deployment event.
[0094] The technical solution of this invention includes a canary release control server and a container cloud platform. The canary release control server is used to execute the application canary release method provided in any embodiment of this invention, and the container cloud platform is used to execute the application canary release method provided in any embodiment of this invention. This technical solution, by adjusting the number of second containers, performs application canary releases without adding extra resources; only one set of resources is needed to achieve application canary releases. Furthermore, it can automatically perform application canary releases in response to canary release events, achieving one-click application canary releases without additional manual costs. Therefore, it enables application canary releases without increasing additional resources or manual costs.
[0095] Figure 7 This is a structural block diagram of an application grayscale deployment apparatus provided in an embodiment of the present invention. This apparatus is used to execute the application grayscale deployment method provided in any of the above embodiments. This apparatus and the application grayscale deployment methods of the above embodiments belong to the same inventive concept. Details not described in detail in the embodiments of the application grayscale deployment apparatus can be found in the embodiments of the application grayscale deployment method described above. See also... Figure 7 The device is configured on the canary release control server and may specifically include: a traffic weight acquisition module 410, a first application replica controller calling module 420, and a canary release implementation module 430.
[0096] The traffic weight acquisition module 410 is used to respond to the canary release event for the application, acquire the current first version and the second version to be updated to, and acquire the traffic weights corresponding to the first and second versions. The application is deployed in the second container of the container cloud platform. Under the control of the second application replica controller corresponding to the second container, the application is updated from the first version to the second version. The first application replica controller calling module 420 is used to create the first application replica controller and call the first application replica controller according to the number of second containers, so as to create a corresponding number of first containers through the first application replica controller. The first application replica controller and the second application replica controller correspond to the same set of resources on the container cloud platform. The first version of the application is deployed in the first container. The canary release implementation module 430 is used to determine the quantity adjustment target according to the number of first containers and traffic weights, and call the second application replica controller according to the quantity adjustment target, so as to adjust the number of second containers through the second application replica controller, so that all traffic related to the application introduced through the resources is evenly distributed to each first container and each second container, thereby realizing the canary release of the application.
[0097] Optionally, the device may further include: an application replica controller identifier acquisition module, used to acquire a pre-configured application replica controller identifier, wherein the application replica controller identifier is the identifier of the second application replica controller; and a traffic weight acquisition module 410, which may include: a canary release event response submodule, used to respond to a canary release event when a canary release event corresponding to the application replica controller identifier is detected.
[0098] Optionally, based on the above-mentioned device, the canary release event is an event triggered by the container cloud platform when it detects a version update operation. The version update operation is an operation to update the version of the application corresponding to the second application replica controller.
[0099] Optionally, the traffic weight represents the proportion of traffic from the second version of the application response in the total traffic. The canary release implementation module 430 may include: a first difference obtaining submodule, used to obtain the first difference between a preset value and the traffic weight; a ratio obtaining submodule, used to obtain the ratio between the number of first containers and the first difference; and a quantity adjustment target obtaining submodule, used to obtain the quantity adjustment target based on the second difference between the ratio and the number of first containers.
[0100] Optionally, resources include gateways and / or service mappings.
[0101] The application canary release device provided in this embodiment of the invention is configured on a canary release control server. Through a traffic weight acquisition module, in response to a canary release event for an application, it acquires the current first version and the second version to be updated to, as well as the traffic weights corresponding to the first and second versions. The application is deployed in a second container on a container cloud platform. Under the control of a second application replica controller corresponding to the second container, the application is updated from the first version to the second version. Then, through the first application replica controller, a module is called to create the first application replica controller, and the first application replica controller is called according to the number of second containers, so as to achieve the desired update speed. The application replica controller creates a corresponding number of first containers. The first and second application replica controllers share the same resources on the container cloud platform. Each first container deploys a first version of the application. This enables the creation of first containers with the first version of the application deployed during application canary deployments. Finally, the canary deployment module determines the quantity adjustment target based on the number of first containers and traffic weights. Based on the quantity adjustment target, it calls the second application replica controller to adjust the number of second containers, ensuring that all application-related traffic introduced through resources is evenly distributed across the first and second containers, thus achieving the canary deployment of the application. This device, by adjusting the number of second containers, performs application canary deployments without adding extra resources, requiring only one set of resources. Furthermore, it can automatically perform application canary deployments in response to canary deployment events, achieving one-click application canary deployments without additional manual costs. Therefore, it enables application canary deployments without incurring additional resource or labor costs.
[0102] The application grayscale deployment device provided in the embodiments of the present invention can execute the application grayscale deployment method provided in any embodiment of the present invention, and has the corresponding functional modules and beneficial effects of the method execution.
[0103] Figure 8 This is a structural block diagram of another application grayscale deployment apparatus provided in an embodiment of the present invention. This apparatus is used to execute the application grayscale deployment method provided in any of the above embodiments. This apparatus belongs to the same inventive concept as the application grayscale deployment methods in the above embodiments. Details not described in detail in the embodiments of the application grayscale deployment apparatus can be referred to the embodiments of the application grayscale deployment methods described above. See also Figure 8 The device is configured on a container cloud platform and may specifically include: a target container determination module 510 and a canary release implementation module 520.
[0104] The target container determination module 510 is used to determine the target container for the corresponding traffic from each of the first containers and each of the second containers in response to the traffic for the application, based on the principle of load balancing, after creating a corresponding number of first containers and adjusting the number of second containers according to the application canary release method provided in any embodiment of the present invention. The application is deployed in the first container in the form of a first version and in the second container in the form of a second version. The canary release implementation module 520 is used to introduce traffic into the target container so as to realize the canary release of the application by responding to the traffic through the application deployed in the target container.
[0105] Optionally, a first application replica controller, a second application replica controller, and a service mapping are deployed on the container cloud platform. The first container is controlled by the first application replica controller, and the second container is controlled by the second application replica controller. The first application replica controller and the second application replica controller correspond to the same service mapping, and the labels corresponding to each first container and each second container are the same as the labels defined in the service mapping, so that all traffic related to the application is introduced from the service mapping and then the load is evenly distributed to each first container and each second container.
[0106] Optionally, a gateway is also deployed on the container cloud platform, and the service mapping corresponds to only one gateway.
[0107] The application canary deployment device provided in this embodiment of the invention is configured on a container cloud platform. Through a target container determination module, after creating a corresponding number of first containers and adjusting the number of second containers according to the application canary deployment method provided in any embodiment of the invention, it determines the target container for the corresponding traffic from each of the first and second containers based on the principle of load balancing, in response to application traffic. The application is deployed in the first container in a first version and in the second container in a second version. Then, through a canary deployment implementation module, traffic is introduced into the target container so that the application deployed in the target container responds to the traffic, thus achieving the canary deployment of the application. This device, by adjusting the number of second containers, can perform application canary deployment without adding extra resources; only one set of resources is needed. Furthermore, it can automatically perform application canary deployment in response to canary deployment events, achieving one-click application canary deployment without additional manual costs. Therefore, it can achieve application canary deployment without adding extra resources or manual costs.
[0108] The application grayscale deployment device provided in the embodiments of the present invention can execute the application grayscale deployment method provided in any embodiment of the present invention, and has the corresponding functional modules and beneficial effects of the method execution.
[0109] It is worth noting that in the above embodiments of the grayscale release device, the various units and modules included are only divided according to functional logic, but are not limited to the above division, as long as the corresponding functions can be achieved; in addition, the specific names of each functional unit are only for easy differentiation and are not used to limit the scope of protection of the present invention.
[0110] Figure 9 A schematic diagram of an electronic device 10 that can be used to implement embodiments of the present invention is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital processors, cellular phones, smartphones, wearable devices (e.g., helmets, glasses, watches, etc.), and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely illustrative and are not intended to limit the implementation of the invention described and / or claimed herein.
[0111] like Figure 9 As shown, the electronic device 10 includes at least one processor 11 and a memory, such as a read-only memory (ROM) 12 or a random access memory (RAM) 13, communicatively connected to the at least one processor 11. The memory stores computer programs executable by the at least one processor. The processor 11 can perform various appropriate actions and processes based on the computer program stored in the ROM 12 or loaded into the RAM 13 from storage unit 18. The RAM 13 can also store various programs and data required for the operation of the electronic device 10. The processor 11, ROM 12, and RAM 13 are interconnected via a bus 14. An input / output (I / O) interface 15 is also connected to the bus 14.
[0112] Multiple components in electronic device 10 are connected to I / O interface 15, including: input unit 16, such as keyboard, mouse, etc.; output unit 17, such as various types of displays, speakers, etc.; storage unit 18, such as disk, optical disk, etc.; and communication unit 19, such as network card, modem, wireless transceiver, etc. Communication unit 19 allows electronic device 10 to exchange information / data with other devices through computer networks such as the Internet and / or various telecommunications networks.
[0113] Processor 11 can be a variety of general-purpose and / or special-purpose processing components with processing and computing capabilities. Some examples of processor 11 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various special-purpose artificial intelligence (AI) computing chips, various processors running machine learning model algorithms, a digital signal processor (DSP), and any suitable processor, controller, microcontroller, etc. Processor 11 performs the various methods and processes described above, such as applying canary release methods.
[0114] In particular, according to embodiments of the present invention, the processes described above with reference to the flowcharts can be implemented as computer software programs. For example, embodiments of the present invention include a computer program product comprising a computer program carried on a non-transitory computer-readable medium, the computer program containing program code for performing the methods shown in the flowcharts. In such embodiments, the computer program can be downloaded and installed from a network via communication unit 19, or installed from storage unit 18, or installed from ROM 12. When the computer program is executed by processor 11, it performs the functions defined in the methods of the embodiments of the present invention.
[0115] In some embodiments, the application canary release method can be implemented as a computer program tangibly contained in a computer-readable storage medium, such as storage unit 18. In some embodiments, part or all of the computer program can be loaded and / or installed on electronic device 10 via ROM 12 and / or communication unit 19. When the computer program is loaded into RAM 13 and executed by processor 11, one or more steps of the application canary release method described above can be performed. Alternatively, in other embodiments, processor 11 can be configured to execute the application canary release method by any other suitable means (e.g., by means of firmware).
[0116] Various embodiments of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field-programmable gate arrays (FPGAs), application-specific integrated circuits (ASICs), application-specific standard products (ASSPs), system-on-a-chip (SoCs), complex programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various embodiments may include implementations in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which may be a dedicated or general-purpose programmable processor, capable of receiving data and instructions from a storage system, at least one input device, and at least one output device, and transmitting data and instructions to the storage system, the at least one input device, and the at least one output device.
[0117] Computer programs used to implement the methods of the present invention can be written in any combination of one or more programming languages. These computer programs can be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, such that when executed by the processor, the computer programs cause the functions / operations specified in the flowcharts and / or block diagrams to be implemented. The computer programs can be executed entirely on a machine, partially on a machine, as a standalone software package partially on a machine and partially on a remote machine, or entirely on a remote machine or server.
[0118] In the context of this invention, a computer-readable storage medium can be a tangible medium that may contain or store a computer program for use by or in conjunction with an instruction execution system, apparatus, or device. A computer-readable storage medium may include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination thereof. Alternatively, a computer-readable storage medium may be a machine-readable signal medium. More specific examples of machine-readable storage media include electrical connections based on one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fibers, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination thereof.
[0119] To provide interaction with a user, the systems and techniques described herein can be implemented on an electronic device having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and pointing device (e.g., a mouse or trackball) through which the user provides input to the electronic device. Other types of devices can also be used to provide interaction with the user; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including sound input, voice input, or tactile input).
[0120] The systems and technologies described herein can be implemented in computing systems that include backend components (e.g., as data servers), or computing systems that include middleware components (e.g., application servers), or computing systems that include frontend components (e.g., user computers with graphical user interfaces or web browsers through which users can interact with implementations of the systems and technologies described herein), or any combination of such backend, middleware, or frontend components. The components of the system can be interconnected via digital data communication of any form or medium (e.g., communication networks). Examples of communication networks include local area networks (LANs), wide area networks (WANs), blockchain networks, and the Internet.
[0121] A computing system can include clients and servers. Clients and servers are generally located far apart and typically interact through communication networks. The client-server relationship is created by computer programs running on the respective computers and having a client-server relationship with each other. The server can be a cloud server, also known as a cloud computing server or cloud host, which is a hosting product within the cloud computing service system to address the shortcomings of traditional physical hosts and VPS services, such as high management difficulty and weak business scalability.
[0122] It should be understood that the various forms of processes shown above can be used, with steps reordered, added, or deleted. For example, the steps described in this invention can be executed in parallel, sequentially, or in different orders, as long as the desired result of the technical solution of this invention can be achieved, and this is not limited herein.
[0123] The specific embodiments described above do not constitute a limitation on the scope of protection of this invention. Those skilled in the art should understand that various modifications, combinations, sub-combinations, and substitutions can be made according to design requirements and other factors. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of this invention should be included within the scope of protection of this invention.
Claims
1. A method for applying canary release, characterized in that, The method, applied to a canary release control server, includes: In response to a canary release event for an application, the application's current first version and the second version to be updated to are obtained, as well as the traffic weights corresponding to the first version and the second version. The application is deployed in a second container on a container cloud platform, and under the control of a second application replica controller corresponding to the second container, the application is updated from the first version to the second version. A first application replica controller is created, and the first application replica controller is invoked according to the number of second containers to create a corresponding number of first containers through the first application replica controller. The first application replica controller and the second application replica controller correspond to the same set of resources on the container cloud platform, and the first version of the application is deployed in the first container. The quantity adjustment target is determined based on the number of the first containers and the traffic weight, and the second application replica controller is invoked according to the quantity adjustment target to adjust the number of the second containers through the second application replica controller, so that all traffic related to the application introduced through the resources is evenly distributed to each of the first containers and each of the second containers, thereby realizing the canary release of the application.
2. The method according to claim 1, characterized in that, Also includes: Obtain a pre-configured application replica controller identifier, wherein the application replica controller identifier is the identifier of the second application replica controller; The response to the canary release event for the application includes: If a canary release event corresponding to the application replica controller identifier is detected, respond to the canary release event.
3. The method according to claim 2, characterized in that, The canary release event is an event triggered by the container cloud platform when it detects a version update operation, which is an operation to update the version of the application corresponding to the second application replica controller.
4. The method according to claim 1, characterized in that, The traffic weight represents the proportion of traffic responded to by the application in the second version in all traffic. Determining the quantity adjustment target based on the number of the first containers and the traffic weight includes: The first difference between the preset value and the traffic weight is obtained; The ratio between the number of the first containers and the first difference is obtained; The quantity adjustment target is obtained based on the second difference between the ratio and the number of the first containers.
5. The method according to claim 1, wherein the resources include gateways and / or service mappings.
6. A method for applying grayscale release, characterized in that, Applied to a container cloud platform, after creating a corresponding number of first containers and adjusting the number of second containers according to the application canary release method of any one of claims 1-5, the method includes: In response to traffic to the application, a target container corresponding to the traffic is determined from each of the first container and each of the second containers based on the principle of load balancing, wherein the application is deployed in the first container in the form of a first version and in the second container in the form of a second version. The traffic is directed to the target container so that the application deployed in the target container can respond to the traffic, thereby enabling the canary release of the application.
7. The method according to claim 6, characterized in that, A first application replica controller, a second application replica controller, and service mappings are deployed on the container cloud platform; wherein, The first container is controlled by the first application replica controller, and the second container is controlled by the second application replica controller. The first application replica controller and the second application replica controller correspond to the same service mapping, and the labels corresponding to each first container and each second container are the same as the labels defined in the service mapping, so that all traffic related to the application is introduced from the service mapping and then the load is balanced to each first container and each second container.
8. The method according to claim 7, characterized in that, A gateway is also deployed on the container cloud platform, and the service mapping corresponds to only one of the gateways.
9. A canary release system, characterized in that, include: An application canary deployment system, characterized in that it includes: a canary deployment control server and a container cloud platform; wherein, The canary release control server is used to execute the application canary release method as described in any one of claims 1-5, and the container cloud platform is used to execute the application canary release method as described in any one of claims 6-8.
10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer instructions that cause a processor to execute and implement the application canary deployment method as described in any one of claims 1-5 or any one of claims 6-8.