An application deployment method, a computing device, and a readable storage medium

By obtaining the differences in application deployment information and performing service redeployment after the audit is approved, combined with container cluster management, the problems of high requirements and low efficiency in the existing technology are solved, and fast and accurate application updates and rollbacks are achieved.

CN115033250BActive Publication Date: 2025-07-01UNIONTECH SOFTWARE TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202210532268.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-01-24
Publication Date
2025-07-01
Estimated Expiration
2042-01-24

AI Technical Summary

Technical Problem

Existing application deployment methods rely on deployment personnel to write Dockerfile and Helm chart files, which are highly demanding and do not support service updates, and are inefficient.

Method used

The difference in the current and previous deployment information of the application is obtained by listening events, and then marked and sent to the audit side for review. Only after the audit is passed, the service is redeployed, and the container cluster is used to create, update or delete resources, and rollback is performed in the event of an exception.

Benefits of technology

Small-grained application updates are implemented, which reduces deployment error rates, improves deployment efficiency, and reduces the requirements for deployment personnel.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115033250B_ABST
    Figure CN115033250B_ABST
Patent Text Reader

Abstract

The present invention discloses an application deployment method, a computing device, and a readable storage medium. The application deployment method of the present invention is executed in a computing device, and the computing device is communicatively connected to a service deployment server. The method includes: when a first event is monitored, obtaining first deployment information of all current services of an application. Next, obtaining second deployment information of all services during the previous effective deployment of the application, and marking the difference information between the first deployment information and the second deployment information in the first deployment information or the second deployment information. Then, sending the marked third deployment information to an audit end. Finally, when an audit success message sent by the audit end is received, sending the third deployment information to the service deployment server so that the service deployment server redeploys the modified services in the application according to the third deployment information. The application deployment method of the present invention supports updates according to services, realizes small-grained updates, and is convenient and fast.
Need to check novelty before this filing date? Find Prior Art

Description

[0001] This application is a divisional application of the invention patent application No. 2022100772961 filed on January 24, 2022. Technical Field

[0002] The present invention relates to the field of computers, and in particular, to an application deployment method, a computing device, and a readable storage medium. Background Art

[0003] Currently, application deployment is mainly implemented based on Helm. Specifically, first, the application packages to be deployed are uploaded, generally in the jar and war formats. Then, the Java Api is called to render and generate a Dockerfile file according to the Velocity syntax, and a Docker image that can be used by Kubernetes is generated according to the Docker API. Next, the Docker image and the generated Helm chart deployment file are uploaded to the server through the Java API. Finally, Kubernetes components such as Pod and Deployment are created through the helm install command.

[0004] Obviously, the implementation of the above application deployment method depends on the deployment personnel to write Dockerfile and Helm chart files, which requires too high requirements for the deployment personnel, and it does not support service updates and has low efficiency.

[0005] Therefore, there is an urgent need for a new application deployment method to solve the above problems. Summary of the Invention

[0006] Therefore, the present invention provides an application deployment method, a computing device, and a readable storage medium in an attempt to solve or at least alleviate the problems existing above.

[0007] According to one aspect of the present invention, there is provided an application deployment method, which is executed in a computing device. The computing device is communicatively connected to a service deployment server. The method includes: when a first event is monitored, obtaining first deployment information of all current services of an application; obtaining second deployment information of all services at the previous effective deployment of the application, and marking the difference information between the first deployment information and the second deployment information in the first deployment information or the second deployment information; sending the marked third deployment information to an audit end so that the audit end can audit the deployment information of the modified services based on the third deployment information; when receiving an audit success message sent by the audit end, sending the third deployment information to the service deployment server so that the service deployment server can redeploy the modified services in the application based on the third deployment information.

[0008] Optionally, in the application deployment method according to the present invention, before the step of obtaining the first deployment information of all current services of the application when the first event is monitored, the method further includes: when the second event is monitored, displaying a service deployment information interface so that the user can create or modify the deployment information of the services of the application through the service deployment information interface, and triggering the first event.

[0009] Optionally, in the application deployment method according to the present invention, the step of marking the difference information between the first deployment information and the second deployment information in the first deployment information or the second deployment information includes: in the first deployment information or the second deployment information, marking the newly added part of the first deployment information compared with the second deployment information with a first identifier, and marking the deleted part of the first deployment information compared with the second deployment information with a second identifier.

[0010] Optionally, in the application deployment method according to the present invention, the method for the service deployment server to redeploy the modified services in the application based on the third deployment information includes: after receiving the third deployment information sent by the computing device, obtaining the marked deployment information of each modified service in the application; redeploying each modified service according to the marked deployment information of each modified service.

[0011] Optionally, in the application deployment method according to the present invention, the step of redeploying each modified service includes: for each modified service, based on its marked deployment information, obtaining the marked deployment information of each modified resource in the service; redeploying each modified resource according to the marked deployment information of each modified resource.

[0012] Optionally, in the application deployment method according to the present invention, a container cluster is built in the service deployment server, and the step of redeploying each modified resource includes: for each modified resource, using its marked deployment information to render a description file template generated based on the interface parameters of the container cluster to generate a description file recognizable by the container cluster; creating, updating, or deleting the resource based on the description file.

[0013] Optionally, in the application deployment method according to the present invention, after the step of creating, updating, or deleting the resource, the method further includes: detecting the status of the service to which the resource belongs; if the service status is normal, continuing to redeploy the next modified resource in the service; if the service status is abnormal, performing a rollback on the target service that has been redeployed.

