A container-based application system deployment method and related device

By deploying scripts to update and loading the configuration files of container images, the complexity of managing and deploying multi-container systems is solved, and one-click installation of container images and simplified deployment of application systems is realized.

CN112230946BActive Publication Date: 2025-02-28SHANDONG LANGCHAO YUNTOU INFORMATION TECH CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202011296786.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-11-18
Publication Date
2025-02-28
Estimated Expiration
2040-11-18

AI Technical Summary

Technical Problem

When managing and deploying numerous containers in a complete system, it is difficult for the existing technology to achieve one-click deployment and management.

Method used

Through the deployment script, update the parameters to be configured in the configuration file to the parameters to be updated in the preset configuration file, and load the container image local file based on the updated configuration file, set and start the container image.

Benefits of technology

It realizes one-click installation of container mirroring and simplifies the deployment process of application systems, improving deployment efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN112230946B_ABST
    Figure CN112230946B_ABST
Patent Text Reader

Abstract

The present invention discloses a container-based application system deployment method, including updating the parameters to be configured in the configuration file to the parameters to be updated recorded in the preset configuration file through a deployment script; loading the container image local file based on the updated configuration file through the deployment script; setting the startup parameters according to the requirements of the container image local file through the deployment script; and starting the container image local file according to the startup parameters through the deployment script. By dividing the configuration parameters in the configuration file into parameters to be configured that change with the environment and default configuration parameters that do not change with the environment, and automatically updating the parameters to be configured and setting the startup parameters through the deployment script, one-click installation of the container image local file can be achieved, simplifying the application system deployment process. The present invention also provides a device, equipment, and storage medium, which also have the above-mentioned beneficial effects.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of computer technology, and in particular to a container-based application system deployment method, a container-based application system deployment device, a container-based application system deployment equipment, and a computer-readable storage medium. Background Art

[0002] With the continuous advancement of science and technology and the continuous development of computer technology, Docker containers have been widely used as an open source application container engine. At present, Docker (container technology) is developing rapidly, and container technology is increasingly used in the deployment and operation and maintenance of application systems. Docker has both good resource isolation capabilities and low virtualization overhead, so the container technology in the present invention uses Docker, but of course the container technology is not limited to Docker. Faced with numerous containers in a complete system, how to deploy and manage these containers with one click has become a problem to be solved. Summary of the invention

[0003] The purpose of the present invention is to provide a container-based application system deployment method, which can realize one-click deployment of the application system; the present invention also provides a container-based application system deployment device, a container-based application system deployment equipment and a computer-readable storage medium, which can realize one-click deployment of the application system.

[0004] In order to solve the above technical problems, the present invention provides a container-based application system deployment method, comprising:

[0005] The parameters to be configured in the configuration file are updated to the parameters to be updated recorded in the preset configuration file through the deployment script; the parameters to be configured are configuration parameters that change with the environment, the configuration file also includes default configuration parameters that do not change with the environment, and the preset configuration file only records the parameters to be updated corresponding to the parameters to be configured;

[0006] Loading the container image local file based on the updated configuration file through the deployment script;

[0007] Setting startup parameters according to the requirements of the local file of the container image through the deployment script;

[0008] The container image local file is started according to the startup parameters by the deployment script.

[0009] Optionally, after starting the container image local file according to the startup parameters through the deployment script, the method further includes:

[0010] The deployment script stores the auxiliary files generated when the local file of the container image is run in the runtime folder.

[0011] Optionally, also include:

[0012] The local file of the container image is uninstalled through the deployment script, while the auxiliary files recorded in the runtime folder are retained.

[0013] Optionally, the deployment script is a script directly added to the local file of the container image.

[0014] Optionally, also include:

[0015] The deployment script records the log information in a log file.

[0016] The present invention also provides a container-based application system deployment device, comprising:

[0017] Update module: used to update the parameters to be configured in the configuration file to the parameters to be updated recorded in the preset configuration file through the deployment script; the parameters to be configured are configuration parameters that change with the environment, the configuration file also includes default configuration parameters that do not change with the environment, and the preset configuration file only records the parameters to be updated corresponding to the parameters to be configured;

[0018] Loading module: used to load the container image local file based on the updated configuration file through the deployment script;

[0019] Startup parameter module: used to set startup parameters according to the requirements of the container image local file through the deployment script;

[0020] Startup module: used to start the container image local file according to the startup parameters through the deployment script.

[0021] Optionally, also include:

[0022] The auxiliary file module is used to store the auxiliary files generated when the local file of the container image is run into the runtime folder through the deployment script.

[0023] Optionally, also include:

[0024] The local file of the container image is uninstalled through the deployment script, while the auxiliary files recorded in the runtime folder are retained.

[0025] The present invention also provides a container-based application system deployment device, the device comprising:

[0026] Memory: used to store computer programs;

[0027] Processor: used to implement the steps of any of the above-mentioned container-based application system deployment methods when executing the computer program.

[0028] The present invention also provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps of the container-based application system deployment method as described in any one of the above items are implemented.

[0029] A container-based application system deployment method provided by the present invention includes updating the parameters to be configured in a configuration file to the parameters to be updated recorded in a preset configuration file through a deployment script; the parameters to be configured are configuration parameters that change with the environment, the configuration file also includes default configuration parameters that do not change with the environment, and the preset configuration file only records the parameters to be updated corresponding to the parameters to be configured; loading the container image local file based on the updated configuration file through the deployment script; setting the startup parameters according to the requirements of the container image local file through the deployment script; and starting the container image local file according to the startup parameters through the deployment script.

[0030] By dividing the configuration parameters in the configuration file into parameters to be configured that change with the environment and default configuration parameters that do not change with the environment, and automatically updating the parameters to be configured and setting the startup parameters through the deployment script, one-click installation of local files of the container image can be achieved, simplifying the application system deployment process.

[0031] The present invention also provides a container-based application system deployment device, a container-based application system deployment equipment and a computer-readable storage medium, which also have the above-mentioned beneficial effects and will not be described in detail here. BRIEF DESCRIPTION OF THE DRAWINGS

[0032] In order to more clearly illustrate the embodiments of the present invention or the technical solutions of the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0033] Figure 1 A flowchart of a container-based application system deployment method provided by an embodiment of the present invention;

[0034] Figure 2 A flowchart of a specific container-based application system deployment method provided by an embodiment of the present invention;

[0035] Figure 3 A structural block diagram of a container-based application system deployment device provided by an embodiment of the present invention;

[0036] Figure 4 A structural block diagram of a container-based application system deployment device provided in an embodiment of the present invention. DETAILED DESCRIPTION

[0037] The core of the present invention is to provide a container-based application system deployment method. In the prior art, the container-based application system deployment process is usually complicated.

[0038] The present invention provides a container-based application system deployment method, which includes updating the parameters to be configured in the configuration file to the parameters to be updated recorded in the preset configuration file through a deployment script; the parameters to be configured are configuration parameters that change with the environment, the configuration file also includes default configuration parameters that do not change with the environment, and the preset configuration file only records the parameters to be updated corresponding to the parameters to be configured; loading the container image local file based on the updated configuration file through the deployment script; setting the startup parameters according to the requirements of the container image local file through the deployment script; and starting the container image local file according to the startup parameters through the deployment script.

[0039] By dividing the configuration parameters in the configuration file into parameters to be configured that change with the environment and default configuration parameters that do not change with the environment, and automatically updating the parameters to be configured and setting the startup parameters through the deployment script, one-click installation of local files of the container image can be achieved, simplifying the application system deployment process.

[0040] In order to enable those skilled in the art to better understand the scheme of the present invention, the present invention is further described in detail below in conjunction with the accompanying drawings and specific implementation methods. Obviously, the described embodiments are only part of the embodiments of the present invention, rather than all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of the present invention.

