Resource scheduling method and device based on containerization

By adopting a containerized resource scheduling method in the CI/CD system, the problem of unreasonable resource utilization in the CI/CD system is solved, the balanced scheduling and full utilization of resources is achieved, and the efficiency of the CI/CD pipeline is improved.

CN112783653BActive Publication Date: 2025-02-18INDUSTRIAL AND COMMERCIAL BANK OF CHINA
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202110095621.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-01-25
Publication Date
2025-02-18
Estimated Expiration
2041-01-25

AI Technical Summary

Technical Problem

There are two major problems in resource utilization in existing CI/CD systems: resources are not fully released when there is no construction task, resulting in waste of resources; when there are a large number of construction tasks, resource scheduling is unbalanced, resulting in tasks waiting in line.

Method used

Using a containerized resource scheduling method, by receiving pipeline templates and issuing requests, creating pipeline templates, and converting tasks into containers in the task scheduling order, mounting resources, and deploying them on predetermined target nodes to achieve resource Balanced scheduling.

Benefits of technology

The full utilization of resources is achieved, resource waste is avoided, resource scheduling is ensured, and the efficiency of the CI/CD pipeline is improved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN112783653B_ABST
    Figure CN112783653B_ABST
Patent Text Reader

Abstract

The present invention provides a resource scheduling method and device based on containerization, which belongs to the field of cloud computing technology. The resource scheduling method based on containerization includes: receiving a pipeline template sending request, creating a pipeline template according to the pipeline template sending request; converting each task into a corresponding container in turn according to the task scheduling order in the pipeline template; mounting resources of the corresponding task in the container; and deploying the container with mounted resources on a predetermined target node to realize resource scheduling. The present invention can evenly schedule resources and ensure full utilization of resources.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of cloud computing technology, and in particular to a container-based resource scheduling method and device. Background Art

[0002] Software development has gone through different stages of development, from waterfall methods to agile delivery, and then to DevOps (a combination of Development and Operations, a general term for processes, methods, and systems). Software development has never stopped moving forward. As enterprises move toward the DevOps approach, improving the capabilities of continuous integration and continuous delivery (CI / CD) will help enterprises develop products quickly, launch them online quickly, and quickly trial and error and recover quickly.

[0003] At present, the traditional build and release system has the following two problems: The first is that when there is no build task, the physical or virtual machine of the CI / CD system will be idle, and the resources will not be completely released, resulting in a large number of machines being idle and wasting resources. The second is that when there are a large number of build tasks, task resource scheduling will be unbalanced, resulting in tasks on some build nodes being queued for execution, while some build nodes are idle or only a small number of tasks are running on them.

[0004] In summary, there is an urgent need for a solution that can dynamically and reasonably utilize resources and load-balance task scheduling to solve the problem of unreasonable resource usage encountered by users during the use of CI / CD pipelines. Summary of the invention

[0005] The main purpose of the embodiments of the present invention is to provide a container-based resource scheduling method and device to evenly schedule resources and ensure full utilization of resources.

[0006] In order to achieve the above object, an embodiment of the present invention provides a resource scheduling method based on containerization, including:

[0007] Receive a pipeline template delivery request, and create a pipeline template according to the pipeline template delivery request;

[0008] Convert each task into a corresponding container in sequence according to the task scheduling order in the pipeline template;

[0009] Mount the resources of the corresponding task in the container;

[0010] The container with mounted resources is deployed on a predetermined target node to implement resource scheduling.

[0011] The embodiment of the present invention further provides a container-based resource scheduling device, including:

[0012] The pipeline template module is used to receive a pipeline template sending request and create a pipeline template according to the pipeline template sending request;

[0013] The container generation module is used to convert each task into a corresponding container in sequence according to the task scheduling order in the pipeline template;

[0014] Resource mounting module, used to mount the resources of the corresponding task in the container;

[0015] The container deployment module is used to deploy the container after mounting resources on a predetermined target node to achieve resource scheduling.

[0016] An embodiment of the present invention also provides a computer device, including a memory, a processor, and a computer program stored in the memory and running on the processor. When the processor executes the computer program, the steps of the container-based resource scheduling method are implemented.

[0017] An embodiment of the present invention further provides a computer-readable storage medium on which a computer program is stored. When the computer program is executed by a processor, the steps of the container-based resource scheduling method are implemented.