[0014] Optionally, in the application deployment method according to the present invention, the step of rolling back the target service that has been redeployed includes: sending a message for rolling back the target service to a computing device, so that the computing device marks the difference information between the current deployment information of the target service and the deployment information of its previous valid deployment in the current deployment information of the target service or the deployment information of its previous valid deployment; receiving the marked fourth deployment information sent by the computing device, and performing a rollback on the target service based on the fourth deployment message.

[0015] Optionally, in the application deployment method according to the present invention, the step of the computing device marking the difference information between the current deployment information of the target service and the deployment information of its previous valid deployment in the current deployment information of the target service or the deployment information of its previous valid deployment includes: in the current deployment information of the target service or the deployment information of its previous valid deployment, marking the part newly added by the deployment information of the previous valid deployment of the target service compared to its current deployment information with a first identifier, and marking the part deleted by the deployment information of the previous valid deployment of the target service compared to its current deployment information with a second identifier.

[0016] Optionally, in the application deployment method according to the present invention, after the step of obtaining the first deployment information of all current services of the application, it further includes: storing the obtained first deployment information.

[0017] According to another aspect of the present invention, there is provided a computing device, including: at least one processor; and a memory storing program instructions, wherein the program instructions are configured to be executed by at least one processor, and the program instructions include instructions for executing the application deployment method according to the present invention.

[0018] According to another aspect of the present invention, there is provided a readable storage medium storing program instructions, which when read and executed by a computing device, cause the computing device to execute the application deployment method according to the present invention.

[0019] According to the application deployment method of the present invention, when deploying an application, first obtain the difference information between the current deployment information of the application and the deployment information of its previous valid deployment. Then, based on this difference information, redeploy the modified service. It can be seen that the present invention only needs to redeploy the modified service to achieve the redeployment of the application. Therefore, the present invention supports updating according to services, realizes small-grained updates, and is convenient and fast.

[0020] Further, after obtaining the difference information between the current deployment information of the application and the deployment information of its previous valid deployment, the present invention will send it to the audit end for auditing. Only after passing the audit will the application be redeployed based on the difference information. Therefore, the present invention can ensure the accuracy of the application deployment information, thereby reducing the error rate of application release. BRIEF DESCRIPTION OF THE DRAWINGS

[0021] To achieve the above and related purposes, certain illustrative aspects are described herein in connection with the following description and drawings, which indicate various ways in which the principles disclosed herein can be practiced, and all aspects and their equivalent aspects are intended to fall within the scope of the claimed subject matter. The above and other objects, features, and advantages of the present disclosure will become more apparent by reading the following detailed description in conjunction with the drawings. Throughout the present disclosure, like reference numerals generally refer to like components or elements.

[0022] Figure 1 FIG. shows a block diagram of a computing device 100 according to an embodiment of the present invention;

[0023] Figure 2 FIG. shows a flowchart of an application deployment method 200 according to an embodiment of the present invention;

[0024] Figure 3 FIG. shows a schematic diagram of a service deployment information interface according to an embodiment of the present invention;

[0025] Figure 4 FIG. shows a comparison diagram of the deployment information of a certain resource under a certain service of an application according to an embodiment of the present invention;

[0026] Figure 5 FIG. shows a schematic diagram of an application deployment method according to another embodiment of the present invention;

[0027] Figure 6 FIG. shows a schematic diagram of an application deployment method according to still another embodiment of the present invention. DETAILED DESCRIPTION OF THE EMBODIMENTS

[0028] The exemplary embodiments of the present disclosure will be described in more detail below with reference to the drawings. Although the exemplary embodiments of the present disclosure are shown in the drawings, it should be understood that the present disclosure can be implemented in various forms and should not be limited by the embodiments set forth herein. On the contrary, these embodiments are provided so that the present disclosure can be more thoroughly understood and the scope of the present disclosure can be completely conveyed to those skilled in the art.

[0029] Figure 1 FIG. shows a block diagram of a computing device 100 according to an embodiment of the present invention. It should be noted that Figure 1The computing device 100 shown is only an example. In practice, the computing device for implementing the application deployment method of the present invention can be a device of any model, and its hardware configuration can be the same as Figure 1 the computing device 100 shown, or can be different from Figure 1 the computing device 100 shown. In practice, the computing device for implementing the application deployment method of the present invention can add or subtract hardware components of Figure 1 the computing device 100 shown. The present invention does not limit the specific hardware configuration of the computing device.

[0030] As Figure 1 shown, in the basic configuration 102, the computing device 100 typically includes a system memory 106 and one or more processors 104. A memory bus 108 can be used for communication between the processor 104 and the system memory 106.

[0031] Depending on the desired configuration, the processor 104 can be any type of processing, including but not limited to: microprocessor (μP), microcontroller (μC), digital signal processor (DSP), or any combination thereof. The processor 104 can include one or more levels of cache such as a level 1 cache 110 and a level 2 cache 112, a processor core 114, and registers 116. An example processor core 114 can include an arithmetic logic unit (ALU), a floating point unit (FPU), a digital signal processing core (DSP core), or any combination thereof. An example memory controller 118 can be used with the processor 104, or in some implementations, the memory controller 118 can be an internal part of the processor 104.

