Container mirror image acceleration method and device, electronic equipment, chip, storage medium and computer program product

Through the automated container mirror acceleration method, the problem of users needing to manually install and configure the mirror acceleration client in the prior art is solved, and efficient mirror acceleration conversion is achieved, reducing user workload and accelerating application release time.

CN120045278APending Publication Date: 2025-05-27CHINA MOBILE (SUZHOU) SOFTWARE TECH CO LTD +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510025465.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-01-06
Publication Date
2025-05-27

AI Technical Summary

Technical Problem

The prior art requires the user to manually install the mirror acceleration client and program during container image acceleration, which increases the user's workload and low conversion efficiency.

Method used

Provide a container image acceleration method, which automatically converts the source image into an acceleration image by receiving or generating a mirror acceleration task, and pushes it to the mirror warehouse to realize the automatic acceleration conversion of the container image format.

Benefits of technology

It realizes automatic acceleration of container image format, improves conversion efficiency, reduces user workload, and effectively accelerates application release time when the mirror is large or the cluster is large.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120045278A_ABST
    Figure CN120045278A_ABST
Patent Text Reader

Abstract

The embodiment of the invention provides a container mirror image acceleration method, a container mirror image acceleration device, electronic equipment, a chip, a storage medium and a computer program product. The method comprises the following steps: receiving a mirror image acceleration task; and / or acquiring a mirror image event of a mirror image warehouse, and generating a mirror image acceleration task according to the mirror image event; the mirror image event at least represents that a new mirror image is deployed in the mirror image warehouse; according to the mirror image acceleration task, converting a source mirror image into an acceleration mirror image; the acceleration mirror image is a mirror image in an acceleration format; and pushing the acceleration mirror image to the mirror image warehouse.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of the present application relate to the technical field of container networks, and particularly to a container image acceleration method, a container image acceleration device, an electronic device, a chip, a storage medium, and a computer program product. Background Art

[0002] In order to accelerate the reading of images, images in an accelerated format are stored in the image repository, such as the nydus image acceleration technology. However, this solution requires users to first package ordinary container images and push them to the image repository, and also requires users to prepare a client machine for image acceleration and install an image acceleration program on the machine. Every time an application is released, users have to manually install the image acceleration client and perform image acceleration to complete the format conversion of the accelerated image, which will increase the workload of users and the conversion efficiency is low. Summary of the Invention

[0003] The embodiments of the present application provide a container image acceleration method, a container image acceleration device, an electronic device, a chip, a storage medium, and a computer program product.

[0004] The container image acceleration method provided by the embodiments of the present application includes:

[0005] Receiving an image acceleration task; and / or, obtaining an image event of an image repository, and generating an image acceleration task according to the image event; the image event at least indicates that a new image is deployed in the image repository;

[0006] Converting a source image into an accelerated image according to the image acceleration task; the accelerated image is an image in an accelerated format;

[0007] Pushing the accelerated image to the image repository.

[0008] The container image acceleration device provided by the embodiments of the present application includes:

[0009] An accelerated image conversion module: configured to receive an image acceleration task; and / or, obtain an image event of an image repository, and generate an image acceleration task according to the image event; the image event at least indicates that a new image is deployed in the image repository; converting a source image into an accelerated image according to the image acceleration task; the accelerated image is an image in an accelerated format; pushing the accelerated image to the image repository.

[0010] The electronic device provided by the embodiments of the present application includes: a processor and a memory, the memory is used to store a computer program, and the processor is used to call and run the computer program stored in the memory to execute any container image acceleration method provided by the embodiments of the present application.

[0011] The chip provided by the embodiment of the present application includes: a processor, configured to call and run a computer program from a memory, so that a device installed with the chip executes any container image acceleration method provided by the embodiment of the present application.

[0012] The storage medium provided by the embodiment of the present application is used to store a computer program, and the computer program enables a computer to execute any container image acceleration method provided by the embodiment of the present application.

[0013] The computer program product provided by the embodiment of the present application includes a computer program, and the computer program implements any container image acceleration method provided by the embodiment of the present application when executed by a processor.

[0014] Through the container image acceleration method provided by the embodiment of the present application, two ways to obtain image acceleration tasks are provided. One is that the user directly issues an image acceleration task, and the other is to generate an acceleration task according to the image event of the image repository. According to the acceleration task, the source image is converted into an accelerated image, which can realize the automatic acceleration conversion of the container image format, improve the conversion efficiency and reduce the workload of users. BRIEF DESCRIPTION OF THE DRAWINGS