[0018] The container-based resource scheduling method and device of the embodiment of the present invention first creates a pipeline template according to the pipeline template issuance request, then converts each task into a corresponding container in turn according to the task scheduling order in the pipeline template, and then mounts the resources of the corresponding task in the container, and deploys the container with mounted resources on the target node, which can evenly schedule resources and ensure full utilization of resources. BRIEF DESCRIPTION OF THE DRAWINGS

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

[0020] Figure 1 is a flow chart of a resource scheduling method based on containerization in one embodiment of the present invention;

[0021] Figure 2 is a flow chart of a resource scheduling method based on containerization in another embodiment of the present invention;

[0022] Figure 3 is a flow chart of creating a pipeline template in an embodiment of the present invention;

[0023] Figure 4 is a structural block diagram of a container-based resource scheduling device in an embodiment of the present invention;

[0024] Figure 5 is a structural block diagram of a custom resource template device in another embodiment of the present invention;

[0025] Figure 6 is a structural block diagram of a custom resource controller in another embodiment of the present invention;

[0026] Figure 7 is a structural block diagram of a monitoring device in another embodiment of the present invention;

[0027] Figure 8 is a structural block diagram of a log device in another embodiment of the present invention;

[0028] Fig. 9 It is a structural block diagram of a computer device in an embodiment of the present invention. DETAILED DESCRIPTION

[0029] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0030] Those skilled in the art will appreciate that the embodiments of the present invention may be implemented as a system, device, apparatus, method or computer program product. Therefore, the present disclosure may be specifically implemented in the following forms, namely: complete hardware, complete software (including firmware, resident software, microcode, etc.), or a combination of hardware and software.

[0031] In view of the unreasonable resource usage and unbalanced resource allocation in the prior art, an embodiment of the present invention provides a resource scheduling method based on containerization, which can evenly schedule resources and ensure full utilization of resources. The present invention is described in detail below in conjunction with the accompanying drawings.

[0032] In the field of cloud computing, the container itself provides users with independent operating systems, operating environments, file storage and other capabilities. The technical implementation of the Kubernetes container orchestration solution based on Google's open source ensures the load balancing, lifecycle management and elastic scaling of the container when it is used. Therefore, based on the characteristics of Kubernetes and containerization technology, the present invention proposes a CI / CD (continuous integration and continuous delivery) system based on Kubernetes native. Through Kubernetes custom resources (CRD), design a variety of CI / CD CRD resources, such as Task, PipelineResource, Pipeline and PipelineRun. By writing a pipeline template, the tasks and resources are combined to form the required pipeline. When the pipeline is running, the tasks of the pipeline are generated into corresponding containers (pods) and run in the Kubernetes cluster. When the task is completed, the running log is collected and the container is deleted, realizing the technical solution that the running resources are generated as soon as they are used, and the task is destroyed after execution. At the same time, based on the load balancing strategy of Kubernetes, the containers running the tasks will be reasonably scheduled to each idle node, ensuring the full utilization of the resources of each virtual machine. The present invention combines Kubernetes native and CI / CD technologies to create a new pipeline operation solution and realize the concept of cloud native.

[0033] Figure 1 It is a flow chart of a resource scheduling method based on containerization in one embodiment of the present invention. Figure 2 FIG. 1 is a flow chart of a resource scheduling method based on containerization in another embodiment of the present invention. Figure 1-Figure 2 As shown in the figure, the resource scheduling method based on containerization includes:

[0034] S101: receiving a pipeline template sending request, and creating a pipeline template according to the pipeline template sending request.

[0035] Figure 3 FIG. 1 is a flow chart of creating a pipeline template in an embodiment of the present invention. Figure 3 As shown, creating a pipeline template includes:

[0036] S201: Send a request to obtain the task scheduling order according to the pipeline template.

[0037] Before executing S201, it also includes: installing a custom resource controller. The custom resource controller is pre-installed in the Kubernetes cluster, mainly used to parse and manage custom resources. The custom resource controller is the core device for containerized running tasks and needs to run in the Kubernetes cluster all the time. When receiving custom resource template information (CRD template information of CI / CD pipeline, pipeline template), it will verify and parse the CRD template information of the pipeline. When the template format and content pass the verification, it will parse the pipeline template (pipeline), and start the corresponding containers in sequence according to the task sequence arranged in the pipeline template to complete the execution of the task.

