Containerization parallel scheduling method for large sample AI simulation
By adopting mirror preheating technology in large sample AI simulation environments, priority is given to downloading and starting some images, the problem of too long download time for container images is solved, and the effect of reducing startup delay and improving business processing capabilities is achieved.
Patent Information
- Application Number
- CN202411913641.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-24
- Publication Date
- 2025-04-25
AI Technical Summary
In a large sample AI simulation environment, large container images lead to too long downloading of images, which seriously affects the system's business processing capabilities.
Using containerized parallel scheduling method for large-sample AI simulation, through mirror preheating technology, layer preheating and mirror preheating are divided into two strategies, and partial mirroring is preferred to download and start, thereby reducing container startup delays and deployment delays.
It effectively reduces the startup delay and deployment delay of containerized jobs, accelerates the deployment efficiency of large-scale distributed parallel containerized jobs, improves the system's business processing capabilities, and provides users with a better startup job experience.
Smart Images

Figure CN119883504A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of computer containers and relates to a containerized parallel scheduling method for large-sample AI simulation. Background Art
[0002] Containers and Kubernetes are becoming the standard way to deploy services in data centers. This rich virtualization ecosystem can simplify the development and management of applications, solve the complex dependency problems between applications and execution environments, and improve the efficiency of application deployment. However, the startup delay and deployment delay of containerized jobs can significantly limit the efficiency of job execution. Especially in large-sample AI simulation environments, when the container image is large, the image download time is too long, which seriously affects the business processing capabilities of the system. The core idea of the traditional container startup method is to download part of the image, that is, the necessary files, dependent libraries, links, etc., and then start it first, but when the container is processing certain jobs, the files required to process these jobs may be suspended due to the lack of files. Therefore, a method for preheating the image is needed to reduce the download delay of the container image and the container startup delay to ensure the efficient execution of the entire job. Summary of the invention
[0003] Purpose of the invention: The present invention provides a containerized parallel scheduling method for large-sample AI simulation parallel containerized job scenarios, reduces the startup delay and deployment delay of containerized jobs, accelerates the deployment efficiency of large-scale distributed parallel containerized jobs, improves the system's business processing capabilities, and provides users with a better job startup experience.
[0004] Technical Solution
[0005] A containerized parallel scheduling method for large sample AI simulation includes the following steps:
[0006] Step 1: First pull down the image of the containerized job;
[0007] Step 2: Create a container using the image in step 1 and start the job.
[0008] Further, step 1 specifically includes the following steps:
[0009] Step 1.1 The container image is stored in the registry. Users can add new images or update existing images by performing a push operation to the registry, and retrieve images by performing a pull operation from the registry. The created image capacity is greater than 10G.
[0010] Step 1.2: Pull the image using layer preheating: An image consists of multiple layers. Each layer has a content-addressable identifier called a digest, which uniquely identifies a layer by obtaining the SHA256 of its data. Layer preheating uses multiple threads to pull different layers of the image in parallel.
[0011] Further, step 2 specifically includes the following steps:
[0012] Step 2.1 Create a container;
[0013] Step 2.2 Prepare the software environment;
[0014] Step 2.3 Initialize user code;
[0015] Step 2.4 starts the job.
[0016] Furthermore, step 2.1 is as follows: the kubernetes master sends a pull command to each node in the cluster, the kubernetes node, according to the deployment order preset by the programmer in the yaml file used for deployment, and then all the computing nodes pull the image and create the container by themselves;
[0017] Further, in step 2.2, the software environment includes necessary files, and the necessary files include dependent libraries and links;
[0018] Further, step 2.3 is specifically: the user issues the correct command on the Kubernetes Master, which will decide where to generate the container, download / build the container on the required Kubernetes node, and finally queue the generation of the container.
[0019] Further, step 2.4 is specifically: create a container through image preheating and start the job, specifically:
[0020] When a job is composed of a huge number of images, in order to run the job, all images must be deployed to the cluster before the job can be started; first download the images of some tasks, and after the images are downloaded, start the job containing these tasks; in this way, when the entire job is deployed and started on the cluster, "the downloaded part will be started first".
[0021] Furthermore, step 1.2 also includes the following steps:
[0022] Step 1.2.1: Sort the layers in the image to be pulled by the pulling time, where the pulling time is the ratio of the image layer size to the network bandwidth;
[0023] Step 1.2.2: Pull the image. Each thread executing the task will first select the one with the largest pull time in step 1.2.1.
[0024] Step 1.2.3: Repeat step 1.2.2 until the entire image is downloaded.
[0025] Further, step 2.4 specifically includes the following steps:
[0026] Step 2.4.1: Divide a job into multiple task mirror groups;
[0027] Step 2.4.2: Sort the image groups of multiple tasks by size according to the ratio between the image execution time and the pull time;
[0028] Step 2.4.3: According to the order in step 2.4.2, the image with the largest value is pulled first;
[0029] Step 2.4.4: Repeat step 2.4.3 until the task image is completely downloaded;
[0030] Step 2.4.5: As long as a task image has been downloaded, the entire job will start, and the downloaded task image will be run first, and other task images will be downloaded and executed in sequence.
[0031] Beneficial Effects
[0032] The core idea of the traditional container startup method is to download part of the image, that is, the necessary files, dependent libraries, links, etc., and then start it first. However, when the container is processing certain jobs, the files required to process these jobs may be suspended due to the lack of files. From the perspective of container jobs, the present invention starts from the perspective of container jobs, and a part of the job that has been downloaded can be started first, which is used to accelerate the deployment efficiency of large-scale distributed parallel containerized jobs. The present invention provides a containerized parallel scheduling method for large-sample AI simulation for large-scale parallel containerized job scenarios, reduces the startup delay and deployment delay of containerized jobs, improves the business processing capabilities of the system, and provides users with a better experience of starting jobs. The present invention uses image preheating to be divided into layer preheating and image preheating. Layer preheating is applied to pull a single image on a single machine to start a single container, and multiple threads are used to pull different layers of the image in parallel to efficiently pull the image; image preheating is applied in cluster deployment. As long as one task image in the job is downloaded, that is, preheating is completed, the entire job starts. BRIEF DESCRIPTION OF THE DRAWINGS
[0033] Figure 1 It is the principle diagram of the method of the present invention;
[0034] Figure 2 It is a flow chart of the present invention. DETAILED DESCRIPTION
[0035] The features and illustrative embodiments of various aspects of the present invention will be described in detail below. In the detailed description below, many specific details are proposed to provide a comprehensive understanding of the present invention. However, it is obvious to those skilled in the art that the present invention can be implemented without the need for some of these specific details. The following description of the embodiments is only to provide a better understanding of the present invention by illustrating examples of the present invention. The present invention is by no means limited to any specific settings and methods proposed below, but covers any improvements, replacements and modifications of structures, methods, devices without departing from the spirit of the present invention. In the accompanying drawings and the following description, known structures and technologies are not shown to avoid unnecessary ambiguity in the present invention.
[0036] It should be noted that, in the absence of conflict, the embodiments of the present invention and the features in the embodiments can be combined with each other, and the embodiments can refer to and quote each other. The present invention will be described in detail below with reference to the accompanying drawings and in combination with the embodiments.
[0037] The present invention proposes a containerized parallel scheduling method for large-sample AI simulation, which is used to accelerate the strategy of starting large-scale distributed parallel containerized jobs. According to different working scenarios, the parallel scheduling method is divided into layer preheating and image preheating. Starting a containerized job often requires two steps. The first step is to pull down the image of the containerized job and then use the image to create a container. Container images are often stored in the Registry. Users push to the Registry by performing a push operation to add new images or update existing images, and retrieve images by performing a pull operation from the registry. An image consists of multiple layers. Each layer has a content-addressable identifier called a digest, which uniquely identifies a layer by obtaining the SHA256 of its data. When an application initiates a request, the system creates one or more containers. The creation process of a container includes the following stages: creating a container; preparing the software environment; initializing user code. The startup time of the container is the time from the creation of the container to the completion of the initialization of the user code. This process is the container startup. In this process, factors such as memory usage and software package download may cause slow startup. The software environment includes necessary files, dependent libraries, links, etc., which are usually large in size and take a long time to download. To deploy a container, the user needs to issue the correct command on the KubernetesMaster, which will determine where to generate the container, download / build the container on the required Kubernetes node, and finally queue the generation of the container. Each Kubernetes node has its own queue and resources. If enough resources are available, it will take an entry from the queue and generate the container. The strategy of Kubernetes for deploying each task image in a job is essentially that the kubernetes master sends a pull-down instruction to each node in the cluster, the kubernetes node, according to the deployment order preset by the programmer in the yaml file used for deployment, and then all computing nodes pull it by themselves.
[0038] The job to be executed is a large-scale distributed parallel computing program. Because it is related to computing business, the number of bytes of each computing program is very large. In the process of containerization transformation, large applications must be encapsulated into container images. Therefore, a job consists of multiple large images, and the size of each image is basically more than 10G. Therefore, we have to find some strategies to solve the huge delay caused by image downloading.
[0039] First, we focus on the scenario where a single machine pulls a single image to start a single container. Layer preheating is applied to a single machine pulling a single image to start a single container, using multiple threads to pull different layers of the image in parallel, and pulling images efficiently; when a job is composed of a huge number of images, in order to run the job, all images must be deployed to the cluster before the job can be started. However, due to the limited bandwidth on each node in the cluster and the limited bandwidth at the traffic outlet of the Registry, only one batch of images can be downloaded first, and then another batch of images can be downloaded each time. The technicians think that the images of some tasks can be downloaded first, and after the images are downloaded, the job can be started immediately or after a period of time. In this way, the idea of "starting first after downloading a part" is realized when the entire job is deployed and started on the cluster. Image preheating is applied in cluster deployment. As long as one task image in the job is downloaded, the preheating is completed, and the entire job starts.
[0040] Therefore, based on the above principles, for large-sample AI simulation parallel containerized job scenarios, the present invention provides a parallel scheduling method to reduce the startup delay and deployment delay of containerized jobs, accelerate the deployment efficiency of large-scale distributed parallel containerized jobs, improve the business processing capability of the system, and provide users with a better job startup experience, which specifically includes the following steps:
[0041] Step 1: First pull down the image of the containerized job;
[0042] Step 1.1 The container image is stored in the registry. Users can add new images or update existing images by performing a push operation to the registry, and retrieve images by performing a pull operation from the registry. The created image capacity is greater than 10G.
[0043] Step 1.2 uses layer preheating to pull the image: an image consists of multiple layers, each layer has a content-addressable identifier called a digest, which uniquely identifies a layer by obtaining the SHA256 of its data. Layer preheating uses multiple threads to pull different layers of the image in parallel; step 1.2 also includes the following steps:
[0044] Step 1.2.1: Sort the layers in the image to be pulled by the pulling time, where the pulling time is the ratio of the image layer size to the network bandwidth;
[0045] Step 1.2.2: Pull the image. Each thread executing the task will first select the one with the largest pull time in step 1.2.1.
[0046] Step 1.2.3: Repeat step 1.2.2 until the entire image is downloaded.
[0047] Step 2: Create a container using the image in step 1 and start the job.
[0048] Step 2.1 Create container: Kubernetes master sends pull instructions to each node in the cluster according to the deployment order preset by the programmer in the yaml file used for deployment. After that, all computing nodes pull the image by themselves and create containers.
[0049] Step 2.2 Prepare the software environment, which includes necessary files, including dependency libraries and links;
[0050] Step 2.3 Initialize User Code: The user issues the correct command on the Kubernetes Master, which will decide where to build the container, download / build the container on the desired Kubernetes nodes, and finally queue the build of the container.
[0051] Step 2.4 Start the job: Create a container through image preheating and start the job, specifically:
[0052] When a job is composed of a huge number of images, in order to run the job, all images must be deployed to the cluster before the job can be started; first download the images of a part of the tasks, and after the images are downloaded, start the job containing this part of the tasks; in this way, when the entire job is deployed and started on the cluster, "the part that is downloaded will be started first" is realized; specifically, the following steps are included:
[0053] Step 2.4.1: Divide a job into multiple task mirror groups;
[0054] Step 2.4.2: Sort the image groups of multiple tasks by size according to the ratio between the image execution time and the pull time;
[0055] Step 2.4.3: According to the order in step 2.4.2, the image with the largest value is pulled first;
[0056] Step 2.4.4: Repeat step 2.4.3 until the task image is completely downloaded;
[0057] Step 2.4.5: As long as a task image has been downloaded, the entire job will start, and the downloaded task image will be run first, and other task images will be downloaded and executed in sequence.
[0058] The present invention proposes a containerized parallel scheduling method for large-sample AI simulation, and adopts image preheating technology to accelerate the startup strategy of large-scale distributed parallel containerized jobs. According to different working scenarios, image preheating is divided into layer preheating and image preheating. First, layer preheating is applied in the scenario where a single machine pulls a single image to start a single container, explores the parallel nature of multiple threads when pulling different layers of the image, and proposes a more efficient heuristic algorithm for accelerating parallel image pulling. Secondly, image preheating is applied in the scenario where the entire parallel job is deployed and started on a cluster. As long as one task image in the job is downloaded, the preheating is completed, and the entire job starts. The advantages of the present invention include reducing the container startup time, improving the deployment efficiency of the application, and enhancing the business processing capabilities of the system. The method and system are suitable for a variety of environments such as server clusters or cloud computing platforms, and have important practical application value.
[0059] One embodiment of the present invention is:
[0060] This implementation takes the deployment of Kubernetes on Windows as an example to illustrate the specific application of the present invention. The specific implementation steps are as follows:
[0061] Step 1: Create a container runtime secret
[0062]
[0063] Step 2: Pull the image by preheating the image
[0064]
[0065]
[0066] Step 3: Clean up the images on the specified Kubernetes nodes periodically as needed to reduce the storage pressure on the node disks.
[0067]
[0068] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, but the protection scope of the present invention is not limited thereto. Any technician familiar with the field can easily think of various equivalent modifications or substitutions within the technical scope disclosed by the present invention, and these modifications or substitutions should all be covered within the protection scope of the present invention.
Claims
1. A containerized parallel scheduling method for large sample AI simulation, characterized in that: The following steps are involved: Step 1: First pull down the image of the containerized job; Step 2: Create a container using the image in step 1 and start the job.
2. The containerized parallel scheduling method for large sample AI simulation according to claim 1 is characterized in that: Step 1 specifically includes the following steps: Step 1.1 The container image is stored in the registry. Users can add new images or update existing images by performing a push operation to the registry, and retrieve images by performing a pull operation from the registry. The created image capacity is greater than 10G. Step 1.2: Use layer preheating to pull the image: An image consists of multiple layers. Each layer has a content-addressable identifier called a digest, which uniquely identifies a layer by obtaining the SHA256 of its data. Layer preheating uses multiple threads to pull different layers of the image in parallel.
3. The containerized parallel scheduling method for large sample AI simulation according to claim 2 is characterized in that: Step 2 specifically includes the following steps: Step 2.1 Create a container; Step 2.2 Prepare the software environment; Step 2.3 Initialize user code; Step 2.4 starts the job.
4. The containerized parallel scheduling method for large sample AI simulation according to claim 3 is characterized in that: Step 2.1 is as follows: The kubernetes master sends pull-down instructions to each node in the cluster, the kubernetes node, according to the deployment order preset by the programmer in the yaml file used for deployment. After that, all computing nodes pull the image and create containers by themselves.
5. The containerized parallel scheduling method for large sample AI simulation according to claim 4 is characterized in that: In step 2.2, the software environment includes necessary files, and the necessary files include dependent libraries and links.
6. The containerized parallel scheduling method for large sample AI simulation according to claim 5 is characterized in that: Step 2.3 specifically involves the user issuing the correct command on the Kubernetes Master, which will decide where to build the container, download / build the container on the desired Kubernetes nodes, and finally queue the generation of the container.
7. The containerized parallel scheduling method for large sample AI simulation according to claim 6 is characterized in that: Step 2.4 is to create a container and start the job by preheating the image, specifically: When a job is composed of a huge number of images, in order to run the job, all images must be deployed to the cluster before the job can be started; first download the images of a part of the tasks, and after the images are downloaded, start the job containing this part of the tasks; in this way, "the downloaded part will be started first" is achieved when the entire job is deployed and started on the cluster.
8. The containerized parallel scheduling method for large sample AI simulation according to claim 7, characterized in that: Step 1.2 also includes the following steps: Step 1.2.1: Sort the layers in the image to be pulled by the pulling time, where the pulling time is the ratio of the image layer size to the network bandwidth; Step 1.2.2: Pull the image. Each thread executing the task will first select the one with the largest pull time in step 1.2.
1. Step 1.2.3: Repeat step 1.2.2 until the entire image is downloaded.
9. The containerized parallel scheduling method for large sample AI simulation according to claim 8, characterized in that: Step 2.4 specifically includes the following steps: Step 2.4.1: Divide a job into multiple task mirror groups; Step 2.4.2: Sort the image groups of multiple tasks by size according to the ratio between the image execution time and the pull time; Step 2.4.3: According to the order in step 2.4.2, the image with the largest value is pulled first; Step 2.4.4: Repeat step 2.4.3 until the task image is completely downloaded; Step 2.4.5: As long as a task image has been downloaded, the entire job will start, and the downloaded task image will be run first, and other task images will be downloaded and executed in sequence.