A method, apparatus, device, and medium for rapid deployment of an application
Patent Information
- Application Number
- CN202211348769.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-10-31
- Publication Date
- 2026-09-01
- Estimated Expiration
- 2042-10-31
AI Technical Summary
[0003]在传统的集群应用部署中,需要运维人员或者集群使用人员在集群内部使用繁琐的命令进行安装,并且若要保证应用正常启动,可能还会需要去各台工作节点手动导入应用镜像
[0053]通过获取预置应用目录中各个应用的配置文件,读取配置文件中的展示字段,并将展示字段上传于前端,使得整个应用部署的过程具有可视化的前端界面,在进行应用部署时更加的形象与直观。通过述基本信息获取与当前待部署应用相对应的配置文件,并读取相对应的配置文件中的部署字段,并通过部署字段确定当前待部署应用的安装类型,以调用对应的客户端实现当前待部署应用的安装,实现自动进行应用安装并的效果,解决了现有技术中应用部署时繁琐的命令行,以及对运维人员具有的kubernetes基础要求过高的问题。同时应用部署过程中不再需要关注于后端服务的底层实现逻辑,只需要关注应用本身即可实现部署,提高了应用部署的效率。
Smart Images

Figure CN115543360B_ABST
Abstract
Description
Technical Field
[0001] This specification relates to the field of information technology, and in particular to a method, apparatus, device, and medium for rapid deployment of an application. Background Technology
[0002] With the continuous development and advancement of information technology, various applications are constantly being developed to meet people's ever-growing needs. These applications require continuous functional updates, necessitating ongoing development by application developers. After completing the code for an application component or modifying a section of code, application developers typically need to deploy the application.
[0003] Traditional cluster application deployments require operations and maintenance personnel or cluster users to perform cumbersome command-line installations within the cluster. Furthermore, to ensure normal application startup, it may be necessary to manually import the application image onto each worker node. This deployment method demands a solid foundation in Kubernetes knowledge from operations and maintenance personnel. When faced with a large volume of cluster application development and deployment tasks, it consumes a significant amount of development time for technical staff, leading to high deployment costs. Moreover, manually importing images one by one for deployment is inefficient.
[0004] Therefore, a fast and efficient method for application deployment is needed. Summary of the Invention
[0005] To address the aforementioned technical problems, this specification provides one or more embodiments of a method, apparatus, device, and medium for rapid deployment of an application.
[0006] One or more embodiments of this specification employ the following technical solutions:
[0007] This specification provides one or more embodiments of a method for rapid deployment of an application, the method comprising:
[0008] Obtain the configuration files of each application in the preset application directory, and read the display fields in the configuration files to upload the display fields to the front end;
[0009] Based on the front-end's response to the displayed fields, the basic information of the application to be deployed is determined.
[0010] Based on the basic information, obtain the configuration file corresponding to the application to be deployed, and read the deployment field in the corresponding configuration file;
[0011] The installation type of the application to be deployed is determined based on the deployment field, and the corresponding client is invoked to install the application.
[0012] Optionally, in one or more embodiments of this specification, before obtaining the configuration files of each application in the preset application directory, the method further includes:
[0013] Based on the preset installation method of each application, the file format corresponding to the file resources of each application is determined, so as to construct the application file of the application based on the file format;
[0014] Build image files for each application based on the application files;
[0015] The configuration information of each application is obtained, and the configuration information and the application files are combined according to a preset arrangement to generate a configuration file for each application; wherein, the configuration information includes: name, basic description information, version number, installation order, and installation method;
[0016] Based on the configuration file, the installation method of the application is determined, and the application file and image file are stored in different directories to generate an application directory based on the installation method.
[0017] Optionally, in one or more embodiments of this specification, determining the application's installation method based on the configuration file and generating an application directory by storing the application file and image file in different directories based on the installation method specifically includes:
[0018] If the application is determined to be a first installation type based on the deployment field in the configuration file, then the application file is stored in the first installation type directory;
[0019] If the application is determined to be a second installation type based on the deployment field in the configuration file, then the application file is stored in the second installation type directory;
[0020] The image files are stored in the corresponding image file directory to generate an application directory based on the first installation type directory, the second installation type directory, and the image file directory of each application.
[0021] Optionally, in one or more embodiments of this specification, the step of generating configuration files for each application by combining the configuration information with the application files based on a preset arrangement method specifically includes:
[0022] Based on the function of each field in the configuration information, the fields are divided into display fields or deployment fields; wherein, the display fields include: application name, basic description information, and version number; the deployment fields include: installation order and installation method;
[0023] The display field and the deployment field are processed based on a preset file format to obtain a configuration file; wherein the preset file format is a YAML file format.
[0024] Optionally, in one or more embodiments of this specification, determining the installation type of the application to be deployed based on the deployment field, and then calling the corresponding client to install the application to be deployed, specifically includes:
[0025] If the deployment field indicates that the application to be deployed belongs to the first installation type, then the first client corresponding to the first installation type is invoked.
[0026] If the deployment field indicates that the application to be deployed belongs to the second installation type, then the second client corresponding to the second installation type is invoked.
[0027] Based on the first client or the second client, a preset script program is invoked to import the image file corresponding to the application to be deployed, thereby realizing the deployment of the application to be deployed.
[0028] Optionally, in one or more embodiments of this specification, before determining the installation type of the currently deployed application based on the deployment field to call the corresponding client to install the currently deployed application, the method includes:
[0029] If it is determined that there are multiple applications to be deployed, then based on the deployment field of each application to be deployed, the installation order of each application to be deployed is obtained, and the dependency relationship between each application to be deployed is obtained.
[0030] If the application to be deployed has dependencies, the waiting time for the application to be deployed is determined based on a preset time interval.
[0031] Based on the installation order, the applications to be deployed are sorted sequentially to obtain an application deployment sequence;
[0032] Based on the order of the currently deployed applications in the application deployment sequence and the waiting time of each currently deployed application, the currently deployed applications in the application deployment sequence are called sequentially in order to install and deploy the currently deployed applications.
[0033] Optionally, in one or more embodiments of this specification, the first installation type is a helm type, the second installation type is a yaml type, the first installation type directory is a charts directory, and the second installation type directory is a yaml directory.
[0034] This specification provides one or more embodiments of a rapid application deployment apparatus, the apparatus comprising:
[0035] The upload unit is used to obtain the configuration files of each application in the preset application directory, and read the display fields in the configuration files to upload the display fields to the front end;
[0036] The determining unit is used to determine the basic information of the application to be deployed based on the front end's response to the displayed fields;
[0037] The reading unit is used to obtain the configuration file corresponding to the application to be deployed based on the basic information, and to read the deployment field in the corresponding configuration file;
[0038] The calling unit is used to determine the installation type of the application to be deployed based on the deployment field, and to call the corresponding client to install the application to be deployed.
[0039] This specification provides one or more embodiments of a device for rapid deployment of an application, the device comprising:
[0040] At least one processor; and,
[0041] A memory communicatively connected to the at least one processor; wherein,
[0042] The memory stores instructions executable by the at least one processor, which, when executed by the at least one processor, enable the at least one processor to:
[0043] Obtain the configuration files of each application in the preset application directory, and read the display fields in the configuration files to upload the display fields to the front end;
[0044] Based on the front-end's response to the displayed fields, the basic information of the application to be deployed is determined.
[0045] Based on the basic information, obtain the configuration file corresponding to the application to be deployed, and read the deployment field in the corresponding configuration file;
[0046] The installation type of the application to be deployed is determined based on the deployment field, and the corresponding client is invoked to install the application.
[0047] This specification provides one or more embodiments of a non-volatile computer storage medium storing computer-executable instructions, wherein the computer-executable instructions are configured as follows:
[0048] Obtain the configuration files of each application in the preset application directory, and read the display fields in the configuration files to upload the display fields to the front end;
[0049] Based on the front-end's response to the displayed fields, the basic information of the application to be deployed is determined.
[0050] Based on the basic information, obtain the configuration file corresponding to the application to be deployed, and read the deployment field in the corresponding configuration file;
[0051] The installation type of the application to be deployed is determined based on the deployment field, and the corresponding client is invoked to install the application.
[0052] The above-described at least one technical solution used in the embodiments of this specification can achieve the following beneficial effects:
[0053] By retrieving the configuration files of each application in the pre-built application directory, reading the display fields in the configuration files, and uploading these fields to the front end, the entire application deployment process is visualized through a front-end interface, making application deployment more intuitive and straightforward. The system retrieves the configuration file corresponding to the application to be deployed based on the basic information, reads the deployment fields from the corresponding configuration file, and determines the installation type of the application to be deployed based on the deployment fields. This then calls the corresponding client to install the application, achieving automatic application installation. This solves the problems of cumbersome command-line operations and excessively high Kubernetes knowledge requirements for operations personnel in existing technologies. Furthermore, the application deployment process no longer requires attention to the underlying implementation logic of backend services; only the application itself needs to be focused on for deployment, thus improving the efficiency of application deployment. Attached Figure Description
[0054] To more clearly illustrate the technical solutions in the embodiments or prior art of this specification, the drawings used in the description of the embodiments or prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments recorded in this specification. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort. In the drawings:
[0055] Figure 1 A schematic diagram of a method flow for a rapid deployment method of an application provided in an embodiment of this specification;
[0056] Figure 2 This is a schematic diagram illustrating the configuration process of a pre-configured application directory in an application scenario provided by an embodiment of this specification.
[0057] Figure 3 A service call flow diagram illustrating a rapid deployment method for an application in an application scenario provided in this specification embodiment;
[0058] Figure 4 A schematic diagram of the internal structure of a rapid deployment device for an application provided in an embodiment of this specification;
[0059] Figure 5 This is a schematic diagram of the internal structure of a rapid deployment device for an application provided in this illustrative embodiment;
[0060] Figure 6 This is a schematic diagram of the internal structure of a non-volatile storage medium provided in the embodiments of this specification. Detailed Implementation
[0061] This specification provides an embodiment of a method, apparatus, device, and medium for rapid deployment of an application.
[0062] Traditional cluster application deployment requires operations and maintenance personnel or cluster users to install applications using cumbersome commands within the cluster. Furthermore, to ensure normal application startup, it may be necessary to manually import the application image onto each worker node. This deployment method demands a solid foundation of Kubernetes knowledge from operations and maintenance personnel. To address these technical issues, this manual provides a method for deploying applications. Operations and maintenance personnel only need to create an application directory according to predefined rules and then perform some simple selection operations in a visual interface to quickly deploy applications and build a complete Kubernetes cluster. This achieves efficient and rapid application deployment, eliminating tedious command-line operations, requiring less extensive Kubernetes knowledge from operations and maintenance personnel, and eliminating the need to worry about post-installation scheduling issues.
[0063] To enable those skilled in the art to better understand the technical solutions in this specification, the technical solutions in the embodiments of this specification will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this specification, and not all embodiments. Based on the embodiments of this specification, all other embodiments obtained by those skilled in the art without creative effort should fall within the scope of protection of this specification.
[0064] like Figure 1 As shown, this specification provides a flowchart illustrating a method for rapid deployment of an application in one or more embodiments. Figure 1 It can be seen that the method includes the following steps:
[0065] S101: Obtain the configuration files of each application in the preset application directory, and read the display fields in the configuration files to upload the display fields to the front end.
[0066] To provide a visual front-end interface for application deployment, offering users a more intuitive and engaging deployment experience, this embodiment of the specification obtains the configuration files of each application in a pre-defined application directory. It then reads the display fields from these configuration files and uploads them to the front-end, allowing the front-end interface to display basic application information such as name, version, and feature descriptions.
[0067] Currently, building a complete Kubernetes cluster, regardless of whether binary or kubeadm installation is used, requires a high level of Kubernetes technical expertise and proficiency in installation commands. Application deployment should occur after the cluster is built. The common installation method is using chart packages, and both chart package and YAML file deployment require familiarity with common installation commands. To eliminate the cumbersome command-line interface during application deployment and enable rapid application deployment based on pre-defined application directories, thus building a complete Kubernetes cluster, in one or more embodiments of this specification, before obtaining the configuration files of each application in the pre-defined application directory, the method further includes the following process: First, based on the preset installation method of each application, the file format corresponding to the file resources of each application is determined, and then the file resources are constructed into application files based on the corresponding file format. For example, for applications installed using the "yaml" method, the YAML file resource must be a standard application YAML file to ensure that the application YAML does not cause errors during installation within Kubernetes. When the application is installed using "helm", a chart package is provided. This chart package needs to be written by the user according to the specific configuration of the application, and the installation package must be a .tgz compressed file. Then, image files for each application are built based on the application files so that the application images can be automatically imported into the load balancer for application deployment. The configuration information of each application is obtained, and then, based on a preset orchestration method, the configuration information and application files are combined to generate configuration files for each application. It should be noted that the configuration information includes: name, basic description information, version number, installation order, installation method, etc. The installation method of the application is determined based on the configuration file, and the application files and image files are stored in different directories to generate the application directory accordingly.
[0068] Furthermore, in one or more embodiments of this specification, determining the application's installation method based on a configuration file, and then storing the application file and image file in different directories to generate an application directory based on the installation method, specifically includes the following steps:
[0069] If the application is determined to be a first installation type based on the deployment field in the configuration file, then the application files are stored in the first installation type directory. If the application is determined to be a second installation type based on the deployment field in the configuration file, then the application files are stored in the second installation type directory. The image files are stored in the corresponding image file directory, thereby generating the application directory based on the first installation type directory, the second installation type directory, and the image file directory for each application. It should be noted that, in one or more embodiments of this specification, the first installation type directory is the charts directory, and the second installation type directory is the yaml directory.
[0070] In one embodiment of an application scenario described in this specification, when planning the pre-built application directory, the application name serves as the application folder name, and the front-end interface display name corresponds one-to-one with the application name on the installation disk. Specifically, the pre-built application directory includes: a `charts` directory, used to store the chart package when the application installation method is "helm". This chart package needs to be written by the user according to the specific configuration of the application, and the installation package must be a .tgz compressed file. An `images` directory, used to store the application image package. This image package must be a standard image package exported by the user using docker or containerd. The container image field in the chart package must be filled with the import tag of the application image package, and the program uses a shell script to execute the command to import the image. A `yaml` directory, containing YAML file resources for the application installation method "yaml". The YAML file must be a standard application YAML file to ensure that the application YAML does not cause errors during installation within Kubernetes. An `app.yaml` configuration file, used to read specific fields internally and to display specific information about the application on the front end.
[0071] Furthermore, to enable rapid deployment without requiring attention to backend services during application deployment, in one or more embodiments of this specification, configuration files for each application are generated based on a preset orchestration method, specifically including the following process: First, according to the function of each field in the configuration information, the fields in the configuration information are divided into display fields or deployment fields; it should be noted that display fields include fields for representing application name, basic description information, version number, etc.; deployment fields include fields for representing installation order, installation method, etc. Then, the display fields and deployment fields are processed based on a preset file format to obtain the configuration file; it should be noted that the preset file format is a YAML file format.
[0072] This specification provides an example of writing a configuration file in a specific application scenario. In this scenario, some fields in the configuration file are display fields that need to be shown on the front end, while others are deployment fields that the backend service needs to read. The configuration file content should strictly adhere to the YAML file format. Specifically, the fields include: `name` (string type): the name of the application, which should be consistent with the name displayed on the front end and the application folder name mentioned in section A; `description` (string type): used to display basic description information of the application on the front end, supporting both Chinese and English characters without other special restrictions; `version` (string type): used to display the current version number of the application on the front end; `index` (integer type): this field is not displayed on the front end and is used by the backend service to determine the installation order in multi-application scenarios; `type` (enumeration type): currently, the invention supports two types: "helm" type, suitable for application installation via chart packages; and "yaml" type, suitable for YAML file deployment. For example, the main attributes of the configuration file are as follows:
[0073] name:"demo"
[0074] Description: "Test example app"
[0075] version:"0.0.1"
[0076] index:1
[0077] type:"yaml"
[0078] S102: Based on the front end's response to the displayed fields, determine the basic information of the application to be deployed.
[0079] After uploading the display fields to the front end in step S101, the front end interface displays application information such as the application name, current version, and basic description information contained in the display fields. This allows the user to identify the application to be deployed based on the front end. Then, based on the front end's response to the display fields, i.e., based on the front end's trigger response, the basic information of the application to be deployed is determined, so as to facilitate the deployment and installation of the identified application.
[0080] S103: Based on the basic information, obtain the configuration file corresponding to the application to be deployed, and read the deployment field in the corresponding configuration file.
[0081] Based on the basic information of the application to be deployed determined in step S102, the configuration file corresponding to the application to be deployed is obtained, and the deployment fields in the corresponding configuration file are read, such as the fields that determine the installation order of the application and the fields that determine the installation method of the application.
[0082] S104: Determine the installation type of the application to be deployed based on the deployment field, and call the corresponding client to install the application to be deployed.
[0083] To quickly deploy the application to be deployed, the embodiments in this specification determine the installation type of the application based on the obtained deployment field, and then call the client corresponding to the installation type of the application to be deployed to install the application.
[0084] In one or more embodiments of this specification, the installation type of the application to be deployed is determined based on the deployment field, and the corresponding client is invoked to install the application. This specifically includes the following steps:
[0085] If the deployment field of the application to be deployed indicates that it belongs to the first installation type, then the first client corresponding to that first installation type is invoked. If the deployment field indicates that the application to be deployed belongs to the second installation type, then the second client corresponding to that second installation type is invoked. Depending on whether it is the first or second client, a preset script program (shell) is invoked to import the image file corresponding to the application to be deployed, thus achieving automatic deployment of the application. Furthermore, it should be noted that in one or more embodiments of this specification, the first installation type of the application to be deployed is Helm, and the second installation type is YAML.
[0086] like Figure 3As shown in the schematic diagram of the service call process in an application scenario provided by one or more embodiments of this specification, in one embodiment, if it is determined that the installation type of the application to be deployed is "helm", then the go-helm client corresponding to this type is called, and then the pre-set script program shell is called based on the go-helm client to import the application image to achieve the deployment of the "helm" type application. If it is determined that the installation type of the application to be deployed is "yaml", then the k8s client corresponding to this type is called, and then the pre-set script program shell is called based on the k8s client to obtain the application image from the pre-set application directory and import the application image to the corresponding deployment location to achieve the deployment of the "k8s" type application. It should be noted that if there are multiple image packages in the images folder of the pre-set application directory, the shell script can traverse the entire folder to perform a loop import. In this way, the application image is not limited to a single image package. Users do not need to pay attention to the underlying implementation logic of the service, but only need to focus on the application itself and export the images required by the application according to the standard container runtime environment. The main implementation code for importing the image is as follows:
[0087]
[0088] Since there may be multiple applications to be deployed, the multiple YAML files corresponding to these applications may have their own installation order. Applications may depend on the state of the previous application, and there is also the issue of checking the state of dependent applications. To achieve orderly deployment of applications, in one or more embodiments of this specification, before determining the installation type of the current application to be deployed based on the deployment field and calling the corresponding client to install the current application, the method includes:
[0089] If multiple applications are identified as needing deployment, the installation order of each application is retrieved based on its deployment field, along with their dependencies. If dependencies exist between applications, a pre-set waiting time is determined for each application. The applications are then sorted according to their installation order to obtain a deployment sequence. Finally, based on the order and waiting time of each application in the deployment sequence, the applications are sequentially called to install and deploy them.
[0090] In one embodiment of this specification, a `steps` field is added to the configuration file when the `type` field is "yaml". This field is an array type. The first field of each array element is a `file` field, used to specify the filename in scenarios with multiple YAML files. The backend service reads this filename and installs and deploys them sequentially. The second field of each array element is a `waitInSeconds` field, representing the waiting time after the file is successfully installed. Users can set this value in seconds according to the application's expected startup time. This optimization solves the problem of multiple YAML file deployment scenarios under the user file deployment method. If there are dependencies, setting the waiting time can effectively ensure that the user's application has a certain startup time, and the next application will be deployed and installed only after a certain period of time. At this time, the main attributes of the configuration file are as follows:
[0091]
[0092] like Figure 3 As shown in one or more embodiments of this specification, a service call flow diagram of a method for rapid deployment of an application in an application scenario is provided. Figure 3 As can be seen, the deployment process first reads the display fields from the configuration file to show basic information about each application, such as application name and version, on the front-end interface. The front-end then inputs the application to be installed and reads the `type` field of the application's `app.yaml` file to determine whether the application to be deployed is a YAML or Helm application. If it's a YAML application, the Kubernetes client is invoked, which then calls a shell script to import the image and deploy the application. If it's a Helm application, the go-helm client is invoked, which then calls a shell script to import the image and deploy the application. After the application is deployed, if it's determined that there are more than one application to be deployed, the process of determining the installation type and deploying is repeated until all applications are deployed.
[0093] As described above, users only need to place the application into the installation disk according to the constrained directory structure and write the app.yaml configuration file. The installer will automatically recognize the configuration file content, read the relevant application directories for installation according to the application installation method specified in the configuration file, and automatically import the application image into the load balancing nodes, thereby building a complete cluster environment. Through this invention, not only can the cluster installation phase be guided by a user interface, eliminating the need to build a standard cluster using cumbersome commands via binary or kubeadm methods, but users only need to configure some relevant machine information in the interface to build a standardized cluster. Furthermore, the cluster initialization phase, such as the installation of basic components like ingress, can also be completed using this invention, without the need for initialization via command line in the console. If users have custom applications, they can build the application directory according to the constraints of the installation disk, write the configuration file, and place it into the installation disk. This invention can quickly help users complete the installation and deployment.
[0094] like Figure 4 As shown, this specification provides a schematic diagram of the internal structure of an application rapid deployment device in one or more embodiments. Figure 4 It can be seen that a rapid deployment device for an application includes:
[0095] The upload unit is used to obtain the configuration files of each application in the preset application directory, and read the display fields in the configuration files to upload the display fields to the front end;
[0096] The determining unit is used to determine the basic information of the application to be deployed based on the front end's response to the displayed fields;
[0097] The reading unit is used to obtain the configuration file corresponding to the application to be deployed based on the basic information, and to read the deployment field in the corresponding configuration file;
[0098] The calling unit is used to determine the installation type of the application to be deployed based on the deployment field, and to call the corresponding client to install the application to be deployed.
[0099] like Figure 5 As shown, this specification provides a schematic diagram of the internal structure of a rapid deployment device for an application, illustrated in one or more embodiments. Figure 4 It can be seen that a rapid deployment device for an application includes:
[0100] At least one processor 401; and,
[0101] The memory 402 is communicatively connected to the at least one processor 401; wherein,
[0102] The memory 402 stores instructions that can be executed by the at least one processor 401, the instructions being executed by the at least one processor 401 to enable the at least one processor 401 to:
[0103] Obtain the configuration files of each application in the preset application directory, and read the display fields in the configuration files to upload the display fields to the front end;
[0104] Based on the front-end's response to the displayed fields, the basic information of the application to be deployed is determined.
[0105] Based on the basic information, obtain the configuration file corresponding to the application to be deployed, and read the deployment field in the corresponding configuration file;
[0106] The installation type of the application to be deployed is determined based on the deployment field, and the corresponding client is invoked to install the application.
[0107] like Figure 5 As shown, this specification provides a schematic diagram of the internal structure of a non-volatile storage medium according to one or more embodiments. Figure 5 It is understood that a non-volatile storage medium stores computer-executable instructions 501, the computer-executable instructions 501 including:
[0108] Obtain the configuration files of each application in the preset application directory, and read the display fields in the configuration files to upload the display fields to the front end;
[0109] Based on the front-end's response to the displayed fields, the basic information of the application to be deployed is determined.
[0110] Based on the basic information, obtain the configuration file corresponding to the application to be deployed, and read the deployment field in the corresponding configuration file;
[0111] The installation type of the application to be deployed is determined based on the deployment field, and the corresponding client is invoked to install the application.
[0112] The various embodiments in this specification are described in a progressive manner. Similar or identical parts between embodiments can be referred to mutually. Each embodiment focuses on describing the differences from other embodiments. In particular, the embodiments of apparatus, devices, and non-volatile computer storage media are basically similar to the method embodiments, so the descriptions are relatively simple; relevant parts can be referred to the descriptions of the method embodiments.
[0113] The foregoing has described specific embodiments of this specification. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recited in the claims may be performed in a different order than that shown in the embodiments and may still achieve the desired result. Furthermore, the processes depicted in the drawings do not necessarily require the specific or sequential order shown to achieve the desired result. In some embodiments, multitasking and parallel processing are possible or may be advantageous.
[0114] The above description is merely one or more embodiments of this specification and is not intended to limit this specification. Various modifications and variations can be made to the one or more embodiments of this specification by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principle of one or more embodiments of this specification should be included within the scope of the claims of this specification.
Claims
1. A method for rapid deployment of an application, characterized in that, The method includes: Obtain the configuration files of each application in the preset application directory, and read the display fields in the configuration files to upload the display fields to the front end; Based on the front-end's response to the displayed fields, the basic information of the application to be deployed is determined. Based on the basic information, obtain the configuration file corresponding to the application to be deployed, and read the deployment field in the corresponding configuration file; Based on the deployment field, the installation type of the application to be deployed is determined, and the corresponding client is invoked to install the application to be deployed. The step of determining the installation type of the application to be deployed based on the deployment field, and then calling the corresponding client to install the application, specifically includes: If the deployment field indicates that the application to be deployed belongs to the first installation type, then the first client corresponding to the first installation type is invoked. If the deployment field indicates that the application to be deployed belongs to the second installation type, then the second client corresponding to the second installation type is invoked; wherein the first installation type is Helm type and the second installation type is YAML type; Based on the first client or the second client, a preset script program is invoked to import the image file corresponding to the application to be deployed, thereby realizing the deployment of the application to be deployed. Before determining the installation type of the application to be deployed based on the deployment field, and before calling the corresponding client to install the application, the method includes: If it is determined that there are multiple applications to be deployed, then based on the deployment field of each application to be deployed, the installation order of each application to be deployed is obtained, and the dependency relationship between each application to be deployed is obtained. If the application to be deployed has dependencies, the waiting time for the application to be deployed is determined based on a preset time interval. Based on the installation order, the applications to be deployed are sorted sequentially to obtain an application deployment sequence; Based on the order of the currently deployed applications in the application deployment sequence and the waiting time of each currently deployed application, the currently deployed applications in the application deployment sequence are called sequentially in order to install and deploy the currently deployed applications; Before obtaining the configuration files of each application in the preset application directory, the method further includes: Based on the preset installation method of each application, the file format corresponding to the file resources of each application is determined, so as to construct the application file of the application based on the file format; Build image files for each application based on the application files; The configuration information of each application is obtained, and the configuration information and the application files are combined according to a preset arrangement to generate a configuration file for each application; wherein, the configuration information includes: name, basic description information, version number, installation order, and installation method; Based on the configuration file, the installation method of the application is determined, and the application file and image file are stored in different directories to generate an application directory based on the installation method.
2. The rapid deployment method for an application according to claim 1, characterized in that, Based on the configuration file, the installation method of the application is determined, and the application files and image files are stored in different directories to generate an application directory based on the installation method. Specifically, this includes: If the application is determined to be a first installation type based on the deployment field in the configuration file, then the application file is stored in the first installation type directory; If the application is determined to be a second installation type based on the deployment field in the configuration file, then the application file is stored in the second installation type directory; The image files are stored in the corresponding image file directory to generate an application directory based on the first installation type directory, the second installation type directory, and the image file directory of each application.
3. The rapid deployment method for an application according to claim 1, characterized in that, The step of generating configuration files for each application by combining the configuration information with the application files based on a preset arrangement method specifically includes: Based on the function of each field in the configuration information, the fields are divided into display fields or deployment fields; wherein, the display fields include: application name, basic description information, and version number; the deployment fields include: installation order and installation method; The display field and the deployment field are processed based on a preset file format to obtain a configuration file; wherein the preset file format is a YAML file format.
4. The rapid deployment method for an application according to claim 2, characterized in that, The first installation type directory is the charts directory, and the second installation type directory is the yaml directory.
5. A rapid deployment device for an application, characterized in that, The device includes: The upload unit is used to obtain the configuration files of each application in the preset application directory, and read the display fields in the configuration files to upload the display fields to the front end; The determining unit is used to determine the basic information of the application to be deployed based on the front end's response to the displayed fields; The reading unit is used to obtain the configuration file corresponding to the application to be deployed based on the basic information, and to read the deployment field in the corresponding configuration file; The invocation unit is used to determine the installation type of the application to be deployed based on the deployment field, and to invoke the corresponding client to implement the installation of the application to be deployed. Specifically, determining the installation type of the application to be deployed based on the deployment field and invoking the corresponding client to implement the installation of the application to be deployed includes: If the deployment field indicates that the application to be deployed belongs to the first installation type, then the first client corresponding to the first installation type is invoked. If the deployment field indicates that the application to be deployed belongs to the second installation type, then the second client corresponding to the second installation type is invoked; wherein the first installation type is Helm type and the second installation type is YAML type; Based on the first client or the second client, a preset script program is invoked to import the image file corresponding to the application to be deployed, thereby realizing the deployment of the application to be deployed. Before determining the installation type of the application to be deployed based on the deployment field, and calling the corresponding client to install the application, the process further includes: If it is determined that there are multiple applications to be deployed, then based on the deployment field of each application to be deployed, the installation order of each application to be deployed is obtained, and the dependency relationship between each application to be deployed is obtained. If the application to be deployed has dependencies, the waiting time for the application to be deployed is determined based on a preset time interval. Based on the installation order, the applications to be deployed are sorted sequentially to obtain an application deployment sequence; Based on the order of the currently deployed applications in the application deployment sequence and the waiting time of each currently deployed application, the currently deployed applications in the application deployment sequence are called sequentially in order to install and deploy the currently deployed applications; Before obtaining the configuration files of each application in the preset application directory, the process also includes: Based on the preset installation method of each application, the file format corresponding to the file resources of each application is determined, so as to construct the application file of the application based on the file format; Build image files for each application based on the application files; The configuration information of each application is obtained, and the configuration information and the application files are combined according to a preset arrangement to generate a configuration file for each application; wherein, the configuration information includes: name, basic description information, version number, installation order, and installation method; Based on the configuration file, the installation method of the application is determined, and the application file and image file are stored in different directories to generate an application directory based on the installation method.
6. A rapid deployment device for an application, characterized in that, The device includes: At least one processor; and, A memory communicatively connected to the at least one processor; wherein, The memory stores instructions executable by the at least one processor, which, when executed by the at least one processor, enable the at least one processor to: Obtain the configuration files of each application in the preset application directory, and read the display fields in the configuration files to upload the display fields to the front end; Based on the front-end's response to the displayed fields, the basic information of the application to be deployed is determined. Based on the basic information, obtain the configuration file corresponding to the application to be deployed, and read the deployment field in the corresponding configuration file; Based on the deployment field, the installation type of the application to be deployed is determined, and the corresponding client is invoked to install the application to be deployed. The step of determining the installation type of the application to be deployed based on the deployment field, and then calling the corresponding client to install the application, specifically includes: If the deployment field indicates that the application to be deployed belongs to the first installation type, then the first client corresponding to the first installation type is invoked. If the deployment field indicates that the application to be deployed belongs to the second installation type, then the second client corresponding to the second installation type is invoked; wherein the first installation type is Helm type and the second installation type is YAML type; Based on the first client or the second client, a preset script program is invoked to import the image file corresponding to the application to be deployed, thereby realizing the deployment of the application to be deployed. Before determining the installation type of the application to be deployed based on the deployment field, and calling the corresponding client to install the application, the process further includes: If it is determined that there are multiple applications to be deployed, then based on the deployment field of each application to be deployed, the installation order of each application to be deployed is obtained, and the dependency relationship between each application to be deployed is obtained. If the application to be deployed has dependencies, the waiting time for the application to be deployed is determined based on a preset time interval. Based on the installation order, the applications to be deployed are sorted sequentially to obtain an application deployment sequence; Based on the order of the currently deployed applications in the application deployment sequence and the waiting time of each currently deployed application, the currently deployed applications in the application deployment sequence are called sequentially in order to install and deploy the currently deployed applications; Before obtaining the configuration files of each application in the preset application directory, the process also includes: Based on the preset installation method of each application, the file format corresponding to the file resources of each application is determined, so as to construct the application file of the application based on the file format; Build image files for each application based on the application files; The configuration information of each application is obtained, and the configuration information and the application files are combined according to a preset arrangement to generate a configuration file for each application; wherein, the configuration information includes: name, basic description information, version number, installation order, and installation method; Based on the configuration file, the installation method of the application is determined, and the application file and image file are stored in different directories to generate an application directory based on the installation method.
7. A non-volatile storage medium storing computer-executable instructions, characterized in that, The computer-executable instructions include: Obtain the configuration files of each application in the preset application directory, and read the display fields in the configuration files to upload the display fields to the front end; Based on the front-end's response to the displayed fields, the basic information of the application to be deployed is determined. Based on the basic information, obtain the configuration file corresponding to the application to be deployed, and read the deployment field in the corresponding configuration file; Based on the deployment field, the installation type of the application to be deployed is determined, and the corresponding client is invoked to install the application to be deployed. The step of determining the installation type of the application to be deployed based on the deployment field, and then calling the corresponding client to install the application, specifically includes: If the deployment field indicates that the application to be deployed belongs to the first installation type, then the first client corresponding to the first installation type is invoked. If the deployment field indicates that the application to be deployed belongs to the second installation type, then the second client corresponding to the second installation type is invoked; wherein the first installation type is Helm type and the second installation type is YAML type; Based on the first client or the second client, a preset script program is invoked to import the image file corresponding to the application to be deployed, thereby realizing the deployment of the application to be deployed. Before determining the installation type of the application to be deployed based on the deployment field, and calling the corresponding client to install the application, the process further includes: If it is determined that there are multiple applications to be deployed, then based on the deployment field of each application to be deployed, the installation order of each application to be deployed is obtained, and the dependency relationship between each application to be deployed is obtained. If the application to be deployed has dependencies, the waiting time for the application to be deployed is determined based on a preset time interval. Based on the installation order, the applications to be deployed are sorted sequentially to obtain an application deployment sequence; Based on the order of the currently deployed applications in the application deployment sequence and the waiting time of each currently deployed application, the currently deployed applications in the application deployment sequence are called sequentially in order to install and deploy the currently deployed applications; Before obtaining the configuration files of each application in the preset application directory, the process also includes: Based on the preset installation method of each application, the file format corresponding to the file resources of each application is determined, so as to construct the application file of the application based on the file format; Build image files for each application based on the application files; The configuration information of each application is obtained, and the configuration information and the application files are combined according to a preset arrangement to generate a configuration file for each application; wherein, the configuration information includes: name, basic description information, version number, installation order, and installation method; Based on the configuration file, the installation method of the application is determined, and the application file and image file are stored in different directories to generate an application directory based on the installation method.
Citation Information
Patent Citations
Cloud native application installation method and device, electronic equipment and medium
CN114237651A