A containerization system updating method, device, equipment and storage medium

By parsing container images and configuration files to generate target resource files and tasks, the problems of lack of automation and high barriers to entry in the containerized system update process are solved, achieving more efficient system updates.

CN119718381BActive Publication Date: 2025-10-10ZHEJIANG BANGSUN TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411885987.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-12-20
Publication Date
2025-10-10
Estimated Expiration
2044-12-20

AI Technical Summary

Technical Problem

In the existing technology, the update process of the containerized system lacks coordination, resulting in insufficient automation of template file generation and container image deployment, low efficiency, and a high technical threshold for users.

Method used

By receiving container image files and configuration files, parsing image metadata and configuration information, generating target template files, generating target resource files and tasks to be run based on this information, and storing them in the preset task pool, the task executor is used to perform containerized system update operations.

Benefits of technology

It improves the update efficiency of the containerized system, lowers the technical threshold for users, and improves the user experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119718381B_ABST
    Figure CN119718381B_ABST
Patent Text Reader

Abstract

The application discloses a containerization system updating method and device, equipment and a storage medium, and relates to the technical field of computers. The method comprises the following steps: receiving a container image file deployment path and a configuration file, determining a container image file based on the container image file deployment path, and analyzing the container image file and the configuration file to obtain corresponding image metadata information and configuration information; determining target template file information based on the image metadata information; generating a target resource file based on the target template file information and the image metadata information, generating a to-be-run task based on the target resource file and the configuration information, and storing the to-be-run task in a preset task pool; obtaining and analyzing the to-be-run task from the preset task pool to obtain task information, obtaining a task resource file from a preset task warehouse based on the task information, and issuing the task resource file and the task information to a task executor to update the containerization system. In this way, the updating efficiency of the containerization system can be improved.
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 containerized system update method, device, equipment, and storage medium. Background Art

[0002] Currently, automated deployment and resource allocation in containerized systems typically involves combining templated configuration with container orchestration tools for resource management and distribution. The core idea behind this approach is to use a template engine to generate standardized resource files for applications and middleware, and then leverage container orchestration tools to deploy, scale, and manage the containers' operational status.

[0003] Operations personnel or system administrators first define a template configuration file based on application and middleware requirements. This template configuration file contains basic configuration information for container resources, such as image paths, resource limits, environment variables, and port mappings. During actual deployment, the template engine generates specific container resource configuration files based on the template file and environment parameters. Furthermore, for multi-node cluster environments, existing solutions typically rely on manual operations or custom scripts to upload container images to a local private image repository.

[0004] However, in many existing solutions, template file generation and actual container image deployment are not integrated into an automated process, resulting in a lack of coordination across the entire process. For example, operations personnel may need to manually generate configuration templates before updating or uploading new container images. This manual process is error-prone and inefficient when rapid deployment is required. Furthermore, users often need to understand the details of resource files in container orchestration platforms such as Kubernetes (K8S), an open source container orchestration platform, to perform customized operations, significantly increasing the barrier to entry for using these technical solutions and introducing additional learning costs.

[0005] As can be seen from the above, how to improve the update efficiency of containerized systems during the update process is an urgent problem that needs to be solved. Summary of the Invention

[0006] In view of this, the present invention aims to provide a containerized system update method, apparatus, device, and storage medium that can improve the update efficiency of the containerized system. The specific solution is as follows:

[0007] In a first aspect, the present application provides a containerized system update method, comprising:

[0008] Receive a container image file deployment path and a configuration file, determine the container image file based on the container image file deployment path, parse the container image file and the configuration file respectively to obtain corresponding image metadata information and configuration information, and then determine the target template file information based on the image metadata information;

[0009] Generate a target resource file based on the target template file information and the image metadata information, then generate a task to be run based on the target resource file and the configuration information, and store the task to be run in a preset task pool;

[0010] Obtain the tasks to be run from the preset task pool, and parse the tasks to be run to obtain task information, so as to obtain the task resource file from the preset task warehouse based on the task information, and send the task resource file and the task information to the task executor to perform the containerized system update operation.

[0011] Optionally, receiving a container image file deployment path and a configuration file, determining a container image file based on the container image file deployment path, parsing the container image file and the configuration file respectively to obtain corresponding image metadata information and configuration information, and then determining target template file information based on the image metadata information includes:

[0012] Receive the container image file deployment path and configuration file through a preset user interaction interface on the pre-trigger, and determine whether the container image file deployment path and the configuration file meet preset conditions;

[0013] If the container image file deployment path and the configuration file meet the preset conditions, the configuration file is parsed to obtain corresponding configuration information, and then a number of container image files are determined based on the container image file deployment path, and each of the container image files is parsed to obtain corresponding image metadata information; the image metadata information includes the image type, version number, build time, and the programming language corresponding to the image;

[0014] The target template file information is obtained from a preset template repository based on the image metadata information.

[0015] Optionally, generating a target resource file based on the target template file information and the image metadata information, then generating a task to be run based on the target resource file and the configuration information, and storing the task to be run in a preset task pool includes:

[0016] acquire template file content from a preset template repository based on the target template file information, and integrate the template file content with the image metadata information to obtain target resource file content;

[0017] generate a target resource file based on the target resource file content and the image metadata information, generate a to-be-run task based on the target resource file and the configuration information, and then store the to-be-run task to a preset task pool.

[0018] Optionally, the to-be-run task is acquired from the preset task pool, and the to-be-run task is parsed to obtain task information, the task resource file is acquired from a preset task repository based on the task information, and the task resource file and the task information are issued to a task executor to perform a containerization system update operation, including:

[0019] An image uploading task is acquired from the preset task pool, and the image uploading task is parsed to obtain an image repository address, user information and an image group corresponding to the container image file, and a target image repository is determined based on the image repository address.

[0020] It is judged whether the target image repository needs to authenticate the user identity, if the target image repository needs to authenticate the user identity, the target image repository is logged in based on the user information;

[0021] After successfully logging in the target image repository based on the user information, it is judged whether the target image repository satisfies a preset container image file uploading condition based on the image group, if the target image repository satisfies the preset container image file uploading condition, each container image file is acquired from the preset task repository, and each container image file is uploaded to the target image repository.

[0022] After uploading the container image file to the target image repository, it is judged whether the container image file is uploaded successfully, and an uploading state is returned to a task manager; the task manager is used for scheduling and maintaining tasks.

[0023] Optionally, the to-be-run task is acquired from the preset task pool, and the to-be-run task is parsed to obtain task information, the task resource file is acquired from a preset task repository based on the task information, and the task resource file and the task information are issued to a task executor to perform a containerization system update operation, including:

[0024] A resource deployment task is acquired from the preset task pool, and the resource deployment task is parsed to obtain resource deployment task information; the resource deployment task information includes a cluster component address and authentication information.

[0025] Determining whether the resource deployment task information satisfies a preset grammatical condition, and if so, establishing a communication connection with a target cluster based on the cluster component address and the authentication information;

[0026] The resource file in the resource deployment task is transmitted to the target cluster based on the communication connection, so that the target cluster performs a resource deployment operation based on the resource file.

[0027] Optionally, after transmitting the resource file in the resource deployment task to the target cluster based on the communication connection so that the target cluster performs a resource deployment operation based on the resource file, the method further includes:

[0028] Determine whether the deployed resources meet the preset health status. If the deployed resources do not meet the preset health status, automatically call the task scheduler to perform a rollback operation.

[0029] In a second aspect, the present application provides a containerized system update device, comprising:

[0030] a template file information determination module, configured to receive a container image file deployment path and a configuration file, determine a container image file based on the container image file deployment path, parse the container image file and the configuration file respectively to obtain corresponding image metadata information and configuration information, and then determine target template file information based on the image metadata information;

[0031] A task generation module is used to generate a target resource file based on the target template file information and the image metadata information, and then generate a task to be run based on the target resource file and the configuration information, and store the task to be run in a preset task pool;

[0032] The system update module is used to obtain tasks to be run from the preset task pool, and parse the tasks to be run to obtain task information, so as to obtain task resource files from the preset task warehouse based on the task information, and send the task resource files and the task information to the task executor for containerized system update operations.

[0033] Optionally, the task generation module includes:

[0034] An information integration unit, configured to obtain template file content from a preset template repository based on the target template file information, and integrate the template file content with the image metadata information to obtain target resource file content;

[0035] The task generation unit is used to generate a target resource file based on the target resource file content and the image metadata information, and generate a task to be run based on the target resource file and the configuration information, and then store the task to be run in a preset task pool.

[0036] In a third aspect, the present application provides an electronic device, comprising:

[0037] Memory, used to store computer programs;

[0038] A processor is configured to execute the computer program to implement the aforementioned containerized system update method.

[0039] In a fourth aspect, the present application provides a computer-readable storage medium for storing a computer program, wherein the computer program implements the aforementioned containerized system update method when executed by a processor.

[0040] As can be seen from the above, before performing a containerized system update, the present application needs to receive an image file deployment path and a configuration file, and determine the image file based on the image file deployment path, and parse the image file and the configuration file respectively to obtain corresponding image metadata information and configuration information, and then determine the target template file information based on the image metadata information; generate a target resource file based on the target template file information and the image metadata information, and then generate a task to be run based on the target resource file and the configuration information, and store the task to be run in a preset task pool; obtain the task to be run from the preset task pool, and parse the task to be run to obtain task information, so as to obtain the task resource file from the preset task warehouse based on the task information, and send the task resource file and the task information to the task executor to perform the containerized system update operation.

[0041] It can be seen that this application first needs to determine the image file based on the image file deployment path, and parse the image file and configuration file separately to obtain the image metadata information and configuration information, and then determine the target template file information based on the image metadata information; generate the target resource file based on the target template file information and the image metadata information, and then generate the task to be run based on the target resource file and the configuration information, and store the task to be run in the preset task pool; finally, obtain the task to be run from the preset task pool, and parse the task to be run to obtain the task information, so as to obtain the task resource file from the preset task warehouse based on the task information, and send the task resource file and task information to the task executor to perform the containerized system update operation. In this way, the efficiency of updating the containerized system is improved, thereby improving the user experience. BRIEF DESCRIPTION OF THE DRAWINGS

