Workflow job scheduling control methodTechnical Field
The invention relates to the field of computers, in particular to a workflow job scheduling control method.
Background
Scientific computing, deep learning, big data jobs have become the most common job types in data centers and cloud computing centers. The existing data center and cloud computing center are diversified in operation type, and meanwhile, hardware resources are developed towards diversification and isomerization. Besides the common X86 CPU and GPU, the machine resources also comprise an NPU (advanced peripheral Unit) for deep learning operation training (such as an AI chip for deep learning model inference), various FPGA chips with special functions, open-source Arm, MIPS, RISK-V processors and the like. And different types of heterogeneous computing resources are clouded, so that the method becomes the best choice for solving the diversity of the operation load and the heterogeneity of the computing resources. The existing container arrangement management system (such as Kubernets) becomes an important core for operating and managing container operation. The container arrangement management system not only meets the requirement of providing a uniform operating environment for diversified operation loads, but also shields the difference of hardware for application developers. The application developer can only focus on the development process of the application and does not need to focus on system environment configuration maintenance. And system research and development workers do not need to provide compatibility support for various applications, and only need to perform compatibility adaptation on a Kubernetes unified application operation environment container.
But the support of the container arrangement management system on scientific calculation, deep learning and big data operation is still not ideal. This is because existing generic container orchestration management systems are initially stateless web services oriented. Support for stateful services such as scientific computing, deep learning, big data jobs, and caching, databases, etc. is insufficient. Typically, a deep learning operation has multiple steps, such as: the method comprises the following steps of data acquisition, data processing, data conversion, data segmentation, model training, parameter tuning, model verification, model online monitoring and log acquisition. However, in a load with "workflow" features, each step needs to wait for the completion of the previous step before it can be executed.
However, the job scheduler in the current container scheduling management system still adopts a first-come first-serve scheduling policy, and cannot meet the load characteristics of the "workflow" type job load. For example, in a multi-tenant scenario, multiple users submit multiple workflow jobs. The later submitted workflow jobs are delayed for a long time and the quality of service of each workflow cannot be guaranteed.
Therefore, in order to solve the above technical problems, it is necessary to provide a new technical means for solving the problems.
Disclosure of Invention
In view of the above, an object of the present invention is to provide a method for controlling job scheduling of a workflow, which can dynamically adjust the execution priority of jobs in the workflow and dynamically adjust the execution order of each job in the same priority, thereby effectively improving the service quality of the jobs, improving the resource utilization rate, and reducing the overall completion time of the jobs.
The invention provides a workflow job scheduling control method, which comprises the following steps:
s1, traversing all the jobs in the workflow of the job control module, and recording the number of predecessor dependent jobs and job numbers of each job;
s2, determining executable operation from the workflow;
s3, determining the priority of the executable job, and sending the executable job and the priority thereof to a job control queue;
and S4, the job control queue divides the jobs into different priority levels according to the priority levels of the jobs, and in each priority level, the selected jobs are executed from a high priority level to a low priority level.
Further, in step S2, the executable job determination process in the workflow is as follows:
s21, judging whether the operation i is the operation of the workflow according to the operation number of the operation i, if so, entering the next step, and if not, ending;
s22, recording the operation time of the predecessor dependent operation of the operation i, including the operation completion time TreceiveAnd a work start time TsendCalculating the actual execution time T of the predecessor dependent job of job iexecute:
Texecute=Treceive-Tsend;
S23, each time the predecessor dependent operation of the operation i is executed, the number of the dependent operations of the operation i is reduced by 1, and the earliest executable time T of the operation i is updatedi,start:
Ti,start=max{Tpre,finishIn which T ispre,finishRelying on the completion time of the job, T, for the remaining predecessors of job ipre,finish=Texecute+Tstart,TstartRelying on the start time of the job for the remaining predecessors of job i; if the number of dependent jobs of job i is 0, job i is an executable job.
Further, the priority of the executable job is determined by:
determining an actual start time T for an executable jobi,startWorking time T set by systemi,systemA difference of (d);
determining priority D of executable job ii:Di={Ti,send-Ti,start0 }; wherein:
if T isi,send≤Ti,startSince it is described that operation i has not been delayed, the priority is set to 0, and if T is seti,system>Ti,startIt is explained that the job has been delayed, and the priority is larger the longer the delayed time is.
Further, in step S4, the priority level is determined according to the following method:
low priority level:
wherein D ═ D
max-D
min;D
maxAs the maximum value of the priority of all executable jobs, D
minIs the minimum of the priorities of all executable jobs.
Further, in step S4, the selected job is determined by:
and (3) constructing an execution profit equation:
f(i,j)=max{f(i-1,j),f(i-1,j-vi)+wi}; wherein f (i, j) represents the maximum gain that can be achieved by the whole cluster if the machine resource is j under the condition of considering the first i jobs, f (i-1, j) represents the maximum gain that can be achieved by the whole cluster if the machine resource is j under the condition of considering the first i-1 jobs, and f (i-1, j-v)i) Represents the maximum benefit, w, that the entire cluster can achieve with machine resources j-vi, considering the first i-1 jobsi=tmax-ti,tmaxRepresents the execution time, t, of the job having the longest execution time among all the jobsiIndicates the current job execution time, f (i-1, V-V)i) Represents the maximum benefit that can be achieved for the entire cluster with machine resources V-vi, V @, given the first i-1 jobs considerediRepresenting the request quantity of the job i to all the resources V of the system;
traversing the job queues with three priority levels, and judging whether f (i, V) is equal to f (i-1, V-V)i)+wiIf the two are the same, the operation i is selected, otherwise, the operation i is not selectedWherein f (i, V) considers the maximum gain that the whole cluster can achieve under all the resources V of the system under the first i job conditions; f (i-1, V-V)i) Representing a system resource of V-V under consideration of i-1 job conditionsiThe maximum gain that can be achieved by the whole cluster.
The invention has the beneficial effects that: by the method and the device, the execution priority of the jobs in the workflow can be dynamically adjusted, and the execution sequence of each job in the same priority can be dynamically adjusted, so that the service quality of the jobs can be effectively improved, the resource utilization rate can be improved, and the total completion time of the jobs can be reduced.
Drawings
The invention is further described below with reference to the following figures and examples:
FIG. 1 is a flow chart of the present invention.
Detailed Description
The invention is described in further detail below with reference to the drawings of the specification:
the invention provides a workflow job scheduling control method, which comprises the following steps:
s1, traversing all the jobs in the workflow of the job control module, and recording the number of predecessor dependent jobs and job numbers of each job;
s2, determining executable operation from the workflow;
s3, determining the priority of the executable job, and sending the executable job and the priority thereof to a job control queue;
and S4, the job control queue divides the jobs into different priority levels according to the priority levels of the jobs, and the selected jobs are executed from a high priority level to a low priority level in each priority level.
In this embodiment, in step S2, the executable job determination process in the workflow is as follows:
s21, judging whether the operation i is the operation of the workflow according to the operation number of the operation i, if so, entering the next step, and if not, ending;
s22, recording the operation time of the predecessor dependent operation of the operation i, including the operation completion time TreceiveAnd a work start time TsendCalculating the actual execution time T of the predecessor dependent job of job iexecute:
Texecute=Treceive-Tsend;
S23, each time the predecessor dependent operation of the operation i is executed, the number of the dependent operations of the operation i is reduced by 1, and the earliest executable time T of the operation i is updatedi,start:
Ti,start=max{Tpre,finishIn which T ispre,finishRelying on the completion time of the job, T, for the remaining predecessors of job ipre,finish=Texecute+Tstart,TstartRelying on the start time of the job for the remaining predecessors of job i; if the number of dependent jobs of the job i is 0, the job i is an executable job, wherein the predecessor dependent job of the job i indicates that the job i is to be executed, and the job i must be executed after the jobs such as i1, i2, …, im and the like are completed, wherein i1, i2, …, im indicates that m predecessor dependent jobs of the job i are executed, and each time the predecessor dependent job of the job i is executed, m is reduced by 1 until the m predecessor dependent job is 0.
In this embodiment, the priority of the executable job is determined by the following method:
determining an actual start time T for an executable jobi,startWorking time T set by systemi,systemA difference of (d);
determining priority D of executable job ii:Di={Ti,send-Ti,start0 }; wherein:
if T isi,send≤Ti,startSince it is described that operation i has not been delayed, the priority is set to 0, and if T is seti,system>Ti,startIt is explained that the job has been delayed, and the priority is larger the longer the delayed time is.
In this embodiment, in step S4, the priority level is determined according to the following method:
low priority level:
wherein D ═ D
max-D
min;D
maxAs the maximum value of the priority of all executable jobs, D
minIs the minimum of the priorities of all executable jobs.
Specifically, the method comprises the following steps: in step S4, the selected job is determined by:
and (3) constructing an execution profit equation:
f(i,j)=max{f(i-1,j),f(i-1,j-vi)+wi}; wherein f (i, j) represents the maximum gain that can be achieved by the whole cluster if the machine resource is j under the condition of considering the first i jobs, f (i-1, j) represents the maximum gain that can be achieved by the whole cluster if the machine resource is j under the condition of considering the first i-1 jobs, and f (i-1, j-v)i) Represents the maximum benefit, w, that the entire cluster can achieve with machine resources j-vi, considering the first i-1 jobsi=tmax-ti,tmaxRepresents the execution time, t, of the job having the longest execution time among all the jobsiIndicates the current job execution time, f (i-1, V-V)i) Represents the maximum benefit that can be achieved for the entire cluster with machine resources V-vi, V @, given the first i-1 jobs considerediRepresenting the request quantity of the job i to all the resources V of the system;
go throughThree priority levels of job queue, and determining whether f (i, V) is equal to f (i-1, V-V)i)+wiIf so, indicating that the job i is selected, otherwise, not selecting the job i, wherein f (i, V) considers the maximum benefit which can be achieved by the whole cluster under the condition of all the resources V of the system under the condition of the first i jobs; f (i-1, V-V)i) Representing a system resource of V-V under consideration of i-1 job conditionsiThe maximum gain that can be achieved by the whole cluster.
In the prior art, the job which is always submitted first in the scheduling control of the job always occupies system resources, and the job which is submitted later cannot be executed and is blocked for a long time.
Finally, the above embodiments are only for illustrating the technical solutions of the present invention and not for limiting, although the present invention has been described in detail with reference to the preferred embodiments, it should be understood by those skilled in the art that modifications or equivalent substitutions may be made to the technical solutions of the present invention without departing from the spirit and scope of the technical solutions of the present invention, and all of them should be covered in the claims of the present invention.