Container image acquisition method and device, chip, network interface card, equipment, medium and program product
By establishing a high-speed communication interface between the host side and the DPU side, and using a cloud disk overlay file system to mount the DPU side image cache directory, the problem of low container image retrieval efficiency is solved, and more efficient image acquisition is achieved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- SHENZHEN JAGUAR MICROSYSTEMS CO LTD
- Filing Date
- 2025-12-11
- Publication Date
- 2026-04-28
AI Technical Summary
In existing technologies, the efficiency of pulling container images is low because each time an image needs to be pulled, it needs to be downloaded from a remote image repository, resulting in extremely low efficiency.
By establishing a high-speed communication interface, such as PCIe/CXL, between the host side and the DPU side, the image cache directory on the DPU side is mounted using a cloud disk overlaid with a file system. The system can detect whether the image is already stored in the DPU side cache and generate a container in the cache. If the image is not cached, it can be obtained from a remote image repository.
It significantly improves the efficiency of pulling container images. By using high-speed interfaces and cloud disks overlaid with file systems, it reduces direct downloads from remote repositories and increases the speed of obtaining local images.
Smart Images

Figure CN121277611B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of network technology, and in particular to a container image acquisition method, apparatus, chip, network interface card, device, medium and program product. Background Technology
[0002] Pulling container images primarily relies on standard remote image repositories, such as Docker Hub and Quay.io (a commonly used repository for Podman). When starting a container, the front-end server (front-end host) needs to download the required container image from these remote repositories over the network and store it in a local cache directory. To meet specific needs, many enterprises or individuals set up private image repositories for internal or public use.
[0003] However, since there may be no cached image locally, the image must be pulled from a remote image repository every time it is pulled, resulting in extremely low pulling efficiency. Summary of the Invention
[0004] Therefore, it is necessary to provide a container image acquisition method, device, chip, network interface card, equipment, media, and program product that can improve the efficiency of pulling, in order to address the above-mentioned technical problems.
[0005] Firstly, this application provides a method for obtaining a container image, applied on the host side, the method comprising:
[0006] The system detects whether the target container image to be acquired has been stored in the image cache directory on the DPU side. The host side communicates with the DPU side through the target interface, and the host side mounts the image cache directory on the DPU side in the form of a cloud disk overlaid with a file system.
[0007] If the target container image to be acquired is already stored in the image cache directory on the DPU side, the container is generated using the image stored in the image cache directory on the DPU side.
[0008] In one embodiment, the method further includes:
[0009] If the target container image to be obtained is not stored in the image cache directory on the DPU side, the target container image is obtained from the remote image repository.
[0010] In one embodiment, before detecting whether the target container image to be acquired is already stored in the image cache directory on the DPU side, the following steps are included:
[0011] Check whether the target container image to be acquired has been stored in the local image cache directory on the host side;
[0012] If the target container image is already stored in the local image cache directory on the host side, the container is generated using the image stored in the local image cache directory on the host side.
[0013] If the target container image is not stored in the local image cache directory on the host side, the step of detecting whether the target container image to be obtained is stored in the image cache directory on the DPU side continues.
[0014] In one embodiment, the method further includes:
[0015] Receive first pod configuration information, the first pod configuration information includes at least one container, and the pod configuration information is deployed on the DPU side of the K8S control plane and sent to the K8S scheduler, so that the K8S scheduler determines the host side and sends the first pod configuration information to the host side;
[0016] The target container image to be obtained is determined based on the configuration information of the first pod.
[0017] Secondly, this application also provides a container image acquisition method, applied to the DPU side, the method comprising:
[0018] Obtain container configuration information;
[0019] Check whether the target container image corresponding to the container configuration information has been cached;
[0020] If the image corresponding to the container configuration information is not cached, the target container image is obtained from a remote image repository. The DPU side communicates with the host side through a target interface, and the host side mounts the image cache directory of the DPU side in the form of a cloud disk overlaid with a file system, so as to generate a container based on the image stored in the image cache directory of the DPU side.
[0021] In one embodiment, the method further includes:
[0022] The prediction identifies hot container images and container images that need to be cleaned up.
[0023] Based on the hot container image and the container image to be cleaned, the container configuration information, and the cache storage space occupancy rate, it is determined whether to pull the hot container image or whether to remove the stored container image to be cleaned from the cache storage space, wherein the cache storage space is the storage space used to store the image cache directory on the DPU side.
[0024] If it is determined that the hot container image will be pulled, the hot container image will be obtained from the remote image repository and stored in the image cache directory on the DPU side;
[0025] If it is determined that a stored container image to be cleaned will be removed from the cache storage space, the container image to be cleaned will be deleted from the image cache directory on the DPU side.
[0026] In one embodiment, the prediction of hot container images and container images to be cleaned includes:
[0027] Retrieve stored pull records from the pull record database and cache hit records from the cache hit record database; based on the pull records and cache hit records, predict and obtain hot container images and container images to be cleaned; or
[0028] Receive the pull records returned by the remote image repository; predict the hot container images and container images to be cleaned based on the pull records.
[0029] In one embodiment, the method further includes:
[0030] Determine the size of each of the aforementioned hotspot container images;
[0031] If the sum of the sizes of the hot container images and the sizes of the container images already cached in the image cache directory on the DPU side is greater than the target cache size, the size of the cache storage space corresponding to the image cache directory on the DPU side shall be increased.
[0032] In one embodiment, the container configuration information includes cache container images generated based on homogeneous tasks involved in the host cluster;
[0033] The method further includes:
[0034] Based on the container configuration information, increase the cache weight corresponding to the cache container image;
[0035] The step of determining whether to remove the stored container image to be cleaned from the cache storage space includes:
[0036] Based on the weight of the container image to be cleaned stored in the cache storage space, it is determined whether to remove the container image to be cleaned.
[0037] In one embodiment, obtaining the container configuration information includes:
[0038] Receive the configuration information of the second pod from the K8S control plane. The configuration information of the second pod includes at least one container.
[0039] The container configuration information is obtained based on the second pod configuration information.
[0040] Thirdly, this application also provides a container image acquisition device, applied on the host side, the device comprising:
[0041] The first detection module is used to detect whether the target container image to be acquired has been stored in the image cache directory on the DPU side. The host side communicates with the DPU side through the target interface, and the host side mounts the image cache directory on the DPU side in the form of a cloud disk overlaid with a file system.
[0042] The container generation module is used to generate a container from the image stored in the image cache directory on the DPU side, when the target container image to be obtained is already stored in the image cache directory on the DPU side.
[0043] Fourthly, this application also provides a container image acquisition device, applied to the DPU side, the device comprising:
[0044] The configuration information acquisition module is used to obtain container configuration information;
[0045] The second detection module is used to detect whether the target container image corresponding to the container configuration information has been cached.
[0046] The pull module is used to retrieve the target container image from a remote image repository when the image corresponding to the container configuration information is not cached. The DPU side communicates with the host side through a target interface, and the host side mounts the image cache directory of the DPU side in the form of a cloud disk overlaid with a file system, so as to generate a container based on the image stored in the image cache directory of the DPU side.
[0047] Fifthly, this application also provides a chip including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the steps of the method in any of the above embodiments.
[0048] Sixthly, this application also provides a network interface card, including a chip as described in any of the above embodiments and multiple interfaces, wherein the chip processes data or communicates externally through the interfaces.
[0049] Seventhly, this application also provides a computer device including a network interface card in any of the above embodiments, the network interface card being used for processing data or external communication.
[0050] Eighthly, this application also provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of the methods in any of the above embodiments.
[0051] Ninthly, this application also provides a computer program product, including a computer program that, when executed by a processor, implements the steps of the method in any of the above embodiments.
[0052] The aforementioned container image acquisition method, apparatus, chip, network interface card, device, media, and program products detect whether the target container image to be acquired is already stored in the image cache directory on the DPU side. The host side communicates with the DPU side through a target interface, and the host side mounts the image cache directory on the DPU side in the form of a cloud disk overlaid with a file system. If the target container image to be acquired is already stored in the image cache directory on the DPU side, a container is generated from the image stored in the image cache directory on the DPU side. In this way, on the one hand, the host side and the DPU side communicate through the target interface, improving efficiency; on the other hand, the host side mounts the image cache directory on the DPU side in the form of a cloud disk overlaid with a file system, so the host side can directly use the image cache directory on the DPU side, which also improves the retrieval efficiency. Attached Figure Description
[0053] To more clearly illustrate the technical solutions in the embodiments of this application or related technologies, the drawings used in the description of the embodiments of this application or related technologies will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other related drawings can be obtained based on these drawings without creative effort.
[0054] Figure 1 This is an application environment diagram of a container image acquisition method in one embodiment;
[0055] Figure 2 This is a flowchart illustrating a method for obtaining a container image in one embodiment;
[0056] Figure 3 This is a flowchart of pulling a container image on the host side in one embodiment;
[0057] Figure 4 This is a flowchart of pulling a container image on the host side in another embodiment;
[0058] Figure 5 This is a flowchart illustrating the container image acquisition method in another embodiment;
[0059] Figure 6 This is a flowchart of dynamic caching decisions in one embodiment;
[0060] Figure 7 This is an architecture diagram of one DPU side versus multiple host side in one embodiment;
[0061] Figure 8 Here is a flowchart of a pod deployment process in the K8S control plane of one embodiment;
[0062] Figure 9 Here is a flowchart of a node pulling a container image in one embodiment;
[0063] Figure 10 This is an architecture diagram of a dynamic caching algorithm in a K8S scenario, as shown in one embodiment.
[0064] Figure 11 This is a structural block diagram of a container image acquisition device in one embodiment;
[0065] Figure 12 This is a structural block diagram of a container image acquisition device in another embodiment;
[0066] Figure 13 This is an internal structural diagram of a computer device in one embodiment. Detailed Implementation
[0067] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application.
[0068] It should be noted that the terms "first," "second," etc., used in this application may be used to describe various elements, but these elements are not limited by these terms. These terms are only used to distinguish the first element from the second element. The terms "comprising" and "having," and any variations thereof, used in this application, are intended to cover non-exclusive inclusion. The term "multiple" used in this application refers to two or more.
[0069] The container image acquisition method provided in this application embodiment can be applied to, for example, Figure 1 In the application environment shown, the host side 102 communicates with the DPU side 104 through the target interface, and the DPU side also communicates with the remote image repository 106 through the network.
[0070] The host side 102 includes various runtime software programs, each of which can obtain images from the DPU side 104 and generate containers. These runtime software programs may include Docker, Podman, Containerd, etc.
[0071] The DPU side includes a cache storage space for storing image cache directories, a dynamic caching algorithm module, and an intelligent decision-making module. The dynamic caching algorithm module is used to predict hot images and images to be cleaned. The intelligent decision-making module is used to pull hot images from the remote image repository 106 or clean up images to be cleaned that are already stored in the cache storage space based on the hot images and images to be cleaned predicted by the dynamic caching algorithm module and the occupancy rate of the cache storage space.
[0072] The target interface can be a high-speed interface such as PCIe / CXL. In this application, the host-side 102 uses the target interface to mount the DPU-side image cache via a cloud disk (Cloud Storage, an internet-based online data storage service that allows users to store files and data on remote servers instead of local computers or hard drives) overlaid with a file system. This file system can be virtiofs (a shared file system based on virtio). A driver (usually virtio-blk or nvme-tcp, etc.) simulates a remote resource (here, the cloud disk) as a block device for use by the virtual machine on the host side. The image itself is read-only. When the virtual machine starts, the system creates a writable thin layer on top of this read-only image by overlaying a file system (such as overlayfs) to record changes made during system runtime. This protects the original image while providing an independent runtime environment for each virtual machine.
[0073] In one exemplary embodiment, such as Figure 2 As shown, a method for obtaining a container image is provided, which can be applied to... Figure 1 Taking the host side as an example, the explanation includes the following steps S202 to S204. Wherein:
[0074] S202: Detect whether the target container image to be acquired has been stored in the image cache directory on the DPU side. The host side and the DPU side communicate through the target interface, and the host side mounts the image cache directory on the DPU side in the form of a cloud disk overlaid with a file system.
[0075] The host side and the DPU side communicate through a target interface, and the host side mounts the DPU side's image cache directory through a cloud disk overlaid with a file system. Specific limitations can be found above. Since the DPU side and the host side are connected via high-speed interfaces such as PCIe / CXL, the transmission speed of these interfaces is much higher than that of traditional network image retrieval, thus significantly improving the efficiency of pulling uncached container images locally on the host side.
[0076] The image cache directory on the DPU side can be the image cache directory on the DPU side in the cloud disk, and some images can be pre-cached in this image cache directory.
[0077] When the host needs to pull the target container image, the host can directly detect whether the target container image to be obtained has been stored in the image cache directory on the DPU side. This is because the host mounts the image cache directory on the DPU side in the form of a cloud disk overlaid with a file system. Therefore, the host can detect the image cache directory on the DPU side in the same way as it detects the local image cache directory.
[0078] One point to note is that detecting whether the target container image to be acquired is already stored in the image cache directory on the DPU side can be done by checking whether the file identifier corresponding to the target container image is in the image cache directory on the DPU side, or by using other content that can uniquely identify the target container image.
[0079] S204: If the target container image to be obtained is already stored in the image cache directory on the DPU side, generate the container using the image stored in the image cache directory on the DPU side.
[0080] If the target container image to be acquired is already stored in the image cache directory on the DPU side, the container is directly generated from the image stored in the image cache directory on the DPU side. Since the host side and the DPU side communicate at high speed through the target interface, this process is highly efficient. The host side directly generates a container from the image stored in the image cache directory on the DPU side for use by the runtime software.
[0081] In some other alternative embodiments, if the target container image to be acquired is not stored in the image cache directory on the DPU side, the target container image is acquired from a remote image repository.
[0082] If the target container image is not stored in the image cache directory on the DPU side, the host side pulls the target container image from the remote container image repository. After the host side pulls the image, it can store the pulled target container image on the DPU side. Alternatively, the host side can directly pull the target container image from the remote container image repository through the DPU side, and after the DPU side pulls the image, it can cache the target container image in the image cache directory on the DPU side.
[0083] The above-described container image acquisition method detects whether the target container image to be acquired is already stored in the image cache directory on the DPU side. The host side and the DPU side communicate through the target interface, and the host side mounts the image cache directory on the DPU side in the form of a cloud disk overlaid with a file system. If the target container image to be acquired is already stored in the image cache directory on the DPU side, the container is generated from the image stored in the image cache directory on the DPU side. In this way, on the one hand, the host side and the DPU side communicate through the target interface, which improves efficiency; on the other hand, the host side mounts the image cache directory on the DPU side in the form of a cloud disk overlaid with a file system, so the host side can directly use the image cache directory on the DPU side, which also improves the pull efficiency.
[0084] In some optional embodiments, before detecting whether the target container image to be acquired is already stored in the image cache directory on the DPU side, the process includes: detecting whether the target container image to be acquired is already stored in the local image cache directory on the host side; if the target container image is already stored in the local image cache directory on the host side, generating a container using the image stored in the local image cache directory on the host side; if the target container image is not stored in the local image cache directory on the host side, continuing to execute the step of detecting whether the target container image to be acquired is already stored in the image cache directory on the DPU side.
[0085] Among them, combined Figure 3 As shown, Figure 3 This is a flowchart illustrating the process of pulling a container image on the host side in one embodiment. In this embodiment, the host-side container runtime software, such as Docker, Podman, or Containerd, is configured to use a local image cache directory and also a mounted DPU-side image cache directory. The main steps of the host-side container image pulling process include: The host side pulls the target container image. The host side checks if the target container image is already cached in the local image cache directory. If it is, no pulling is required; the image in the local image cache directory is used, and the pull is complete. If it is not cached, the host side checks if the target container image is already cached in the DPU-side image cache directory mounted on the front end (host side). If it is already cached, no pulling is required; the image in the DPU-side image cache directory is used, and the pull is complete. If it is not cached, the host side pulls the target container image from a remote container image repository. The host side completes the pull of the target container image and generates a container based on the target container image.
[0086] In some optional embodiments, the host can also directly use the cloud disk provided by the DPU as the system disk and storage disk for booting and running. In the DPU scenario, the host generally only needs to use the cloud disk and does not need to configure additional storage space to save costs. In this case, the host-side container runtime software can be directly configured to use the image cache directory on the DPU side. The process of pulling container images can be found in [link to documentation]. Figure 4 As shown, the process includes: The host side pulls the target container image. The host side queries the image cache directory on the DPU side to see if the target container image is already cached. If it is cached, no pull is needed; the image in the DPU side's image cache directory is used, and the pull is complete. If it is not cached, the host side pulls the target container image from the remote container image repository, and the host side completes the target container image pull.
[0087] In the above embodiments, by utilizing high-speed interfaces such as PCIe / CXL on the host side and DPU side, container image caching is provided on the DPU side to accelerate container image retrieval. Since the DPU and the host side are connected via high-speed interfaces such as PCIe / CXL, the transmission speed of these interfaces is much higher than the speed of pulling images over a traditional network, thus significantly improving the retrieval efficiency of uncached container images on the host side.
[0088] In some optional embodiments, the method further includes: receiving first pod configuration information, the first pod configuration information including at least one container, and the first pod configuration information being sent from the K8S control plane deployed on the DPU side to the K8S scheduler, so that the K8S scheduler determines the host side and sends the first pod configuration information to the host side; and determining the target container image to be acquired based on the first pod configuration information.
[0089] The target container image can be determined based on the configuration information of the first pod. In a Kubernetes (K8S) scenario, a K8S cluster consists of a control plane and a set of nodes for running containerized applications. In a DPU scenario, the control plane is typically deployed on the DPU side, and the nodes are the host side. Subsequently, the K8S control plane on the DPU side sends the configuration information of the first pod to the K8S scheduler. The K8S scheduler then determines the host side and sends the configuration information of the first pod to the corresponding host side, allowing the host side to resolve and obtain the target container image.
[0090] In the above embodiments, the cloud computing Kubernetes platform (Kubernets, an open-source containerized application management and deployment platform) is introduced to improve the efficiency of container deployment and management.
[0091] In one exemplary embodiment, such as Figure 5 As shown, a method for obtaining a container image is provided, which can be applied to... Figure 1Taking the DPU side as an example, the explanation includes the following steps S502 to S506. Wherein:
[0092] S502: Obtain container configuration information.
[0093] Container configuration information can be pre-configured, for example, by the user in advance with the runtime software on the host side, and the container configuration information includes at least one target container image.
[0094] In some optional embodiments, one host side corresponds to one DPU side, or multiple host sides correspond to one DPU side. The container configuration information can be configured based on the image corresponding to the runtime software of each host side, such as the image involved in the container corresponding to the runtime software. No specific limitation is made here.
[0095] S504: Check whether the target container image corresponding to the container configuration information has been cached.
[0096] S506: If the image corresponding to the container configuration information is not cached, obtain the target container image from the remote image repository. The DPU side and the host side communicate through the target interface, and the host side mounts the image cache directory of the DPU side in the form of a cloud disk overlaid with a file system, so as to generate the container based on the image stored in the image cache directory of the DPU side.
[0097] In this application, the system detects whether the target container image exists in the image cache directory on the DPU side. If it does, the host side can directly obtain the target container image. This is because the host side mounts the image cache directory on the DPU side through a cloud disk overlaid with a file system, so the host side can generate a container based on the image stored in the image cache directory on the DPU side.
[0098] If the image corresponding to the container configuration information is not cached, the target container image is obtained from the remote image repository, thereby achieving pre-caching of the image.
[0099] In the above embodiments, on the one hand, the host side and the DPU side communicate through the target interface to improve efficiency. On the other hand, the host side mounts the image cache directory of the DPU side in the form of cloud disk superimposed file system, so that the host side can directly use the image cache directory of the DPU side, which also improves the pulling efficiency. Furthermore, the pre-caching of images based on container configuration information lays the foundation for the subsequent pulling of container images on the host side, thereby improving the pulling efficiency of the host side.
[0100] In some optional embodiments, the method further includes: predicting hot container images and container images to be cleaned; determining whether to pull the hot container image or remove the stored container image to be cleaned from the cache storage space based on the hot container image, the container image to be cleaned, container configuration information, and cache storage space occupancy rate, wherein the cache storage space is the storage space used to store the image cache directory on the DPU side; if it is determined that the hot container image should be pulled, obtaining the hot container image from the remote image repository and storing it in the image cache directory on the DPU side; if it is determined that the stored container image to be cleaned should be removed from the cache storage space, deleting the container image to be cleaned from the image cache directory on the DPU side.
[0101] The hot container images and the container images to be cleaned can be predicted based on a dynamic caching algorithm.
[0102] In some optional embodiments, predicting hot container images and container images to be cleaned includes: obtaining stored pull records from a pull record database and obtaining cache hit records from a cache hit record database; predicting hot container images and container images to be cleaned based on queries and pull records and cache hit records; or receiving pull records returned by a remote image repository; and predicting hot container images and container images to be cleaned based on pull records.
[0103] The dynamic caching module registers pull record notification callbacks with the remote container image repository. Specifically, when an image is pulled from the remote container image repository, the repository sends the pull record to the DPU side. The dynamic caching module on the DPU side then stores this record in its pull record database. Based on the pull records in the database, the dynamic caching module uses machine learning and other algorithms to predict hot images and images that need to be cleaned up.
[0104] In other embodiments, the dynamic caching module does not necessarily need to register pull record notification callbacks with the remote container image repository. When the container deployment management control plane is deployed on the DPU side, such as when the Kubernetes control plane is deployed on the DPU side, the control plane can send the container configuration information to the dynamic caching algorithm module simultaneously when issuing the container configuration information. The dynamic caching module records cache hits and pull records in the database and uses machine learning and other algorithms to predict hot images and images to be cleaned up.
[0105] The machine learning algorithms can be any type of algorithm, and these algorithms can be pre-trained. In other embodiments, the algorithm of the dynamic caching algorithm module can be a logistic regression algorithm, etc., without specific limitations.
[0106] The dynamic caching algorithm module predicts hot container images and container images to be cleaned, and then sends them to the cache decision module. The cache decision module can make image caching decisions based on hot container images, container images to be cleaned, container configuration information, and cache storage space occupancy, including determining whether to pull hot container images or whether to remove stored container images to be cleaned from the cache storage space.
[0107] The container configuration information includes the user's pre-caching configuration, which is based on the containers required by the host-side runtime software. Cache storage space utilization refers to the storage space utilization of the image cache directory used to cache the DPU side. With a fixed cache storage space, the more images included in the DPU-side image cache directory, the higher this utilization rate will be.
[0108] When the cache storage space occupancy rate is less than a threshold, the cache decision module can directly cache the hot container image, i.e., pull the hot container image from the remote image repository. When the cache storage space occupancy rate is greater than the threshold, it can first delete the container image to be cleaned up, and then pull the hot container image from the remote image repository. Optionally, if the container image to be cleaned up is an image specified in the container configuration information, it can be left undeleted. In other embodiments, the cache decision module can decide whether to pull the hot image in advance to complete pre-caching, or decide whether to remove the container image to be cleaned up to release cache storage space, based on other rules. Finally, the cache decision is executed to complete the update of the container image cache on the DPU side.
[0109] For ease of understanding, combined with Figure 6 As shown, Figure 6 This is a flowchart of a dynamic caching decision-making process in one embodiment. In this embodiment, the DPU reads and parses the user configuration, i.e., the container configuration information. The DPU confirms whether the pre-caching of the user configuration has been completed. That is, it iterates through the user configuration's pre-caching and checks whether caching has been completed. If all pre-caching has been completed, then pre-caching is complete. Otherwise, the DPU pulls the user-configured but uncached container image from the remote container image repository. Subsequently, the DPU loads the intelligent dynamic caching algorithm, completing the configuration and state loading of the intelligent dynamic caching algorithm.
[0110] Specifically, the system predicts hot container images and container images to be cleaned up. The cache decision module determines whether to pull the hot container image or remove the stored container image to be cleaned up from the cache storage space based on the hot container image, the container configuration information, and the cache storage space occupancy rate. The cache storage space is the storage space used to store the image cache directory on the DPU side. If it is determined to pull the hot container image, the system retrieves the hot container image from the remote image repository and stores it in the image cache directory on the DPU side. If it is determined to remove the stored container image to be cleaned up from the cache storage space, the system deletes the container image to be cleaned up from the image cache directory on the DPU side.
[0111] In this application, to effectively manage DPU-side storage resources, the DPU side can intelligently allocate image caches. The DPU side will not cache all images indefinitely, but will selectively cache hot images, frequently used images, or user-configured images. Through a dynamic caching algorithm module, the cache content is adjusted in real time, prioritizing the caching of hot or high-priority images, removing inactive images, improving the backend container image cache hit rate, and ensuring maximum utilization of the DPU-side cache space.
[0112] In some optional embodiments, the method further includes: determining the size of each hotspot container image; and increasing the size of the cache storage space corresponding to the image cache directory on the DPU side if the sum of the size of each hotspot container image and the size of the container images already cached in the image cache directory on the DPU side is greater than the target cache size.
[0113] In scenarios where a single DPU serves multiple host sides, combined with Figure 7 As shown, the dynamic caching algorithm module will receive more pull records from remote image repositories. In scenarios with multiple hosts, more container images may need to be cached. It is advisable to increase the cache storage space of the container image cache to improve the cache hit rate of the container image cache.
[0114] For example, if the sum of the sizes of the hot container images and the sizes of the container images already cached in the image cache directory on the DPU side is greater than the target cache size, then the size of the cache storage space corresponding to the image cache directory on the DPU side can be increased.
[0115] In other embodiments, the size of the cache space used for the cache image cache directory on the DPU side can be increased based on the number of host sides connected to the DPU side.
[0116] In the above embodiments, the cache storage space of the container image cache is increased, thereby improving the cache hit rate of the container image cache.
[0117] In some optional embodiments, the container configuration information includes cached container images generated based on homogeneous tasks involved in the host cluster; the method further includes: increasing the cache weight corresponding to the cached container image based on the container configuration information; determining whether to remove the stored container image to be cleaned from the cache storage space, including: determining whether to remove the container image to be cleaned based on the weight of the container image to be cleaned stored in the cache storage space.
[0118] The probability of hosts performing similar tasks within the cluster is high, meaning there's a high chance they'll pull the same container images. When configuring the dynamic caching module, these container images can be pre-configured in the pre-caching configuration file to increase their caching weight in the dynamic caching module, preventing the caching decision module from removing these important images.
[0119] In some optional embodiments, obtaining container configuration information includes: receiving second pod configuration information issued by the K8S control plane, the second pod configuration information including at least one container; and obtaining container configuration information based on the second pod configuration information.
[0120] A Kubernetes (K8S) cluster consists of a control plane and a set of nodes for running containerized applications. In a DPU (Device Processing Unit) scenario, the control plane is typically deployed on the DPU side, and the nodes are the host side. This embodiment uses this architecture, where the K8S control plane is deployed on the DPU side, and the DPU side connects to at least one host side through a target interface. Figure 7 As shown, four host sides were connected.
[0121] The DPU initializes the container image cache directory.
[0122] On the host side, nodes mount the DPU-side image cache directory, such as virtiofs, via a cloud disk overlaid with a file system through the target interface. The host-side node's container runtime software, such as Docker, Podman, or Containerd, is configured to use both a local cache directory and the mounted DPU-side image cache directory. In scenarios where the host-side nodes use only cloud disks, they can also be directly configured to use the image cache directory.
[0123] The process of deploying a pod (the smallest deployable unit of computing created and managed by Kubernetes, typically containing one or more containers) in the Kubernetes control plane is as follows: Figure 8The specific steps are as follows: The Kubernetes control plane sends the second pod configuration information to the Kubernetes scheduler and simultaneously sends this information to the dynamic caching module. The Kubernetes scheduler confirms which host-side node to schedule the second pod configuration information to and sends the configuration information to that host-side node. Upon receiving the second pod configuration information, the dynamic caching module checks if the image used by the pod has already been cached. If not, it pulls the target image from the remote image repository to the backend container image cache. If caching is successful, it records the container image cache hit status and pull records in the dynamic caching module's database.
[0124] For the host-side nodes, the process of pulling the container image is as follows: Figure 9 Specifically, this includes: The host-side node receives the second pod configuration from the Kubernetes control plane. The host-side node's container runtime software pulls the target container image according to the second pod configuration. The host-side node's container runtime software checks if the target container image is already cached in the local cache directory. If it is already cached, no pulling is needed; the local cache is used, and the pull is complete. If it is not cached, the host-side node's container runtime software checks if the target container image is already cached in the backend DPU image cache directory mounted on the frontend. If it is already cached, no pulling is needed; the backend DPU image cache is used, and the pull is complete. If it is not cached, the host-side node pulls the target container image from the remote container image repository. The host-side node completes the pull of the target container image.
[0125] Combination Figure 10 As shown, after receiving the second pod configuration information from the Kubernetes control plane, the dynamic caching module checks whether the target container image has been cached. If not, the cache decision module and decision execution module pull the target container image from the remote image repository. Regardless of whether the target container image is cached, the dynamic caching module stores this record in its pull record database and records the cache hit status in the cache hit record database. Based on these two databases, the dynamic caching module uses machine learning and other algorithms to predict hot images and container images that need to be cleaned up, and inputs the results into the cache decision module. The cache decision module, based on the prediction results, the user's pre-caching configuration (container configuration information), and the current cache storage space utilization rate, decides whether to pull hot images in advance for pre-caching, or whether to remove some container image caches to release cache storage space. Finally, the cache decision is executed, updating the backend DPU container image cache.
[0126] In the above embodiments, in the DPU scenario, high-speed interfaces such as PCIe / CXL on both the host and DPU sides are used to provide container image caching on the DPU side, accelerating the retrieval of container images. Since the DPU side and the host side are connected via high-speed interfaces such as PCIe / CXL, the transmission speed of these interfaces is much higher than that of traditional network image retrieval, thus significantly improving the retrieval efficiency of uncached container images on the host side. Simultaneously, to effectively manage DPU-side storage resources, a dynamic caching module is used to cache user-configured container images, adjust cache content in real time, and pre-cache hot images, ensuring a high cache hit rate for container images and thereby improving cache space utilization.
[0127] It should be understood that although the steps in the flowcharts of the above embodiments are shown sequentially according to the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless explicitly stated herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least some steps in the flowcharts of the above embodiments may include multiple steps or multiple stages. These steps or stages are not necessarily completed at the same time, but can be executed at different times. The execution order of these steps or stages is not necessarily sequential, but can be performed alternately or in turn with other steps or at least some of the steps or stages in other steps. It is understood that the steps in different embodiments can be freely combined as needed, and all non-contradictory solutions formed by such combinations are within the scope of protection of this application.
[0128] Based on the same inventive concept, this application also provides a container image acquisition device for implementing the container image acquisition method described above. The solution provided by this device is similar to the implementation described in the above method; therefore, the specific limitations in one or more container image acquisition device embodiments provided below can be found in the limitations of the container image acquisition method described above, and will not be repeated here.
[0129] In one exemplary embodiment, such as Figure 11 As shown, a container image acquisition device is provided, including: a first detection module 1001 and a container generation module 1002, wherein:
[0130] The first detection module 1001 is used to detect whether the target container image to be acquired has been stored in the image cache directory on the DPU side. The host side and the DPU side communicate through the target interface, and the host side mounts the image cache directory on the DPU side in the form of cloud disk overlay file system.
[0131] The container generation module 1002 is used to generate a container from the image stored in the image cache directory on the DPU side when the target container image to be obtained has been stored in the image cache directory on the DPU side.
[0132] In some optional embodiments, the container generation module 1002 is further configured to obtain the target container image from a remote image repository when the target container image to be obtained is not stored in the image cache directory on the DPU side.
[0133] In some alternative embodiments, the above-described apparatus further includes:
[0134] The third detection module is used to detect whether the target container image to be obtained has been stored in the local image cache directory on the host side; if the target container image has been stored in the local image cache directory on the host side, the container is generated using the image stored in the local image cache directory on the host side; if the target container image is not stored in the local image cache directory on the host side, the step of detecting whether the target container image to be obtained has been stored in the image cache directory on the DPU side continues to be executed.
[0135] In some optional embodiments, the above apparatus further includes: a target container image determination module, configured to receive first pod configuration information, the first pod configuration information including at least one container, and the pod configuration information is sent from the K8S control plane deployed on the DPU side to the K8S scheduler, so that the K8S scheduler determines the host side and sends the first pod configuration information to the host side; and determine the target container image to be obtained based on the first pod configuration information.
[0136] In one exemplary embodiment, such as Figure 12 As shown, a container image acquisition device is provided, including: a configuration information acquisition module 1101, a second detection module 1102, and a pull module 1103, wherein:
[0137] Configuration information acquisition module 1101 is used to acquire container configuration information;
[0138] The second detection module 1102 is used to detect whether the target container image corresponding to the container configuration information has been cached.
[0139] The pull module 1103 is used to obtain the target container image from a remote image repository when the image corresponding to the container configuration information is not cached. The DPU side and the host side communicate through the target interface, and the host side mounts the image cache directory of the DPU side in the form of a cloud disk overlaid with a file system, so as to generate the container based on the image stored in the image cache directory of the DPU side.
[0140] In some alternative embodiments, the above-described apparatus further includes:
[0141] The prediction module is used to predict hot container images and container images to be cleaned. Based on the hot container images, container images to be cleaned, container configuration information, and cache storage space usage, it determines whether to pull the hot container image or whether to remove the stored container image to be cleaned from the cache storage space, where the cache storage space is the storage space used to store the image cache directory on the DPU side. If it is determined to pull the hot container image, the hot container image is obtained from the remote image repository and stored in the image cache directory on the DPU side. If it is determined to remove the stored container image to be cleaned from the cache storage space, the container image to be cleaned is deleted from the image cache directory on the DPU side.
[0142] In some optional embodiments, the prediction module is specifically used to obtain stored pull records from the pull record database and cache hit records from the cache hit record database; to make predictions based on the query and the pull records and cache hit records to obtain hot container images and container images to be cleaned; or to receive pull records returned by a remote image repository; and to make predictions based on the pull records to obtain hot container images and container images to be cleaned.
[0143] In some optional embodiments, the above apparatus further includes: a cache space control module, configured to determine the size of each hotspot container image; and, if the sum of the size of each hotspot container image and the size of the container images already cached in the image cache directory on the DPU side is greater than the target cache size, to increase the size of the cache storage space corresponding to the image cache directory on the DPU side.
[0144] In some alternative embodiments, the container configuration information includes cache container images generated based on homogeneous tasks involved in the host cluster;
[0145] The aforementioned device also includes: a weight configuration module, used to increase the cache weight corresponding to the cache container image based on container configuration information;
[0146] The aforementioned prediction module is also used to determine whether to remove a container image to be cleaned based on the weight of the container images to be cleaned stored in the cache storage space.
[0147] In some optional embodiments, the above apparatus further includes: a configuration information determination module, configured to receive second pod configuration information issued by the K8S control plane, the second pod configuration information including at least one container; and to obtain container configuration information based on the second pod configuration information.
[0148] Each module in the aforementioned container image acquisition device can be implemented entirely or partially through software, hardware, or a combination thereof. These modules can be embedded in or independent of the processor in a computer device, or stored in the memory of a computer device as software, so that the processor can invoke and execute the operations corresponding to each module.
[0149] In one exemplary embodiment, a computer device is provided, which may be a terminal, and its internal structure diagram may be as follows: Figure 13 As shown, the computer device includes a processor, memory, input / output interfaces, a communication interface, a display unit, and an input device. The processor, memory, and input / output interfaces are connected via a system bus, and the communication interface, display unit, and input device are also connected to the system bus via the input / output interfaces. The processor provides computing and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system and computer programs. The internal memory provides an environment for the operation of the operating system and computer programs in the non-volatile storage media. The input / output interfaces are used for exchanging information between the processor and external devices. The communication interface (such as a network interface card) is used for wired or wireless communication with external terminals; wireless communication can be achieved through Wi-Fi, mobile cellular networks, Near Field Communication (NFC), or other technologies. When the computer program is executed by the processor, it implements a container image acquisition method. The display unit of the computer device is used to form a visually visible image and can be a display screen, a projection device, or a virtual reality imaging device. The display screen can be an LCD screen or an e-ink screen. The input device of the computer device can be a touch layer covering the display screen, or buttons, trackballs, or touchpads set on the casing of the computer device, or external keyboards, touchpads, or mice, etc.
[0150] Those skilled in the art will understand that Figure 13 The structure shown is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the computer device to which the present application is applied. Specific computer devices may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.
[0151] In one exemplary embodiment, a chip, such as a DPU (Data Processing Unit) chip, is provided, including a memory and a processor. The memory stores a computer program, and the processor executes the computer program to implement the steps of the method in any of the above embodiments.
[0152] In one exemplary embodiment, a network interface card is provided, including a chip as described in any of the above embodiments and multiple interfaces, through which the chip processes data or communicates externally.
[0153] In one embodiment, a computer device is also provided, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the steps in the above method embodiments.
[0154] In one embodiment, a computer-readable storage medium is provided having a computer program stored thereon that, when executed by a processor, implements the steps in the above method embodiments.
[0155] In one embodiment, a computer program product is provided, including a computer program that, when executed by a processor, implements the steps in the above method embodiments.
[0156] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium, and when executed, it can include the processes of the embodiments of the above methods. Any references to memory, databases, or other media used in the embodiments provided in this application can include at least one of non-volatile memory and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM can take many forms, such as Static Random Access Memory (SRAM) or Dynamic Random Access Memory (DRAM). The databases involved in the embodiments provided in this application may include at least one type of relational database and non-relational database. Non-relational databases may include, but are not limited to, blockchain-based distributed databases. The processors involved in the embodiments provided in this application may be general-purpose processors, central processing units, graphics processing units, digital signal processors, programmable logic devices, quantum computing-based data processing logic devices, artificial intelligence (AI) processors, etc., and are not limited to these.
[0157] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this application.
[0158] The embodiments described above are merely illustrative of several implementation methods of this application, and while the descriptions are specific and detailed, they should not be construed as limiting the scope of this application. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of this application, and these all fall within the protection scope of this application. Therefore, the protection scope of this application should be determined by the appended claims.
Claims
1. A container image acquisition method, characterized by, Applied to the host side, the method includes: The system detects whether the target container image to be acquired has been stored in the image cache directory on the DPU side. The host side communicates with the DPU side through the target interface, and the host side mounts the image cache directory on the DPU side in the form of a cloud disk overlaid with a file system. The target interface is a PCIe interface or a CXL interface. If the target container image to be acquired is already stored in the image cache directory on the DPU side, the container is generated using the image stored in the image cache directory on the DPU side; and the image stored in the image cache directory on the DPU side is read-only. When the virtual machine starts, a writable thin layer is created by overlaying the file system to record changes made to the image at runtime. If the target container image to be obtained is not stored in the image cache directory on the DPU side, the target container image is obtained from the remote image repository.
2. The method of claim 1, wherein, Before detecting whether the target container image to be acquired is already stored in the image cache directory on the DPU side, the following steps are included: Check whether the target container image to be acquired has been stored in the local image cache directory on the host side; If the target container image is already stored in the local image cache directory on the host side, the container is generated using the image stored in the local image cache directory on the host side. If the target container image is not stored in the local image cache directory on the host side, the step of detecting whether the target container image to be obtained is stored in the image cache directory on the DPU side continues.
3. The method according to claim 1 or 2, characterized in that, The method further includes: Receive first pod configuration information, the first pod configuration information includes at least one container, and the pod configuration information is deployed on the DPU side of the K8S control plane and sent to the K8S scheduler, so that the K8S scheduler determines the host side and sends the first pod configuration information to the host side; The target container image to be obtained is determined based on the configuration information of the first pod.
4. A container image acquisition method comprising: Applied to the DPU side, the method includes: Obtain container configuration information; Check whether the target container image corresponding to the container configuration information has been cached; If the image corresponding to the container configuration information is not cached, the target container image is obtained from a remote image repository. The DPU side communicates with the host side through a target interface, and the host side mounts the image cache directory of the DPU side in the form of a cloud disk overlaid with a file system to generate a container based on the image stored in the image cache directory of the DPU side. The target interface is a PCIe interface or a CXL interface, and the image stored in the image cache directory of the DPU side is read-only. When the virtual machine on the host side starts, a writable thin layer is created through the overlaid file system to record changes made to the image by the system on the host side during runtime. If the host side determines that the target container image to be obtained is not stored in the image cache directory of the DPU side, the target container image is obtained from a remote image repository.
5. The method of claim 4, wherein, The method further includes: The prediction identifies hot container images and container images that need to be cleaned up. Based on the hot container image and the container image to be cleaned, the container configuration information, and the cache storage space occupancy rate, it is determined whether to pull the hot container image or whether to remove the stored container image to be cleaned from the cache storage space, wherein the cache storage space is the storage space used to store the image cache directory on the DPU side. If it is determined that the hot container image will be pulled, the hot container image will be obtained from the remote image repository and stored in the image cache directory on the DPU side; If it is determined that a stored container image to be cleaned will be removed from the cache storage space, the container image to be cleaned will be deleted from the image cache directory on the DPU side.
6. The method of claim 5, wherein, The prediction yields hot container images and container images to be cleaned, including: Retrieve stored pull records from the pull record database and cache hit records from the cache hit record database; based on the pull records and cache hit records, predict and obtain hot container images and container images to be cleaned; or Receive the pull records returned by the remote image repository; predict the hot container images and container images to be cleaned based on the pull records.
7. The method of claim 5, wherein, The method further includes: Determine the size of each of the aforementioned hotspot container images; If the sum of the sizes of the hot container images and the sizes of the container images already cached in the image cache directory on the DPU side is greater than the target cache size, the size of the cache storage space corresponding to the image cache directory on the DPU side shall be increased.
8. The method of claim 5, wherein, The container configuration information includes cache container images generated based on homogeneous tasks involved in the host cluster; The method further includes: Based on the container configuration information, increase the cache weight corresponding to the cache container image; The step of determining whether to remove the stored container image to be cleaned from the cache storage space includes: Based on the weight of the container image to be cleaned stored in the cache storage space, it is determined whether to remove the container image to be cleaned.
9. The method of claim 4, wherein, The obtained container configuration information includes: Receive the configuration information of the second pod from the K8S control plane. The configuration information of the second pod includes at least one container. The container configuration information is obtained based on the second pod configuration information.
10. A container mirror image acquisition apparatus characterized by comprising: Applied to the host side, the device includes: The first detection module is used to detect whether the target container image to be acquired has been stored in the image cache directory on the DPU side. The host side communicates with the DPU side through the target interface, and the host side mounts the image cache directory on the DPU side in the form of a cloud disk overlaid with a file system. The target interface is a PCIe interface or a CXL interface. The image stored in the image cache directory on the DPU side is read-only. When the virtual machine starts, a writable thin layer is created through the overlaid file system to record changes made to the image during runtime. The container generation module is used to generate a container from the image stored in the image cache directory on the DPU side when the target container image to be obtained is already stored in the image cache directory on the DPU side; and to obtain the target container image from a remote image repository when the target container image to be obtained is not stored in the image cache directory on the DPU side.
11. A container mirror image acquisition apparatus characterized by comprising: Applied to the DPU side, the device includes: The configuration information acquisition module is used to obtain container configuration information; The second detection module is used to detect whether the target container image corresponding to the container configuration information has been cached. The pull module is used to retrieve the target container image from a remote image repository when the image corresponding to the container configuration information is not cached. The DPU side communicates with the host side through a target interface, and the host side mounts the image cache directory of the DPU side in the form of a cloud disk overlaid with a file system to generate a container based on the image stored in the image cache directory of the DPU side. The target interface is a PCIe interface or a CXL interface, and the image stored in the image cache directory of the DPU side is read-only. When the virtual machine on the host side starts, a writable thin layer is created through the overlaid file system to record changes made to the image by the system on the host side during runtime. If the host side determines that the target container image to be retrieved is not stored in the image cache directory of the DPU side, it retrieves the target container image from the remote image repository.
12. A chip comprising a memory and a processor, the memory storing a computer program, characterized in that, When the processor executes the computer program, it implements the steps of the method according to any one of claims 1 to 9.
13. A network interface card, comprising: Includes the chip as described in claim 12 and multiple interfaces. The chip processes data or communicates with the outside world through the interface.
14. A computer device, comprising: Includes the network interface card as described in claim 13, wherein the network interface card is used for processing data or external communication.
15. A computer readable storage medium having stored thereon a computer program, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 9.
16. A computer program product comprising a computer program, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 9.
Citation Information
Patent Citations
Container mirror image sharing method and device, server, equipment and medium
CN112799780A
Mirror data processing method, DPU and system
CN118283059A
Method for increasing starting speed of cloud game, storage medium and processing equipment
CN118356641A
Container creation method, device and system and storage medium
CN119512678A
Virtual machine management unloading method and device, computer equipment, readable storage medium and program product
CN119621244A