[0032] Depending on the desired configuration, system memory 106 can be any type of memory, including but not limited to: volatile memory (such as RAM), non-volatile memory (such as ROM, flash memory, etc.), or any combination thereof. Physical memory in a computing device generally refers to volatile memory RAM, and data on a disk needs to be loaded into physical memory before it can be read by processor 104. System memory 106 can include an operating system 120, one or more applications 122, and program data 124. In some embodiments, applications 122 can be arranged to execute instructions on one or more processors 104 using program data 124 on the operating system. The operating system 120 can be, for example, Linux, Windows, etc., which includes program instructions for handling basic system services and performing hardware-dependent tasks. Applications 122 include program instructions for implementing various user-desired functions. Applications 122 can be, for example, a browser, instant messaging software, software development tools (such as integrated development environment IDE, compiler, etc.), but are not limited thereto. When an application 122 is installed in the computing device 100, a driver module can be added to the operating system 120.

[0033] When the computing device 100 starts running, processor 104 reads and executes the program instructions of the operating system 120 from system memory 106. Applications 122 run on top of the operating system 120 and use the interfaces provided by the operating system 120 and the underlying hardware to implement various user-desired functions. When a user starts an application 122, the application 122 is loaded into system memory 106, and processor 104 reads and executes the program instructions of the application 122 from system memory 106.

[0034] The computing device 100 further includes a storage device 132. The storage device 132 includes a removable storage 136 and a non-removable storage 138, and both the removable storage 136 and the non-removable storage 138 are connected to a storage interface bus 134.

[0035] The computing device 100 may also include an interface bus 140 that facilitates communication from various interface devices (e.g., output device 142, peripheral interface 144, and communication device 146) to the basic configuration 102 via the bus / interface controller 130. Exemplary output devices 142 include a graphics processing unit 148 and an audio processing unit 150. They may be configured to facilitate communication with various external devices such as a display or speakers via one or more A / V ports 152. Exemplary peripheral interfaces 144 may include a serial interface controller 154 and a parallel interface controller 156, which may be configured to facilitate communication with external devices such as input devices (e.g., keyboard, mouse, pen, voice input device, touch input device) or other peripherals (e.g., printer, scanner, etc.) via one or more I / O ports 158. Exemplary communication device 146 may include a network controller 160, which may be arranged to facilitate communication with one or more other computing devices 162 via one or more communication ports 164 over a network communication link.

[0036] The network communication link may be an example of a communication medium. A communication medium can generally embody computer-readable instructions, data structures, program modules in a modulated data signal such as a carrier wave or other transmission mechanism, and can include any information delivery medium. A "modulated data signal" can be a signal in which one or more of its data sets or its changes can encode information in the signal. As a non-limiting example, the communication medium can include wired media such as a wired network or a dedicated line network, and various wireless media such as sound, radio frequency (RF), microwave, infrared (IR), or other wireless media. The term computer-readable medium as used herein can include both storage media and communication media.

[0037] In the computing device 100 according to the present invention, the application 122 includes instructions for executing the application deployment method 200 of the present invention, and the instructions may direct the processor 104 to execute the application deployment method of the present invention. Those skilled in the art can understand that in addition to the instructions for executing the application deployment method 200, the application 122 may also include other applications 126 for implementing other functions.

[0038] Figure 2 A flowchart of an application deployment method 200 according to an embodiment of the present invention is shown. The method 200 is adapted to be executed in a computing device (e.g., Figure 1 the computing device 100 shown). The computing device is communicatively connected to a service deployment server.

[0039] To improve the efficiency of deployment, the application can be deployed based on the microservices pattern. Microservices is an architectural style that divides a single application into multiple smaller service units. Therefore, when deploying an application using the microservices pattern, an application will be divided into multiple services. That is, the application in the present invention consists of several services.

[0040] As Figure 2 shown, the application deployment method 200 of the present invention begins with step S210. Among them, before step S210, it also includes when a second event is monitored, displaying a service deployment information interface so that the user can create or modify the deployment information of the services of the application through this service deployment information interface, and triggering a first event.

[0041] Specifically, the second event can be the pressing event of a predetermined button. In this way, when the user presses the predetermined button, the service deployment information interface will be displayed on the current desktop. The service deployment information interface may include service name, image address, start command, service port, configuration mapping, environment variables, key name, etc. In this way, the user can modify the deployment information such as the service image address and configuration file in the application through this interface. Further, the service deployment information interface can adopt the form of a form, such as Figure 3 . Of course, the service deployment information interface can also adopt other forms, and the present invention does not make any limitations in this regard. In a specific embodiment, those skilled in the art can set it according to actual needs.

[0042] In addition, the first event can be the click event of a deployment control. Based on this, the service deployment information interface can also include a deployment control. In this way, after the user modifies the deployment information such as the service image address and configuration file in the application, the first event (i.e., the deployment event) can be triggered by clicking this deployment control. Of course, regarding the setting of the first event and the second event, the above is only an example. In a specific embodiment, those skilled in the art can set it according to actual needs, and the present invention does not make any limitations in this regard.

[0043] Subsequently, when the first event is monitored, step S210 is entered to obtain the first deployment information of all the current services of the application. Among them, after obtaining the first deployment information of all the current services of the application, it can be stored. Specifically, the first deployment information of all the current services of the application can be snapshotted, and then the generated snapshot of the first deployment information can be stored locally or in a storage device communicatively connected to the computing device. The storage device can be a database, such as MySQL, MariaDB, Oracle database, etc., and the present invention does not make any limitations in this regard.