[0015] The drawings described herein are used to provide a further understanding of the present application, and constitute a part of the present application. The illustrative embodiments and descriptions of the present application are used to explain the present application, and do not constitute an improper limitation to the present application. In the drawings:

[0016] Figure 1 It is a schematic diagram of the architecture of the acceleration service in the related art;

[0017] Figure 2 It is a schematic diagram of the implementation process of the nydus image acceleration method provided by the embodiment of the present application;

[0018] Figure 3 It is a schematic diagram of the implementation process of the container image acceleration method provided by the embodiment of the present application Figure 1 ;

[0019] Figure 4 It is a schematic diagram of the process of image acceleration conversion provided by the embodiment of the present application;

[0020] Figure 5 It is a schematic diagram of the application acceleration deployment process provided by the embodiment of the present application;

[0021] Figure 6 It is a schematic diagram of the structure of the container image acceleration device provided by the embodiment of the present application;

[0022] Figure 7 It is a schematic diagram of the implementation process of the container image acceleration method provided by the embodiment of the present application Figure 2 ;

[0023] Figure 8 Schematic structural diagram of the electronic device provided by the embodiment of the present application;

[0024] Figure 9 Schematic structural diagram of the chip provided by the embodiment of the present application. Detailed implementation manners

[0025] Next, the technical solutions in the embodiments of the present application will be described with reference to the accompanying drawings in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, rather than all the embodiments. All other embodiments obtained by those of ordinary skill in the art based on the embodiments of the present application without creative efforts shall fall within the protection scope of the present application.

[0026] It should be noted that in the embodiments of the present application, the term "and / or" only describes the association relationship of associated objects and indicates that there can be three relationships. For example, A and / or B can represent: A exists alone, A and B exist simultaneously, and B exists alone. In addition, in the embodiments of the present application, the character " / " generally represents an "or" relationship between the front and rear associated objects.

[0027] In the description of the embodiments of the present application, the term "corresponding" may represent a direct or indirect corresponding relationship between two parties, may also represent an association relationship between two parties, or may be a relationship such as indication and being indicated, configuration and being configured, etc.

[0028] To facilitate the understanding of the technical solutions of the embodiments of the present application, the related technologies of the embodiments of the present application are described below. The following related technologies can be arbitrarily combined with the technical solutions of the embodiments of the present application as optional solutions, and they all fall within the protection scope of the embodiments of the present application.

[0029] Currently, when deploying an impact in a kubernetes container cluster, the application node first needs to pull the image from the image repository before it can be deployed. Currently, container images use the Open Container Initiative (OCI) specification for image layering. Although it effectively realizes the layered reading and writing and fast distribution of images, when deploying an application, according to the OCI specification, all the image layer files need to be completely pulled and merged into a complete image before it can be deployed. This method has the following performance problems. First, when the image volume is very large, it usually takes a long time to completely pull down the image, seriously increasing the time loss of application release. In addition, when deploying an application in a large-scale cluster, due to the excessive pressure on the central image repository, the load of the image repository increases, the throughput decreases, and the image pulling time will increase, further reducing the efficiency of application release.

[0030] To solve these problems, some mirror acceleration methods have been proposed in the related technologies, such as the mirror acceleration method based on Nydus. Its technical architecture is as Figure 1 shown, Figure 1 This is the schematic diagram of the architecture of the acceleration service in the related technologies provided by the embodiments of the present application. It is the process of converting OCI v1 Image to Nydus Image. The OCI v1 Image contains three layers, and each layer is a tar.gz file. The first layer contains files a and wd. The second layer contains files b and bc. The third layer contains files c and dp. Each layer of the Nydus Image is decomposed into multiple BLOBs. The tar.gz file of the first layer is decomposed into two BLOBs. The tar.gz file of the second layer is decomposed into two BLOBs. The tar.gz file of the third layer is decomposed into two BLOBs. The META component records the organizational structure and dependencies of these BLOBs. The application can be deployed by loading the mirror on demand. The main implementation method is to customize a new mirror storage format RAFS v6 to store the mirror layer data more compactly and efficiently. And through the Chunking technology, the mirror is cut into smaller data blocks to achieve the on-demand loading ability, so that the application only loads the parts needed in the container mirror during runtime, rather than loading the entire mirror at once in the traditional way. This can greatly reduce the startup time, reduce the storage occupancy, and manage the mirror content more flexibly.

[0031] Refer to Figure 2 , Figure 2 This is the schematic diagram of the implementation process of the Nydus mirror acceleration method provided by the embodiments of the present application. As Figure 2 shown, taking the nginx:v1 mirror as an example, its acceleration configuration process is as follows:

