Application program updating method and container management platform

By using annotation information in the resource data of each version of the application to determine the target resource data and its loading order, the high cost and inefficiency problems of full updates in cross-version updates are solved, and efficient and low-cost application updates are achieved.

WO2025107576A1PCT designated stage expired Publication Date: 2025-05-30HUAWEI CLOUD COMPUTING TECHNOLOGIES CO LTD
View PDF 8 Cites 0 Cited by

Patent Information

Application Number
PCT/CN2024/097513
Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
Priority Date
2024-02-06
Filing Date
2024-06-05
Publication Date
2025-05-30

AI Technical Summary

Technical Problem

When updating application versions, especially when updating across versions, the existing technology requires full updates, resulting in high cost, low efficiency, and a large number of intermediate versions increase the update complexity.

Method used

By using annotation information in the resource data of each version of the application, determine the target resource data and its loading order, cross-version updates are achieved without full updates or developing all upgrade paths.

Benefits of technology

Reduces the cost of cross-version updates for applications, improves update efficiency, reduces development workload and maintenance costs, and is suitable for more diverse iteration situations.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN2024097513_30052025_PF_FP_ABST
    Figure CN2024097513_30052025_PF_FP_ABST
Patent Text Reader

Abstract

Embodiments of the present application relate to the technical field of computers, and provide an application program updating method and a container management platform. The application program updating method is applied to the container management platform. An application program is deployed on a container managed by the container management platform. The method comprises: the container management platform receiving an updating instruction for updating an application program from a first version to a second version; on the basis of annotation information in resource data under each version among the first version, the second version, and at least one intermediate version, determining at least one piece of target resource data and a loading sequence of the at least one piece of target resource data; and on the basis of the loading sequence of the at least one piece of target resource data and the at least one piece of target resource data, updating the resource data of the application program of the first version. The embodiments of the present application can improve the application program updating efficiency.
Need to check novelty before this filing date? Find Prior Art

Description

Application update method and container management platform

[0001] This application claims priority to the Chinese patent application filed with the China Patent Office on November 21, 2023, with application number 202311558339.9 and invention name “A cloud-native cross-version upgrade method and device”, and the Chinese patent application filed with the China Patent Office on February 6, 2024, with application number 202410171818.3 and invention name “Application update method and container management platform”, the entire contents of which are incorporated by reference into this application. Technical Field

[0002] The embodiments of the present application relate to the field of computer technology, and in particular to an application updating method and a container management platform. Background Art

[0003] Containers provide an isolated computing environment for storing and accessing programs. They are virtualization devices similar to virtual machines, but differ in that they implement process-level resource isolation. Container management platforms, or container orchestration systems (such as Kubernetes and K8s), enable application deployment by loading application resource data (such as resource templates in K8s deployment packages (charts)), making application deployment and management more convenient.

[0004] In related technologies, when an application undergoes version updates, such as version upgrades or rollbacks, the container orchestration system can replace the resource data of the current version with the resource data of the updated version to obtain the updated resource data, and then load the updated resource data to update the current version of the application. For cross-version application updates, such as updates between versions V1 and V3, it is necessary to update the versions in order of age, that is, a full update; upgrade version V1 to version V2, and then upgrade version V2 to version V3, so as to utilize the resource data of the intermediate version (such as version V2) to implement data iteration between the current version and the updated version (such as iteration of data structures, iteration of functional interfaces, etc.), and avoid update failures caused by missing resource data of the intermediate version.

[0005] However, the number of application versions will continue to increase over time, and the large number of intermediate versions will make full updates very costly and inefficient.

[0006] Summary of the Invention

[0007] To address the above technical issues, this application provides an application update method and a container management platform. This application update method, applied to a container management platform, leverages annotations in the resource data of each version of an application to enable cross-version updates without performing a full update or developing upgrade paths for all versions, thereby improving application update efficiency.

[0008] In a first aspect, an embodiment of the present application provides an application update method, which is applied to a container management platform, and an application is deployed on a container managed by the container management platform. The method includes: receiving an update instruction to update a first version of an application to a second version; wherein there is at least one intermediate version between the first version and the second version; determining at least one target resource data and a loading order of at least one target resource data based on annotation information in the resource data under each version of the first version, the second version, and the at least one intermediate version; wherein the annotation information is used to indicate a functional type of resource data in the update path from the first version to the second version; and updating the resource data of the first version of the application based on the loading order of the at least one target resource data and the at least one target resource data.

[0009] In an embodiment of the present application, annotation information is used to indicate the functional type of resource data in a cross-version update path. Based on this, according to the annotation information in the resource data under each version in the cross-version update path, at least one target resource data that can realize cross-version updates and the loading order of at least one target resource data can be determined. On this basis, at least one target resource data is loaded based on the loading order, which can ensure that in a cross-version update of an application from a first version to a second version, the loading order of the resource data conforms to the iterative logic corresponding to the update path, and the resource data is the target resource data required by the update path. In this way, the resource data used for intermediate version iteration and irrelevant to the cross-version update when a full update is performed directly is omitted, and the complexity of the update process is reduced, thereby greatly reducing the cost of cross-version updates of the application and improving the update efficiency. In addition, this solution realizes cross-version updates by reusing the resource data required for version iteration, without the need to develop all upgrade paths in each version, thereby reducing the development workload and subsequent maintenance costs, improving the update efficiency of the application and reducing the update cost.

[0010] According to the first aspect, the function type includes one or more of the first type, the second type and the third type; the resource data of the first type is used to deploy the application of each version in the first version, the second version and at least one intermediate version; the resource data of the second type is used to initialize the second version of the application; the resource data of the third type is used to implement the iteration of data in the application from the first version to the second version.

[0011] In an embodiment of the present application, different function types are used to indicate the functions of different resource data in the update path from the first version to the second version, thereby ensuring that the update of the application can be applicable to more diverse iterative situations, reducing the update complexity of the application and improving the update efficiency.

[0012] According to the first aspect, or any implementation of the first aspect above, at least one target resource data and the loading order of at least one target resource data are determined based on the annotation information in the resource data under each version of the first version, the second version, and at least one intermediate version, including: determining the resource data under each version of the first version, the second version, and at least one intermediate version, whose annotation information indicates the first type and whose corresponding version is the second version as the target resource data, and determining the loading order of the target resource data according to the resource data loading order specified by the container management platform; determining the resource data under each version of the first version, the second version, and at least one intermediate version, whose annotation information indicates the second type and whose corresponding version is applicable to the current deployment environment as the target resource data, and determining the loading order of the target resource data to be loaded before resource data of other types except the second type; wherein the current deployment environment is the deployment environment of the first version of the application; determining the resource data under each version of the first version, the second version, and at least one intermediate version, whose annotation information indicates the third type as the target resource data, and determining the loading order of all target resource data with the same name under the third type according to the version order corresponding to the update indication.

[0013] In an embodiment of the present application, the loading order of the target resource is determined according to the functional type of the target resource data, ensuring that the loading order of the target resource data complies with the iterative logic of the update path, and reusing the resource data required for version iteration to achieve cross-version updates, taking into account the accuracy and efficiency of cross-version updates of the application.

[0014] According to the first aspect, or any implementation of the first aspect above, after the resource data under each version of the first version, the second version and at least one intermediate version, the annotation information indicates the second type and the corresponding version is applicable to the current deployment environment. Resource data is determined as target resource data, the method also includes: obtaining the sequence weight of each target resource data of the second type; and determining the loading order of each target resource data of the second type based on the sequence weight.

[0015] In an embodiment of the present application, for resource data whose function type is initialization, that is, the second type, the loading order can be further controlled by weight to achieve different update paths corresponding to different loading orders of resource data, thereby reducing the implementation complexity of the diversified update process and further improving the update efficiency of the application.

