Application arrangement method and device and electronic equipment
A target device and application deployment technology, applied in the information field, can solve problems such as not easy to find the cause, difficult to debug, etc.
Active Publication Date: 2019-10-18
WUXI CHINAC DATA TECH SERVICE
5 Cites 0 Cited by
AI-Extracted Technical Summary
Problems solved by technology
[0004] The purpose of the embodiments of the present application is to provide an application orchestration method, device and electronic equipment to solve the proble...
Abstract
The embodiment of the invention provides an application arrangement method and device and electronic equipment. The application arrangement method comprises the following steps: according to the execution relationship among the deployment steps, issuing the deployment steps needing to be executed currently to the target equipment corresponding to the deployment steps; and receiving an execution result fed back by the target device, and when the execution result meets a preset continuous execution condition, issuing the next deployment step to be executed to the target device corresponding to the deployment step. Therefore, the deployment of one application is divided into a plurality of small deployment steps, and the next deployment step can be executed only after each deployment step isexecuted without errors, so that the deployment process of the whole application becomes controllable, and once an error occurs in the application deployment process, the problem deployment step can be quickly positioned, so as to find out the reason and debug the problem.
Application Domain
Version controlSoftware testing/debugging
Technology Topic
Software engineeringElectric equipment +1
Image
Examples
- Experimental program(4)
Example Embodiment
[0041] Example one
[0042] Please see figure 1 , figure 1 The flow diagram of an application orchestration method applied to an orchestration engine provided in an embodiment of this application includes:
[0043] S101: Obtain application deployment data.
[0044] In the embodiment of the present application, the application deployment data includes each deployment step of the application, the execution relationship between the deployment steps, and the target device corresponding to each deployment step.
[0045] It should be noted that, in the embodiment of the present application, the application deployment data may be preset by the engineer and then input into the editing engine. For example, an engineer can decouple a large script or a group of scripts of an application to be deployed into multiple small deployment steps according to execution relationships such as serial, parallel, and branch selection. After decoupling, the engineer obtains each deployment step of the application and the execution relationship between the deployment steps, and can determine the target device corresponding to each deployment step based on the original application deployment plan or requirements.
[0046] It should also be noted that in the embodiment of the present application, when decoupling, one deployment step corresponds to one target device, and one target device may correspond to one or more deployment steps.
[0047] It should be understood that the so-called serial refers to the relationship that the next deployment step is executed after the previous deployment step is successfully executed, for example, see figure 2 As shown, deployment step 1, deployment step 2, deployment step 3, deployment step 5, or deployment step 1, deployment step 2, deployment step 4, and deployment step 5 are serial relationships. The so-called parallel refers to the relationship where two deployment steps can be executed simultaneously, for example, see figure 2 As shown, deployment step 3 and deployment step 4 are parallel relationships. The so-called branch selection refers to the relationship in which only one deployment step can be selected among several parallel deployment steps, for example, see image 3 As shown, the relationship between deployment step 12 and deployment step 13 is the branch selection relationship. It should be noted that, generally speaking, when there is a branch selection relationship, the orchestration engine will perform a judgment step (such as figure 2 Judgement in 11).
[0048] S102: Determine the deployment step currently to be executed according to the execution relationship between the deployment steps.
[0049] In the embodiment of the present application, the orchestration engine can determine the current deployment step to be executed based on the execution relationship between the deployment steps and the previous execution deployment step. In particular, when there is no previous execution deployment step, the current deployment step to be executed is the first deployment step in the execution relationship.
[0050] S103: Issue a first step execution instruction to the target device corresponding to the deployment step currently to be executed.
[0051] In the embodiment of the present application, the first step execution instruction may include the content of the deployment step currently to be executed, so as to facilitate the target device corresponding to the deployment step currently to be executed to execute the deployment step.
[0052] S104: Receive the execution result of the first step execution instruction returned by the target device corresponding to the deployment step currently to be executed.
[0053] In the embodiment of the present application, after the target device executes the corresponding step execution instruction, it will return the corresponding execution result to the orchestration engine for the orchestration engine to confirm whether to execute the next deployment step.
[0054] In the embodiment of this application, the orchestration engine and the target device corresponding to each deployment step can realize information exchange through the message bus, such as the issuance of step execution instructions and the return of execution results, so as to ensure the orchestration engine and each deployment step The validity and reliability of the information exchange between the corresponding target devices.
[0055] S105: When the execution result meets the preset execution condition, according to the execution relationship between the deployment steps, issue the second step execution instruction to the target device corresponding to the next deployment step of the deployment step currently to be executed.
[0056] In the embodiment of the present application, when the next deployment step and the current deployment step to be executed are in a serial execution relationship, the preset execution condition may be: the execution result is successful execution. When the next deployment step is a selective deployment step, for example, you can choose to execute the A deployment step, or you can choose to execute the B deployment step, which can be determined based on preset selection conditions and combined with the execution result received by the orchestration engine. For example, assuming that the condition corresponding to the deployment step A is that m is greater than 1, and the condition corresponding to the deployment step B is that m is less than or equal to 1, then the deployment step A is executed when the received execution result is that m is greater than 1, and the received execution result is When m is less than or equal to 1, the deployment step B is executed, and the application deployment is ended when the received execution result is execution failure.
[0057] It should be noted that when there are two or more deployment steps to be executed next time, that is, when the next deployment steps to be executed are in a parallel execution relationship, step S105 needs to be executed twice or more to achieve this. Parallel execution of two or more deployment steps. For example, the next deployment steps that need to be executed are B and C, and step S105 will be executed twice, respectively: sending a second step execution instruction to the target device corresponding to deployment step B, and the second step execution instruction types include Deploy the content of step B; send a second step execution instruction to the target device corresponding to deployment step C, and the second step execution instruction includes the content of deployment step C.
[0058] S106: Receive the execution result of the second step execution instruction returned by the target device corresponding to the next deployment step of the deployment step currently to be executed.
[0059] It should be noted that in the embodiment of the present application, the above steps S102 to S106 will be repeatedly executed until all the deployment steps are completed.
[0060] In the embodiment of the present application, after step S102, that is, after determining the current deployment step to be executed according to the execution relationship between the deployment steps, according to the current deployment step to be executed and the execution between the deployment steps Relationship, determine the next deployment step of the deployment step currently to be executed. It should be noted that if there is a branch selection relationship in the execution relationship between the deployment steps, because the selected result depends on the execution result of the previous deployment step, the branch selection relationship cannot be determined after step S102 and before step S105. , The next deployment step of the deployment step currently to be executed. Therefore, in order to solve this problem, in the embodiment of the present application, in step S105, before issuing the second step execution instruction to the target device corresponding to the next deployment step of the deployment step currently to be executed, according to the current The execution relationship between the deployment step to be executed and each deployment step determines the next deployment step of the current deployment step to be executed.
[0061] The embodiment of the present application also provides an application orchestration method applied to the target device, see Figure 4 Shown, including:
[0062] S401: Receive a step execution instruction sent by the orchestration engine;
[0063] In the embodiment of the present application, the step execution instruction includes the content of the deployment step to be executed. In a feasible example of the embodiment of the present application, the content of the deployment step that needs to be executed may include a download instruction of a deployment step file or a download instruction of a deployment step script. In this way, after the target device receives the step execution instruction, it can download the deployment step file according to the download instruction of the deployment step file and execute the deployment step file, or download the deployment step script according to the download instruction of the deployment step script, and execute the deployment step script . Of course, in another feasible example of the embodiment of the present application, the content of the deployment step to be executed may also directly include the file or script of the deployment step to be executed, which is directly executed by the target device.
[0064] It should be noted that the download instruction may include a download link, so that the target device can download the deployment step file or the deployment step script according to the download link.
[0065] S402: Execute the deployment step required to be executed in the execution instruction.
[0066] S403: Feed back the execution result of the deployment step to the orchestration engine.
[0067] It should be noted that in the embodiment of the present application, the final execution result will be fed back to the orchestration engine. Exemplarily, it can be sent to the orchestration engine through the message bus.
[0068] It should also be noted that, in the embodiment of the present application, the data generated in the process of executing the deployment step required to be executed in the step execution instruction can also be sent to the orchestration engine for display to the customer or later for determining this Problems in the execution of the deployment steps.
[0069] It should be noted that the application orchestration method provided in the embodiments of the present application can be applied to a cluster, and each target device can be a basic device in the cluster, such as a virtualized cloud host, a physical host, and a container platform.
[0070] It should also be noted that when the application orchestration method provided in the embodiments of the present application is applied to a cluster, since the information is transmitted in the cluster by broadcasting, then if all devices in the cluster are regarded as a message domain , It is easy to cause information interference, and the probability of the instruction being mishandled is greater. Therefore, in the embodiments of the present application, the message domain corresponding to each deployment step can be pre-divided, and the message domain includes the target device corresponding to the deployment step, so as to realize the isolation of the execution instructions of the steps corresponding to each deployment step and reduce the remaining The interference of the equipment reduces the probability of mishandling and improves the reliability of the solution. In an example of the present application, the message field corresponding to each deployment step may only include the target device corresponding to the deployment step.
[0071] In the embodiment of the present application, the orchestration engine may add the unique identifier of the target device corresponding to each deployment step (for example, device MAC (Media Access Control, media access control) address, device number, etc.) to the step execution instructions corresponding to each deployment step ). Exemplarily, the unique identifier of the target device corresponding to the deployment step currently to be executed can be added to the execution instruction of the first step, and the next deployment step corresponding to the deployment step currently to be executed can be added to the execution instruction of the second step. The unique identifier of the target device. In this way, when the first step execution instruction is issued to the target device corresponding to the deployment step currently to be executed, the first step execution instruction is broadcast in the message field corresponding to the deployment step currently to be executed. The target device corresponding to the deployment step can accurately receive and execute the first step execution instruction based on the unique identifier in the first step execution instruction; similarly, the target device corresponding to the next deployment step to the current deployment step to be executed When the second step execution instruction is issued, the second step execution instruction is broadcast in the message field corresponding to the next deployment step of the current deployment step to be executed, and the next deployment step of the current deployment step to be executed corresponds to The target device can accurately receive and execute the second step execution instruction based on the unique identifier in the second step execution instruction.
[0072] It should be understood that the specific method for the target device to receive and execute the step execution instruction based on the unique identifier in the step execution instruction may be: each device in the message domain will use its own locally pre-stored unique identifier and step execution instruction When the comparison result of a certain device is that the locally pre-stored unique identifier is consistent with the unique identifier in the step execution instruction, it indicates that it is the target device and receives and executes the second step execution instruction.
[0073] In summary, the embodiment of the present application provides an application orchestration method, by disassembling the deployment of the application into multiple deployment steps in advance, and then gradually issuing each deployment step to each deployment based on the execution relationship between the deployment steps The target device corresponding to the step. Specifically, according to the execution relationship between the deployment steps, the deployment step currently to be executed (that is, the deployment step currently to be executed) is first issued to the target device corresponding to the deployment step, and the execution result fed back by the target device is received , And then when the execution result meets the preset execution conditions, the next deployment step to be executed (that is, the next deployment step of the current deployment step to be executed) is issued to the target device corresponding to the deployment step, and the current The execution result fed back by the target device corresponding to the next deployment step of the deployment step to be executed. In this way, the deployment of an application is split into multiple small deployment steps. After each deployment step is executed correctly, the next deployment step can be executed. This makes the deployment process of the entire application controllable. Once an error occurs in the application deployment process, You can quickly locate the problem deployment steps, find out the cause, and debug the problem.
Example Embodiment
[0074] Embodiment two:
[0075] In this embodiment, on the basis of the first embodiment, an application orchestration process with two deployment steps is taken as an example to further illustrate the application.
[0076] See Figure 5 Shown in Figure 5 In, the entire implementation process involves three execution subjects and a transfer device, namely the editing engine, the first target device, the second target device, and the message bus.
[0077] Suppose the two deployment steps are deployment step A and deployment step B; the execution relationship between deployment step A and deployment step B is a serial relationship, that is, deployment step B is executed after deployment step A is executed, and deployment step A corresponds to the target The device is the first target device, and the target device corresponding to the deployment step B is the second target device.
[0078] See Figure 5 As shown, application orchestration methods include:
[0079] S501: The orchestration engine obtains application deployment data.
[0080] The application deployment data includes deployment step A and deployment step B of the application, the execution relationship between deployment step A and deployment step B, and target devices corresponding to deployment step A and deployment step B.
[0081] S502: According to the execution relationship between the deployment step A and the deployment step B, it is determined that the deployment step currently to be executed is the deployment step A.
[0082] S503: Issue a first step execution instruction to the first target device through the message bus.
[0083] The first step execution instruction includes the script download instruction of deployment step A to be executed; the script download includes the script download link of deployment step A.
[0084] S504: The first target device downloads the script of the deployment step A according to the requirements of the script download instruction in the execution instruction of the first step.
[0085] S505: Execute the script of deployment step A.
[0086] S506: Feed back the execution result of deployment step A to the orchestration engine through the message bus.
[0087] S507: Determine whether the execution result fed back by the first target device is successful.
[0088] S508: When the execution result is successful execution, according to the execution relationship between deployment step A and deployment step B, determine that the current deployment step to be executed is deployment step B; when the execution result is execution failure, go to step S515.
[0089] S509: Issue a second step execution instruction to the second target device through the message bus.
[0090] The second step execution instruction includes the script download instruction of the deployment step B that needs to be executed; the script download includes the script download link of the deployment step B.
[0091] S510: The second target device downloads the script of the deployment step B according to the requirements of the script download instruction in the execution instruction of the second step.
[0092] S511: Execute the script of deployment step B.
[0093] S512: Feed back the execution result of deployment step B to the orchestration engine through the message bus.
[0094] S513: Determine whether the execution result fed back by the second target device is successful.
[0095] S514: When the execution result is successful execution, display that the application deployment is successful.
[0096] S515: When the execution result is that the execution failed, the application deployment is ended, and the failed deployment steps are displayed.
[0097] It should be understood that the foregoing execution process is only for facilitating understanding of a feasible example of the solution provided in the embodiment of the present application. The case where there are three or more execution deployment steps is similar to the above execution process, so it will not be illustrated by examples.
[0098] In addition, see Image 6 As shown, Image 6 An implementation provided for this application Figure 5 The system diagram of the application orchestration process in, includes an orchestration engine 61, a message bus 62, a first target device 63, a second target device 64, and a file server 65. In the embodiment of the present application, when the target device receives the step execution instruction including the download instruction of the deployment step script or the download instruction of the deployment step file, it can download the corresponding deployment step script or deployment step file from the file server 65. It should be noted that, in the embodiment of the present application, the target device may implement the reception and execution of step execution instructions through its corresponding proxy server or proxy program.
[0099] This application obtains the deployment steps of the application through decoupling, and supports the application deployment process through the message bus, which makes the application deployment process more controllable, saves labor, reduces the chance of error, and improves debugging and error correction. Ability.
Example Embodiment
[0100] Example three
[0101] In this embodiment, on the basis of the first and second embodiments, two specific deployment examples are used to further illustrate this application.
[0102] Let the hosts in the cluster be host A and host B.
[0103] See Figure 7 As shown, Figure 7 It is an example of data synchronization. After the cluster system is initialized, the orchestration engine can issue a master node setting instruction to host A to configure host A as a master node, and send a slave node setting instruction to host B to configure host B as a slave node. After host A and host B are configured, the orchestration engine issues a data synchronization instruction to the slave node (host B), so that the slave node obtains data from the master node to achieve synchronization.
[0104] See Figure 8 As shown, Figure 8 It is an example of system connectivity test. After the cluster system is initialized, the orchestration engine can issue a TLS (Transport Layer Security) support judgment instruction to the management platform. After receiving the instruction, the management platform determines whether the cluster supports TLS, and feeds back the judgment result to the orchestration engine.
[0105] When the judgment result is not supported, the orchestration engine issues a disabling instruction to the management platform so that the management platform disables TLS; the orchestration engine sends a test instruction to the management platform after receiving the message that TLS is disabled from the management platform. The management platform executes the test instructions to test the system connectivity.
[0106] When the judgment result is support, the orchestration engine issues a preparation instruction to the management platform so that the management platform prepares the TLS certificate; the orchestration engine sends a message to the host A and host B after receiving the message that the TLS certificate has been prepared as feedback from the management platform Issue TLS configuration instructions; after receiving the message that the TLS configuration is completed from Host A and Host B, the orchestration engine issues test instructions to the management platform, and the management platform executes the test instructions to test system connectivity.
PUM


Description & Claims & Application Information
We can also present the details of the Description, Claims and Application information to help users get a comprehensive understanding of the technical details of the patent, such as background art, summary of invention, brief description of drawings, description of embodiments, and other original content. On the other hand, users can also determine the specific scope of protection of the technology through the list of claims; as well as understand the changes in the life cycle of the technology with the presentation of the patent timeline. Login to view more.