[0032] Step 201: Push the original mirror.

[0033] First, the user needs to package the ordinary container mirror nginx:v1 and push it to the mirror repository as the original mirror for acceleration.

[0034] Step 202: Push the mirror with acceleration.

[0035] The user needs to prepare a client machine for mirror acceleration, install the Nydus mirror acceleration program on the machine, and use the nydusify convert command of the mirror acceleration program to perform mirror conversion. The converted mirror nginx:v1-nydus will be pushed to the mirror repository.

[0036] Step 203: Configure the mirror acceleration node.

[0037] In the target Kubernetes cluster, the user needs to select the target deployment nodes in advance, install the Nydus server program nydus-snapshotter on the target nodes, create a Nydus configuration file, and start the Nydus server in the background. The user needs to modify the containerd configuration of the target nodes to add support for the Nydus image format and restart the target nodes.

[0038] Step 204: Application deployment.

[0039] When the user deploys an application, they need to select the nginx:v1-nydus accelerated image and, through the label selector, manually schedule the application to be deployed on the nodes where the Nydus acceleration server has been installed.

[0040] The above solution greatly increases the implementation complexity of image acceleration and has two technical problems:

[0041] (1) Every time an application is released, the user has to manually install the image acceleration client, perform image acceleration, and complete the format conversion of the accelerated image.

[0042] (2) If it is necessary to expand the image acceleration nodes in the Kubernetes cluster, the user also has to repeatedly manually deploy the Nydus server program and adjust the node configuration. Moreover, when an application is released, the user needs to select the accelerated image and the image acceleration nodes for manual scheduling.

[0043] Figure 3 Schematic of the implementation process of the container image acceleration method provided by the embodiment of the present application Figure 1 , as Figure 3 shown, the embodiment of the present application provides a container image acceleration method, and the method includes the following steps:

[0044] Step 301: Receive an image acceleration task; and / or, obtain an image event of an image repository, and generate an image acceleration task according to the image event; the image event at least represents that a new image is deployed in the image repository.

[0045] In the embodiment of the present application, an interface can be designed for the user to call, and the user can directly call this interface to issue an image acceleration task. Exemplarily, the interface can be a Representational State Transfer Application Programming Interface (REST API). In actual applications, other forms of interfaces can also be used, and the embodiment of the present application does not limit this.

[0046] In the embodiments of the present application, it is also possible to obtain mirror events of the mirror repository, and generate mirror acceleration tasks according to the mirror events. Exemplarily, by docking with the mirror repository message notification system of the mirror repository, when there is a mirror event in the mirror repository, the mirror events of the mirror repository are obtained through the mirror repository message notification system. Exemplarily, by adding a notification to the configuration file to configure the event notification of the registry repository, the mirror repository can automatically push mirror events; it is also possible to finely configure the event notification of an integrated mirror repository such as Harbor through the user interface (UI).

[0047] In the embodiments of the present application, the mirror event at least indicates that a new mirror is deployed in the mirror repository, and the mirror event may specifically be a push event.

[0048] In the embodiments of the present application, when a user deploys a mirror that needs to be accelerated in the mirror repository, a push event can be immediately obtained from the mirror repository, and a mirror acceleration task is generated.

[0049] In the embodiments of the present application, the parameters of the mirror acceleration task include: mirror repository authentication information, the address of the mirror repository that needs to be accelerated, the name of the source mirror, and the name of the accelerated mirror.

[0050] Step 302: Convert the source mirror into an accelerated mirror according to the mirror acceleration task; the accelerated mirror is a mirror in an accelerated format.

[0051] In the embodiments of the present application, the execution of the mirror acceleration task can adopt an asynchronous batch conversion mechanism. By setting up a task queue, whenever there is a new mirror acceleration task, the mirror acceleration task will be added to the task queue, and the accelerated mirror conversion will be performed by concurrently reading the mirror acceleration tasks.

[0052] In the embodiments of the present application, the types of accelerated formats include the nydus mirror format, the estargz mirror format, etc.; in actual applications, the types of accelerated formats may also include other accelerated formats, and the embodiments of the present application do not limit this.

[0053] In the embodiments of the present application, the name of the source mirror and the name of the accelerated mirror are parsed from the mirror acceleration task. By calling the relevant containerd APIs, each mirror layer of the source mirror is pulled from the mirror repository where the source mirror is located, and then each mirror layer of the source mirror is converted into an accelerated mirror format.