[0041] Please refer to Figure 1 , Figure 1 The present invention provides a flowchart of a container-based application system deployment method.

[0042] See also Figure 1 In an embodiment of the present invention, a container-based application system deployment method includes:

[0043] S101: updating the parameters to be configured in the configuration file to the parameters to be updated recorded in the preset configuration file through a deployment script.

[0044] In the embodiment of the present invention, the parameters to be configured are configuration parameters that change with the environment, the configuration file also includes default configuration parameters that do not change with the environment, and the preset configuration file only records the parameters to be updated corresponding to the parameters to be configured.

[0045] At this stage, each container image corresponds to an application, and each application corresponds to a software project, that is, a service, which can be made into a container image, such as a Docker container image. Docker container image production can generally be divided into two methods: one based on Dockerfile, and one based on a running container. The command docker save can be used to save the image as a local image file, that is, a container image local file, which generally has a suffix of .tar. The advantage is that the image file can be distributed to various on-site environments. Each software project can have its own configuration file, which can be extracted by mounting the container, and the variables can be extracted. That is, the container image local file usually corresponds to a configuration file, and in an embodiment of the present invention, the configuration file includes parameters to be configured that change with the environment, and default configuration parameters that do not change with the environment.

[0046] In an embodiment of the present invention, a preset configuration file is usually pre-set, and the preset configuration file records the parameters to be updated, and the parameters to be updated correspond to the specific contents corresponding to the above parameters to be configured in different environments. Usually, in an embodiment of the present invention, only one preset configuration file is usually set, and the preset configuration file records the parameters to be updated corresponding to different parameters to be configured of multiple container image local files in different environments.

[0047] Before this step, the local file of the container image is usually mounted first, and the configuration file corresponding to the local file of the container image is obtained. In this step, the parameters to be configured in the deployment script configuration file are updated to the parameters to be updated to complete the update of the configuration file. Specifically, the above deployment script is usually a script directly added to the local file of the container image, so that the deployment script can be directly obtained when the local file of the container image is mounted.

[0048] S102: Load the container image local file based on the updated configuration file through the deployment script.

[0049] In this step, the local file of the container image is loaded based on the updated configuration file. For the specific loading process, please refer to the existing technology and will not be described in detail here.

[0050] S103: Setting startup parameters according to the requirements of the local file of the container image through the deployment script.

[0051] In this step, the startup parameters will be specified according to the different requirements of each service through the deployment script in order to start the container image local file. The setting of the startup parameters needs to be set according to the requirements of the container image local file. For example, some need to specify DNS, some need to mount volumes, some need to map ports, some need to specify environment variables, etc. The above contents are all startup parameters, and in this step, the startup parameters need to be set before starting the container image local file.

[0052] S104: Start the container image local file according to the startup parameters through the deployment script.

[0053] In this step, the local file of the container image, i.e. dockerrun, will be started according to the startup parameters through the deployment script to complete the deployment of the application system. It should be noted that in the embodiment of the present invention, when a specific service needs to be installed, the above process will only be executed on the specific local file of the container image through the above deployment script; and when multiple services need to be installed, the above process will usually be executed on multiple local files of the container image in sequence through the above deployment script to complete the installation of multiple services.

[0054] A container-based application system deployment method provided by an embodiment of the present invention includes updating the parameters to be configured in a configuration file to the parameters to be updated recorded in a preset configuration file through a deployment script; the parameters to be configured are configuration parameters that change with the environment, the configuration file also includes default configuration parameters that do not change with the environment, and the preset configuration file only records the parameters to be updated corresponding to the parameters to be configured; loading a container image local file based on the updated configuration file through a deployment script; setting startup parameters according to the requirements of the container image local file through the deployment script; and starting the container image local file according to the startup parameters through the deployment script.