[0044] After obtaining the first deployment information of all services of the application currently, step S220 is entered, the second deployment information of all services during the previous valid deployment of the application is obtained, and the difference information between the first deployment information and the second deployment information is marked in the first deployment information or the second deployment information.

[0045] Based on the above description, it can be known that for each application, the present invention stores the deployment information of each service in each release thereof in a local storage device or a storage device communicatively connected to a computing device. Therefore, the second deployment information of all services during the previous valid deployment of the application can be obtained from the local storage device or the storage device communicatively connected to the computing device. Herein, "valid" means a successful release, that is, the second deployment information of all services in the previous successful release of the application is obtained.

[0046] Next, by comparing the first deployment information of all services of the application currently with the second deployment information of all services in the previous successful release of the application, the difference information (i.e., modification difference) between the first deployment information and the second deployment information can be obtained. For example, Figure 4 the left side shows the deployment information of a resource under a service during the previous successful release of the application, and the right side shows the deployment information of this resource in the current version of the application. Obviously, Figure 4 the two marked rows in

[0047] are the difference information of the two deployments of this resource, and these two corresponding rows can also be called the change set of the two deployments of this resource. After obtaining the difference information between the first deployment information and the second deployment information, taking the first deployment information of all services of the application currently as the target and the second deployment information of all services in the previous successful release of the application as the source, the difference information is marked in the first deployment information or the second deployment information. Specifically, when marking the difference information in the second deployment information, the newly added part of the first deployment information compared with the second deployment information is marked with a first identifier, and the deleted part of the first deployment information compared with the second deployment information is marked with a second identifier. Further, using the first identifier, the newly added part of the first deployment information compared with the second deployment information is marked at the corresponding position in the second deployment information, and using the second identifier, the deleted part of the first deployment information compared with the second deployment information is marked at the original position in the second deployment information. Among them, the first identifier can be set as an underline, and the second identifier can be set as a strikethrough. Of course, the first identifier can also be set as red, and the second identifier can be set as blue. The present invention does not make any limitation in this regard. In a specific embodiment, those skilled in the art can set according to actual needs.

[0048] In addition, the method of annotating the difference information in the first deployment information with the first deployment information as the target and the second deployment information as the source is similar to the method of annotating the difference information in the second deployment information with the first deployment information as the target and the second deployment information as the source as shown above. For the relevant parts, reference can be made to the description of annotating in the second deployment information, which will not be elaborated here.

[0049] To better illustrate this step, a specific example is given below using the AppConfig resource under a service of a certain application. The first deployment information of the AppConfig resource when the application was successfully released last time was "Host: 0.0.0.0 Port: 18822", and the user modified the first deployment information of the AppConfig resource to "Host: 127.0.0.1 Port: 18822". Then, with the second deployment information of the modified AppConfig resource "Host: 127.0.0.1 Port: 18822" as the target and the first deployment information of the AppConfig resource when the application was successfully released last time "Host: 0.0.0.0 Port: 18822" as the source, after annotation in the first deployment information, it becomes " Host: 127.0.0.1 Port: 18822".

[0050] Thus, the difference information between the first deployment information and the second deployment information has been annotated in the first deployment information or the second deployment information, and the annotated third deployment information is obtained. Subsequently, step S230 is entered, and the annotated third deployment information is sent to the audit end so that the audit end can audit the deployment information of the modified service (i.e., the service whose deployment information has changed) based on this third deployment information. Specifically, at the audit end, the auditor can audit the deployment information of the modified service based on the annotated third deployment information and send a message indicating successful audit to the computing device after the audit is passed.

[0051] For the computing device, when it receives the message indicating successful audit sent by the audit end, it enters step S240 and sends the third deployment information to the service deployment server so that the service deployment server can redeploy the modified service in the application according to the third deployment information. It can be seen that in the present invention, the deployment information is sent to the service deployment server only after the audit is successful, so the accuracy of the application deployment information can be guaranteed, and thus the error rate of application release can be reduced.

[0052] Specifically, for the service deployment server, when it receives the third deployment information sent by the computing device, it first obtains the annotated deployment information of each modified service in the application. Then, according to the annotated deployment information of each modified service, it redeploys each modified service.

[0053] Among them, for any modified service, it can be redeployed through the following steps. First, based on the labeled deployment information of the service, obtain the labeled deployment information of each modified resource in the service. Then, according to the labeled deployment information of each modified resource, redeploy each modified resource, thus completing the redeployment of the service.

[0054] According to an embodiment of the present invention, when deploying any modified resource, it can be deployed through a container cluster. Therefore, a container cluster environment can be built in the service deployment server first. Specifically, the container cluster environment can be an environment such as Kubernetes (an open-source container cluster management system for deploying, scaling, and managing containerized applications), Docker-Compose (a tool for defining and running multi-container Docker applications), or Docker-SWARM (a cluster management tool officially designated by Docker). The present invention is not limited thereto. In a specific embodiment, those skilled in the art can select according to actual needs.

[0055] After building the container cluster environment in the service deployment server, the container cluster can be used to deploy any modified resource. Specifically:

[0056] First, use the labeled deployment information of the resource to render the description file template generated based on the interface parameters of the container cluster to generate a description file recognizable by the container cluster. Among them, when generating the description file template based on the interface parameters of the container cluster environment, it can be generated based on a template engine. The template engine can adopt Pongo2, Mustache, Hero, GO-Template, etc. The present invention is not limited thereto. In addition, as an example here, in the Kubernetes container cluster environment, the generated description file is a YAML file. The YAML file is used to declare Kubernetes Objects. Kubernetes Objects are persistent entries, and Kubernetes uses these entries to represent the state of the entire cluster, such as Pod, ConfigMap, Service. The description files of other container clusters will not be elaborated here one by one.

[0057] Then, based on the generated description file, create, update, or delete the resource. Specifically, the generated description file can be executed through the API (Application Programming Interface) of the container cluster to implement the creation, update, or deletion of the resource, thus completing the deployment of the resource.

[0058] In addition, according to an embodiment of the present invention, after creating, updating, or deleting any resource, it further includes detecting the status of the service to which the resource belongs. Among them, the status of the service to which the resource belongs can be detected through WebSocket. Further, based on WebSocket, the status of the service to which the resource belongs can be detected by calling the detection interface of the container cluster.

[0059] If the status of the service to which the resource belongs is normal, continue to redeploy the next modified resource in the service. After all the modified resources in the service are deployed, continue to deploy the next modified service until all the modified services are deployed. At this time, the deployment of the application is completed, that is, the release is completed.

[0060] If the status of the service to which the resource belongs is abnormal, roll back the target service that has been redeployed. Specifically, first, send a message for rolling back the target service that has been redeployed to the computing device.

[0061] For the computing device, when it receives the message for rolling back the target service, it will compare the current deployment information of the target service obtained based on the first deployment information with the deployment information of the previous valid deployment of the target service obtained based on the second deployment information to obtain the difference information between the current deployment information of the target service and the deployment information of its previous valid deployment, and mark the obtained difference information in the current deployment information of the target service or the deployment information of its previous valid deployment.

[0062] Among them, when marking the obtained difference information in the current deployment information of the target service or the deployment information of its previous valid deployment, the deployment information of the previous valid deployment of the target service should be used as the target and the current deployment information of the target service should be used as the source to mark the obtained difference information in the current deployment information of the target service or the deployment information of its previous valid deployment.

[0063] Specifically, when marking the obtained difference information in the current deployment information of the target service, the newly added part of the deployment information of the previous valid deployment of the target service compared with its current deployment information is marked with a first identifier, and the deleted part of the deployment information of the previous valid deployment of the target service compared with its current deployment information is marked with a second identifier. In addition, the method of marking the obtained difference information in the deployment information of the previous valid deployment of the target service is similar to the method of marking in the current deployment information of the target service, and will not be elaborated here.

[0064] The following still takes the AppConfig resource under a service of a certain application as an example to give a specific example. The deployment information of the AppConfig resource when the application was successfully released last time was "Host: 0.0.0.0 Port: 18822", and the user modified the deployment information of the AppConfig resource to "Host: 127.0.0.1 Port: 18822". When the computing device receives the rollback message, it takes the deployment information "Host: 0.0.0.0 Port: 18822" of the last valid deployment of the AppConfig resource as the target, and the current deployment information "Host: 127.0.0.1 Port: 18822" of the AppConfig resource as the source. After marking in the current deployment information, it becomes " Host: 0.0.0.0 Port: 18822".

[0065] After marking the obtained difference information in the current deployment information of the target service or the deployment information of its previous valid deployment, the marked fourth deployment information is obtained. Subsequently, the computing device will send the marked fourth deployment information to the service deployment server.

[0066] When the service deployment server receives the marked fourth deployment information sent by the computing device, it performs a rollback on the target service based on the received fourth deployment message. Among them, when performing a rollback on the target service, it is no longer necessary for the review end to conduct a review. Specifically:

[0067] For any target service, based on the marked deployment information of the target service, obtain the marked deployment information of each modified resource in the target service. Then, according to the marked deployment information of each modified resource, perform a rollback on each modified resource, thereby completing the rollback of the target service.

[0068] Among them, when performing a rollback on any modified resource, first, use the marked deployment information of the resource to render the description file template generated based on the interface parameters of the container cluster to generate a description file recognizable by the container cluster. Then, based on the generated description file, create, update, or delete the resource, thereby completing the rollback of the resource.

[0069] It should be noted that the method of performing a rollback on the target service is similar to the method of deploying the service. Specifically, reference can be made to the method of redeploying the modified service in the application above, which will not be elaborated here.

[0070] As can be seen thus far, the present invention is based on the difference information obtained twice in the forward direction (with the current deployment information of the application as the target and the deployment information of the last valid deployment as the source) to redeploy the modified resources, thereby achieving the corresponding redeployment. Among them, if an exception is detected during the deployment, the rollback is performed on the redeployed resources based on the difference information obtained twice for the redeployed service in the reverse direction (with the current deployment information of the redeployed service as the source and the deployment information of the last valid deployment as the target), thereby achieving the rollback of the application. Obviously, based on the difference information between two adjacent deployments, the present invention can achieve the redeployment and rollback of the application only through a small amount of updates, which is convenient and fast.