[0054] Based on this, in an alternative embodiment of the present application, the converting the source mirror into an accelerated mirror according to the mirror acceleration task includes:

[0055] Determine the name of the source mirror and the name of the accelerated mirror according to the mirror acceleration task;

[0056] Pull all the image layers of the source image from the image repository;

[0057] Convert the source image into the accelerated image according to all the image layers of the source image.

[0058] Exemplarily, taking the accelerated format as the nydus image format, the source image can be converted into the nydus image format of RAFS v6 by integrating the built-in image conversion ability of the nydus convert related sdk.

[0059] Step 303: Push the accelerated image to the image repository.

[0060] In the embodiment of the present application, after the image acceleration is completed, the generated accelerated image is pushed to the image repository to automatically complete the conversion of the image acceleration format.

[0061] Exemplarily, taking the accelerated format as the nydus image format, refer to Figure 4 , Figure 4 which is the schematic flow diagram of the image acceleration conversion provided by the embodiment of the present application. As Figure 4 shown, by monitoring the image events in the image repository through webhook, when the push event of the image nginx:v1 is monitored, an image acceleration task is generated and added to the asynchronous queue. The source image name: nginx:v1 and the accelerated image name: nginx:v1-nydus are parsed from the image acceleration task. The source image is obtained from the image repository, converted into the accelerated image, and the accelerated image is pushed to the image repository.

[0062] The container image acceleration method provided by the embodiment of the present application can also manage the image acceleration nodes, monitor each node in the cluster, deploy the image acceleration program for the image acceleration nodes, and uninstall the image acceleration program for the ordinary nodes.

[0063] Based on this, in an alternative embodiment of the present application, the method further includes: if it is detected that the first node is an image acceleration node, deploy the image acceleration program on the first node; and / or,

[0064] if it is detected that the second node is an ordinary node, detect whether the second node deploys the image acceleration program; if the second node deploys the image acceleration program, uninstall the image acceleration program deployed on the second node.

[0065] In the embodiment of the present application, the first node and the second node are nodes in the cluster.

[0066] In the embodiment of the present application, in order to ensure that the image acceleration program deployed on the image acceleration node works normally and is not affected, the image acceleration file in the node can be cleared before the image acceleration program is deployed.

[0067] Based on this, in an optional implementation manner of the present application, before the first node deploys the image acceleration program, the method further includes:

[0068] Clear the image acceleration file saved in the first node.

[0069] In the embodiment of the present application, the image acceleration node can be labeled with an acceleration label. For example, the acceleration label can be image-accelerate = true. When the node has an acceleration label, the node is an image acceleration node. When the node does not have an acceleration label, the node is a common node.

[0070] Based on this, in an optional implementation manner of the present application, the method further includes: if it is detected that the first node has an acceleration label, then the first node is characterized as a mirror acceleration node; and / or,

[0071] If it is detected that the second node does not have an acceleration label, it indicates that the second node is a common node.

[0072] In the embodiment of the present application, when the acceleration label is detected on a node, a job task can be scheduled on the node. The task is deployed to the image acceleration node in a containerized manner, and the key directory of the host is mounted for acceleration detection. It is monitored whether the image acceleration program has been deployed on the node. If the image acceleration program is not deployed on the node, the image acceleration program is installed on the node. When the acceleration label is removed for a node, a job task is also scheduled on the node to automatically uninstall the image acceleration program of the node.

[0073] In the embodiment of the present application, taking the acceleration format as the nydus image format as an example, the image acceleration program is nydus-snapshotter.

[0074] In an embodiment of the present application, when a user initiates a request to deploy an application to a cluster, the request can be intercepted through a webhook to monitor whether the request carries an acceleration tag. If it carries an acceleration tag, it indicates that the application deployment request is an application acceleration deployment request. If it does not carry an acceleration tag, it indicates that the application deployment request is not an application acceleration deployment request. If an acceleration tag is detected, the accelerated image corresponding to the application is obtained from the image repository, and the accelerated image is deployed on the image acceleration node.

[0075] Based on this, in an alternative embodiment of the present application, the method further includes: obtaining a first deployment request; the first deployment request is a request for a user to deploy an application in a cluster;

[0076] If the first deployment request includes an acceleration flag, replace the source image of the application with an accelerated image, and deploy the accelerated image on an image acceleration node.

[0077] In an embodiment of the present application, the acceleration flag can be added to the annotation.

[0078] In an embodiment of the present application, after the application is deployed on the image acceleration node, the application can be quickly started in a mode of loading images on demand.