[0038] The custom resource controller includes a custom resource validation unit (Pipeline-Webhook) and a custom resource control unit (Pipeline-Controller). The custom resource control unit is used to monitor the parsing, creation, deletion, modification, and query events of CRD resources.

[0039] S202: Acquire each task and its resources according to the task scheduling order.

[0040] Before executing S202, the process also includes: defining tasks, resources corresponding to the tasks, and a task scheduling sequence.

[0041] In specific implementation, the CRD template information of the CI / CD pipeline can be stored through the custom resource template device to define the composition, function and input and output information (resources) of the pipeline template. The CRD resource types of the template include: Task, PipelineResource, Pipeline and PipelineRun.

[0042] The tasks to be executed (such as compiling code, building images, and pushing images) are defined through task units. Tasks are the smallest configurable units in the pipeline. Each task actually runs in the Kubernetes cluster in the form of a container. If the task is executed successfully, the corresponding container status will become Completed, otherwise it will be Failed.

[0043] The input and output information of the pipeline resources are defined through the pipeline resource management unit, and the pipeline can be used by introducing the required resource names.

[0044] S203: Create a pipeline template according to the task scheduling sequence, each task and the resources of each task.

[0045] A pipeline template (pipeline) is a combination of one or more tasks, resources, and custom parameters. The pipeline template defines the names of the tasks and resources to be scheduled. When the custom resource control unit (Pipeline-Controller) parses the template, it will create the corresponding tasks based on the task name and resource name.

[0046] During the specific implementation, the user integrates Task, PipelineResource, Pipeline and PipelineRun by writing a pipeline template, and sends the pipeline template to the Kubernetes cluster. The custom resource controller in the Kubernetes cluster receives the pipeline template sending request, and starts running the pipeline job from the CRD resource of PipelineRun until the last task container of Pipeline ends, completing a pipeline job task.

[0047] S102: Convert each task into a corresponding container in sequence according to the task scheduling order in the pipeline template.

[0048] Before executing S102, it also includes: verifying the correctness of the pipeline template format through a custom resource verification unit. When the pipeline template format is correct, execute S102-S104, trigger the specified pipeline run through PipelineRun, parse the task scheduling order set in the pipeline template through the custom resource control unit, convert each task into a corresponding container in turn, and mount the resources into the container at the same time.

[0049] S103: Mounting resources corresponding to the task in the container.

[0050] S104: Deploy the container with the mounted resources on a predetermined target node to implement resource scheduling.

[0051] In one embodiment, before executing S104, the process further includes: determining a target node according to a load balancing strategy.

[0052] In specific implementation, the scheduler (kube-scheduler) component of the Kubernetes cluster will monitor the resource operation status of each virtual machine node (node), and deploy the task container to the selected target node through pre-selection and optimization of load balancing strategies to ensure full utilization of node resources.

[0053] In one embodiment, after executing S104, the method further includes:

[0054] 1. Run the container on the target node to obtain the task execution results.

[0055] 2. When the user initiates a release deployment request, the task execution result is an image. At this time, the image is uploaded to the image warehouse for subsequent release work.

[0056] 3. Receive the application startup instruction, and pull the corresponding image from the image repository according to the application startup instruction and run it to start the application.

[0057] For example, a user initiates a deployment request and sends the published pipeline template to the Kubernetes cluster. The custom resource controller in the cluster parses the published pipeline template format and deploys the template to the corresponding cluster environment according to the load balancing strategy. During the deployment process, the corresponding image will be pulled from the image repository to start the application according to the actual application situation.

[0058] In one embodiment, the method further includes: collecting log information during the execution of the task in real time; storing the collected log information, and displaying it to the user.

[0059] In one embodiment, it also includes: real-time monitoring of the running status of the pipeline (such as the success or failure of the task) and monitoring of the log information of the task running. After the log collection is completed and the task is completed, the container is deleted to release the construction resources for other tasks to use, thereby achieving reasonable utilization of resources.

[0060] Figure 1 The execution subject of the container-based resource scheduling method shown can be a computer. Figure 1 As can be seen from the process shown, the container-based resource scheduling method of the embodiment of the present invention first creates a pipeline template according to the pipeline template request, and then converts each task into a corresponding container in turn according to the task scheduling order in the pipeline template, and then mounts the resources of the corresponding task in the container, and deploys the container with mounted resources on the target node, which can evenly schedule resources and ensure full utilization of resources.