[0042] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are merely embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without paying any creative work.

[0043] Figure 1 This is a flow chart of a containerized system update method disclosed in this application;

[0044] Figure 2 This is a flowchart of a specific containerized system update method disclosed in this application;

[0045] Figure 3 This is a schematic diagram of the component structure of a containerized system update device disclosed in this application;

[0046] Figure 4 This is a schematic diagram of the components of a pre-trigger disclosed in this application;

[0047] Figure 5 This is a schematic diagram of the component structure of a template parser disclosed in this application;

[0048] Figure 6 This is a schematic diagram of the component structure of a task manager disclosed in this application;

[0049] Figure 7 This is a schematic diagram of the component structure of an image upload task center disclosed in this application;

[0050] Figure 8 This is a schematic diagram of the component structure of a resource file upload task center disclosed in this application;

[0051] Figure 9 This is a schematic diagram of the structure of a containerized system update device disclosed in this application;

[0052] Figure 10 This is a structural diagram of an electronic device disclosed in this application. DETAILED DESCRIPTION

[0053] The following will clearly and completely describe the technical solutions in the embodiments of the present invention in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present invention, not 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 efforts are within the scope of protection of the present invention.

[0054] At present, the technical solutions for realizing automatic deployment and resource configuration in containerized systems usually use template engines to generate standardized resource files for applications and middleware, and then use container orchestration tools to deploy, expand and manage the running status of containers. Among them, in the existing solutions, the operation and maintenance personnel or system administrators first define the template configuration file according to the application and middleware requirements. During actual deployment, the template engine will generate a specific container resource configuration file based on the template file and environment parameters. In addition, for multi-node cluster environments, existing solutions usually rely on manual operations or custom scripts to upload container images to local private image repositories. However, in many existing solutions, the generation of template files and the actual deployment of container images are not an integrated automated process, resulting in a lack of coordination in the entire process. To this end, the present application provides a containerized system update method that can improve the update efficiency of the containerized system.

[0055] See also Figure 1 As shown, an embodiment of the present invention discloses a containerized system update method, including:

[0056] Step S11: Receive the container image file deployment path and configuration file, determine the container image file based on the container image file deployment path, and parse the container image file and the configuration file respectively to obtain corresponding image metadata information and configuration information, and then determine the target template file information based on the image metadata information.

[0057] In this embodiment, the nodes involved in the process of updating the containerized system are as follows: Figure 2 As shown. The above-mentioned nodes are respectively the containerized system update device P100 and the Kubernetes Master node P200. In a specific embodiment, the number of Kubernetes Master nodes is three nodes, namely P300, P301, and P302. It is worth mentioning that the number of Kubernetes Master nodes is set based on user needs and will not be elaborated on here. The containerized system update device is responsible for communicating with the container cluster and completing the update operation of the containerized system through the communication interface.

[0058] In this embodiment, the containerized system update device P100 includes a pre-trigger P110 that directly interacts with the user, a template parser P120 that dynamically generates resource files, and a task manager P130 that is responsible for task maintenance and task scheduling. It is worth mentioning that the sequence of processes between the pre-trigger, template parser, and task manager is as follows: Figure 3As shown in the figure, after receiving the user's container image file deployment path and configuration file, the pre-trigger attempts to parse the image file and configuration file, and determines the target template file information based on the parsing results. It then calls the template parser and obtains the template file content from the template repository based on the target template file information. The template parser then generates the target resource file based on the parsing results of the pre-trigger, and generates the task to be run based on the target resource file and configuration information. The pre-trigger then calls the task manager to use the task manager to manage the task to be run.

[0059] Among them, the pre-trigger P110 includes an input module P111 for receiving user input, an image metadata parsing module P112 for completing image file parsing, a template matching module P113 for completing template selection based on image metadata, a configuration parsing module P114 responsible for parsing the configuration file input by the user, and a task delivery module P115 responsible for communicating with the task manager P130. It is worth mentioning that the sequence of processes between the input module, image metadata parsing module, template matching module, configuration parsing module and task delivery module is as follows: Figure 4 shown.

[0060] In this embodiment, the input module first receives the container image file deployment path and configuration file input by the user and verifies the validity of this information. Subsequently, the pre-trigger traverses all image files under the container image file deployment path and calls the image metadata parsing module to parse each image file to obtain the image type, version number, build time, and programming language—that is, image metadata information. The pre-trigger then calls the template matching module to use this information to find the appropriate target template file from the template repository. Specifically, receiving a container image file deployment path and a configuration file, determining the container image file based on the container image file deployment path, and parsing the container image file and the configuration file respectively to obtain corresponding image metadata information and configuration information, and then determining the target template file information based on the image metadata information, can include: receiving the container image file deployment path and the configuration file through a preset user interaction interface on the pre-trigger, and judging whether the container image file deployment path and the configuration file meet the preset conditions; if the container image file deployment path and the configuration file meet the preset conditions, parsing the configuration file to obtain the corresponding configuration information, and then determining a number of container image files based on the container image file deployment path, and parsing each container image file to obtain corresponding image metadata information; the image metadata information includes the type, version number, build time and programming language corresponding to the image; obtaining the target template file information from the preset template repository based on the image metadata information.