[0016] According to the first aspect, or any implementation of the first aspect above, at least one target resource data and the loading order of at least one target resource data are determined based on the annotation information in the resource data under each version of the first version, the second version, and at least one intermediate version, including: determining the resource data with empty annotation information and / or no functional type in the resource data under each version of the first version, the second version, and at least one intermediate version as the target resource data, and determining the loading order of the target resource data according to the resource data loading order specified by the container management platform.

[0017] In this embodiment, the annotation information is empty and / or has no function type, indicating that the resource data is not restricted by function type. In other words, there is no special update logic, and the resource data can be loaded directly according to the loading order specified by the container management platform, which is also the default loading order. This allows for a wider range of update paths and further improves the convenience of application updates.

[0018] According to the first aspect, or any implementation of the first aspect above, before updating the resource data of the first version of the application based on the loading order of at least one target resource data and at least one target resource data, the method also includes: if any target resource data of the at least one target resource data corresponds to multiple loading orders in the loading order of at least one target resource data, feedback is used to indicate a prompt information of an update error.

[0019] In the embodiment of the present application, by identifying the situation where a loop is included in the loading sequence of the target resource data, that is, the situation where a target resource is loaded repeatedly, and reporting an error, update anomalies can be avoided.

[0020] According to the first aspect, or any implementation of the first aspect above, the container management platform is Kubernetes; before determining at least one target resource data and the loading order of at least one target resource data based on the annotation information in the resource data under each version of the first version, the second version and at least one intermediate version, the method also includes: obtaining the deployment package under each version of the first version, the second version and at least one intermediate version applicable to the current deployment environment in the Helm repository repository; wherein the current deployment environment is the deployment environment of the first version of the application; reading the resource data in the obtained deployment package, and reading the annotation information in the resource data until the resource data in the obtained deployment package is traversed.

[0021] The embodiment of the present application, when applied to Kubernetes, obtains the deployment package of each of the first version, the second version, and at least one intermediate version applicable to the current deployment environment from the Helm repository through Helm, and reads the annotation information in the resource data until the resource data in the obtained deployment package is traversed, thereby improving the efficiency of application updates in the Kubernetes scenario

[0022] In a second aspect, an embodiment of the present application provides a container management platform, on which an application is deployed. The container management platform manages the container, and the container management platform includes: an indication receiving module for receiving an update indication for updating a first version of an application to a second version; wherein there is at least one intermediate version between the first version and the second version; an annotation parsing module for determining at least one target resource data and a loading order of at least one target resource data based on annotation information in the resource data under each version of the first version, the second version, and at least one intermediate version; wherein the annotation information is used to indicate the functional type of the resource data in the update path from the first version to the second version; a resource update module for updating the resource data of the first version of the application based on the loading order of at least one target resource data and at least one target resource data.

[0023] According to the second aspect, the function type includes one or more of a first type, a second type, and a third type; the resource data of the first type is used to deploy an application of each of a first version, a second version, and at least one intermediate version;

[0024] The second type of resource data is used to initialize the second version of the application; the third type of resource data is used to implement the iteration of data from the first version to the second version of the application.

[0025] According to the second aspect, or any implementation method of the above second aspect, the annotation parsing module is specifically used to: determine the resource data under each version of the first version, the second version and at least one intermediate version, in which the annotation information indicates the first type and the corresponding version is the second version as the target resource data, and determine the loading order of the target resource data according to the resource data loading order specified by the container management platform; determine the resource data under each version of the first version, the second version and at least one intermediate version, in which the annotation information indicates the second type and the corresponding version is applicable to the current deployment environment as the target resource data, and determine the loading order of the target resource data to be loaded before resource data of other types except the second type; wherein the current deployment environment is the deployment environment of the first version of the application; determine the resource data under each version of the first version, the second version and at least one intermediate version, in which the annotation information indicates the third type as the target resource data, and determine the loading order of all target resource data with the same name under the third type according to the version order corresponding to the update indication.

[0026] According to the second aspect, or any implementation method of the above second aspect, the annotation parsing module is also used to: after determining the resource data under each version of the first version, the second version and at least one intermediate version, in which the annotation information indicates the second type and the corresponding version is applicable to the current deployment environment as the target resource data, obtain the sequence weight of each target resource data of the second type; and determine the loading order of each target resource data of the second type according to the sequence weight.

[0027] According to the second aspect, or any implementation of the second aspect above, the annotation parsing module is specifically used to: determine the resource data with empty annotation information and / or no functional type in the resource data under each version of the first version, the second version and at least one intermediate version as target resource data, and determine the loading order of the target resource data according to the resource data loading order specified by the container management platform.

[0028] According to the second aspect, or any implementation of the second aspect above, the device also includes an information output module, which is used to: before the resource update module updates the resource data of the first version of the application based on the loading order of at least one target resource data and at least one target resource data, when any target resource data in the at least one target resource data corresponds to multiple loading orders in the loading order of at least one target resource data, feedback a prompt message indicating an update error.

[0029] According to the second aspect, or any implementation of the second aspect above, the container management platform is Kubernetes; the device also includes a data acquisition module, which is used to: obtain the deployment package under each of the first version, the second version and at least one intermediate version applicable to the current deployment environment in the Helm repository repository before the annotation parsing module determines at least one target resource data and the loading order of at least one target resource data based on the annotation information in the resource data under each of the first version, the second version and at least one intermediate version; wherein the current deployment environment is the deployment environment of the first version of the application; read the resource data in the obtained deployment package, and read the annotation information in the resource data until the resource data in the obtained deployment package is traversed.

[0030] The second aspect and any implementation of the second aspect correspond to the first aspect and any implementation of the first aspect, respectively. The technical effects corresponding to the second aspect and any implementation of the second aspect can be referred to the technical effects corresponding to the first aspect and any implementation of the first aspect, and will not be repeated here.

[0031] In a third aspect, an embodiment of the present application provides a computing device cluster, comprising: at least one computing device, each computing device comprising a processor and a memory; the processor and the memory are connected; the processor of at least one computing device is used to execute instructions stored in the memory of at least one computing device, so that the computing device cluster performs a method as in the first aspect and any one of the implementation methods of the first aspect.

[0032] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, comprising a computer program, which includes instructions for executing the method in the first aspect or any possible implementation of the first aspect. When the computer program runs in a computing device cluster, the computing device cluster executes the method in the first aspect or any possible implementation of the first aspect.

[0033] In a fifth aspect, an embodiment of the present application provides a computer program comprising instructions for executing the method of the first aspect or any possible implementation of the first aspect. When the computer program runs in a computing device cluster, the computing device cluster executes the method of the first aspect or any possible implementation of the first aspect.

[0034] In a sixth aspect, an embodiment of the present application provides a chip comprising one or more interface circuits and one or more processors; the interface circuit is used to receive a signal from a memory of at least one computing device in a computing device cluster and send a signal to the processor, the signal comprising a computer instruction stored in the memory; when the processor executes the computer instruction, the at least one computing device executes the instructions of the method in the first aspect or any possible implementation of the first aspect. BRIEF DESCRIPTION OF THE DRAWINGS

[0035] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the following briefly introduces the drawings required for use in the description of the embodiments of the present application. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.

[0036] FIG1 is a schematic diagram illustrating an exemplary full update process in Kubernetes;

[0037] FIG2 is a schematic diagram of the structure of a computing cluster provided in an embodiment of the present application;

[0038] FIG3 is a structural block diagram of an application updating device provided in an embodiment of the present application;

[0039] FIG4 is a flow chart of a method for updating an application program according to an embodiment of the present application;

[0040] FIG5 is a flow chart of a method for updating an application program according to an embodiment of the present application;

[0041] FIG6 is a schematic diagram of a target resource data determination process provided by an embodiment of the present application;