[0061] The specific process of the embodiment of the present invention is as follows:

[0062] 1. Receive the pipeline template sending request, and obtain the task scheduling order according to the pipeline template sending request.

[0063] 2. Obtain each task and its resources according to the task scheduling order.

[0064] 3. Create a pipeline template based on the task scheduling sequence, tasks and resources of each task.

[0065] 4. Convert each task into a corresponding container in sequence according to the task scheduling order in the pipeline template.

[0066] 5. Mount the resources of the corresponding task in the container.

[0067] 6. Deploy the container with mounted resources on the predetermined target node to achieve resource scheduling.

[0068] 7. Run the container on the target node to obtain the task execution result; when the task execution result is an image, upload the image to the image warehouse and receive the application startup instruction.

[0069] 8. Pull the corresponding image from the image repository according to the application startup instructions and run it to start the application.

[0070] In summary, the container-based resource scheduling method provided by the embodiment of the present invention has the following beneficial effects:

[0071] 1. The pipeline tasks can be run in the Kubernetes cluster as containers. By using the Kubernetes scheduler (kube-scheduler)'s ability to pre-select and optimize strategies, each task can be distributed to idle nodes for execution, making full use of the computing resources of each node to complete the CI / CD pipeline tasks.

[0072] 2. Through the custom resource controller, the control of the pipeline and the operation of the custom resource CRD are completed in the Kubernetes cluster. Users only need a Kubernetes cluster environment to easily install and run the CI / CD pipeline, avoiding the work of applying for and configuring the execution environment in the traditional CI / CD process, and closely integrating with the cloud ecosystem.

[0073] 3. The present invention first defines the tasks to be executed through a custom resource template device, and then organizes the tasks into a pipeline, which has the characteristics of flexible arrangement and reusable tasks, and is also convenient for sharing and modification among users.

[0074] 4. The present invention monitors the running status and log information of tasks, so that users can view the running information of tasks in real time, and can promptly find and repair problems for abnormal tasks. At the same time, the present invention will clean up the tasks that have been completed, further release computing resources, and ensure full utilization of resources.

[0075] 5. Containerization: The core of the present invention is to containerize the build tasks and integrate them with Kubernetes natively. The installation of the CI / CD process and the task operation are all completed in the Kubernetes cluster. Users do not need to build an additional build environment. As long as they have a Kubernetes cluster, they can implement CI / CD pipeline operations. At the same time, compared with the traditional build pipeline, the system operation tasks of the present invention are destroyed upon use, and no historical task resources will remain.

[0076] 6. Lightweight: The construction tasks in the present invention do not require additional plug-ins. Users only need to introduce the construction image suitable for the application when writing the task resources. If the user is going to compile the code in the Java environment, then choose the java:1.8 image as the basic image; when the pre-compiled environment is the golang environment, golang:1.4 can be selected. Each task has its own image environment and will not interfere with each other.

[0077] 7. Strong stability: The custom resource controller runs in the Kubernetes cluster as a Deployment (a resource of Kubernetes that starts a corresponding number of containers based on the information filled in by the user). When the controller's container is deleted or abnormal, Kubernetes will automatically create a new copy to ensure that the number of copies is consistent with the set number.

[0078] Based on the same inventive concept, an embodiment of the present invention also provides a resource scheduling device based on containerization. Since the principle of solving the problem by the device is similar to that of the resource scheduling method based on containerization, the implementation of the device can refer to the implementation of the method, and the repeated parts will not be repeated.

[0079] Figure 4 It is a structural block diagram of a container-based resource scheduling device in an embodiment of the present invention. Figure 5 It is a structural block diagram of a custom resource template device in another embodiment of the present invention. Figure 6 It is a structural block diagram of a custom resource controller in another embodiment of the present invention. Figure 7 It is a structural block diagram of a monitoring device in another embodiment of the present invention. Figure 8 FIG. 1 is a structural block diagram of a log device in another embodiment of the present invention. Figure 4-Figure 8 As shown, the container-based resource scheduling device includes:

[0080] The pipeline template module is used to receive a pipeline template sending request and create a pipeline template according to the pipeline template sending request;