[0061] In step S12, the target resource file is generated based on the target template file information and the image metadata information, and then the to-be-run task is generated based on the target resource file and the configuration information, and the to-be-run task is stored in the preset task pool.

[0062] In this embodiment, when the adaptive template resource file is found, the pre-trigger calls the configuration parsing module to parse the configuration file input by the user and obtains the configuration information, and then generates the target resource file based on the target template file information and the configuration information, generates the to-be-run task based on the target resource file and the configuration information, and then the pre-trigger calls the task delivery module to schedule the to-be-run task to the task manager, so as to manage the to-be-run task by using the task manager. It is worth mentioning that the pre-trigger determines the health status of the computer resource according to the response value of each task, and attempts to automatically roll back in an abnormal case.

[0063] The template parser P120 includes a template parsing engine P121 for parsing the incoming template file, a template warehouse P122 for managing all template files, a template rendering module P123 responsible for resource configuration filling, and a resource file generation module P124 for integrating the template filled with content into a resource file. It is worth mentioning that the sequence of the template parsing engine, the template warehouse, the template rendering module and the resource file generation module is as shown in Figure 5 The template parsing engine receives the target template file information and the image metadata information from the upstream, tries to pull the corresponding template file content from the template warehouse, the template rendering module integrates the template content and the template data to generate a final resource file content, the resource file generation module generates the target resource file based on the image metadata information and the resource file content on the file system, and then generates the to-be-run task based on the target resource file and the configuration information, and stores the to-be-run task in the preset task pool. Specifically, the target resource file is generated based on the target template file information and the image metadata information, and then the to-be-run task is generated based on the target resource file and the configuration information, and the to-be-run task is stored in the preset task pool, which can include: obtaining the template file content from the preset template warehouse based on the target template file information, integrating the template file content with the image metadata information to obtain the target resource file content, generating the target resource file based on the target resource file content and the image metadata information, and generating the to-be-run task based on the target resource file and the configuration information, and then storing the to-be-run task in the preset task pool.

[0064] Step S13: Obtain the tasks to be run from the preset task pool, and parse the tasks to be run to obtain task information, and obtain the task resource file from the preset task warehouse based on the task information, and send the task resource file and the task information to the task executor to perform the containerized system update operation.

[0065] In this embodiment, after the tasks to be run are stored in the preset task pool, the embodiment of the present application needs to call the task manager to obtain the tasks to be run from the preset task pool. Among them, the task manager includes a task scheduler P131 responsible for coordinating the tasks to be run, a task pool P132 for temporarily storing the tasks to be run, a task warehouse P133 for managing all task resource files, a task executor P134 for actually executing the tasks to be run, an image upload task center P135 responsible for completing the image upload work, and a resource deployment task center P136 responsible for completing the distribution of resource files. It is worth mentioning that the sequential processes between the task scheduler, the task pool, the task warehouse, the task executor, the image upload task center, and the resource deployment task center are as follows: Figure 6 shown.

[0066] The task scheduler first scans the task pool to see if there are any pending tasks. If any are found, it parses the pending tasks to obtain task information. Based on the task information, it then retrieves the corresponding task resource file from the task repository and sends the retrieved task information and task resource file to the task executor. The task executor then integrates the task information and the task resource file contents and executes the task according to the order of the task steps.

[0067] In this embodiment, the image upload task center P135 includes an image loading component P135-1 responsible for reading the image file, an image repository authentication component P135-2 responsible for authenticating the encrypted image repository, and an image push component P135-3 for uploading the image. It is worth mentioning that the sequential processes between the image loading component, the image repository authentication component, and the image push component are as follows: Figure 7As shown. Among them, the image loading component reads the image file and loads it into the local file system. Subsequently, it is determined whether the target image warehouse needs to authenticate the user information. If the target image warehouse needs to authenticate the user information, the image warehouse authentication component is called, and the target image warehouse is logged in based on the image warehouse address and username and password parsed by the configuration parsing module. Subsequently, the image push component needs to determine whether the target image warehouse has the conditions for uploading the image file based on the mirror group configured by the configuration parsing module. If the target image warehouse has the conditions for uploading the image file, the image upload process is started. It is worth mentioning that after the image upload process is completed, the embodiment of the present application needs to call the image push component to check whether the image is uploaded successfully in the image warehouse, and return the upload status to the task manager.