[0042] FIG7 is a diagram illustrating an example of an application of annotation information provided in an embodiment of the present application;

[0043] FIG8 is a schematic diagram of an application update process under Kubernetes provided in an embodiment of the present application;

[0044] FIG9 is a structural block diagram of a container management platform provided in an embodiment of the present application;

[0045] FIG10 is a structural block diagram of a computing device 100 provided in an embodiment of the present application;

[0046] FIG11 is a block diagram of a computing device cluster according to an embodiment of the present application;

[0047] FIG12 is one of the structural block diagrams of a computing device cluster provided in an embodiment of the present application. DETAILED DESCRIPTION

[0048] The following will be combined with the drawings in the embodiments of this application to clearly and completely describe the technical solutions in the embodiments of this application. Obviously, the embodiments described are part of the embodiments of this application, not all of them. Based on the embodiments in this application, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of this application.

[0049] The term "and / or" in this article is merely a description of the association relationship between associated objects, indicating that three relationships may exist. For example, A and / or B can mean: A exists alone, A and B exist at the same time, and B exists alone.

[0050] In the description and claims of the embodiments of this application, the terms "first" and "second" are used to distinguish different objects, rather than to describe a specific order of objects. For example, the terms "first target object" and "second target object" are used to distinguish different objects, rather than to describe a specific order of objects.

[0051] In the embodiments of this application, words such as "exemplary" or "for example" are used to indicate examples, illustrations, or descriptions. Any embodiment or design described as "exemplary" or "for example" in the embodiments of this application should not be interpreted as being preferred or advantageous over other embodiments or designs. Rather, the use of words such as "exemplary" or "for example" is intended to present the relevant concepts in a concrete manner.

[0052] In the description of the embodiments of this application, unless otherwise specified, "multiple" means two or more. For example, "multiple processing units" means two or more processing units; "multiple systems" means two or more systems.

[0053] First, some of the terms and related technologies involved in this application are explained to facilitate understanding.

[0054] Application deployment: The process of providing an application to users, which usually includes steps such as configuring the environment, installing the application, and testing.

[0055] Containers provide an isolated computing environment for storing and accessing programs. They can host processes corresponding to tasks and are similar to virtual machines, differing in that they implement process-level resource isolation. Tasks can be tasks that support the running of applications.

[0056] Kubernetes (K8s): An open-source platform for managing containers, also known as an open-source container orchestration system. K8s makes it easier to deploy, scale, and manage containerized applications, automating load balancing, service discovery, and auto-scaling. Over the past few years, K8s has become the de facto standard for container orchestration and management, and its adoption has grown exponentially.

[0057] Helm: A software package management tool provided by Kubernetes that is specifically responsible for managing the resources of applications deployed on containers managed by Kubernetes. Helm can be used to uniformly package, distribute, install, upgrade, and rollback applications deployed on containers managed by Kubernetes.

[0058] Deployment package (chart): A package used to deploy applications in Kubernetes. The templates directory in a deployment package stores application resource data, such as resource templates. Resource templates render variables to generate valid files that support application execution. The values.yaml file in the deployment package stores default values ​​for templates.

[0059] For example, Figure 1 is a schematic diagram of the full update process under Kubernetes. As shown in Figure 1, K8s manages applications based on Helm charts. Charts have a version concept corresponding to application versions. The chart contains resource data corresponding to the application, such as deployment resources and configuration information. Among them, the deployment resources are the deployment objects (Deployment) and stateful sets (Statefulset) indicated by templates. For example, the V1 version chart shown in Figure 1 includes two applications to be deployed: resources App1 and App2; and two middleware (MySQL and Memcached) in the stateful set (Statefulset).

[0060] As time goes by, the application has version updates (such as version upgrades and version rollbacks), and accordingly, the version of the application's resource data is iterated accordingly. The chart when the application is released is the release version, and this version of the chart contains all the resource data of the application. When upgrading the application based on the chart, Helm parses the upgraded version of the chart to obtain the target resource data, replaces the resource data source of the current version of the chart with the target resource data, and performs the necessary tasks (jobs). As shown in Figure 1, taking the version upgrade of the application as an example, version V1, version V2 and version V3, there can be the following upgrade paths: V1 to V2, V1 to V3, V2 to V3. For ease of understanding, each upgrade path is introduced below:

[0061] When upgrading an application from version V1 to version V2, the resource data contained in the templates directory of the V1 chart include: DeploymentOfApp1.yaml, DeploymentOfApp2.yaml, StatefulsetOfMySQL.yaml, and StatefulsetOfMemcached.yaml. The resource data contained in the templates directory of the V2 chart include: DeploymentOfApp1.yaml, DeploymentOfApp2.yaml, DeploymentOfApp3.yaml, StatefulsetOfMySQL.yaml, StatefulsetOfRedis.yaml, and JobOfDataMigration.yaml. Based on this, upgrading from V1 to V2 can involve splitting App2 in the V1 chart package into App2 and App3, uninstalling Redis and replacing it with Memcached, and performing the conversion of Memcached data to Redis using Development Task 1 (Job1). Development Task 1 (Job1) is the migration from Memcached to Redis.

[0062] When upgrading an application from version V2 to version V3, the V3 chart's templates directory contains the following resource data: DeploymentOfApp1.yaml, DeploymentOfApp2.yaml, DeploymentOfApp3.yaml, StatefulsetOfMySQL.yaml, StatefulsetOfElasticSearch.yaml, and JobOfDataMigration.yaml. Based on this, upgrading from V2 to V3 involves upgrading App1 and App3 in the V2 resource data, replacing Redis with ElasticSearch, and converting the data from Redis to ElasticSearch using Development Task 2 (Job 2). Development Task 2 (Job 2) involves migrating from Redis to ElasticSearch.

[0063] When upgrading an application from version V1 to version V3, if a differential update method similar to the one used for upgrading from V1 to V2 and from V2 to V3 is used, that is, the differential (such as the application and / or middleware) is determined solely by the resource data in the V3 chart and the resource data in the V1 chart, and the differential is updated (such as by uninstalling, replacing, and / or executing development tasks), the upgrade may fail due to the missing resource data of the intermediate versions. For example, upgrading from V1 to V2 requires executing development task 1 (Job1). Upgrading from V2 to V3 requires executing development task 2 (Job2). If upgrading from V1 to V3 using the differential update method, development tasks 1 (Job1) and 2 (Job2) are missing, causing the upgrade to fail.

[0064] To solve the above problems caused by the upgrade from V1 to V3, there are generally two solutions:

[0065] Solution 1: Upgrade in order of version rank. This upgrades version V1 to V2, and then V2 to V3. Obviously, if there are multiple versions of the middleware, each upgrade will require a full upgrade, consuming significant time and computational resources. This results in high update costs and low efficiency.

[0066] Solution 2: Develop all upgrade paths in each version. For example, consider the upgrade paths for V1 and V2 in version V3. That is, based on the diagram in Figure 1, add an additional development task (Job3) to V3 to implement the Memcached -> ES data migration. Obviously, as the number of versions increases, this approach will lead to a massive development workload, a lack of convergence later on, a significant increase in maintenance costs, excessively high update costs, and low efficiency.

[0067] An embodiment of the present application provides an application update method to solve the above-mentioned problem. In this method, annotation information is used to indicate the functional type of resource data in the cross-version update path. Based on this, according to the annotation information in the resource data under each version in the cross-version update path, at least one target resource data that can achieve cross-version update and the loading order of at least one target resource data can be determined. On this basis, at least one target resource data is loaded based on the loading order, which can ensure that in the cross-version update of updating the first version of the application to the second version of the application, the loading order of the resource data conforms to the iteration logic corresponding to the update path, and the resource data is the target resource data required by the update path. In this way, the resource data used for intermediate version iteration and irrelevant to the cross-version update when directly performing a full update is omitted, and the complexity of the update process is reduced, thereby greatly reducing the cost of cross-version update of the application and improving the update efficiency. In addition, this solution implements cross-version update by reusing the resource data required for version iteration, without the need to develop all upgrade paths in each version, thereby reducing development workload and subsequent maintenance costs, improving the update efficiency of the application and reducing update costs.