[0081] The container generation module is used to convert each task into a corresponding container in sequence according to the task scheduling order in the pipeline template;

[0082] Resource mounting module, used to mount the resources of the corresponding task in the container;

[0083] The container deployment module is used to deploy the container after mounting resources on a predetermined target node to achieve resource scheduling.

[0084] In one embodiment, the pipeline template module includes:

[0085] The task scheduling sequence unit is used to obtain the task scheduling sequence according to the pipeline template.

[0086] A task resource acquisition unit, used to acquire each task and its resources according to the task scheduling order;

[0087] The pipeline template creation unit is used to create a pipeline template according to the task scheduling sequence, each task and the resources of each task.

[0088] In one embodiment, it also includes:

[0089] The container running module is used to run the container on the target node and obtain the task execution result.

[0090] In one embodiment, it also includes:

[0091] The image upload module is used to upload the image to the image warehouse when the task execution result is an image.

[0092] In one embodiment, it also includes:

[0093] The image pulling module is used to receive the application startup instruction, and pull the corresponding image from the image repository according to the application startup instruction and run it to start the application program.

[0094] In one embodiment, it also includes:

[0095] The container deletion module is used to delete the container corresponding to each task to release the resources corresponding to each task.

[0096] In one embodiment, it also includes:

[0097] The target node determination module is used to determine the target node according to the load balancing strategy.

[0098] like Figure 5-Figure 8 As shown, in actual application, the container-based resource scheduling device includes a custom resource template device, a custom resource controller, a monitoring device and a logging device.

[0099] The custom resource template device includes a pipeline resource management unit, a task unit, a pipeline unit and a pipeline operation unit.

[0100] The task unit defines the tasks to be performed (such as compiling code, building images, and pushing images). The task is the smallest configurable unit in the pipeline. Each task actually runs in the Kubernetes cluster in the form of a container. If the task is successfully executed, the corresponding container status will become Completed, otherwise it will be Failed.

[0101] The pipeline resource management unit defines the input and output information of the pipeline resources, and the pipeline can be used by importing the required resource names.

[0102] A pipeline unit is a combination of one or more tasks, resources, and custom parameters, including a pipeline template module. The pipeline template defines the names of the tasks and resources to be scheduled. When the custom resource control unit (Pipeline-Controller) parses the template, it will create the corresponding tasks based on the task name and resource name.

[0103] The pipeline operation unit is used to trigger the specified pipeline operation and output the pipeline operation results.

[0104] The custom resource controller includes a custom resource verification unit and a custom resource control unit.

[0105] The custom resource verification unit is used to verify the correctness of the pipeline template format.

[0106] The custom resource control unit includes a container generation module, a resource mounting module, a container deployment module, a container operation module, an image upload module, an image pull module, and a target node determination module, which are used to monitor the parsing, creation, deletion, modification, and query events of CRD resources. When the custom resource verification unit passes the verification, the task scheduling order set in the pipeline template is parsed, and the corresponding containers are generated for each task in turn, and the resources are mounted into the container. The scheduler (kube-scheduler) component of the Kubernetes cluster monitors the resource operation status on each virtual machine node (node), and deploys the task container to the selected target node through pre-selection and optimization of load balancing strategies to ensure full use of node resources.

[0107] The monitoring device includes a monitoring unit and a deletion unit, which are used to monitor the running status of the pipeline in real time (such as whether the task runs successfully or fails) and monitor the log information of the task running. After the log collection is completed and the task runs, the container is deleted to release the construction resources for other tasks to use, thereby achieving reasonable utilization of resources.

[0108] The monitoring unit is used to monitor the operating status of the assembly line in real time.

[0109] The deletion unit includes a container deletion module, which is used to delete the container after the task is completed.

[0110] The log device includes a log collection unit and a log storage unit, which are used to collect and store log information when the pipeline is running. The log information of each running pipeline will be collected by the log collection unit, and the collected log information will be stored by the log storage unit.

[0111] In summary, the containerized resource scheduling device of the embodiment of the present invention first creates a pipeline template according to the pipeline template request, and then converts each task into a corresponding container in sequence according to the task scheduling order in the pipeline template, and then mounts the resources of the corresponding task in the container, and deploys the container with mounted resources on the target node, which can evenly schedule resources and ensure full utilization of resources.