[0068] Specifically, tasks to be run are obtained from a preset task pool, and the tasks to be run are parsed to obtain task information, and task resource files are obtained from a preset task repository based on the task information, and the task resource files and task information are sent to the task executor to perform a containerized system update operation, which may include: obtaining an image upload task from a preset task pool, and parsing the image upload task using a configuration parsing module to obtain the image repository address, user information, and image group corresponding to the container image file, and determining the target image repository based on the image repository address; then, determining whether the target image repository needs to authenticate the user identity, and if the target image repository needs to authenticate the user identity, logging in to the target image repository based on the user information. It is worth mentioning that after successfully logging into the target image warehouse based on user information, the target image warehouse is judged based on the image group whether it meets the preset container image file upload conditions. If the target image warehouse meets the preset container image file upload conditions, each container image file is obtained from the preset task warehouse and uploaded to the target image warehouse; after uploading the container image file to the target image warehouse, the embodiment of the present application needs to determine whether the container image file is uploaded successfully, and return the upload status to the task manager; wherein, the task manager is used to schedule and maintain tasks.

[0069] In this embodiment, the resource file upload task center P136 includes a resource file verification component P136-1 responsible for loading resource files, a kubernetes api (i.e., Kubernetes application programming interface) authentication component P136-2 responsible for establishing communication with the Kubernetes ApiServer (i.e., Kubernetes application programming interface server), a resource deployment component P136-3 for issuing resource files, a health check component P136-4 for checking resource status, and an automatic rollback component P136-5 responsible for abnormal loading processing. It is worth mentioning that the sequence of processes between the resource file verification component, the kubernetes api authentication component, the resource deployment component, the health check component, and the automatic rollback component is as follows: Figure 8 As shown in the figure, the resource file validation component first reads and parses the resource file contents to eliminate syntax errors. It then calls the Kubernetes API authentication component to establish a connection with the Kubernetes API server using the Kubernetes API server address and user authentication information parsed by the configuration parsing module. Subsequently, the resource deployment component is called and sends the resource file to the Kubernetes API server through the aforementioned connection, allowing the Kubernetes API server to use the resource file for deployment.

[0070] Specifically, tasks to be run are obtained from a preset task pool, and the tasks to be run are parsed to obtain task information, and task resource files are obtained from a preset task warehouse based on the task information, and the task resource files and task information are sent to the task executor for containerized system update operations, which may include: obtaining resource deployment tasks from a preset task pool, and parsing the resource deployment tasks to obtain resource deployment task information; the resource deployment task information includes cluster component addresses and authentication information; determining whether the resource deployment task information meets preset grammatical conditions, and if the resource deployment task information meets the preset grammatical conditions, establishing a communication connection with the target cluster based on the cluster component address and authentication information; transmitting the resource files in the resource deployment task to the target cluster based on the communication connection, so that the target cluster performs resource deployment operations based on the resource files.

[0071] It is worth mentioning that after the resource file is sent, the health check component will regularly check the status of the computer resources. In a specific embodiment, after a preset timeout period, if the computer resources are not in a healthy state, the embodiment of the present application will call the rollback component to roll back the issued computer resources, so that the application will roll back to the last available version, and call the resource file upload task center to return the rollback status to the task manager. Specifically, after the resource files in the resource deployment task are transmitted to the target cluster based on the communication connection, so that the target cluster performs resource deployment operations based on the resource files, it can also include: judging whether the deployed resources meet the preset health status, and if the deployed resources do not meet the preset health status, automatically calling the task scheduler to perform a rollback operation.

[0072] In a specific embodiment, if the application scenario of the embodiment of the present application is in a company that provides enterprise-oriented products, there is a lot of customization work because the customer groups are diverse. Therefore, the embodiment of the present application needs to dispatch operators to various sites, but this operation will cause the operators to have uneven mastery of container field technology, so that operators who are not so familiar with the details of container technology will encounter various problems when performing containerized system update operations. The template warehouse and task warehouse in this embodiment can circumvent this problem. By utilizing the various templates and tasks preset by technicians in the template warehouse and task warehouse, operators only need to carry the image files prepared in advance, and the subsequent containerized system update process can be automatically executed based on the image files.

[0073] In this embodiment, in order to explain the embodiment of the present application in detail, the specific process of executing the containerized system update is as follows:

[0074] First, the operator needs to upload the image file and configuration file to be deployed to the preset server, and store the uploaded image files and configuration files in the same directory.

[0075] Secondly, the pre-trigger receives the container image file deployment path and configuration file input by the operator. After the input module checks the rationality of the input container image file deployment path and configuration file, if the container image file deployment path and configuration file are reasonable, the pre-trigger is called to traverse the container image file deployment path to obtain all image files. Subsequently, the image metadata parsing module is called to parse each image file in turn to obtain the corresponding image metadata information.

[0076] Subsequently, the template matching module is called to search the template repository for the target template file based on the image metadata. Once a matching target template file is found, the pre-trigger calls the configuration parsing module to parse the configuration file passed in by the operator. It is understood that once the configuration file is parsed, the pre-trigger is called to invoke the template parser based on the target template file and image metadata.

[0077] Then, the template parsing engine is called and the template file content is searched and downloaded from the template repository based on the target template file information. Then, based on the image metadata information, the template rendering module is called to integrate the template file content and the image metadata information to obtain the target resource file content, and then the target resource file is generated based on the target resource file content and the image metadata information.