[0055] By dividing the configuration parameters in the configuration file into parameters to be configured that change with the environment and default configuration parameters that do not change with the environment, and automatically updating the parameters to be configured and setting the startup parameters through the deployment script, one-click installation of local files of the container image can be achieved, simplifying the application system deployment process.

[0056] The specific contents of the container-based application system deployment method provided by the present invention will be described in detail in the following invention embodiments.

[0057] Please refer to Figure 2 , Figure 2 The present invention provides a flowchart of a specific container-based application system deployment method.

[0058] See also Figure 2 In an embodiment of the present invention, a container-based application system deployment method includes:

[0059] S201: Update the parameters to be configured in the configuration file to the parameters to be updated recorded in the preset configuration file through the deployment script.

[0060] In the embodiment of the present invention, there are two software projects: example-service is a backend project, and example-front is a frontend project. The configuration file of example-service is application.yml, and the configuration file of example-front is application.json.

[0061] The following is an example of application.yml:

[0062]

[0063] In this configuration file, configurations that do not change with the environment, such as tool.dir, are default configuration parameters and need to retain the default values. Parameters to be configured that change with the environment, such as tool.pwd and check.enable, need to be extracted into variable form in the format of {{.Values.Group name.Variable name}}. The values ​​of the parameters to be configured are uniformly configured in the preset configuration file values.yaml.

[0064] The application.json example is as follows:

[0065]

[0066]

[0067] In this configuration file, default configuration parameters that do not change with the environment, such as title, retain the default values. Parameters to be configured that change with the environment, such as coreComponent and checkEnable, need to be extracted into variable form in the format of {{.Values.Group name.Variable name}}. The variable values ​​are uniformly configured in the preset configuration file values.yaml.

[0068] The default configuration file values.yaml is as follows:

[0069]

[0070] As mentioned above, the deployer does not need to open the configuration file of each service for configuration, but only needs to configure values.yaml.

[0071] S202: Load the container image local file based on the updated configuration file through the deployment script.

[0072] S203: Setting startup parameters according to the requirements of the local file of the container image through the deployment script.

[0073] S204: Start the container image local file according to the startup parameters through the deployment script.

[0074] The above S202 to S204 are basically the same as S102 to S104 in the above invention embodiment. Please refer to the above invention embodiment for details, which will not be repeated here.

[0075] S205: Store the attached files generated when running the local file of the container image in the runtime folder through the deployment script.

[0076] The specific content of the attachment file depends on the specific situation and is not specifically limited here. The runtime folder specifically stores the records of each service runtime, which can facilitate the staff to query the service data of each service.

[0077] S206: Uninstall the local file of the container image through the deployment script, while retaining the attached files recorded in the runtime folder.

[0078] In this step, the local file of the container image can be uninstalled through the deployment script to complete the uninstallation of the service. Specifically, in this step, the attached files recorded in the runtime folder will not be deleted during uninstallation. At this time, when the service is reinstalled or upgraded later, the service data of the above service is retained to facilitate the reinstallation or upgrade of the service.

[0079] It should be noted that when a specific service needs to be uninstalled, only the specific container image local file will be uninstalled through the above deployment script; when multiple services need to be uninstalled, multiple container image local files will usually be uninstalled in sequence through the above deployment script.

[0080] In an embodiment of the present invention, it is also possible to start a service, stop a service, and view the service status through a deployment script. The specific process of starting a service, stopping a service, and viewing the service status can refer to the prior art and will not be repeated here. When the above operation needs to be performed on a specific service, only the corresponding operation will be performed on the specific container image local file through the above deployment script; and when operations need to be performed on multiple services, the corresponding operations will usually be performed on multiple container image local files in sequence through the above deployment script.

[0081] S207: Log information is recorded in a log file through the deployment script.

[0082] The log information usually represents the operation performed each time by the deployment script. Accordingly, the deployment script will record the log information in a log file so that the operator can understand the actions performed by the deployment script according to the log information recorded in the log file.

