Application deployment method and device
By generating configuration files and automatically deploying components, the problems of time-consuming and labor-intensive manual operations and high error rates in traditional server application deployment are solved, improving deployment efficiency and accuracy.
Patent Information
- Application Number
- CN202510574688.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-30
- Publication Date
- 2025-09-19
AI Technical Summary
Traditional server application deployment requires manual operations, which is time-consuming, labor-intensive, and error-prone. It also places high demands on deployment personnel, resulting in low efficiency.
By receiving application deployment requests, generating configuration files, and automatically deploying multiple components based on configuration templates and application deployment information, including determining the deployment order and using different deployment methods, performing resource configuration, intranet penetration configuration, and environment variable configuration.
It realizes the automation of application deployment, reduces manual errors, improves deployment efficiency and accuracy, and reduces the requirements for professional knowledge.
Smart Images

Figure CN120669993A_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present application relate to the field of software testing technology, and in particular to an application deployment method and device. Background Art
[0002] In traditional server application deployment, many deployment tasks require manual execution, such as uploading code packages, configuring environment variables, and setting up database connections. This is not only time-consuming and labor-intensive, but also prone to human error, leading to deployment failures and system instability. Furthermore, deployers often require extensive knowledge and experience, placing high demands on their skills. These challenges collectively constitute major obstacles in traditional application deployment, significantly reducing deployment efficiency. Summary of the Invention
[0003] The embodiments of the present application provide an application deployment method and device for improving the efficiency of application deployment.
[0004] To achieve the above objectives, the present invention adopts the following technical solutions:
[0005] On the one hand, an application deployment method is provided, which includes: receiving an application deployment request; the application deployment request includes application deployment information of the application to be deployed; generating a configuration file for the application to be deployed based on a configuration template and the application deployment information; the configuration file includes configuration information of multiple components required for the application to be deployed and information of a server for deploying the application to be deployed; and deploying multiple components in the server based on the configuration information of the multiple components.
[0006] Configuration files can be automatically generated through application deployment information and configuration templates, and the application to be deployed can be deployed based on the information in the configuration files, thereby realizing the automation of application deployment, reducing the low efficiency, high error rate, and the need for a large amount of professional knowledge in manual deployment, and thus improving the efficiency of application deployment.
[0007] In one possible implementation, the configuration file includes a deployment order of multiple components, and the multiple components are deployed in the server based on the configuration information of the multiple components, including: deploying multiple components in the server based on the deployment order of the multiple components and the configuration information of the multiple components.
[0008] Since some components have dependencies, for example, the operating system component is the first component, and the container component needs to rely on the operating system to be deployed, it is necessary to deploy them in sequence according to the deployment order between multiple components, so as to improve the accuracy of component deployment.
[0009] In one possible implementation, multiple components are deployed in a server based on configuration information of the multiple components, including: determining a deployment method corresponding to each of the multiple components; and deploying the multiple components in the server based on the deployment method and configuration information corresponding to each of the multiple components.
[0010] Different components correspond to different deployment methods. Therefore, multiple components can be deployed separately through different deployment methods, so that multiple components can be automatically deployed through different deployment methods, which can improve deployment efficiency.
[0011] In one possible implementation, based on the deployment method and configuration information corresponding to each of the multiple components, before deploying the multiple components on the server, the method further includes:
[0012] For each of the multiple components, obtain an installation script corresponding to each component based on the configuration file;
[0013] Execute the installation script corresponding to each component.
[0014] In one possible implementation, based on the deployment method and configuration information corresponding to each of the multiple components, before deploying the multiple components on the server, the method further includes:
[0015] Execute deployment configuration in the server based on the configuration file;
[0016] Among them, deployment configuration includes: resource configuration, intranet penetration configuration, and environment variable configuration.
[0017] In one possible implementation,
[0018] In a possible implementation, resource configuration includes: configuring resources required for deploying multiple components in a server based on a configuration file, installing an operating system for the server based on the configuration file, and adding a monitoring agent to the server.
[0019] In one possible implementation, the intranet penetration configuration includes: obtaining intranet penetration configuration information based on a configuration file, configuring based on the reverse proxy frp service and the intranet penetration configuration information, and obtaining a target address; the target address is the intranet address of the application to be deployed.
[0020] In a possible implementation, the environment variable configuration includes: obtaining the value of the to-be-configured environment variable of each server based on a configuration file, and configuring the value of the server's environment variable to be the value of the to-be-configured environment variable.
[0021] In one possible implementation, determining a deployment method corresponding to each of the multiple components includes:
[0022] Verify whether the configuration information, alarm objects, and dependencies of multiple components in the configuration file are consistent with the configuration information, alarm objects, and dependencies of multiple components in the application deployment information; if the verification is consistent, determine the deployment method corresponding to each component in the multiple components.
[0023] On the other hand, an application deployment device is provided, the device comprising: a receiving module, a generating module, and a deploying module;
[0024] A receiving module, configured to receive an application deployment request; the application deployment request includes application deployment information of the application to be deployed;
[0025] A generation module, configured to generate a configuration file for the application to be deployed based on the configuration template and the application deployment information; the configuration file includes configuration information of multiple components required for the application to be deployed and information of a server for deploying the application to be deployed;
[0026] A deployment module is used to deploy the multiple components in the server based on the configuration information of the multiple components.
[0027] In another aspect, a computing device is provided, comprising a processor and a memory, the processor and the memory being coupled, wherein the memory is configured to store computer program instructions, and the processor is configured to call the computer program instructions in the memory to execute the application deployment method described in the above embodiment.
[0028] On the other hand, a computer-readable storage medium is provided, which stores computer program instructions, and the computer program instructions are used to enable a computing device to execute the application deployment method shown in the above embodiment.
[0029] On the other hand, a computer program product is provided, comprising computer program instructions. When the computer program instructions are executed on a computing device, the computing device is caused to execute the application deployment method as shown in the above embodiment. BRIEF DESCRIPTION OF THE DRAWINGS
[0030] Figure 1 A schematic diagram of an application scenario of an application deployment method provided in an embodiment of the present application;
[0031] Figure 2 A schematic diagram of the hardware structure of an application deployment platform provided in an embodiment of the present application;
[0032] Figure 3 A flowchart of an application deployment method provided in an embodiment of the present application;
[0033] Figure 4 A schematic diagram of the structure of a configuration file provided in an embodiment of the present application;
[0034] Figure 5 A schematic diagram of a process for deploying an application to be deployed provided in an embodiment of the present application;
[0035] Figure 6 A flowchart of another application deployment method provided in an embodiment of the present application;
[0036] Figure 7 A flowchart of another application deployment method provided in an embodiment of the present application;
[0037] Figure 8 A flowchart of another application deployment method provided in an embodiment of the present application;
[0038] Figure 9 A flowchart of another application deployment method provided in an embodiment of the present application;
[0039] Figure 10 A schematic diagram of the structure of an application deployment device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0040] In the description of the embodiments of the present application, unless otherwise specified, " / " means "or", for example, A / B can mean A or B. "And / or" in this article is merely a description of the association relationship of associated objects, indicating that three relationships can exist. For example, A and / or B can mean: A exists alone, A and B exist at the same time, and B exists alone. In addition, "at least one" means one or more, and "a plurality" means two or more. Words such as "first" and "second" do not limit the quantity and execution order, and words such as "first" and "second" do not limit them to be necessarily different.
[0041] It should be noted that 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.
[0042] To facilitate understanding, the relevant technical terms involved in the embodiments of this application are introduced below.
[0043] Applications: Servers need to run a variety of applications, each providing different functions. Before running an application, it must be deployed on the server. Applications rely on components to provide their operating environment and functional support. Components are the fundamental building blocks of applications, forming a complete deployment system. Therefore, deploying an application is essentially deploying its corresponding components.
[0044] Component: A component is a logical unit for implementing server functions. Common components include OS components, container components, and external components.
[0045] Solution: A solution is an integration of a series of functions or applications. It is a product used to implement certain functions. The deployment of a solution is essentially the deployment process of an application.
[0046] In traditional server application deployment, many deployment tasks require manual execution, such as uploading code packages, configuring environment variables, and setting up database connections. This is not only time-consuming and labor-intensive, but also prone to human error, leading to deployment failures and system instability. Furthermore, deployers often require extensive knowledge and a high level of skill. These issues collectively constitute major obstacles in traditional application deployment, hindering deployment efficiency and the ability to rapidly iterate and update services.
[0047] In view of this, an embodiment of the present application provides an application deployment method, which can generate a configuration file of the application to be deployed through the application deployment information and configuration template of the application to be deployed in the application deployment request. Since the configuration file includes the configuration information of multiple components required for the application to be deployed and the information of the corresponding multiple servers, multiple components can be configured in multiple servers through the configuration information of multiple components. In this way, the configuration file can be automatically generated through the application deployment information and the configuration template, and the application to be deployed can be deployed based on the information in the configuration file, thereby realizing the automation of application deployment, reducing the low efficiency, high error rate, and the need for a large amount of professional knowledge in manual deployment, and thus improving the efficiency of application deployment.
[0048] In some embodiments, the application deployment method provided in the embodiments of the present application can be applied to Figure 1 In the application scenario shown. Figure 1 This is a schematic diagram of an application scenario of an application deployment method provided in an embodiment of the present application. Figure 1 , the application scenario includes: an application deployment platform 101 and multiple servers 102.
[0049] Among them, the application deployment platform 101 and multiple servers 102 are respectively communicated and connected. The application deployment platform 101 can be AppArts, and the user can deploy the application to be deployed through the application deployment platform 101 on the network management device. The server 102 can be an independent physical server, such as a general server, a graphics processing unit (GPU) server, a data processing unit (DPU) server, an artificial intelligence (AI) server, etc., or a server cluster or distributed file system composed of multiple physical servers, or at least one of the cloud servers that provide basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, content distribution networks, and big data or artificial intelligence platforms. The embodiments of the present application are not limited to this.
[0050] In an embodiment of the present application, the application deployment platform 101 can receive an application deployment request initiated by a user, and generate a configuration file for the application to be deployed using the application deployment information and configuration template of the application to be deployed in the application deployment request. Afterwards, the application deployment platform 101 can deploy multiple components in multiple servers 102 corresponding to the application to be deployed based on the configuration information of the multiple components required by the application to be deployed in the configuration file, thereby deploying the application to be deployed. In this way, a configuration file can be automatically generated using the application deployment information and the configuration template, and the application to be deployed can be deployed based on the information in the configuration file, thereby realizing the automation of application deployment, reducing the low efficiency, high error rate, and the need for a large amount of professional knowledge in manual deployment, thereby improving the efficiency of application deployment.
[0051] Figure 2 This is a hardware structure diagram of an application deployment platform provided in an embodiment of the present application. Figure 2 , Figure 2 The application deployment platform 200 shown may include: a processor 201 , a memory 202 , a communication interface 203 , and a bus 204 . The processor 201 , the memory 202 , and the communication interface 203 may be connected via the bus 204 .
[0052] Processor 201 is the control center of the application deployment platform 200 and can be a general-purpose central processing unit (CPU) or other general-purpose processor. A general-purpose processor can be a microprocessor or any conventional processor. In the embodiment of the present application, the application deployment method can be executed by processor 201 in the application deployment platform 200.
[0053] As an example, the processor 201 may include one or more CPUs, such as Figure 2 CPU 0 and CPU 1 are shown in Figure 1.
[0054] The memory 202 may be a read-only memory (ROM) or other type of static storage device that can store static information and instructions, or other type of dynamic storage device that can store information and instructions, or an electrically erasable programmable read-only memory (EEPROM), a disk storage medium or other magnetic storage device, or any other medium that can be used to carry or store desired program code in the form of instructions or data structures and can be accessed by a computer, but is not limited thereto. In an embodiment of the present application, the memory 202 in the application deployment platform 200 can be used to store, for example, historical test data sets, etc.
[0055] In one possible implementation, memory 202 may exist independently of processor 201. Memory 202 may be connected to processor 201 via bus 204 and used to store data, instructions, or program code. When processor 201 calls and executes the instructions or program code stored in memory 202, the application deployment method provided in the embodiments of the present application can be implemented.
[0056] In another possible implementation, the memory 202 may also be integrated with the processor 201 .
[0057] The communication interface 203 is used to connect the application deployment platform 200 to other devices via a communication network, which can be Ethernet, a radio access network (RAN), a wireless local area network (WLAN), etc. The communication interface 203 can include a receiving unit for receiving data and a sending unit for sending data.
[0058] The bus 204 may be an ISA bus, a PCI bus, or an EISA bus. The bus may be divided into an address bus, a data bus, a control bus, and the like. For ease of presentation, Figure 2Only one thick line is used in the diagram, but this does not mean that there is only one bus or one type of bus.
[0059] It should be pointed out that Figure 2 The structure shown in does not constitute a limitation on the application deployment platform 200, except Figure 2 In addition to the components shown, the application deployment platform 200 may include more or fewer components than shown, or combine certain components, or arrange the components differently.
[0060] Figure 3 This is a flow chart of an application deployment method provided in an embodiment of the present application. Figure 3 The method includes the following S301-S303:
[0061] S301: Receive an application deployment request.
[0062] The application deployment request includes application deployment information of the application to be deployed. The application deployment request may be a request initiated by a user. For example, the application deployment information may include an identifier of the application to be deployed, information about a server for deploying the application to be deployed, and the like.
[0063] Users can select an application to be deployed, thereby determining the multiple components required for the application to be deployed, and then select multiple servers for deployment, thereby forming application deployment information and initiating an application deployment request to the application deployment platform. Optionally, the multiple servers can be selected by the user or determined based on the resource reserves of each server in the server cluster.
[0064] S302: Generate a configuration file for the application to be deployed based on the configuration template and application deployment information.
[0065] The configuration file includes configuration information for multiple components required for the application to be deployed and information about the server used to deploy the application. The configuration template is a blank template for the configuration file, including all blank parameters in the configuration file. That is, the parameter values are blank. After filling in the parameters in the configuration template, the configuration file is generated.
[0066] The configuration template includes the parameters required for deploying the application, and these required parameters are filled in the deployment template through the application deployment information to form a configuration file. For example, the required parameters are the configuration information of multiple components required to deploy the application to be deployed and the information of the server corresponding to the application to be deployed.
[0067] In a possible implementation, after the configuration file is generated, the user may verify and modify the parameters in the configuration file to ensure the accuracy of the parameters in the configuration file.
[0068] In another possible implementation, the configuration file may be obtained by filling the application deployment information into the configuration template, or by filling the application deployment information into a part of the parameters of the configuration template, while the other part of the parameters may be filled in by the user.
[0069] For example, Figure 4 As shown in the figure, the configuration file, also known as the package definition, includes component configuration information and server information. Components include operating system (OS) components, chart components, and Docker image components. The server includes OS components and container components. Container components can be divided into k8s and docker components.
[0070] S303: Deploy multiple components in the server based on the configuration information of the multiple components.
[0071] Since deploying an application to be deployed is equivalent to deploying the multiple components required for the application to be deployed, in other words, deploying multiple components is equivalent to deploying the application to be deployed. Therefore, based on the configuration information of multiple components, multiple components can be deployed on multiple servers as required. In this way, configuration files can be automatically generated through application deployment information and configuration templates, and the application to be deployed can be deployed based on the information in the configuration files, thus achieving automated application deployment. This can reduce the low efficiency, high error rate, and the need for extensive professional knowledge of manual deployment, thereby improving the efficiency of application deployment.
[0072] It should be noted that the application deployment platform can deploy the application to be deployed in each server by managing the server.
[0073] For example, Figure 5 As shown, the solution deployment process can be understood as the deployment process of the application to be deployed. The deployment process may include installing the operating system for multiple servers and deploying K8s. After the meeting, the components corresponding to the application to be deployed can be deployed. The application to be deployed can be one or more. For example, the code for installing the operating system may include:
[0074] "nodes":[
[0075] {
[0076] “access”:[],
[0077] "instal1Timeout": 300, / / installation timeout
[0078] “name”:”scow_node”,
[0079] "osSpec":{
[0080] "arch": "x86_64", / / required architecture
[0081] "chipType": "lntet", / / Required chip type
[0082] "cpυ":4, / / Required CPU specifications
[0083] “dilatation”:true,
[0084] "dilatationSize":50,
[0085] “disk”:[], / / required disk size
[0086] "installType": 1, / / Node installation type (such as virtual machine, physical machine, k8s, etc.)
[0087] "mem":8, / / required memory size
[0088] "os": "CentOS", / / required operating system name
[0089] "osVersion":"7.6.1816" / / Required operating system version
[0090] },
[0091] "type":6
[0092] },
[0093] {"name":"scow_node"...} / / Node 2
[0094] In one possible implementation, when deploying multiple components on multiple servers based on their configuration information, the deployment order of the components can be obtained from the configuration file. Because some components have dependencies, deployment of multiple components must be based on the order in which they are deployed. For example, if the operating system component is the first component, and the container component requires the operating system to be deployed, the operating system component is deployed before the container component.
[0095] In another possible implementation, in an embodiment of the present application, the application deployment platform can also obtain callback data from the server at any time. The callback data is used to indicate the installation status of the application to be deployed, such as installing, installation completed, installation failed, etc.
[0096] In some embodiments, combined Figure 3 ,like Figure 6As shown, in the above S303, deploying multiple components in the server based on the configuration information of the multiple components specifically includes:
[0097] S601: Determine a deployment method corresponding to each component in a plurality of components.
[0098] S602: Deploy multiple components in a server based on the deployment method and configuration information corresponding to each component in the multiple components.
[0099] Since different types of components have different deployment methods, when deploying based on the component's configuration information, it is necessary to determine the deployment methods corresponding to different components. That is, the deployment processes corresponding to different components are different, so that multiple components can be deployed in multiple servers based on the deployment method corresponding to each component and the configuration information corresponding to the component.
[0100] In a possible implementation, the correspondence between each type of component and the deployment method may be preset.
[0101] In some embodiments, combined Figure 6 ,like Figure 7 As shown, before the above S602, the method provided in the embodiment of the present application further includes:
[0102] S701: For each component among the multiple components, obtain an installation script corresponding to each component based on a configuration file.
[0103] S702: Execute the installation script corresponding to each component.
[0104] The configuration file includes the script address of each component's installation script. The application deployment platform can control the server to obtain the installation script for each component based on the script address. After that, the installation scripts of multiple components can be executed in sequence to deploy multiple components.
[0105] In one possible implementation, before deploying the multiple components on the server based on the deployment method and configuration information corresponding to each of the multiple components, deployment configuration is performed on the server based on the configuration file. The deployment configuration includes resource configuration, intranet penetration configuration, and environment variable configuration.
[0106] Before deploying multiple components, you need to perform deployment preparations such as resource configuration. This is called deployment configuration, which includes resource configuration, intranet penetration configuration, and environment variable configuration. Resource configuration involves configuring the resources required for the application to be deployed, intranet penetration configuration involves configuring intranet penetration for the server to be deployed, and environment variable configuration involves configuring the environment variables required for the application to run properly.
[0107] The resource configuration process involves configuring the resources required to deploy multiple components on the server based on the configuration files, installing the operating system on the server based on the configuration files, and adding a monitoring agent to the server. Specifically, the server requests the resources required to deploy the components, installs the operating system, and then adds a monitoring agent to monitor the running status of the components.
[0108] The specific process of configuring intranet penetration includes: obtaining intranet penetration configuration information based on the configuration file, configuring the reverse proxy (FRP) service based on the intranet penetration configuration information, and obtaining the target address; the target address is the intranet address of the application to be deployed. The intranet penetration configuration information can be obtained based on the configuration file, and intranet penetration can be configured for the application to be deployed using FRP and the intranet penetration configuration information, thereby obtaining the intranet address of the application to be deployed.
[0109] The specific process of configuring environment variables includes: obtaining the value of the environment variable to be configured for each server based on the configuration file, and configuring the value of the server's environment variable to the value of the environment variable to be configured. By configuring the server's environment variable to the value of the environment variable to be configured through the configuration file, multiple components can run in the corresponding environment variables.
[0110] In another possible implementation, determining the deployment method corresponding to each component in the multiple components specifically includes:
[0111] Verify that the configuration information, alarm objects, and dependencies of multiple components in the configuration file are consistent with the configuration information, alarm objects, and dependencies of multiple components in the application deployment information. If they are consistent, determine the corresponding deployment method for each of the multiple components. Before executing deployment, check that the configuration information, alarm objects, and dependencies of multiple components in the application deployment information are consistent with the configuration information, alarm objects, and dependencies of multiple components in the configuration file. If they are consistent, execute the deployment; if they are inconsistent, issue an alarm.
[0112] For example, Figure 8 As shown in the figure, taking AppArts as an application deployment platform as an example, the application scenarios of the application deployment method also include: containers as a service (CaaS), actuators, and bare metal as a service (BMaaS).
[0113] 1. AppArts can receive application deployment requests initiated by users.
[0114] 2. AppArts can perform resource detection on BMaaS to check whether the resources of multiple servers being deployed are sufficient.
[0115] 3. AppArts can install the operating system for the server through the actuator.
[0116] 4. The actuator can install the operating system for BMaaS and query the installation progress during the installation process.
[0117] 5. AppArts can use actuator to download component installation scripts for the server and call back the progress.
[0118] 6. AppArts can execute the installation script through the actuator and call back the progress.
[0119] 7. AppArts can create a cluster on a specified node through actuator.
[0120] 8. AppArts can create namespaces through actuators.
[0121] 9. AppArts can create container application instances through actuators.
[0122] 10. AppArts can use the actuator to call the instance query API to check whether all pods are created successfully.
[0123] 11. AppArts can obtain application connection information through actuator.
[0124] Another example, Figure 9 As shown, the application deployment method provided in the embodiment of the present application also includes:
[0125] 1. Obtain an application deployment request and generate a configuration file based on the configuration template and the application deployment information in the application deployment request.
[0126] The configuration template can be as follows:
[0127]
[0128]
[0129]
[0130]
[0131]
[0132]
[0133]
[0134]
[0135]
[0136]
[0137]
[0138]
[0139]
[0140] 2. Pre-deployment preparation: The pre-deployment preparation process includes initializing the solution and user data (that is, initializing the data in some deployment structures), pre-deployment verification, and pre-deployment initialization.
[0141] Pre-deployment verification includes checking whether component / node names are duplicated, checking alarm objects, and verifying dependencies.
[0142] Pre-deployment initialization includes inserting the solution into the database, initializing the timeout period, converting nodes into components, initializing access to deployment cache data, initializing Base information, initializing user context information, initializing visitor objects, initializing callback data, initializing header information, initializing solution metadata, and setting the installation status to installing.
[0143] 3. Determine the types of multiple components according to the configuration file, and create component instances based on the component types.
[0144] Among them, creating a component instance can be done through createinstance.
[0145] When creating component instances, you can implement the visitor pattern, accessing elements such as OS components, Docker components, chart components, external components, and node components through the Visitor interface. Elements can submit themselves to the accept method for access and access operations under the element, and each element performs operations to create an instance.
[0146] The Visitor design pattern, an object-oriented concept aimed at improving code reuse, encapsulates operations on elements within a data structure. For example, deploying an application requires data structures that may be subject to numerous operations. The Visitor pattern encapsulates these operations, allowing new operations to be added to elements without changing the data structure.
[0147] 4. Configure the server based on the configuration file.
[0148] The process of configuring the server configuration may include updating specified data through the Mongo database interaction interface, that is, adding a central processing unit (CPU), memory, setting callback data, etc.
[0149] 5. Initialize component instances and deployment methods.
[0150] Among them, the initialization deployment method may include adding callback information when executing deployment, setting the installation status to installing, and setting timeout information.
[0151] 6. Deployment configuration based on configuration files.
[0152] Among them, deployment configuration includes resource configuration, intranet penetration configuration, and environment variable configuration.
[0153] The resource configuration process includes: applying for resources required by components, adding nodes (i.e., multiple servers), applying for callback information, installing the operating system, adding monitoring agents on the nodes, and returning node information.
[0154] The process of configuring intranet penetration includes: obtaining node information, passing the intranet penetration configuration field (i.e., local Internet Protocol (IP), local port) based on the configuration file, traversing the configuration information, checking the intranet penetration interface (configuring forwarding rules between containers), calling the frp service addConfig() to add the intranet penetration configuration (including configuring the forwarding port, adding callback data, and returning error information), and returning the target address that can access the intranet service.
[0155] The process of configuring environment variables includes: obtaining cache information, traversing and parsing environment variables (returning them as a combination of data and templates), and configuring the environment variable value to the parsed value. If the parsing fails, it is logged and the next variable is obtained.
[0156] 7. Install the node class component list and update the node.
[0157] 8. Obtain the deployment order of multiple components based on the configuration file, and install the multiple components in sequence according to the deployment order.
[0158] Among them, multiple components include OS components, Docker components, Chart components, and external components.
[0159] The deployment process of OS components (i.e., the deployment method) includes: obtaining node information (i.e., information of multiple servers), adding callback information (such as node name, node IP), filtering files and downloading scripts (such as calling the automation engine interface post request, downloading the file structure and entering callback information, time consumption, and results), checking and configuring environment variables (calling the installation engine interface to configure the environment variable structure, and outputting callback information, time consumption, and results), and executing scripts (calling the installation engine interface to execute the script structure, and outputting callback information, time consumption, and results).
[0160] The deployment process of the Docker component includes: obtaining node information, creating an image and pulling the key, and obtaining access information for the Docker container.
[0161] The deployment process of the Chart component includes: obtaining node information, creating an Ada instance (that is, creating a namespace), and obtaining pod access information (the chart component calls the ads service, obtains the container instance, and obtains the container workload).
[0162] The deployment process of external components is to skip the deployment process and experience the application to be deployed through a trial account.
[0163] 9. Check the installation of multiple components.
[0164] This involves updating component instance information in the database and checking the pod list. If the pod list is empty, the pod check is skipped; otherwise, the installation phase is checked. Installation phase checks include checking whether the pod is successfully scheduled to a node (if not, a callback is added to indicate that there are unscheduled containers), checking whether container operating conditions are met (if not, a callback is added to indicate that some container operating conditions are not met), and checking whether the containers in the pod are successfully started (if not, a callback is added to indicate that there are containers that have not started successfully).
[0165] 10. Get application instance resources and record deployment runtime. For example, get chart component details.
[0166] 11. Output the inspection results.
[0167] If the check result is that the component is installed successfully, if the check result is that the component is installed failed, the callback information of installation failure will be returned.
[0168] 12. Configure and enable intranet penetration return. For example, define and enable configuration structure forwarding configuration.
[0169] 13. Add alert rules. For example, obtain the solution instance through the Mongo database interface, and the Mongo database stores the alert rules.
[0170] 14. Set the solution status.
[0171] Optionally, you can also add an experience record.
[0172] 15. Return the deployment response.
[0173] The above mainly introduces the scheme of the embodiment of the present application from the perspective of method. It is understandable that the computing device (such as server) in the embodiment of the present application includes a hardware structure and / or software module corresponding to the execution of each function in order to realize the above functions. Those skilled in the art should easily appreciate that, in conjunction with the units and algorithm steps of each example described in the embodiment disclosed herein, the embodiment of the present application can be implemented in the form of hardware or a combination of hardware and computer software. Whether a certain function is executed in a way that hardware or computer software drives hardware depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to exceed the scope of the embodiment of the present application.
[0174] Figure 10 This is a schematic diagram of the structure of an application deployment device provided in an embodiment of the present application. Figure 10 The application deployment device includes a receiving module 1001, a generating module 1002 and a deploying module 1003.
[0175] The receiving module 1001 is configured to receive an application deployment request; the application deployment request includes application deployment information of the application to be deployed.
[0176] The generation module 1002 is used to generate a configuration file of the application to be deployed based on the configuration template and the application deployment information; the configuration file includes configuration information of multiple components required by the application to be deployed and information of a server for deploying the application to be deployed.
[0177] The deployment module 1003 is configured to deploy the multiple components in the server based on the configuration information of the multiple components.
[0178] The technical solution provided by the embodiment of the present application is to determine the first historical test data with the shortest text distance to the data to be tested in the historical test data set, and then determine the second historical test data with the shortest text distance to the data to be tested in the historical test data with a different security status from the first historical test data in the same cluster as the first historical test data. In this way, it is possible to determine the historical test data that is closest to the data to be tested and has security issues, and the historical test data that is closest to the data to be tested and does not have security issues in the same cluster, and then further determine the target historical test data that reaches a similarity threshold with the data to be tested in the two determined historical test data, so as to determine the security status of the target historical test data as the security status of the data to be tested. In this way, a solution for determining target historical test data based on the same cluster is realized, which can reduce the coupling between data of different clusters and avoid mutual interference between data of different clusters when calculating similarity, thereby effectively improving the accuracy of application deployment.
[0179] The present application also provides a computing device including a processor and a memory, wherein the processor and the memory are coupled, wherein the memory is used to store computer program instructions, and the processor is used to call the computer program instructions in the memory to execute the application deployment method shown in the above embodiment.
[0180] An embodiment of the present application further provides a computer-readable storage medium, which stores computer program instructions, and the computer program instructions are used to enable a computing device to execute the application deployment method shown in the above embodiment.
[0181] An embodiment of the present application also provides a computer program product, including computer program instructions. When the computer program instructions are executed on a computing device, the computing device executes the application deployment method shown in the above embodiment.
[0182] The computing devices, computer-readable storage media, or computer program products provided in the embodiments of the present application are all used to execute the corresponding methods provided above. Therefore, the beneficial effects that can be achieved can refer to the beneficial effects of the corresponding methods provided above, and will not be repeated here.
[0183] Through the description of the above implementation methods, those skilled in the art can clearly understand that for the convenience and brevity of description, only the division of the above functional modules is used as an example. In actual applications, the above functions can be assigned to different functional modules as needed, that is, the internal structure of the device (such as a computing device) can be divided into different functional modules to complete all or part of the functions described above. The specific working processes of the above-described systems, devices (such as computing devices) and units can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.
[0184] In the several embodiments provided in this application, it should be understood that the disclosed systems, devices (such as computing devices) and methods can be implemented in other ways. For example, the device (such as computing device) embodiments described above are merely schematic. For example, the division of the modules or units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be an indirect coupling or communication connection through some interfaces, devices or units, which can be electrical, mechanical or other forms.
[0185] The units described above as separate components may or may not be physically separate, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed across multiple network units. Some or all of these units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0186] In addition, the functional units in the various embodiments of the present application may be integrated into a single processing unit, or each unit may exist physically separately, or two or more units may be integrated into a single unit. The aforementioned integrated units may be implemented in the form of hardware or software functional units.
[0187] If the above-mentioned integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product. The computer software product is stored in a storage medium and includes several instructions for enabling a computer device (which can be a personal computer, server, or network device, etc.) or a processor to execute all or part of the steps of the method of each embodiment of the present application. The aforementioned storage medium includes: various media that can store program codes, such as flash memory, mobile hard disk, read-only memory, random access memory, magnetic disk or optical disk.
[0188] The above description is merely a specific embodiment of the present application, but the scope of protection of the present application is not limited thereto. Any changes or substitutions that can be easily conceived by a person skilled in the art within the technical scope disclosed in this application should be included in the scope of protection of the present application. Therefore, the scope of protection of the present application should be based on the scope of protection of the claims.
Claims
1. An application deployment method, characterized in that: The method comprises: Receive an application deployment request; the application deployment request includes application deployment information of the application to be deployed; Generate a configuration file for the application to be deployed based on the configuration template and the application deployment information; the configuration file includes configuration information of multiple components required for the application to be deployed and information of a server for deploying the application to be deployed; The multiple components are deployed in the server based on the configuration information of the multiple components.
2. The method according to claim 1, characterized in that The configuration file includes a deployment order of the multiple components, and the deploying the multiple components in the server based on the configuration information of the multiple components includes: The multiple components are deployed in the server based on the deployment order of the multiple components and the configuration information of the multiple components.
3. The method according to claim 1, characterized in that The deploying the multiple components in the server based on the configuration information of the multiple components includes: Determining a deployment method corresponding to each of the multiple components; The multiple components are deployed in the server based on the deployment method and configuration information corresponding to each component in the multiple components.
4. The method according to claim 3, characterized in that Based on the deployment method and configuration information corresponding to each component in the multiple components, before deploying the multiple components in the server, the method further includes: For each component of the plurality of components, obtaining an installation script corresponding to each component based on the configuration file; Execute the installation script corresponding to each component.
5. The method according to claim 3, characterized in that Based on the deployment method and configuration information corresponding to each component in the multiple components, before deploying the multiple components in the server, the method further includes: Based on the configuration file, executing deployment configuration in the server; The deployment configuration includes: resource configuration, intranet penetration configuration, and environment variable configuration.
6. The method according to claim 5, characterized in that The resource configuration includes: configuring resources required for deploying the multiple components in the server based on the configuration file, installing an operating system for the server based on the configuration file, and adding a monitoring agent to the server.
7. The method according to claim 5, characterized in that The intranet penetration configuration includes: obtaining intranet penetration configuration information based on the configuration file, configuring based on the reverse proxy frp service and the intranet penetration configuration information, and obtaining the target address; the target address is the intranet address of the application to be deployed.
8. The method according to claim 5, characterized in that The environment variable configuration includes: obtaining the value of the to-be-configured environment variable of each server based on the configuration file, and configuring the value of the environment variable of the server to be the value of the to-be-configured environment variable.
9. The method according to claim 3, characterized in that Determining a deployment method corresponding to each component in the multiple components includes: Verifying whether the configuration information, alarm objects, and dependencies of the multiple components in the configuration file are consistent with the configuration information, alarm objects, and dependencies of the multiple components in the application deployment information; If the verification is consistent, the deployment method corresponding to each component in the multiple components is determined.
10. A computing device, characterized in that The computing device includes a processor and a memory; the processor and the memory are coupled; The memory is used to store computer program instructions; The processor is configured to call the computer program instructions in the memory to execute the method according to any one of claims 1 to 9.