[0078] Furthermore, after generating the target resource file, the embodiment of the present application needs to call the pre-trigger to generate the task to be run based on the target resource file and configuration information, so as to send the task to be run to the task pool through the task sending module.

[0079] Subsequently, the embodiment of the present application needs to call the task scheduler to scan the tasks to be run in the task pool. If there are tasks to be run, the tasks to be run are parsed to obtain the corresponding task information, and the task resource files are obtained in the task warehouse based on the task information. Then, the task scheduler is called to send the task resource files and task information to the task executor, so as to call the task executor to execute the tasks to be run.

[0080] It is worth mentioning that in the process of updating the containerized system, the pre-trigger will first call the image upload task center to execute the uploaded image upload task to load the local image file, upload the image file to the target image repository, and finally check the upload status of the image file to the target image repository.

[0081] Furthermore, after the image file is successfully uploaded, the embodiment of the present application will call the resource deployment task center in the pre-trigger to use the resource deployment task center to verify the syntax of the target resource file, and after the verification is passed, the target resource file will be sent to the Kubernetes cluster, so that after the target resource file is successfully sent, the deployment operation of the computer resource will be automatically started. Among them, after the computer resources are deployed, the embodiment of the present application needs to cyclically check the health status of the computer resources. If the health status of the computer resources is abnormal, the resource deployment task will be actively rolled back by the task scheduler; if the health status of the computer resources is normal, the containerized system update process will end normally.

[0082] As can be seen from the above, before performing a containerized system update, the embodiment of the present application needs to receive the image file deployment path and configuration file, and determine the image file based on the image file deployment path, and parse the image file and configuration file respectively to obtain the corresponding image metadata information and configuration information, and then determine the target template file information based on the image metadata information; generate a target resource file based on the target template file information and the image metadata information, and then generate a task to be run based on the target resource file and the configuration information, and store the task to be run in a preset task pool; obtain the task to be run from the preset task pool, and parse the task to be run to obtain task information, so as to obtain the task resource file from the preset task warehouse based on the task information, and send the task resource file and task information to the task executor to perform the containerized system update operation. In this way, the update efficiency of the containerized system is improved.

[0083] Accordingly, see Figure 9 As shown, the present application also provides a containerized system update device, including:

[0084] The template file information determination module 11 is configured to receive a container image file deployment path and a configuration file, determine a container image file based on the container image file deployment path, parse the container image file and the configuration file respectively to obtain corresponding image metadata information and configuration information, and then determine target template file information based on the image metadata information;

[0085] A task generation module 12 is configured to generate a target resource file based on the target template file information and the image metadata information, and then generate a task to be run based on the target resource file and the configuration information, and store the task to be run in a preset task pool;

[0086] The system update module 13 is used to obtain the tasks to be run from the preset task pool, and parse the tasks to be run to obtain task information, so as to obtain the task resource file from the preset task warehouse based on the task information, and send the task resource file and the task information to the task executor for containerized system update operation.

[0087] As can be seen from the above, before performing a containerized system update, the embodiment of the present application first needs to receive the image file deployment path and configuration file, and determine the image file based on the image file deployment path, and parse the image file and configuration file respectively to obtain the corresponding image metadata information and configuration information, and then determine the target template file information based on the image metadata information; generate the target resource file based on the target template file information and the image metadata information, and then generate the task to be run based on the target resource file and the configuration information, and store the task to be run in the preset task pool; furthermore, obtain the task to be run from the preset task pool, and parse the task to be run to obtain task information, and obtain the task resource file from the preset task warehouse based on the task information; finally, send the task resource file and task information to the task executor to perform the containerized system update operation. In this way, the update efficiency of the containerized system is improved.

[0088] In some specific implementations, the template file information determination module 11 may specifically include:

[0089] An information receiving unit, configured to receive a container image file deployment path and a configuration file through a preset user interaction interface on a pre-trigger, and determine whether the container image file deployment path and the configuration file meet preset conditions;

[0090] a file parsing unit configured to parse the configuration file to obtain corresponding configuration information if the container image file deployment path and the configuration file meet the preset conditions, then determine a plurality of container image files based on the container image file deployment path, and parse each of the container image files to obtain corresponding image metadata information; the image metadata information includes the image type, version number, build time, and programming language corresponding to the image;

[0091] The file information acquiring unit is configured to acquire target template file information from a preset template repository based on the image metadata information.

[0092] In some specific implementations, the task generation module 12 may specifically include:

[0093] A resource file content acquisition unit, configured to acquire template file content from a preset template repository based on the target template file information, and integrate the template file content with the image metadata information to obtain target resource file content;

[0094] The resource file generating unit is used to generate a target resource file based on the target resource file content and the image metadata information, and generate a task to be run based on the target resource file and the configuration information, and then store the task to be run in a preset task pool.

[0095] In some specific implementations, the system update module 13 may specifically include:

[0096] A task parsing unit is used to obtain an image upload task from the preset task pool, parse the image upload task to obtain the image repository address, user information, and image group corresponding to the container image file, and determine a target image repository based on the image repository address;