[0071] To better illustrate the complete implementation process of the present invention, the following will be combined with Figure 5 A specific example is used to illustrate the entire process of the application deployment method of the present invention. Among them, in this example, the user modified the deployment information of services A, B, and C of the application through the service deployment information form. Specifically, for application service A, the user modified two resources, namely ConfigMap Objects and Pod Objects. In addition, in this example, the container cluster built in the service deployment server is Kubernetes, which is an open-source tool for managing containerized applications on multiple hosts in the cloud platform. The description file template generated based on the interface parameters of Kubernetes is Kubernetes Objects, which are persistent entries, and Kubernetes uses these entries to represent the state of the entire cluster, such as Pod, ConfigMap, and Service. Next, the deployment method of the application will be described.

[0072] Step 1: When a deployment event is detected, obtain the deployment information of all current services of the application and generate its snapshot.

[0073] Step 2: Obtain the snapshot of the deployment information of all services during the last valid deployment of the application, and use the snapshot of the deployment information of all current services of the application as the target and the snapshot of the deployment information of all services during the last valid deployment of the application as the source to obtain the modification differences between these two deployments in the forward direction.

[0074] Step 3: Mark the obtained modification differences in the snapshot of the deployment information during the last valid deployment of the application, and send the marked deployment information to the audit side for auditing.

[0075] Step 4: If the review fails, notify the user to modify the service deployment information again through the form. If the review passes, enter the Kubernetes Objects stage. First, render the Kubernetes Objects template using the labeled deployment information of the ConfigMap Objects resource in Service A to generate a YAML file. Among them, in Kubernetes 8, the YAML file is used to declare Kubernetes Objects.

[0076] Step 5: Execute the YAML file through the Kubernetes API Server to update the ConfigMap Objects resource.

[0077] Step 6: Check the status of Service A through WebSocket. If it is abnormal, perform a rollback and record the rollback message. If it is normal, continue to update the next Pod Objects resource in Service A (similar to the method of updating the ConfigMap Objects resource).

[0078] Step 7: Continue to check the status of Service A through WebSocket. If it is abnormal, perform a rollback and record the rollback message. If it is normal, continue to deploy Service B and Service C (similar to the method of deploying Service A). When both Service B and Service C are deployed, the release is completed, and the release information is recorded.

[0079] Among them, for the specific details of the application deployment method of this embodiment, reference can be made to the above description based on Figures 1 to 4 and will not be elaborated here.

[0080] For a better understanding of the application deployment method of the present invention, the present invention also gives four embodiments in combination with Figure 6 Four examples are given. It should be noted that these four examples are all described with one resource as an example.

[0081] (1) Create a configuration during the first release

[0082] Step 1: The user creates a configuration (as follows) through the service deployment information form and applies for deployment.

[0083]

[0084] Step 2: When a deployment event is monitored, create a new deployment snapshot new and cache the deployment snapshot old during the last valid deployment, as follows:

[0085]

[0086] Step 3: Use the deployment snapshot from the last valid deployment as the source and the current deployment snapshot as the target to obtain the difference information between the two deployments (i.e., calculate the change set), and mark the difference information, where the underscore represents addition and the dash represents deletion, as follows. Additionally, send the marked deployment information to the reviewer.

[0087]

[0088] Step 4: After receiving the review passed message sent by the reviewer, enter the Kubernetes Objects template stage, and use the marked deployment information to render the Kubernetes Objects template to generate a YAML file, as follows:

[0089]

[0090] Step 5: Execute the YAML file through the Kubernetes API Server to create Kubernetes Objects.

[0091] Step 6: Check the service status through WebSocket. If the status is Running (i.e., normal), the creation of the configuration is completed, that is, the release is completed.

[0092] Step 7: Record the release status.

[0093] (2) Modify the configuration

[0094] Step 1: The user modifies the configuration through the service deployment information form (as follows) and applies for deployment.

[0095]

[0096] Step 2: When a deployment event is monitored, create a new deployment snapshot new and cache the deployment snapshot old from the last valid deployment, as follows:

[0097]

[0098] Step 3: Use the deployment snapshot from the last valid deployment as the source and the current deployment snapshot as the target to obtain the difference information between the two deployments (i.e., calculate the change set), and mark the difference information, where the underscore represents addition and the dash represents deletion, as follows. Additionally, send the marked deployment information to the reviewer.

[0099]

[0100] Step 4: After receiving the review passed message sent by the reviewer, enter the Kubernetes Objects template stage, render the Kubernetes Objects template using the annotated deployment information, and generate a YAML file as follows:

[0101]

[0102] Step 5: Execute the YAML file through the Kubernetes API Server to update the Kubernetes Objects.

[0103] Step 6: Check the service status through WebSocket. If the status is Running (i.e., normal), the configuration update is completed, that is, the release is completed.

[0104] Step 7: Record the release status.

[0105] (3) Deleting the configuration

[0106] Step 1: The user modifies the configuration (as follows) through the deployment information form and applies for deployment.

[0107]

[0108] Step 2: When a deployment event is monitored, create a new deployment snapshot new and cache the deployment snapshot old at the time of the last valid deployment as follows:

[0109]

[0110] Step 3: Use the deployment snapshot at the time of the last valid deployment as the source and the current deployment snapshot as the target to obtain the difference information between the two deployments (i.e., calculate the change set), and annotate the difference information, where the underscore represents addition and the dash represents deletion, as follows. In addition, send the annotated deployment information to the reviewer.

[0111]

[0112] Step 4: After receiving the review passed message sent by the reviewer, enter the Kubernetes Objects template stage, render the Kubernetes Objects template using the annotated deployment information, and generate a YAML file as follows:

[0113]

[0114] Step 5: Execute the YAML file through the Kubernetes API Server to delete the Kubernetes Objects.