[0083] A container-based application system deployment method provided by an embodiment of the present invention can achieve one-click installation of local files of container images by dividing the configuration parameters in the configuration file into parameters to be configured that change with the environment and default configuration parameters that do not change with the environment, and automatically update the parameters to be configured and set the startup parameters through a deployment script, thereby simplifying the application system deployment process.

[0084] A container-based application system deployment device provided in an embodiment of the present invention is introduced below. The container-based application system deployment device described below and the container-based application system deployment method described above can refer to each other.

[0085] Please refer to Figure 3 , Figure 3 A structural block diagram of a container-based application system deployment device provided in an embodiment of the present invention.

[0086] See also Figure 3 In an embodiment of the present invention, a container-based application system deployment device may include:

[0087] Update module 100: used to update the parameters to be configured in the configuration file to the parameters to be updated recorded in the preset configuration file through the deployment script; the parameters to be configured are configuration parameters that change with the environment, and the configuration file also includes default configuration parameters that do not change with the environment, and the preset configuration file only records the parameters to be updated corresponding to the parameters to be configured.

[0088] Loading module 200: used to load the container image local file based on the updated configuration file through the deployment script.

[0089] The startup parameter module 300 is used to set startup parameters according to the requirements of the local file of the container image through the deployment script.

[0090] The startup module 400 is used to start the local file of the container image according to the startup parameters through the deployment script.

[0091] Preferably, in the embodiment of the present invention, it also includes:

[0092] The auxiliary file module is used to store the auxiliary files generated when the local file of the container image is run into the runtime folder through the deployment script.

[0093] Preferably, in the embodiment of the present invention, it also includes:

[0094] The local file of the container image is uninstalled through the deployment script, while the auxiliary files recorded in the runtime folder are retained.

[0095] Preferably, in an embodiment of the present invention, the deployment script is a script directly added to the local file of the container image.

[0096] Preferably, in the embodiment of the present invention, it also includes:

[0097] Log module: used to record log information in a log file through the deployment script.

[0098] The container-based application system deployment device of this embodiment is used to implement the aforementioned container-based application system deployment method. Therefore, the specific implementation method of the container-based application system deployment device can be seen in the embodiment part of the container-based application system deployment method in the previous text. For example, the update module 100, the loading module 200, the startup parameter module 300, and the startup module 400 are respectively used to implement steps S101, S102, S103 and S104 in the aforementioned container-based application system deployment method. Therefore, its specific implementation method can refer to the description of the corresponding embodiments of each part, which will not be repeated here.

[0099] A container-based application system deployment device provided in an embodiment of the present invention is introduced below. The container-based application system deployment device described below and the container-based application system deployment method and container-based application system deployment apparatus described above can be referenced to each other.

[0100] Please refer to Figure 4 , Figure 4 A structural block diagram of a container-based application system deployment device provided in an embodiment of the present invention.

[0101] Reference Figure 4 The container-based application system deployment device may include a processor 11 and a memory 12.

[0102] The memory 12 is used to store computer programs; the processor 11 is used to implement the container-based application system deployment method described in the above-mentioned embodiment of the invention when executing the computer program.

[0103] The processor 11 in the container-based application system deployment device of this embodiment is used to install the container-based application system deployment device described in the above invention embodiments, and the processor 11 combined with the memory 12 can implement the container-based application system deployment method described in any of the above invention embodiments. Therefore, the specific implementation of the container-based application system deployment device can be seen in the embodiment of the container-based application system deployment method in the above text, and its specific implementation can refer to the description of the corresponding various parts of the embodiment, which will not be repeated here.

[0104] The present invention also provides a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, a container-based application system deployment method introduced in any of the above-mentioned embodiments of the invention is implemented. The rest of the content can refer to the prior art and will not be described in detail here.

[0105] In this specification, each embodiment is described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the embodiments can be referred to each other. For the device disclosed in the embodiment, since it corresponds to the method disclosed in the embodiment, the description is relatively simple, and the relevant parts can be referred to the method part.