[0097] An image repository login unit, configured to determine whether the target image repository requires user identity authentication, and if so, to log in to the target image repository based on the user information;

[0098] an image file uploading unit, configured to, after successfully logging into the target image repository based on the user information, determine whether the target image repository meets a preset container image file uploading condition based on the image group; if the target image repository meets the preset container image file uploading condition, obtain each container image file from the preset task repository, and upload each container image file to the target image repository;

[0099] The upload status returning unit is used to determine whether the container image file is uploaded successfully after uploading the container image file to the target image repository, and return the upload status to the task manager; wherein, the task manager is used to schedule and maintain tasks.

[0100] In some specific implementations, the system update module 13 may specifically include:

[0101] A deployment task parsing unit, configured to obtain resource deployment tasks from the preset task pool and parse the resource deployment tasks to obtain resource deployment task information; the resource deployment task information includes cluster component addresses and authentication information;

[0102] a communication connection establishing unit, configured to determine whether the resource deployment task information satisfies a preset grammatical condition, and if so, establish a communication connection with the target cluster based on the cluster component address and the authentication information;

[0103] The file transmission unit is configured to transmit the resource file in the resource deployment task to the target cluster based on the communication connection, so that the target cluster performs a resource deployment operation based on the resource file.

[0104] In some specific implementations, the containerized system update device may further include:

[0105] The rollback operation execution unit is used to determine whether the deployed resources meet the preset health status. If the deployed resources do not meet the preset health status, the task scheduler is automatically called to perform a rollback operation.

[0106] Furthermore, the embodiment of the present application also discloses an electronic device, Figure 10 This is a structural diagram of an electronic device 20 according to an exemplary embodiment. The content in the diagram cannot be considered as any limitation on the scope of use of this application. The electronic device 20 may specifically include: at least one processor 21, at least one memory 22, a power supply 23, a communication interface 24, an input / output interface 25, and a communication bus 26. The memory 22 is used to store a computer program, which is loaded and executed by the processor 21 to implement the relevant steps in the containerized system update method disclosed in any of the aforementioned embodiments. In addition, the electronic device 20 in this embodiment may specifically be an electronic computer.

[0107] In this embodiment, the power supply 23 is used to provide operating voltage for each hardware device on the electronic device 20; the communication interface 24 can create a data transmission channel between the electronic device 20 and the external device. The communication protocol it follows is any communication protocol that can be applied to the technical solution of this application and is not specifically limited here; the input and output interface 25 is used to obtain external input data or output data to the outside world. Its specific interface type can be selected according to specific application needs and is not specifically limited here.

[0108] In addition, the memory 22, as a carrier for resource storage, can be a read-only memory, random access memory, disk or CD, etc. The resources stored thereon can include an operating system 221, a computer program 222, etc., and the storage method can be temporary storage or permanent storage.

[0109] The operating system 221 is used to manage and control the hardware devices on the electronic device 20 and the computer program 222, which can be Windows Server, Netware, Unix, Linux, etc. In addition to including a computer program capable of performing the containerized system update method performed by the electronic device 20 disclosed in any of the aforementioned embodiments, the computer program 222 may further include a computer program capable of performing other specific tasks.

[0110] Furthermore, this application also discloses a computer-readable storage medium for storing a computer program; wherein, when executed by a processor, the computer program implements the aforementioned containerized system update method. The specific steps of this method can be referred to the corresponding content disclosed in the aforementioned embodiments and will not be repeated here.

[0111] The various embodiments in this specification are described in a progressive manner, with each embodiment focusing on its differences from the other embodiments. Reference can be made to the descriptions of the identical or similar parts between the various embodiments. For the devices disclosed in the embodiments, since they correspond to the methods disclosed in the embodiments, the descriptions are relatively simple, and the relevant parts can be referred to the descriptions of the methods.

[0112] 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 above description has generally described the components and steps of each example according to their functions. 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 beyond the scope of this application.

[0113] The steps of the methods or algorithms 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 random access memory (RAM), internal memory, read-only memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, registers, a hard disk, a removable disk, a CD-ROM, or any other form of storage medium known in the art.

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

[0115] The above is a detailed introduction to the technical solution provided by the present application. Specific examples are used herein to illustrate the principles and implementation methods of the present application. The description of the above embodiments is only used to help understand the method of the present application and its core idea. At the same time, for those skilled in the art, according to the ideas of the present application, there may be changes in the specific implementation methods and application scope. In summary, the content of this specification should not be understood as a limitation on the present application.

Claims

1. A containerized system update method, characterized in that: include: Receive a container image file deployment path and a configuration file, determine the container image file based on the container image file deployment path, parse the container image file and the configuration file respectively to obtain corresponding image metadata information and configuration information, and then determine the target template file information based on the image metadata information; Generate a target resource file based on the target template file information and the image metadata information, then generate a task to be run based on the target resource file and the configuration information, and store the task to be run in a preset task pool; Obtain the tasks to be run from the preset task pool, and parse the tasks to be run to obtain task information, so as to obtain the task resource file from the preset task warehouse based on the task information, and send the task resource file and the task information to the task executor to perform the containerized system update operation.