[0079] In an embodiment of the present application, it is also possible to determine whether there is an accelerated image version corresponding to the source image of the application in the image repository. If not, the corresponding accelerated image version can be generated in advance and pushed to the image repository.

[0080] Based on this, in an alternative embodiment of the present application, before replacing the source image of the application with an accelerated image, it further includes:

[0081] Determine whether there is an accelerated image version corresponding to the source image of the application in the image repository. If not, convert the source image of the application into a corresponding accelerated image version and push it to the image repository.

[0082] In an embodiment of the present application, taking the cluster as a k8s cluster and the acceleration format as the nydus image format as an example, the container image acceleration method of the present application is further described. Refer to Figure 5 , Figure 5 is a schematic diagram of the application acceleration deployment process provided by an embodiment of the present application. As shown in Figure 5 , by deploying a controller in the target cluster, notifying it to perform list-watch on the cluster resource node, monitoring events of all nodes and tuning tasks for corresponding acceleration events, performing background automatic deployment and uninstallation of the image acceleration program nydus-snapshotter for the node. In a normally running k8s cluster, there are multiple node nodes, such as node1, node2, etc. To use the image acceleration ability, it is necessary to install the image acceleration server program on the node. Taking the acceleration of node1 as an example, the node can be configured for image acceleration through the following command:

[0083] kubectl label node node1 image-accelerate=true.

[0084] The controller performs list-watch on nodes through the runtime-controller. When it watches that an update event occurs on node1, detects that its label has changed and the image-accelerator=true label is added, it determines that the node is marked as an image acceleration node. By calling the k8s cluster interface, a job task is created. This task is forcibly scheduled to run on node1, and the host root directory and / run directory are mounted into the container to facilitate the control of the host configuration and services within the container. In addition, in the embodiment of this application, the control program for deploying the acceleration service is provided through the container image accelerate-install:v1. The job task can be started through this image when it starts, to achieve automatic installation of the image acceleration program on the node.

[0085] The specific implementation method of the accelerate-install image is as follows: First, detect whether the image acceleration program is already running on the node. By checking the / usr / lib / systemd / system / nydus.service file, if the nydus service file exists, stop the nydus service through the built-in service control program. The instruction is as follows: go-systemctl stop nydus.service. After uninstalling the image acceleration program, immediately clean up the relevant acceleration components. If the image acceleration program has not been installed on this node, the installation process of the image acceleration program is carried out. Copy the prefabricated image acceleration program server files in the image to the specified directory / host / usr / bin / in the container, which is equivalent to copying to the / usr / bin / directory on the host. The installed programs include containerd-nydus-grpc, ctr-remote, nydusctl, nydusd, nydus_graphdriver, nydusify, nydus-image, nydus-overlayfs.

[0086] At the same time, the nydus service can be started on the host node through the system service method. For example, copy the prefabricated nydus.service service file to the / usr / lib / systemd / system directory on the host. The content of this file is shown in Table 1:

[0087]

[0088] Table 1

[0089] Call the host system service in the container, and start the nydus-server service on node1. The start command is as follows: go-systemctl restart nydus.service; When the image acceleration service on node1 starts successfully, the accelerate-install program will continue to configure the containerd service on the host node, and configure the node container runtime to use the nydys-snapshotter installed on this node. Update the configuration patch to the containerd configuration file of the node through the patch patch file shown in Table 2, and reload the containerd application to make the node switch to use nydus for image acceleration.

[0090]

[0091] Table 2

[0092] The image acceleration server program on node1 has completed the automated installation and configuration, and is incorporated into the controller for use as an image acceleration node pool.

[0093] Users can deploy applications through accelerated images. The user application deployment process does not need to be modified. Only need to mark in the original deployment file that the application uses image acceleration, that is, mark that the application needs to use an accelerated image through annotations, such as annotations:image-accelerate = true.

[0094] When the user initiates an application deployment, the webhook in the controller will intercept the deployment request. Through the verification of the application, it is detected that the application is configured with image acceleration, and it will call the relevant image repository interface to check whether there is an accelerated image nginx:v1-nydus for the nginx:v1 image. Once the accelerated image is retrieved, it will automatically modify the image configuration in the application deployment image to nginx:v1-nydus without the user having to manually specify the accelerated image. In addition, through the node affinity function, the application will be scheduled to be deployed on the node that has joined the image acceleration node pool as described above, that is, nodeselect will be added to schedule the pod to node1. Thus, the automated scheduling and deployment of the image acceleration application are completed.