[0068] Before describing the technical solution of the embodiment of the present application, the operating platform of the application update method of the embodiment of the present application is first described in conjunction with the accompanying drawings. The application update method of the embodiment of the present application can be applied to a container management platform, which can run on a single electronic device, a computing cluster and other devices. Among them, the single electronic device can be, for example, a desktop computer, a portable computer, a server, a mobile terminal, a wearable device, etc. The computing cluster can be, for example, a cluster including multiple physical computing nodes, or it can be a cluster including multiple virtual computing nodes. For example, Figure 2 is a structural diagram of a computing cluster provided by an embodiment of the present application. As shown in Figure 2, the computing cluster 200 may include: a management node 201, multiple computing nodes 202 and a container management platform 203. Among them, containers are running on the management node 201 and each computing node 202, and the container management platform 203 is used to manage the containers on all nodes in the computing cluster 200.

[0069] In one example, each node in the computing cluster 200 is a physical computing node such as a computing device. In this case, the management node 201 may include: a processor 2011 and a memory 2012; the processor 2011 and the memory 2012 are connected; similarly, the computing node 202 may include a processor 2021 and a memory 2022; the processor 2021 and the memory 2022 are connected;

[0070] The processor (such as processor 2011 and / or processor 2021) of at least one computing node (such as management node 201 and one or more computing nodes 202) is used to execute instructions stored in the memory (such as memory 2012 and / or memory 2022) of the at least one computing node, so that the computing cluster 200 implements the application update method provided in the embodiment of the present application.

[0071] It should be understood that the computing cluster shown in FIG2 is only one example of a computing cluster, and that a computing cluster may have more or fewer components than shown in the figure, may combine two or more components, or may have a different component configuration. The various components shown in FIG2 may be implemented in hardware, including one or more signal processing and / or application specific integrated circuits, software, or a combination of hardware and software.

[0072] For example, Figure 3 is a block diagram of an application update device provided in an embodiment of the present application. As shown in Figure 3, the application update device is applied to a container management platform, where an application is deployed on a container managed by the container management platform. The device includes:

[0073] The receiving module 301 is configured to receive an update instruction for updating a first version of an application to a second version; wherein there is at least one intermediate version between the first version and the second version;

[0074] A parsing module 302 is configured to determine at least one target resource data and a loading order for the at least one target resource data based on annotation information in the resource data of each of the first version, the second version, and the at least one intermediate version; wherein the annotation information indicates a functional type of the resource data in the update path from the first version to the second version;

[0075] The updating module 303 is configured to update the resource data of the first version of the application program based on the loading order of the at least one target resource data and the at least one target resource data.

[0076] It is understandable that the application update device shown in Figure 3 above can be in the form of a plug-in, thread, process, entity module, etc. in a specific application. The embodiment of the present application does not limit this and can be set according to application requirements.

[0077] For ease of understanding, the application updating method provided in the embodiment of the present application is described in detail below with reference to FIG. 4 to FIG. 8 .

[0078] For example, Figure 4 is a flowchart of an application update method provided in an embodiment of the present application. As shown in Figure 4, the application update method can be applied to a container management platform, where an application is deployed on a container managed by the container management platform. The method may include:

[0079] S401: Receive an update instruction to update a first version of an application to a second version; wherein there is at least one intermediate version between the first version and the second version.

[0080] Specifically, the update indication may indicate a version upgrade or version rollback of the application. There is at least one intermediate version between the first version and the second version, that is, a cross-version update of the application is performed in response to the above update indication. For example, as shown in FIG1 above, version V1 is upgraded to version V3. The first version is version V1, and the second version is version V3. There is an intermediate version between the two, which is version V2. Assuming that the first version is version V1 and the second version is version V5, there are three intermediate versions, namely version V2, version V3, and version V4. Similarly, assuming that version V3 is rolled back to version V1, there is an intermediate version, which is version V2.

[0081] It is understood that the versions in the embodiments of this application are merely examples. In specific applications, versions may be in English, date, or other formats, and this embodiment of the application does not impose any limitations on this. Furthermore, version rollback is the reverse operation of version upgrade. The rollback method is similar to the upgrade method, differing only in the update path and the updated resource data. For the same parts, refer to the version upgrade process. For ease of description and understanding, the following explanation will use version upgrade as an example.

[0082] For example, FIG5 is a flowchart of an application updating method provided by an embodiment of the present application. As shown in FIG5, the application updating method may include:

[0083] S501: Receive a Helm upgrade command.

[0084] When the container management platform is K8s and the update instruction is to upgrade the application version, the update instruction may be a Helm upgrade command.

[0085] S402, determining at least one target resource data and the loading order of at least one target resource data based on the annotation information in the resource data under each version of the first version, the second version and at least one intermediate version; wherein the annotation information is used to indicate the functional type of the resource data in the update path from the first version to the second version.

[0086] Exemplarily, the update path refers to the version iteration process experienced by the first version to the second version. Taking Figure 1 above as an example, the update path from version V1 to version V3 is that version V1 is upgraded to version V2 through the execution of development task 1 and the splitting of APP2, and version V2 is upgraded to version V3 through the upgrade of APP2 and APP3 and development task 2. Among them, development task 1, the splitting of APP2, the upgrade of APP2 and APP3, and development task 2 are resource data. The functional type of the resource data in the update path is used to indicate the role achieved by the resource data in the iterative process indicated by the update path. Still referring to Figure 1, the functional type of resource data development task 1 and development task 2 is loaded in a certain order to realize data iteration (such as iteration of data structure, iteration of functional interface, etc.): by loading development task 1 and development task 2 in the iterative order, the conversion of data in Memcached to data in Redis, and the conversion of data in Redis to data in ElasticSearch can be realized in turn, thereby achieving the conversion of data in Memcached to data in ElasticSearch. This way, there is no need for additional development to address the differences between Memcached and ElasticSearch, and application updates are more convenient and efficient.

[0087] It is understood that the target resource data is the resource data whose loading order is restricted by the function type in the update path from the first version to the second version. If there is only one target resource data, the loading order is to directly load the target resource data.

[0088] In an optional implementation, the container management platform is Kubernetes;

[0089] Accordingly, before determining at least one target resource data and the loading order of at least one target resource data based on the annotation information in the resource data of each of the first version, the second version, and the at least one intermediate version, the application update method provided in the embodiment of the present application may further include:

[0090] Obtain the deployment packages for each of the first version, the second version, and at least one intermediate version applicable to the current deployment environment from the Helm repository; wherein the current deployment environment is the deployment environment of the first version of the application;

[0091] The resource data in the acquired deployment package is read, and the annotation information in the resource data is read, until the resource data in the acquired deployment package is traversed.

[0092] Taking Figure 5 as an example, after receiving the Helm upgrade command, K8s executes S502 to S508 to determine at least one target resource data and the loading order of at least one target resource data:

[0093] S502: Pull the chart of the deployed version in the current environment and the target version of the chart from the Helm repository, as well as all intermediate versions of the chart release packages between the two.

[0094] The deployed version chart in the current environment and the target version chart refer to the first and second versions of the application chart, respectively. The intermediate version chart release package refers to the intermediate version chart released between the first and second versions. The Helm repository is a Helm repository that stores resource data for each version of the application.

[0095] S503: Verify template specifications and complete value.yaml rendering.