2. The containerized system update method according to claim 1, characterized in that: The receiving a container image file deployment path and a configuration file, determining a container image file based on the container image file deployment path, parsing the container image file and the configuration file respectively to obtain corresponding image metadata information and configuration information, and then determining target template file information based on the image metadata information, includes: Receive the container image file deployment path and configuration file through a preset user interaction interface on the pre-trigger, and determine whether the container image file deployment path and the configuration file meet preset conditions; If the container image file deployment path and the configuration file meet the preset conditions, the configuration file is parsed to obtain corresponding configuration information, and then a number of container image files are determined based on the container image file deployment path, and each of the container image files is parsed to obtain corresponding image metadata information; the image metadata information includes the image type, version number, build time, and the programming language corresponding to the image; The target template file information is obtained from a preset template repository based on the image metadata information.

3. The containerized system update method according to claim 1, characterized in that: The step of generating a target resource file based on the target template file information and the image metadata information, then generating a task to be run based on the target resource file and the configuration information, and storing the task to be run in a preset task pool includes: Acquire the template file content from the preset template repository based on the target template file information, and integrate the template file content with the image metadata information to obtain the target resource file content; A target resource file is generated based on the target resource file content and the image metadata information, and a task to be run is generated based on the target resource file and the configuration information, and then the task to be run is stored in a preset task pool.

4. The containerized system update method according to claim 1, wherein: The step of obtaining the to-be-run tasks from the preset task pool and parsing the to-be-run tasks to obtain task information, obtaining task resource files from the preset task warehouse based on the task information, and sending the task resource files and the task information to the task executor for the containerized system update operation includes: Obtain an image upload task from the preset task pool, parse the image upload task to obtain an image repository address, user information, and image group corresponding to the container image file, and determine a target image repository based on the image repository address; Determine whether the target image repository requires user identity authentication, and if so, log in to the target image repository based on the user information; After successfully logging into the target image warehouse based on the user information, determining whether the target image warehouse meets the preset container image file upload conditions based on the image group; if the target image warehouse meets the preset container image file upload conditions, obtaining each container image file from the preset task warehouse, and uploading each container image file to the target image warehouse; After uploading the container image file to the target image repository, it is determined whether the container image file is uploaded successfully, and the upload status is returned to the task manager; wherein, the task manager is used to schedule and maintain tasks.

5. The containerized system update method according to any one of claims 1 to 4, characterized in that: The step of obtaining the to-be-run tasks from the preset task pool and parsing the to-be-run tasks to obtain task information, obtaining task resource files from the preset task warehouse based on the task information, and sending the task resource files and the task information to the task executor for the containerized system update operation includes: Obtaining a resource deployment task from the preset task pool, and parsing the resource deployment task to obtain resource deployment task information; the resource deployment task information includes a cluster component address and authentication information; Determining whether the resource deployment task information satisfies a preset grammatical condition, and if so, establishing a communication connection with a target cluster based on the cluster component address and the authentication information; The resource files in the resource deployment task are transmitted to the target cluster based on the communication connection, so that the target cluster performs a resource deployment operation based on the resource files.

6. The containerized system update method according to claim 5, characterized in that: After transmitting the resource file in the resource deployment task to the target cluster based on the communication connection so that the target cluster performs a resource deployment operation based on the resource file, the method further includes: Determine whether the deployed resources meet the preset health status. If the deployed resources do not meet the preset health status, automatically call the task scheduler to perform a rollback operation.

7. A containerized system update device, characterized in that: include: a template file information determination module, configured to receive a container image file deployment path and a configuration file, determine a container image file based on the container image file deployment path, parse the container image file and the configuration file respectively to obtain corresponding image metadata information and configuration information, and then determine target template file information based on the image metadata information; A task generation module is used to generate a target resource file based on the target template file information and the image metadata information, and then generate a task to be run based on the target resource file and the configuration information, and store the task to be run in a preset task pool; The system update module is used to obtain tasks to be run from the preset task pool, and parse the tasks to be run to obtain task information, so as to obtain task resource files from the preset task warehouse based on the task information, and send the task resource files and the task information to the task executor for containerized system update operations.

8. The containerized system update device according to claim 7, characterized in that: The task generation module includes: An information integration unit, configured to obtain template file content from a preset template repository based on the target template file information, and integrate the template file content with the image metadata information to obtain target resource file content; The task generation unit is used to generate a target resource file based on the target resource file content and the image metadata information, and generate a task to be run based on the target resource file and the configuration information, and then store the task to be run in a preset task pool.

9. An electronic device, characterized in that: include: Memory, used to store computer programs; A processor, configured to execute the computer program to implement the steps of the containerized system update method according to any one of claims 1 to 6.

10. A computer-readable storage medium, characterized in that Used to store a computer program, wherein when the computer program is executed by a processor, the steps of the containerized system update method according to any one of claims 1 to 6 are implemented.

Citation Information

Patent Citations

  • Container mirror image deployment method and device

    CN116257323A

  • Software system automatic deployment system, method and device supporting incremental deployment and storage medium

    CN117149216A