[0095] Through the container image acceleration method provided by the embodiments of the present application, the nydus acceleration service is integrated to achieve automatic acceleration conversion of the container image format, automatically manage the k8s cluster nodes and complete the accelerated installation of the nodes. During the application deployment process, the application deployment request is automatically intercepted to complete the conversion of the application acceleration image and the node scheduling of the acceleration task. The whole process can greatly improve the acceleration deployment efficiency of the container image and reduce the complexity of manual operations by users. It can effectively speed up the application release time when the image is large or the cluster scale is large.

[0096] Embodiments of the present application also provide a container image acceleration device. Refer to Figure 6 , Figure 6 which is a schematic structural diagram of the container image acceleration device provided by the embodiments of the present application. The container image acceleration device in this embodiment includes:

[0097] Accelerated image conversion module: used to receive the image acceleration task; and / or, obtain the image events in the image repository, generate an image acceleration task according to the image events; the image events at least indicate that a new image is deployed in the image repository; convert the source image into an accelerated image according to the image acceleration task; the accelerated image is an image in an accelerated format; push the accelerated image to the image repository.

[0098] In the embodiments of the present application, the accelerated image conversion module: is used to determine the source image name and the accelerated image name according to the image acceleration task; pull all the image layers of the source image from the image repository; convert the source image into the accelerated image according to all the image layers of the source image.

[0099] In the embodiments of the present application, the container image acceleration device further includes: a controller; the controller is used to deploy an image acceleration program on the first node if it is monitored that the first node is an image acceleration node; and / or, if it is monitored that the second node is a normal node, detect whether the second node deploys an image acceleration program; if the second node deploys an image acceleration program, uninstall the image acceleration program deployed on the second node.

[0100] In the embodiments of the present application, the controller: is used to clear the image acceleration files saved in the first node before deploying the image acceleration program on the first node.

[0101] In the embodiments of the present application, the controller: is used to indicate that the first node is an image acceleration node if it is monitored that the first node has an acceleration label; and / or, indicate that the second node is a normal node if it is monitored that the second node does not have an acceleration label.

[0102] In an embodiment of the present application, the controller is used to obtain a first deployment request; the first deployment request is a request from a user to deploy an application in a cluster; if the first deployment request includes an acceleration mark, the source image of the application is replaced with an accelerated image, and the accelerated image is deployed on a mirror acceleration node.

[0103] In an embodiment of the present application, the controller is used to determine whether there is an accelerated image version corresponding to the source image of the application in the image warehouse before replacing the source image of the application with the accelerated image; if not, converting the source image of the application into the corresponding accelerated image version and pushing it to the image warehouse.

[0104] Those skilled in the art should understand that Figure 6 The implementation functions of each unit in the container image acceleration device shown can be understood by referring to the relevant description of the aforementioned method. Figure 6 The functions of each unit in the container image acceleration device shown can be implemented by a program running on a processor, or by a specific logic circuit.

[0105] refer to Figure 7 , Figure 7 Schematic diagram of the implementation process of the container image acceleration method provided in the embodiment of the present application Figure 2 ,like Figure 7 As shown, when the user needs to publish an application, the source image is pushed to the image warehouse, the container image acceleration device is connected to the image warehouse, the image warehouse sends the push event to the container image acceleration device, the container image acceleration device generates an image acceleration task according to the push event, converts the source image into an accelerated image, and pushes the accelerated image to the image warehouse. The container image acceleration device monitors the nodes in the cluster and deploys the image acceleration program for the image acceleration node. The user initiates an application deployment request to the cluster, the automatic acceleration device intercepts the request, identifies the acceleration tag, automatically switches to the accelerated image, schedules the accelerated image to the image acceleration node, and completes the application deployment.

[0106] Figure 8 It is a schematic structural diagram of an electronic device 800 provided in an embodiment of the present application. Figure 8 The electronic device 800 shown includes a processor 810, which can call and run a computer program from a memory to implement the method in the embodiment of the present application.

[0107] Alternatively, if Figure 8 As shown, the electronic device 800 may further include a memory 820. The processor 810 may call and run a computer program from the memory 820 to implement the method in the embodiment of the present application.

[0108] Among them, the memory 820 can be a separate device independent of the processor 810, or can be integrated in the processor 810.

[0109] Optionally, as Figure 8 shown, the electronic device 800 may further include a transceiver 830. The processor 810 can control the transceiver 830 to communicate with other devices. Specifically, it can send information or data to other devices, or receive information or data sent by other devices.

[0110] Among them, the transceiver 830 can include a transmitter and a receiver. The transceiver 830 may further include an antenna, and the number of antennas can be one or more.