[0112] The embodiment of the present invention also provides a specific implementation of a computer device that can implement all the steps in the container-based resource scheduling method in the above embodiment. Fig. 9 is a block diagram of a computer device in an embodiment of the present invention, see Fig. 9 , the computer equipment specifically includes the following contents:

[0113] Processor (processor) 901 and memory (memory) 902 .

[0114] The processor 901 is used to call the computer program in the memory 902. When the processor executes the computer program, all steps in the container-based resource scheduling method in the above embodiment are implemented. For example, when the processor executes the computer program, the following steps are implemented:

[0115] Receive a pipeline template delivery request, and create a pipeline template according to the pipeline template delivery request;

[0116] Convert each task into a corresponding container in sequence according to the task scheduling order in the pipeline template;

[0117] Mount the resources of the corresponding task in the container;

[0118] The container with mounted resources is deployed on a predetermined target node to implement resource scheduling.

[0119] In summary, the computer device of the embodiment of the present invention first creates a pipeline template according to the pipeline template and sends a request, then converts each task into a corresponding container in sequence according to the task scheduling order in the pipeline template, and then mounts the resources of the corresponding task in the container, and deploys the container with mounted resources on the target node, which can evenly schedule resources and ensure full utilization of resources.

[0120] The embodiment of the present invention also provides a computer-readable storage medium capable of implementing all the steps in the container-based resource scheduling method in the above embodiment. The computer-readable storage medium stores a computer program. When the computer program is executed by a processor, all the steps of the container-based resource scheduling method in the above embodiment are implemented. For example, when the processor executes the computer program, the following steps are implemented:

[0121] Receive a pipeline template delivery request, and create a pipeline template according to the pipeline template delivery request;

[0122] Convert each task into a corresponding container in sequence according to the task scheduling order in the pipeline template;

[0123] Mount the resources of the corresponding task in the container;

[0124] The container with mounted resources is deployed on a predetermined target node to implement resource scheduling.

[0125] In summary, the computer-readable storage medium of an embodiment of the present invention first creates a pipeline template according to a pipeline template request, and then converts each task into a corresponding container in sequence according to the task scheduling order in the pipeline template, and then mounts the resources of the corresponding task in the container, and deploys the container with mounted resources on the target node, which can evenly schedule resources and ensure full utilization of resources.

[0126] The specific embodiments described above further illustrate the objectives, technical solutions and beneficial effects of the present invention in detail. It should be understood that the above description is only a specific embodiment of the present invention and is not intended to limit the scope of protection of the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present invention should be included in the scope of protection of the present invention.

[0127] Those skilled in the art may also understand that the various illustrative logical blocks, units, and steps listed in the embodiments of the present invention may be implemented by electronic hardware, computer software, or a combination of the two. In order to clearly demonstrate the interchangeability of hardware and software, the various illustrative components, units, and steps described above have generally described their functions. Whether such functions are implemented by hardware or software depends on the specific application and the design requirements of the entire system. Those skilled in the art may use various methods to implement the described functions for each specific application, but such implementation should not be understood as exceeding the scope of protection of the embodiments of the present invention.

[0128] The various illustrative logic blocks, or units, or devices described in the embodiments of the present invention can be implemented or operated by a general-purpose processor, a digital signal processor, an application-specific integrated circuit (ASIC), a field programmable gate array or other programmable logic device, a discrete gate or transistor logic, a discrete hardware component, or any combination of the above. The general-purpose processor can be a microprocessor, and optionally, the general-purpose processor can also be any conventional processor, controller, microcontroller or state machine. The processor can also be implemented by a combination of computing devices, such as a digital signal processor and a microprocessor, a plurality of microprocessors, one or more microprocessors combined with a digital signal processor core, or any other similar configuration.

[0129] The steps of the method or algorithm described in the embodiments of the present invention can be directly embedded in hardware, a software module executed by a processor, or a combination of the two. The software module can be stored in a RAM memory, a flash memory, a ROM memory, an EPROM memory, an EEPROM memory, a register, a hard disk, a removable disk, a CD-ROM, or other storage media of any form in the art. Exemplarily, the storage medium can be connected to the processor so that the processor can read information from the storage medium and can write information to the storage medium. Optionally, the storage medium can also be integrated into the processor. The processor and the storage medium can be arranged in an ASIC, and the ASIC can be arranged in a user terminal. Optionally, the processor and the storage medium can also be arranged in different components in the user terminal.