[0115] Step 6: Check the service status via WebSocket. If the status is Running (i.e., normal), the deletion of the configuration is completed, which means the release is completed.

[0116] Step 7: Record the release status.

[0117] (4) If the configuration modification fails, roll back

[0118] Step 1: The user modifies the configuration (as follows) through the deployment information form and applies for deployment.

[0119]

[0120] Step 2: When a deployment event is monitored, create a new deployment snapshot new and cache the deployment snapshot old at the time of the last valid deployment, as follows:

[0121]

[0122] Step 3: Use the deployment snapshot at the time of the last valid deployment as the source and the current deployment snapshot as the target to obtain the difference information between the two deployments (i.e., calculate the change set), and mark the difference information. The underscore represents addition, and the middle line represents deletion, as follows. In addition, send the marked deployment information to the reviewer.

[0123]

[0124] Step 4: After receiving the review passed message sent by the reviewer, enter the Kubernetes Objects template stage, and use the marked deployment information to render the Kubernetes Objects template to generate a YAML file, as follows:

[0125]

[0126] Step 5: Execute the YAML file through the Kubernetes API Server to update the Kubernetes Objects.

[0127] Step 6: Check the service status via WebSocket. If the status is Fail (i.e., abnormal), perform a rollback operation.

[0128] Step 7: Swap the source and target for obtaining the difference information between two deployments during the deployment process, that is, use the deployment snapshot of the executed part in the current deployment snapshot as the source and the deployment snapshot of this part during the previous valid deployment as the target, obtain the difference information between the two deployments, and mark this difference information, where the underline represents addition and the dash represents deletion, as follows. It should be noted that when performing a rollback, it is not necessary to send the marked deployment information to the reviewer for review.

[0129]

[0130] Step 8: Enter the Kubernetes Objects template stage, and use the marked deployment information to render the Kubernetes Objects template to generate a YAML file, as follows:

[0131]

[0132] Step 9: Execute the YAML file through the Kubernetes API Server to update the Kubernetes Objects, and then the rollback is completed.

[0133] Step 10: Record the rollback status.

[0134] According to the application deployment method of the present invention, when deploying an application, first obtain the difference information between the current deployment information of the application and the deployment information of its previous valid deployment. Then, based on this difference information, redeploy the modified resources under the modified service. That is, the present invention only needs to redeploy the modified resources to achieve the redeployment of the application. Moreover, when deploying an application, if an exception occurs midway, the present invention can, based on the current deployment information of the application and the deployment information of its previous valid deployment, obtain the difference information between the current deployment information of the redeployed service and the deployment information of its previous valid deployment. Based on this difference information, the present invention only needs to perform a rollback on the redeployed resources to achieve the rollback of the application. It can be seen that the present invention realizes the update with the smallest granularity when deploying and rolling back an application, which is convenient and fast.

[0135] Furthermore, after obtaining the difference information between the current deployment information of the application and the deployment information of its previous valid deployment, the present invention will send it to the review end for review, and only after passing the review will it redeploy the application based on this difference information. Therefore, the present invention can ensure the accuracy of the application deployment information, thereby reducing the error rate of application release.

[0136] In addition, the present invention provides a visual service deployment information interface. Users only need to fill in a small amount of deployment information such as the application name on this interface to achieve the deployment of the application, reducing the requirements for deployment personnel.

[0137] The various technologies described herein can be implemented in combination with hardware or software, or a combination thereof. Thus, the method and device of the present invention, or certain aspects or parts of the method and device of the present invention, may take the form of program code (i.e., instructions) embedded in a tangible medium, such as a removable hard disk, USB flash drive, floppy disk, CD-ROM, or any other machine-readable storage medium. When the program is loaded into a machine such as a computer and executed by the machine, the machine becomes a device for practicing the present invention.

[0138] In the case where the program code is executed on a programmable computer, the computing device generally includes a processor, a processor-readable storage medium (including volatile and non-volatile memory and / or storage elements), at least one input device, and at least one output device. Among them, the memory is configured to store the program code; the processor is configured to execute the application deployment method of the present invention according to the instructions in the program code stored in the memory.

[0139] By way of example and not limitation, the readable medium includes a readable storage medium and a communication medium. The readable storage medium stores information such as computer-readable instructions, data structures, program modules, or other data. The communication medium generally embodies computer-readable instructions, data structures, program modules, or other data in a modulated data signal such as a carrier wave or other transmission mechanism, and includes any information delivery medium. A combination of any of the above is also included within the scope of the readable medium.

[0140] In the specification provided herein, the algorithms and displays are not inherently related to any particular computer, virtual system, or other device. Various general-purpose systems can also be used in conjunction with the examples of the present invention. Based on the above description, the structure required to construct such a system is obvious. In addition, the present invention is not directed to any particular programming language. It should be understood that the content of the present invention described herein can be implemented using various programming languages, and the description of the specific language above is for disclosing the best mode of the present invention.

[0141] In the specification provided herein, a large number of specific details are set forth. However, it can be understood that the embodiments of the present invention can be practiced without these specific details. In some instances, well-known methods, structures, and technologies have not been shown in detail so as not to obscure the understanding of this specification.

[0142] It should be understood that, in order to streamline the present disclosure and assist in understanding one or more of the various inventive aspects, in the foregoing description of the exemplary embodiments of the present invention, the various features of the present invention are sometimes grouped together in a single embodiment, figure, or description thereof. However, the disclosed method should not be construed as reflecting an intention that the claimed invention requires more features than are expressly recited in each claim.