[0111] Specifically, the electronic device 800 can be the container image acceleration device of the embodiment of the present application, and the electronic device 800 can implement the corresponding processes implemented by the container image acceleration device in each method of the embodiment of the present application. For the sake of brevity, it will not be elaborated here.

[0112] Exemplarily, the embodiment of the present application further provides a computer program product, including a computer program, which can be executed by the processor 810 of the communication device 800 to complete the steps of any of the foregoing methods.

[0113] Figure 9 is a schematic structural diagram of the chip of the embodiment of the present application. Figure 9 The shown chip 900 includes a processor 910. The processor 910 can call and run a computer program from the memory to implement the method in the embodiment of the present application.

[0114] Optionally, as Figure 9 shown, the chip 900 may further include a memory 920. Among them, the processor 910 can call and run a computer program from the memory 920 to implement the method in the embodiment of the present application.

[0115] Among them, the memory 920 can be a separate device independent of the processor 910, or can be integrated in the processor 910.

[0116] Optionally, the chip 900 may further include an input interface 930. Among them, the processor 910 can control the input interface 930 to communicate with other devices or chips. Specifically, it can obtain information or data sent by other devices or chips.

[0117] Optionally, the chip 900 may further include an output interface 940. Among them, the processor 910 can control the output interface 940 to communicate with other devices or chips. Specifically, it can output information or data to other devices or chips.

[0118] The chip can be applied to the electronic device 800 in the embodiments of the present application, and the chip can implement the corresponding processes implemented by the electronic device 800 in the various methods of the embodiments of the present application. For the sake of brevity, it will not be elaborated here.

[0119] It should be understood that the chip mentioned in the embodiments of the present application may also be referred to as a system-on-chip, system chip, chip system, or system-on-chip, etc.

[0120] It should be understood that the processor in the embodiments of the present application may be an integrated circuit chip with signal processing capabilities. In the implementation process, the steps of the above method embodiments can be completed by the integrated logic circuit in the hardware of the processor or by instructions in software form. The above-mentioned processor may be a general-purpose processor, a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components. It can implement or execute the various methods, steps, and logic block diagrams disclosed in the embodiments of the present application. The general-purpose processor may be a microprocessor or the processor may also be any conventional processor, etc. The steps of the method disclosed in combination with the embodiments of the present application can be directly embodied as being executed and completed by the hardware decoding processor, or by a combination of the hardware and software units in the decoding processor. The software unit may be located in a mature storage medium in the art such as a random access memory, flash memory, read-only memory, programmable read-only memory, or electrically erasable programmable memory, register, etc. This storage medium is located in the memory, and the processor reads the information in the memory and combines its hardware to complete the steps of the above method.

[0121] It can be understood that the memory in the embodiments of the present application can be a volatile memory or a non-volatile memory, or can include both volatile and non-volatile memories. Among them, the non-volatile memory can be a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), or a flash memory. The volatile memory can be a random access memory (RAM), which is used as an external cache. By way of example but not limitation, many forms of RAM are available, such as static random access memory (SRAM), dynamic random access memory (DRAM), synchronous dynamic random access memory (SDRAM), double data rate synchronous dynamic random access memory (DDR SDRAM), enhanced synchronous dynamic random access memory (ESDRAM), synchlink dynamic random access memory (SLDRAM), and direct rambus random access memory (DR RAM). It should be noted that the memory of the systems and methods described herein is intended to include but not be limited to these and any other suitable types of memory.

[0122] It should be understood that the above-mentioned memory is by way of example but not limitation. For example, the memory in the embodiments of the present application can also be a static random access memory (SRAM), a dynamic random access memory (DRAM), a synchronous dynamic random access memory (SDRAM), a double data rate SDRAM (DDR SDRAM), an enhanced SDRAM (ESDRAM), a synch link DRAM (SLDRAM), and a direct rambus random access memory (DR RAM), etc. That is to say, the memory in the embodiments of the present application is intended to include but not be limited to these and any other suitable types of memory.

[0123] The embodiments of the present application also provide a storage medium for storing a computer program. The storage medium can be applied to the electronic device 800 in the embodiments of the present application, and the computer program enables the computer to execute the corresponding processes implemented by the electronic device 800 in the various methods of the embodiments of the present application. For the sake of brevity, details are not described herein again.

[0124] Those of ordinary skill in the art can realize that the units and algorithm steps of the examples described in conjunction with the embodiments disclosed herein can be implemented by electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are executed in hardware or software depends on the specific application and design constraints of the technical solution. A professional technician can use different methods to implement the described functions for each specific application, but such implementation should not be considered to exceed the scope of the present application.