[0096] In specific applications, after K8s obtains the resource data used to update the application, it can perform standard verification on the resource data, such as the template, and complete the value.yaml rendering, that is, the rendering parameters, if the verification passes, to obtain a valid template for subsequent loading.

[0097] S504, read the template in each chart package of each pulled version in turn, and read the template annotations.

[0098] Template Annotations are annotation information. Annotations can be pre-added to the template in each version of the chart package. Annotations can be added during the development of each version of the application, or during the maintenance of each version of the application, etc., which is not limited in this embodiment of the application.

[0099] S505, determine whether annotation information is included; if so, execute S506; if not, execute S507;

[0100] S506, determine whether it is category 1, if it is category 1, determine the loading order according to category 1; if it is not category 1, determine whether it is category 2, if it is category 2, determine the loading order according to category 2; ... If it is not category 2, determine whether it is the remaining categories in turn, until the last category: determine whether it is category n, if it is category n, determine the loading order according to category n; if it is not category n, execute S507.

[0101] Among them, category 1 to category n are functional types of resource data described in an exemplary manner. For example, taking the container management platform K8s as an example, Figure 6 is a schematic diagram of the target resource data determination process provided by an embodiment of the present application. As shown in Figure 6, the first version is version V1 and the second version is version Vn. For the n versions of the V1 version char package to the Vn version chart, that is, all versions of the chart, each char contains a number of resource data such as template1-1 to template1-n in the V1 version char package. When K8s processes these templates, it determines whether to load and the loading order for each template based on the annotation information, and obtains a reorganized chart arranged in the loading order. By loading the reorganized chart, a part of the templates in all versions of the chart, that is, the target resource data, will be loaded. For example, template1-1, template n-2 and template n-3 are loaded in sequence, and then template1-m to template nn are loaded in parallel, where template2-m is executed after template1-m in template1-m to template nn.

[0102] S507, using Helm's default loading order;

[0103] In an optional implementation, the determining of at least one target resource data and the loading order of the at least one target resource data based on the annotation information in the resource data of each of the first version, the second version, and the at least one intermediate version may specifically include:

[0104] In the resource data under each version of the first version, the second version and at least one intermediate version, the resource data with empty annotation information and / or no functional type is determined as the target resource data, and the loading order of the target resource data is determined according to the resource data loading order specified by the container management platform.

[0105] For example, if the container management platform is K8s, then S507 is executed. Helm's default loading order can be, for example: for resource data with different content types, or resource types, the loading order is determined by resource type; for resource data of the same resource type, the loading order is determined by the first letter of the resource data name. Resource types, for example, can be API Service, Deployment, and Job, and the corresponding loading order is "Deployment," "Job," and "API Service."

[0106] In this embodiment, the annotation information is empty and / or has no function type, indicating that the resource data is not restricted by function type. In other words, there is no special update logic, and the resource data can be loaded directly according to the loading order specified by the container management platform, which is also the default loading order. This allows for a wider range of update paths and further improves the convenience of application updates.

[0107] S508, determine whether all templates have been traversed, if so, execute S509, if not, execute S504.

[0108] The embodiment of FIG5 ensures that the annotation information in the resource data of each version of the first version, the second version and at least one intermediate version, ie, the template annotations in all templates, is read by traversing, thereby avoiding update anomalies caused by omissions.

[0109] In an optional embodiment, the above-mentioned function type may include one or more of the first type, the second type and the third type;

[0110] The first type of resource data is used to deploy each of the first version, the second version, and the at least one intermediate version of the application;

[0111] The second type of resource data is used to initialize the second version of the application;

[0112] The third type of resource data is used to implement the iteration of data from the first version to the second version of the application.

[0113] Exemplarily, the annotation information "stateless" can be used to indicate the first type, the annotation information "initialized" can be used to indicate the second type, and the annotation information "sequenced" can be used to indicate the third type. The embodiment of the present application does not limit the specific form of the annotation information used to indicate different functional types, and can be set according to application requirements. Taking the container management platform as K8s as an example, the annotation information can be added to the metadata of the resource data yaml file in the templates directory, such as classified-annotations:stateless / initialized / sequenced.

[0114] In an embodiment of the present application, different function types are used to indicate the functions of different resource data in the update path from the first version to the second version, thereby ensuring that the update of the application can be applicable to more diverse iterative situations, reducing the update complexity of the application and improving the update efficiency.

[0115] In an optional implementation, the determining of at least one target resource data and the loading order of the at least one target resource data based on the annotation information in the resource data of each of the first version, the second version, and the at least one intermediate version may specifically include:

[0116] Determine, in the resource data of each of the first version, the second version, and the at least one intermediate version, the resource data whose annotation information indicates the first type and whose corresponding version is the second version as the target resource data, and determine the loading order of the target resource data according to the resource data loading order specified by the container management platform;

[0117] Determining, in resource data under each of the first version, the second version, and at least one intermediate version, resource data whose annotation information indicates the second type and whose corresponding version is applicable to the current deployment environment as target resource data, and determining the order in which the target resource data is loaded to be loaded before resource data of other types except the second type; wherein the current deployment environment is the deployment environment of the first version of the application;

[0118] In the resource data under each version of the first version, the second version and at least one intermediate version, the annotation information indicates that the third type of resource data is determined as the target resource data, and the loading order of all target resource data with the same name under the third type is determined according to the version order corresponding to the update indication.

[0119] For example, if the annotation information is stateless, indicating the first type, K8s determines whether the version of the chart to which the currently processed template belongs is the same as the target chart version. If it is, Helm's default loading order is used as the loading order for the currently processed template. If it is not the target chart version, the template is not loaded and the next template is analyzed. The target chart is the deployment package of the third version of the application.

[0120] If the annotation information is initialized, which indicates the second type, K8s determines whether the version of the chart to which the currently processed template belongs is the version of the chart deployed in the environment where the first version of the application is deployed, that is, the version of the chart deployed on the current environment. If it is the version of the chart deployed on the current environment, this type of template is placed before other types of templates and executed in this order.

[0121] In an optional implementation, after determining, as target resource data, resource data in each of the first version, the second version, and the at least one intermediate version, whose annotation information indicates the second type and whose corresponding version is applicable to the current deployment environment, the application update method provided in the embodiment of the present application may further include:

[0122] Obtaining a sequence weight of each target resource data of the second type;

[0123] The loading order of each target resource data of the second type is determined according to the order weight.

[0124] Exemplarily, if the annotation information is initialized, which indicates the second type, K8s determines whether the version of the chart to which the currently processed template belongs is the version of the chart deployed in the environment where the first version of the application is deployed, that is, the version of the chart deployed in the current environment. If it is the version of the chart deployed in the current environment, it continues to read the sequence weight of the resource data, such as classified-annotations-weight, and assigns a sequence weight to the loading order of this type of template, thereby determining the loading order of each template in this type of template according to the sequence weight.

[0125] In an embodiment of the present application, for resource data whose function type is initialization, that is, the second type, the loading order can be further controlled by weight to achieve different update paths corresponding to different loading orders of resource data, thereby reducing the implementation complexity of the diversified update process and further improving the update efficiency of the application.

[0126] For example, if the annotation information is "sequenced," indicating the third type, Kubernetes reads the versions of templates of the third type with the same resource name and parses the version order indicated by the versions. The template loading order is determined according to the version order consistent with the update order indicated by the update instruction. For example, if the update instruction indicates an upgrade from version V1 to version V3, the loading order of resource data with the "sequenced" function type is from version V1 to version V3. In one example, the version order indicated by the "sequenced" function can be parsed using a regular expression (regex). This facilitates adaptation to versions in various text formats. A regular expression (regex, regexp, or RE) is a text pattern that includes common characters (e.g., letters from a to z) and special characters (called "metacharacters") and is a concept in computer science. A regular expression uses a single string to describe and match a series of strings that match a certain syntactic rule and can be used to identify text that conforms to a certain pattern (rule).