[0130] In one or more exemplary designs, the above functions described in the embodiments of the present invention can be implemented in hardware, software, firmware or any combination of the three. If implemented in software, these functions can be stored on a computer-readable medium, or transmitted in the form of one or more instructions or codes on a computer-readable medium. Computer-readable media include computer storage media and communication media that facilitate the transfer of computer programs from one place to another. The storage medium can be any available medium that can be accessed by any general or special computer. For example, such computer-readable media can include but are not limited to RAM, ROM, EEPROM, CD-ROM or other optical disk storage, disk storage or other magnetic storage devices, or any other medium that can be used to carry or store program codes in the form of instructions or data structures and other forms that can be read by general or special computers, or general or special processors. In addition, any connection can be appropriately defined as a computer-readable medium, for example, if the software is transmitted from a website site, server or other remote resource through a coaxial cable, fiber optic cable, twisted pair, digital subscriber line (DSL) or wirelessly, such as infrared, wireless and microwave, it is also included in the defined computer-readable medium. The disk and disc include compact disk, laser disk, optical disk, DVD, floppy disk and blue-ray disk. Disks usually copy data magnetically, while discs usually copy data optically with lasers. The above combination can also be included in computer readable media.

Claims

1. A resource scheduling method based on containerization, characterized in that: include: Receiving a pipeline template sending request, and creating a pipeline template according to the pipeline template sending request; Convert each task into a corresponding container in sequence according to the task scheduling order in the pipeline template; Mount the resources of the corresponding task in the container; Deploy the container with mounted resources on a predetermined target node to implement resource scheduling; The step of sending a request to create a pipeline template according to the pipeline template includes: Obtaining the task scheduling order by issuing a request according to the pipeline template; Acquire each task and its resources according to the task scheduling order; Creating a pipeline template according to the task scheduling order, the tasks and the resources of the tasks; Before creating the pipeline template according to the pipeline template sending request, it also includes: pre-installing the custom resource controller into the Kubernetes cluster to verify the pipeline template.

2. The container-based resource scheduling method according to claim 1, characterized in that: Also includes: The container is run on the target node to obtain a task execution result.

3. The container-based resource scheduling method according to claim 2, characterized in that: Also includes: When the task execution result is an image, the image is uploaded to the image warehouse.

4. The container-based resource scheduling method according to claim 3, characterized in that: After uploading the image to the image repository, the following steps are also included: An application startup instruction is received, and according to the application startup instruction, a corresponding image is pulled from the image repository and run to start the application program.

5. The container-based resource scheduling method according to claim 2, characterized in that: After getting the task execution results, it also includes: Delete the container corresponding to each task to release the resources corresponding to each task.

6. The container-based resource scheduling method according to claim 1, characterized in that: Also includes: Determine the target node based on the load balancing strategy.

7. A resource scheduling device based on containerization, characterized in that: include: A pipeline template module, used to receive a pipeline template sending request, and create a pipeline template according to the pipeline template sending request; A container generation module, used to convert each task into a corresponding container in sequence according to the task scheduling order in the pipeline template; Resource mounting module, used to mount the resources of the corresponding task in the container; The container deployment module is used to deploy the container after mounting resources on a predetermined target node to achieve resource scheduling; The pipeline template module includes: The task scheduling sequence unit is used to obtain the task scheduling sequence according to the pipeline template. A task resource acquisition unit, used to acquire each task and its resources according to the task scheduling order; A pipeline template creation unit, used to create a pipeline template according to the task scheduling sequence, each task and the resources of each task; The container-based resource scheduling device also includes: a custom resource controller installation module, which is used to pre-install the custom resource controller into the Kubernetes cluster to verify the pipeline template.

8. A computer device comprising a memory, a processor, and a computer program stored in the memory and running on the processor, characterized in that: When the processor executes the computer program, the steps of the container-based resource scheduling method described in any one of claims 1 to 6 are implemented.

9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the container-based resource scheduling method according to any one of claims 1 to 6 are implemented.

Citation Information

Patent Citations

  • Hadoop Yarn (Yet another Resource Negotiator) network bandwidth resource scheduling and isolating method and device

    CN107483364A

  • Containerized CICD service deployment method and device adaptive to multiple architectures

    CN112068845A