[0106] Professionals may further appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the composition and steps of each example have been generally described in the above description according to function. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professionals and technicians may use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of the present invention.

[0107] The steps of the method or algorithm described in conjunction with the embodiments disclosed herein may be implemented directly using hardware, a software module executed by a processor, or a combination of the two. The software module may be placed in a random access memory (RAM), a memory, a read-only memory (ROM), an electrically programmable ROM, an electrically erasable programmable ROM, a register, a hard disk, a removable disk, a CD-ROM, or any other form of storage medium known in the art.

[0108] Finally, it should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the presence of other identical elements in the process, method, article or device including the elements.

[0109] The above is a detailed introduction to a container-based application system deployment method, a container-based application system deployment device, a container-based application system deployment equipment, and a computer-readable storage medium provided by the present invention. Specific examples are used herein to illustrate the principles and implementation methods of the present invention. The description of the above embodiments is only used to help understand the method of the present invention and its core idea. It should be pointed out that for ordinary technicians in this technical field, without departing from the principles of the present invention, several improvements and modifications can be made to the present invention, and these improvements and modifications also fall within the scope of protection of the claims of the present invention.

Claims

1. A container-based application system deployment method, characterized in that: include: Update the parameters to be configured in the configuration file to the parameters to be updated recorded in the preset configuration file through the deployment script; The parameters to be configured are configuration parameters that change with the environment, the configuration file also includes default configuration parameters that do not change with the environment, and the preset configuration file only records the parameters to be updated corresponding to the parameters to be configured; the preset configuration file records the parameters to be updated corresponding to different parameters to be configured of multiple container image local files in different environments; Loading the container image local file based on the updated configuration file through the deployment script; Setting startup parameters according to the requirements of the local file of the container image through the deployment script; Start the container image local file according to the startup parameters through the deployment script; After starting the container image local file according to the startup parameters through the deployment script, it also includes: The deployment script is used to store the auxiliary files generated when the local file of the container image is run in the runtime folder; Also includes: Uninstalling the local file of the container image through the deployment script while retaining the auxiliary files recorded in the runtime folder; Before updating the parameters to be configured in the configuration file to the parameters to be updated recorded in the preset configuration file through the deployment script, it also includes: Mount the local file of the container image and obtain the configuration file corresponding to the local file of the container image.

2. The method according to claim 1, characterized in that The deployment script is a script that is directly added to the local file of the container image.

3. The method according to claim 1, characterized in that Also includes: The deployment script records the log information in a log file.

4. A container-based application system deployment device, characterized in that: include: Update module: used to update the parameters to be configured in the configuration file to the parameters to be updated recorded in the preset configuration file through the deployment script; The parameters to be configured are configuration parameters that change with the environment, the configuration file also includes default configuration parameters that do not change with the environment, and the preset configuration file only records the parameters to be updated corresponding to the parameters to be configured; the preset configuration file records the parameters to be updated corresponding to different parameters to be configured of multiple container image local files in different environments; Loading module: used to load the container image local file based on the updated configuration file through the deployment script; Startup parameter module: used to set startup parameters according to the requirements of the container image local file through the deployment script; Startup module: used to start the container image local file according to the startup parameters through the deployment script; Also includes: Ancillary file module: used to store the ancillary files generated when running the local file of the container image into the runtime folder through the deployment script; Also includes: Uninstalling the local file of the container image through the deployment script while retaining the auxiliary files recorded in the runtime folder; Also includes: The mounting module is used to mount the local file of the container image and obtain the configuration file corresponding to the local file of the container image.

5. A container-based application system deployment device, characterized in that: The device comprises: Memory: used to store computer programs; Processor: used to implement the steps of the container-based application system deployment method as described in any one of claims 1 to 3 when executing the computer program.

6. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the container-based application system deployment method according to any one of claims 1 to 3 are implemented.

Citation Information

Patent Citations

  • Method and device for service deployment, readable medium, and storage controller

    CN107885551A