[0127] In an embodiment of the present application, the loading order of the target resource is determined according to the functional type of the target resource data, ensuring that the loading order of the target resource data complies with the iterative logic of the update path, and reusing the resource data required for version iteration to achieve cross-version updates, taking into account the accuracy and efficiency of cross-version updates of the application.

[0128] For example, Figure 7 is an application example diagram of the annotation information provided by the embodiment of the present application. As shown in Figure 7, taking the upgrade of the application from version V1 to version V3 as an example, through the application update method provided by the embodiment of the present application, there is no need to perform additional development work to resolve the differences between Memcached and ElasticSearch. Add annotation information classified-annotations Annotations in the resource data JobOfDataMigration.yaml of version V2 and version V3. In this example, the job needs to be executed in order from old to new versions, so the annotation information classified-annotations:sequenced is added to the yaml file. Add annotation information classified-annotations:stateless to other yaml files of version V1, version V2 and version V3. The specific sequence determination process is as follows:

[0129] When K8s receives the Helm upgrade command, it pulls the chart packages of versions V1, V2, and V3 through the Helm provided in the embodiment of this application, and then verifies, reads, and renders the templates in the three versions of the chart packages. In one example, the analysis can be performed in order by version:

[0130] All templates in version V1 are marked with classified-annotations:stateless, but version V1 is not the target version, that is, not version V3, so all templates in version V1 are not processed;

[0131] The resource data JobOfDataMigration.yaml in version V2 is marked with classified-annotations:sequenced. When this annotation information is recognized, K8s looks for templates with the resource name JobOfDataMigration.yaml in other chart packages, and determines the execution order of resources with the same name based on version comparison. In one example, the sequenced resource data with a determined execution order can be marked as parsed at this time, so that these resource data do not need to be parsed repeatedly in the future, thereby further improving the update efficiency of the application. The remaining five yaml files of version V2 are marked with classified-annotations:stateless, but version V2 is not the target version, so the templates marked with stateless in version V2 are not processed;

[0132] The JobOfDataMigration.yaml file in version V3 is marked with classified-annotations:sequenced. If the parsing of the resource data in version V2 is marked as resolved, or if resource data with the sequenced annotation has already been processed during parsing of the resource data in version V2, then the JobOfDataMigration.yaml file does not need to be processed. If the remaining five YAML files in version V3 are marked with classified-annotations:stateless and version V3 is the target version, then these five templates can be loaded in the default Helm load order.

[0133] In summary, the resource data DeploymentOfApp1.yaml, DeploymentOfApp2.yaml, DeploymentOfApp3.yaml, StatefulsetOfMySQL.yaml, and StatefulsetOfElasticSearch.yaml of version V3 in the example in Figure 7 are loaded in the default loading order of Helm, and the JobOfDataMigration.yaml in versions V2 and V3 are executed in the order from version V2 to version V3.

[0134] In addition, the Helm provided in the embodiment of the present application can also be called Enhanced Helm, and the name of the subject used to implement the application update method in the embodiment of the present application is not limited.

[0135] S403: Update resource data of the first version of the application based on the loading order of the at least one target resource data and the at least one target resource data.

[0136] Exemplarily, as shown in FIG5 , after determining the loading order of each target resource data, the following steps may be performed:

[0137] S509: Update resource data according to the determined loading order.

[0138] Specifically, the container management platform loads the target resource data in sequence according to the loading order of the target resource data, and can use the target resource data (such as the resource data DeploymentOfApp1.yaml, DeploymentOfApp2.yaml, DeploymentOfApp3.yaml, StatefulsetOfMySQL.yaml and StatefulsetOfElasticSearch.yaml of version V3) to replace the resource data of the first version of the application, and / or execute the target resource data (such as JobOfDataMigration.yaml in versions V2 and V3), iterate the resource data of the first version of the application, and thus update the first version of the application to the second version of the application.

[0139] In an optional implementation, before loading at least one target resource data based on the loading order of at least one target resource data to update the first version of the application, the application update method provided in the embodiment of the present application may further include:

[0140] If any target resource data in the at least one target resource data corresponds to multiple loading orders in the loading order of the at least one target resource data, prompt information indicating an update error is fed back.

[0141] For example, if any of the at least one target resource data corresponds to multiple loading orders in the loading order of the at least one target resource data, this indicates that the determined loading order contains a loop. Continuing the update will cause an update anomaly, and therefore, an error may be reported. It is understood that if each of the at least one target resource data corresponds to a loading order in the loading order of the at least one target resource data, that is, the determined loading order does not contain a loop, then the above S403 may be executed.

[0142] In the embodiment of the present application, by identifying the situation where a loop is included in the loading sequence of the target resource data, that is, the situation where a target resource is loaded repeatedly, and reporting an error, update anomalies can be avoided.

[0143] For ease of understanding, the application update method provided by each embodiment of the present application is integrated and explained in conjunction with Figure 8 below. For example, Figure 8 is a schematic diagram of the application update process under Kubernetes provided by the embodiment of the present application. As shown in Figure 8, the application update method provided by the embodiment of the present application can be applied to a computing cluster managed by a container management platform. When the container management platform is K8s, the application can be deployed on the computing cluster by adding a deployment package with annotation information (Helm Chart With Classified Annotations). By rendering the file values.yaml in the deployment package, the parameters for the files in the resource data temples directory in the Chart can be rendered to obtain valid resource data for updating the application. The application update process can include the following steps 1 to 8:

[0144] 1. The user executes Helm upgrade foo xxxx;

[0145] 2. The Helm Library API is called;

[0146] 3. Pull the charts from the Helm repository, from the current version deployed in the environment to the target version of the update, and all release versions in between.

[0147] 4. Verify and process / read / render the templates in foo's Helm chart;

[0148] 5. Read templates annotations. If classified annotations exist, determine the function type and sort based on the annotations; otherwise, sort according to step 6.

[0149] 6. Sort by resource type, and finally sort by resource name in ascending order;

[0150] 7. Load resources into Kubernetes in the determined order;

[0151] 8. Exit the client.

[0152] The above-mentioned embodiment of Figure 8 is similar to the steps with the same functions in the embodiment of Figure 4 and the optional embodiment. The difference lies in the different descriptions. The same parts will not be repeated here. Please refer to the description of the embodiment of Figure 4 and the optional embodiment. Among them, the user executes helm upgrade foo xxxx, that is, the user issues an update instruction Helm upgrade (such as updating xxxx) for the application (such as foo) to K8s through Helm. After Helm verifies the template specification and completes the rendering of values.yaml, it will perform the upgrade in order according to the resource type. Verification refers to the specification verification of the template in each chart. The client refers to a client that can issue update instructions for the application, such as a Helm client.

[0153] This application also provides a container management platform. For example, FIG9 is a block diagram of a container management platform provided in an embodiment of this application. As shown in FIG9 , the container management platform manages a container on which an application is deployed. The container management platform includes:

[0154] an instruction receiving module, configured to receive an update instruction for updating a first version of an application to a second version; wherein there is at least one intermediate version between the first version and the second version;

[0155] An annotation parsing module, configured to determine at least one target resource data and a loading order for the at least one target resource data based on annotation information in the resource data of each of the first version, the second version, and the at least one intermediate version; wherein the annotation information is used to indicate a functional type of the resource data in the update path from the first version to the second version;

[0156] The resource update module is configured to update resource data of the first version of the application program based on a loading order of at least one target resource data and at least one target resource data.

[0157] The instruction receiving module, annotation parsing module, and resource updating module can all be implemented via software or hardware. For example, the following describes the implementation of the instruction receiving module using the instruction receiving module as an example. Similarly, the implementation of the annotation parsing module and resource updating module can refer to the implementation of the instruction receiving module.