[0143] Those skilled in the art should understand that the modules or units or components of the devices in the examples disclosed herein may be arranged in the devices as described in the embodiments, or alternatively may be located in one or more devices different from the devices in the examples. The modules in the foregoing examples may be combined into one module or further divided into multiple sub-modules.

[0144] Those skilled in the art can understand that the modules in the devices of the embodiments can be adaptively changed and arranged in one or more devices different from the embodiments. The modules or units or components in the embodiments can be combined into one module or unit or component, and further can be divided into multiple sub-modules or sub-units or sub-components. Except that at least some of such features and / or processes or units are mutually exclusive, any combination can be adopted to combine all the features disclosed in this specification (including the accompanying claims, abstract, and drawings) and all the processes or units of any method or device thus disclosed. Unless otherwise expressly stated, each feature disclosed in this specification (including the accompanying claims, abstract, and drawings) can be replaced by an alternative feature that provides the same, equivalent, or similar purpose.

[0145] In addition, those skilled in the art can understand that although some of the embodiments described herein include certain features included in other embodiments rather than other features, the combination of the features of different embodiments means that it is within the scope of the present invention and forms different embodiments.

[0146] In addition, some of the embodiments described herein are described as combinations of methods or method elements that can be implemented by a processor of a computer system or by other devices performing the functions. Therefore, a processor having the necessary instructions for implementing the method or method element forms a device for implementing the method or method element. In addition, the elements described herein in the device embodiments are examples of the following devices: the device is used to implement the functions performed by the elements for the purpose of implementing the present invention.

[0147] As used herein, unless otherwise specified, the use of ordinal numbers such as "first", "second", "third", etc. to describe ordinary objects merely indicates different instances of similar objects and is not intended to imply that the objects so described must be in a given order, whether in terms of time, space, ranking, or in any other manner.

[0148] Although the invention has been described in terms of a limited number of embodiments, those skilled in the art of this technology will appreciate that other embodiments can be contemplated within the scope of the invention as thus described. Additionally, it should be noted that the language used in this specification has been principally selected for readability and teaching purposes rather than for the purpose of explaining or limiting the subject matter of the invention. Accordingly, many modifications and variations will be apparent to those of ordinary skill in the art without departing from the scope and spirit of the appended claims. The disclosure of the invention is illustrative, not restrictive, of the scope of the invention, which is defined by the appended claims.

Claims

1. An application deployment method, suitable for execution in a computing device, the computing device being communicatively connected to a service deployment server, the application including multiple services, the method comprising: When a second event is monitored, display a service deployment information interface, where the service deployment information interface includes service name, image address, start command, service port, configuration mapping, environment variables, key name, and deployment control, so that a user can create or modify the deployment information of the services of the application through the service deployment information interface and trigger the deployment control; When a trigger event of the deployment control is monitored, obtain the first deployment information of all the current services of the application and store the obtained first deployment information; Obtain the second deployment information of all the services during the previous valid deployment of the application, and mark the difference information between the first deployment information and the second deployment information in the first deployment information or the second deployment information; Send the marked third deployment information to an audit end, so that the audit end can audit the modified deployment information of the services according to the third deployment information; When an audit success message sent by the audit end is received, send the third deployment information to the service deployment server, so that when the service deployment server receives the third deployment information sent by the computing device, obtain the marked deployment information of each modified service in the application, and according to the marked deployment information of each modified service, redeploy each modified service; Among them, the step of redeploying each modified service includes: for each modified service, based on its marked deployment information, obtain the marked deployment information of each modified resource in the service; according to the marked deployment information of each modified resource, redeploy each modified resource; A container cluster is built in the service deployment server, and the step of redeploying each modified resource includes: for each modified resource, use its marked deployment information to render a description file template generated based on the interface parameters of the container cluster to generate a description file recognizable by the container cluster; based on the description file, create, update, or delete the resource; detect the status of the service to which the resource belongs; if the service status is normal, continue to redeploy the next modified resource in the service; if the service status is abnormal, roll back the target service that has been redeployed.

2. The method according to claim 1, wherein, The step of marking the difference information between the first deployment information and the second deployment information in the first deployment information or the second deployment information includes: In the first deployment information or the second deployment information, mark the part newly added in the first deployment information compared with the second deployment information with a first identifier, and mark the part deleted in the first deployment information compared with the second deployment information with a second identifier.

3. The method according to claim 1, wherein The step of rolling back the target service that has been redeployed includes: Send a message to roll back the target service to the computing device, so that the computing device marks the difference information between the current deployment information of the target service and the deployment information of its previous valid deployment in the current deployment information of the target service or the deployment information of its previous valid deployment; Receive the marked fourth deployment information sent by the computing device, and perform a rollback on the target service based on the fourth deployment message.

4. A computing device, comprising: At least one processor; And A memory storing program instructions, wherein the program instructions are configured to be executed by the at least one processor, and the program instructions include instructions for performing the method according to any one of claims 1-3.

5. A readable storage medium storing program instructions, which when read and executed by a computing device, cause the computing device to execute the method according to any one of claims 1-3.

Citation Information

Patent Citations

  • Software deployment method and system and computer readable storage medium

    CN109814918A

  • Data updating system, method and device, equipment and storage medium

    CN112394961A