[0125] Those skilled in the art can clearly understand that for the convenience and brevity of description, the specific working processes of the systems, devices, and units described above can refer to the corresponding processes in the foregoing method embodiments, and details are not described herein again.

[0126] In several embodiments provided by the present application, it should be understood that the disclosed systems, devices, and methods can be implemented in other ways. For example, the device embodiments described above are merely illustrative. For example, the division of the units is only a logical function division, and there can be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the displayed or discussed mutual coupling, direct coupling, or communication connection can be through some interfaces. The indirect coupling or communication connection of the devices or units can be in electrical, mechanical, or other forms.

[0127] The units described as separate components may or may not be physically separated. The components displayed as units may or may not be physical units, that is, they can be located in one place, or distributed to multiple network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0128] In addition, the functional units in the various embodiments of the present application can be integrated into one processing unit, or each unit can exist physically alone, or two or more units can be integrated into one unit.

[0129] When the above-mentioned functions are implemented in the form of software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or a part of this technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions for causing a computer device (which may be a personal computer, a server, or an electronic device 800, etc.) to execute all or part of the steps of the methods described in various embodiments of this application. The aforementioned storage medium includes: various media such as USB flash drives, mobile hard disks, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical discs that can store program codes.

[0130] As described above, the above is only the specific implementation manner of this application, but the protection scope of this application is not limited thereto. Any person skilled in the art within the technical scope disclosed by this application can easily think of changes or substitutions, which should all be covered within the protection scope of this application. Therefore, the protection scope of this application should be subject to the protection scope of the claims.

Claims

1. A container image acceleration method, characterized in that: include: Receive image acceleration tasks; And / or, obtaining an image event of an image repository, and generating an image acceleration task according to the image event; The image event at least indicates that a new image is deployed in the image repository; According to the image acceleration task, converting the source image into an accelerated image; The accelerated image is an image in an accelerated format; Push the accelerated image to the image warehouse.

2. The method according to claim 1, characterized in that The converting the source image into the accelerated image according to the image acceleration task includes: According to the image acceleration task, determine the source image name and the acceleration image name; Pull all image layers of the source image from the image repository; According to all image layers of the source image, the source image is converted into the accelerated image.

3. The method according to claim 1, characterized in that Also includes: If it is detected that the first node is a mirror acceleration node, deploying a mirror acceleration program on the first node; and / or, If it is detected that the second node is a common node, it is detected whether the second node is deployed with an image acceleration program; if the second node is deployed with an image acceleration program, the image acceleration program deployed with the second node is uninstalled.

4. The method according to claim 3, characterized in that Before deploying the image acceleration program on the first node, the method further includes: Clear the image acceleration file saved in the first node.

5. The method according to claim 3, characterized in that: Also includes: If it is detected that the first node has an acceleration label, it indicates that the first node is a mirror acceleration node; and / or, If it is detected that the second node does not have an acceleration label, it indicates that the second node is a common node.

6. The method according to any one of claims 1 to 5, characterized in that Also includes: Get the first deployment request; The first deployment request is a request from a user to deploy an application in a cluster; If the first deployment request includes an acceleration mark, the source image of the application is replaced with an acceleration image, and the acceleration image is deployed on the image acceleration node.

7. The method according to claim 6, characterized in that Before replacing the source image of the application with the accelerated image, the method further includes: It is determined whether there is an accelerated image version corresponding to the source image of the application in the image warehouse. If not, the source image of the application is converted into the corresponding accelerated image version and pushed to the image warehouse.

8. A container image acceleration device, characterized in that: include: Accelerated image conversion module: used to receive image acceleration tasks; And / or, obtaining an image event of an image repository, and generating an image acceleration task according to the image event; The image event at least indicates that a new image is deployed in the image warehouse; according to the image acceleration task, the source image is converted into an accelerated image; The accelerated image is an image in an accelerated format; the accelerated image is pushed to the image warehouse.

9. An electronic device, characterized in that: include: A processor and a memory, the memory being used to store a computer program, the processor being used to call and run the computer program stored in the memory, and executing the container image acceleration method according to any one of claims 1 to 7.

10. A chip, characterized in that: include: A processor, configured to call and run a computer program from a memory, so that a device equipped with the chip executes the container image acceleration method according to any one of claims 1 to 7.

11. A storage medium, characterized in that: Used to store a computer program, wherein the computer program enables a computer to execute the container image acceleration method according to any one of claims 1 to 7.

12. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the computer program implements the container image acceleration method according to any one of claims 1 to 7.