[0158] As an example of a software functional unit, a module indicates that the receiving module may include code running on a computing instance. The computing instance may include at least one of a physical host (computing device), a virtual machine, and a container. Furthermore, the computing instance may be one or more. For example, the receiving module may include code running on multiple hosts / virtual machines / containers. It should be noted that the multiple hosts / virtual machines / containers used to run the code may be distributed in the same region or in different regions. Furthermore, the multiple hosts / virtual machines / containers used to run the code may be distributed in the same availability zone (AZ) or in different AZs, each AZ including one data center or multiple geographically close data centers. Typically, a region may include multiple AZs.

[0159] Similarly, multiple hosts / virtual machines / containers running the code can be distributed within the same virtual private cloud (VPC) or across multiple VPCs. Typically, a VPC is set up within a region. Cross-region communication between two VPCs within the same region, or between VPCs in different regions, requires a communication gateway within each VPC to interconnect the VPCs.

[0160] As an example of a hardware functional unit, the instruction receiving module may include at least one computing device, such as a server. Alternatively, the instruction receiving module may be implemented using an application-specific integrated circuit (ASIC) or a programmable logic device (PLD). The PLD may be a complex programmable logical device (CPLD), a field-programmable gate array (FPGA), a generic array logic (GAL), or any combination thereof.

[0161] The multiple computing devices included in the instruction receiving module can be distributed in the same region or in different regions. The multiple computing devices included in the instruction receiving module can be distributed in the same AZ or in different AZs. Similarly, the multiple computing devices included in the instruction receiving module can be distributed in the same VPC or in multiple VPCs. The multiple computing devices can be any combination of computing devices such as servers, ASICs, PLDs, CPLDs, FPGAs, and GALs.

[0162] It should be noted that, in other embodiments, the indication receiving module can be used to execute any step in the application update method, the annotation parsing module can be used to execute any step in the application update method, and the resource update module can be used to execute any step in the application update method. The steps that the indication receiving module, the annotation parsing module, and the resource update module are responsible for implementing can be specified as needed. The full functions of the container management platform are realized by respectively implementing different steps in the application update method through the indication receiving module, the annotation parsing module, and the resource update module.

[0163] The present application also provides a computing device 100. For example, FIG10 is a block diagram of a computing device 100 provided in an embodiment of the present application. As shown in FIG10 , the computing device 100 includes a bus 102, a processor 104, a memory 106, and a communication interface 108. The processor 104, the memory 106, and the communication interface 108 communicate with each other via the bus 102. The computing device 100 can be a server or a terminal device. It should be understood that the present application does not limit the number of processors and memories in the computing device 100.

[0164] Bus 102 may be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, among others. Buses may be classified as address buses, data buses, control buses, and the like. For ease of illustration, FIG10 illustrates a single bus line, but this does not imply a single bus or type of bus. Bus 104 may include a path for transmitting information between various components of computing device 100 (e.g., memory 106, processor 104, and communication interface 108).

[0165] The processor 104 may include any one or more processors such as a central processing unit (CPU), a graphics processing unit (GPU), a microprocessor (MP), or a digital signal processor (DSP).

[0166] The memory 106 may include volatile memory, such as random access memory (RAM). The processor 104 may also include non-volatile memory, such as read-only memory (ROM), flash memory, hard disk drive (HDD), or solid state drive (SSD).

[0167] The memory 106 stores executable program code, and the processor 104 executes the executable program code to implement the functions of the aforementioned instruction receiving module, annotation parsing module, and resource updating module, thereby implementing the application updating method. In other words, the memory 106 stores instructions for executing the application updating method.

[0168] The communication interface 103 uses a transceiver module such as, but not limited to, a network interface card or a transceiver to implement communication between the computing device 100 and other devices or a communication network.

[0169] Embodiments of the present application also provide a computing device cluster. The computing device cluster includes at least one computing device. The computing device can be a server, such as a central server, an edge server, or a local server in a local data center. In some embodiments, the computing device can also be a terminal device such as a desktop computer, a laptop computer, or a smartphone.

[0170] For example, Figure 11 is a block diagram of a computing device cluster provided in an embodiment of the present application. As shown in Figure 11, the computing device cluster includes at least one computing device 100. The memory 106 of one or more computing devices 100 in the computing device cluster may store the same instructions for executing the application update method.

[0171] In some possible implementations, the memory 106 of one or more computing devices 100 in the computing device cluster may also store partial instructions for executing the application update method. In other words, the combination of one or more computing devices 100 can jointly execute the instructions for executing the application update method.

[0172] It should be noted that the memory 106 in different computing devices 100 in the computing device cluster can store different instructions, each for executing a portion of the functions of the container management platform. In other words, the instructions stored in the memory 106 in different computing devices 100 can implement the functions of one or more of the instruction receiving module, the annotation parsing module, and the resource updating module.

[0173] In some possible implementations, one or more computing devices in a computing device cluster may be connected via a network. The network may be a wide area network or a local area network, etc. For example, FIG12 is one of the structural block diagrams of a computing device cluster provided in an embodiment of the present application. As shown in FIG12 , in a possible implementation, two computing devices 100A and 100B are connected via a network. Specifically, the connection to the network is made through a communication interface in each computing device. In this type of possible implementation, the memory 106 in the computing device 100A stores instructions for executing the functions of the indication receiving module. At the same time, the memory 106 in the computing device 100B stores instructions for executing the functions of the annotation parsing module and the resource update module.

[0174] The connection method between the computing device clusters shown in Figure 12 can be considered to be that the application update method provided in this application requires a large amount of reading of resource data, parsing of resource data, and sorting of resource data, so it is considered to entrust the functions implemented by the annotation parsing module and the resource update module to the computing device 100B for execution.

[0175] It should be understood that the functions of the computing device 100A shown in FIG12 may also be completed by multiple computing devices 100. Similarly, the functions of the computing device 100B may also be completed by multiple computing devices 100.

[0176] The present application also provides a computer program product including instructions. The computer program product may be software or a program product including instructions that can be run on a computing device or stored on any available medium. When the computer program product is run on at least one computing device, the at least one computing device executes an application update method, or an application update method.

[0177] The embodiments of the present application also provide a computer-readable storage medium. The computer-readable storage medium can be any available medium that can be stored by a computing device or a data storage device such as a data center that contains one or more available media. The available medium can be a magnetic medium (e.g., a floppy disk, a hard disk, a magnetic tape), an optical medium (e.g., a DVD), or a semiconductor medium (e.g., a solid-state drive). The computer-readable storage medium includes instructions that instruct a computing device to execute an application update method, or instructs a computing device to execute an application update method.

[0178] Among them, the computing device, computing device cluster, computer storage medium or computer program product provided in this embodiment is used to execute the corresponding method provided above. Therefore, the beneficial effects that can be achieved can refer to the beneficial effects in the corresponding method provided above, and will not be repeated here.

[0179] Any content of each embodiment of this application, as well as any content of the same embodiment, can be freely combined. Any combination of the above content is within the scope of this application.

[0180] Those skilled in the art will appreciate that in one or more of the above examples, the functions described in the embodiments of the present application can be implemented using hardware, software, firmware, or any combination thereof. When implemented using software, these functions can be stored in a computer-readable medium or transmitted as one or more instructions or codes on a computer-readable medium. Computer-readable media include computer storage media and communication media, wherein communication media include any media that facilitates the transmission of computer programs from one place to another. The storage medium can be any available medium that can be accessed by a general-purpose or special-purpose computer.

[0181] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the protection scope of the technical solutions of the various embodiments of the present invention.

Claims

1. A method for updating an application, characterized in that: Applied to a container management platform, where an application is deployed on a container managed by the container management platform, the method includes: Receiving an update instruction to update a first version of an application to a second version; wherein there is at least one intermediate version between the first version and the second version; Determine at least one target resource data and a loading order of the at least one target resource data according to annotation information in the resource data of each of the first version, the second version and the at least one intermediate version; wherein the annotation information is used to indicate a function type of the resource data in the update path from the first version to the second version; The resource data of the first version of the application is updated based on the loading order of the at least one target resource data and the at least one target resource data.

2. The method according to claim 1, characterized in that The functional type includes one or more of a first type, a second type and a third type; The resource data of the first type is used to deploy the application of each version of the first version, the second version and the at least one intermediate version; The second type of resource data is used to initialize the second version of the application program; The third type of resource data is used to implement iteration of data from the first version to the second version of the application.

3. The method according to claim 2, characterized in that The step of determining at least one target resource data and a loading order of the at least one target resource data according to the annotation information in the resource data of each of the first version, the second version, and the at least one intermediate version includes: Determine, in the resource data of each of the first version, the second version, and the at least one intermediate version, resource data whose annotation information indicates the first type and whose corresponding version is the second version as the target resource data, and determine the loading order of the target resource data according to the resource data loading order specified by the container management platform; Determine, in the resource data of each of the first version, the second version and the at least one intermediate version, the resource data of which the annotation information indicates the second type and the corresponding version is applicable to the current deployment environment as the target resource data, and determine the loading order of the target resource data to be loaded before the resource data of other types except the second type; wherein the current deployment environment is the deployment environment of the first version of the application; In the resource data under each of the first version, the second version and the at least one intermediate version, the resource data of the third type indicated by the annotation information is determined as the target resource data, and the loading order of all target resource data with the same name under the third type is determined according to the version order corresponding to the update indication.

4. The method according to claim 3, characterized in that After determining, in the resource data of each of the first version, the second version and the at least one intermediate version, the resource data whose annotation information indicates the second type and whose corresponding version is applicable to the current deployment environment as the target resource data, the method further includes: Obtaining a sequence weight of each target resource data of the second type; The loading order of each target resource data of the second type is determined according to the order weight.

5. The method according to claim 3 or 4, characterized in that: The step of determining at least one target resource data and a loading order of the at least one target resource data according to the annotation information in the resource data of each of the first version, the second version, and the at least one intermediate version includes: In the resource data under each version of the first version, the second version and the at least one intermediate version, the resource data with empty annotation information and / or no functional type is determined as the target resource data, and the loading order of the target resource data is determined according to the resource data loading order specified by the container management platform.

6. The method according to any one of claims 1 to 5, characterized in that Before updating the resource data of the first version of the application based on the loading order of the at least one target resource data and the at least one target resource data, the method further includes: If any one of the at least one target resource data corresponds to a plurality of loading orders in the loading order of the at least one target resource data, prompt information indicating an update error is fed back.

7. The method according to any one of claims 1 to 6, characterized in that The container management platform is Kubernetes; The annotation information in the resource data of each version of the first version, the second version and the at least one intermediate version is Before determining at least one target resource data and a loading order of the at least one target resource data, the method further comprises: Obtaining the deployment packages of each of the first version, the second version, and the at least one intermediate version applicable to the current deployment environment from the Helm repository; wherein the current deployment environment is the deployment environment of the first version of the application; The resource data in the acquired deployment package is read, and the annotation information in the resource data is read, until the resource data in the acquired deployment package is traversed.

8. A container management platform, characterized in that: An application is deployed on a container managed by the container management platform, and the container management platform includes: An instruction receiving module, configured to receive an update instruction for updating a first version of an application to a second version; wherein there is at least one intermediate version between the first version and the second version; An annotation parsing module, used to determine at least one target resource data and a loading order of the at least one target resource data according to annotation information in the resource data of each of the first version, the second version and the at least one intermediate version; wherein the annotation information is used to indicate a function type of the resource data in the update path from the first version to the second version; The resource update module is used to update the resource data of the first version of the application based on the loading order of the at least one target resource data and the at least one target resource data.

9. The container management platform according to claim 8, characterized in that: The functional type includes one or more of a first type, a second type and a third type; The resource data of the first type is used to deploy the application of each version of the first version, the second version and the at least one intermediate version; The second type of resource data is used to initialize the second version of the application program; The third type of resource data is used to implement iteration of data from the first version to the second version of the application.

10. The container management platform according to claim 9, characterized in that: The annotation parsing module is specifically used for: Determine, in the resource data of each of the first version, the second version, and the at least one intermediate version, the resource data whose annotation information indicates the first type and whose corresponding version is the second version as the target resource data, and determine the loading order of the target resource data according to the resource data loading order specified by the container management platform; Determine, in the resource data of each of the first version, the second version and the at least one intermediate version, the resource data of which the annotation information indicates the second type and the corresponding version is applicable to the current deployment environment as the target resource data, and determine the loading order of the target resource data to be loaded before the resource data of other types except the second type; wherein the current deployment environment is the deployment environment of the first version of the application; In the resource data under each of the first version, the second version and the at least one intermediate version, the resource data of the third type indicated by the annotation information is determined as the target resource data, and the loading order of all target resource data with the same name under the third type is determined according to the version order corresponding to the update indication.

11. The container management platform according to claim 10, characterized in that: The annotation parsing module is also used for: After determining, in the resource data of each of the first version, the second version and the at least one intermediate version, the resource data of which the annotation information indicates the second type and the corresponding version is applicable to the current deployment environment as the target resource data, obtaining the sequence weight of each target resource data of the second type; The loading order of each target resource data of the second type is determined according to the order weight.

12. The container management platform according to claim 10 or 11, characterized in that: The annotation parsing module is specifically used for: In the resource data under each version of the first version, the second version and the at least one intermediate version, the resource data with empty annotation information and / or no functional type is determined as the target resource data, and the loading order of the target resource data is determined according to the resource data loading order specified by the container management platform.

13. The container management platform according to any one of claims 8 to 12, characterized in that: The container management platform also includes an information output module, which is used to: Before the resource update module updates the resource data of the first version of the application based on the loading order of the at least one target resource data and the at least one target resource data, if any target resource data among the at least one target resource data corresponds to multiple loading orders in the loading order of the at least one target resource data, prompt information for indicating an update error is fed back.

14. The container management platform according to any one of claims 8 to 13, characterized in that: The container management platform is Kubernetes; The container management platform further includes a data acquisition module, which is used to: Before the annotation parsing module determines at least one target resource data and the loading order of the at least one target resource data according to the annotation information in the resource data of each of the first version, the second version and the at least one intermediate version, the deployment package of each of the first version, the second version and the at least one intermediate version applicable to the current deployment environment is obtained from the Helm repository repository; wherein the current deployment environment is the deployment environment of the first version of the application program; The resource data in the acquired deployment package is read, and the annotation information in the resource data is read, until the resource data in the acquired deployment package is traversed.

15. A computing device cluster, characterized in that: include: at least one computing device, each computing device comprising a processor and a memory; The processor of the at least one computing device is configured to execute instructions stored in the memory of the at least one computing device, so that the computing device cluster executes the method according to any one of claims 1 to 7.

16. A computer-readable storage medium, characterized in that: The method comprises a computer program, wherein when the computer program is executed in a computing device cluster, the computing device cluster is caused to execute the method according to any one of claims 1 to 7.

17. A computer program product, characterized in that The method comprises a computer program, which, when executed in a computing device cluster, enables the computing device cluster to execute the method according to any one of claims 1 to 7.

Citation Information

Patent Citations

  • Application deployment method, computing device and readable storage medium

    CN115033250A

  • Application program version updating method and device

    CN115480808A

  • Archival format for incremental deployments and version control

    US10089108B1

  • Updating service applications

    US20160041819A1

  • Updating of container-based applications

    US20200409680A1