Cloud-native orchestration scheduling system scheduling method, device and storage medium
By encapsulating the judgment rules of the cloud-native orchestration and scheduling system into a plug-in form, the flexible configuration and extensibility of the preemption rules in the scheduler are realized, which solves the problem of insufficient extensibility of the preemption mechanism in the existing technology and meets the need for flexible preemption.
Patent Information
- Application Number
- CN202411281893.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-12
- Publication Date
- 2026-02-06
- Estimated Expiration
- 2044-09-12
AI Technical Summary
The existing cloud-native orchestration and scheduling systems have weak preemption mechanisms, which cannot flexibly add or delete preemption rules and cannot meet flexible preemption requirements.
The judgment rules used to determine whether an instance is allowed to be preempted are encapsulated as plugins. The target judgment rule plugin is determined from the preset judgment rule plugin set through the rule plugin selection instruction and loaded in the scheduler. The candidate nodes are sorted in combination with the preset comparison plugin to achieve flexible configuration of the preemption rules.
It improves the flexibility and scalability of preemption rules in the scheduler, making it easier to determine the addition and deletion of rules and meeting more flexible preemption requirements.
Smart Images

Figure CN119011584B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The embodiment of the present disclosure relates to the technical field of computer and network communication, in particular to a scheduling method of a cloud-native orchestration scheduling system, a device and a storage medium. BACKGROUND
[0002] In recent years, the concept of cloud-native has gradually become popular. Cloud-native aims to achieve a more efficient, reliable, flexible and scalable way of developing and running applications. In order to achieve this goal, various cloud-native orchestration scheduling technologies have emerged. Cloud-native orchestration scheduling refers to the process of effectively managing and scheduling containerized workloads in cloud-native applications. It needs to select appropriate resources for applications in the cluster, and when there are no resources available in the cluster, it needs to acquire resources by preemption. Preemption refers to the process of terminating low-priority applications so that high-priority applications can be scheduled to run. This mechanism ensures that critical workloads in the cluster can obtain sufficient computing resources according to their priority and needs, thereby maintaining the stability and reliability of the system.
[0003] However, the existing cloud-native orchestration scheduling usually implements preemption based on preset preemption rules, but the existing preemption mechanism has poor scalability and cannot flexibly add or delete preset preemption rules, which cannot meet the flexible preemption requirements. SUMMARY
[0004] The embodiment of the present disclosure provides a scheduling method of a cloud-native orchestration scheduling system, a device and a storage medium to improve the flexibility and scalability of configuring preemption rules when the scheduler preempts.
[0005] In a first aspect, the embodiment of the present disclosure provides a scheduling method of a cloud-native orchestration scheduling system, comprising:
[0006] In response to a rule plug-in selection instruction, a target judgment rule plug-in is determined from a plurality of preset judgment rule plugs included in a preset judgment rule plug-in set, and the target judgment rule plug-in is loaded in a scheduler of the cloud-native orchestration scheduling system. Any judgment rule plug-in is configured with at least one preset judgment rule for judging whether an instance is allowed to be preempted;
[0007] For a to-be-deployed instance, whether any instance of any node in the cloud-native orchestration scheduling system is allowed to be preempted by the to-be-deployed instance is judged in sequence by the target judgment rule plug-in;
[0008] if there is an instance in the any node that allows to be preempted by the to-be-deployed instance, the any node is determined as a candidate to-be-preempted node, and a candidate to-be-preempted instance in the candidate to-be-preempted node is determined according to the to-be-deployed instance and the instance in the candidate to-be-preempted node that allows to be preempted;
[0009] the candidate to-be-preempted nodes are sorted by a preset comparison plug-in in the scheduler, a target to-be-preempted node is determined according to a sorting result, and the to-be-deployed instance is controlled to preempt the candidate to-be-preempted instance in the target to-be-preempted node.
[0010] In a second aspect, the embodiments of the present disclosure provide a scheduling device of a cloud native orchestration scheduling system, comprising:
[0011] a rule selection unit configured to determine a target judgment rule plug-in from a plurality of preset judgment rule plugs-in included in a preset judgment rule plug-in set in response to a rule plug-in selection instruction, and load the target judgment rule plug-in in a scheduler of the cloud native orchestration scheduling system, wherein at least one preset judgment rule for judging whether an instance allows to be preempted is configured in any judgment rule plug-in;
[0012] a processing unit configured to, for a to-be-deployed instance, sequentially judge whether any instance of any node in the cloud native orchestration scheduling system allows to be preempted by the to-be-deployed instance by using the target judgment rule plug-in, and if there is an instance in the any node that allows to be preempted by the to-be-deployed instance, determine the any node as a candidate to-be-preempted node, and determine a candidate to-be-preempted instance in the candidate to-be-preempted node according to the to-be-deployed instance and the instance in the candidate to-be-preempted node that allows to be preempted;
[0013] a preemption unit configured to sort the candidate to-be-preempted nodes by a preset comparison plug-in in the scheduler, determine a target to-be-preempted node according to a sorting result, and control the to-be-deployed instance to preempt the candidate to-be-preempted instance in the target to-be-preempted node.
[0014] In a third aspect, the embodiments of the present disclosure provide an electronic device, comprising at least one processor and a memory;
[0015] the memory stores computer execution instructions;
[0016] the at least one processor executes the computer execution instructions stored in the memory, so that the at least one processor performs the scheduling method of the cloud native orchestration scheduling system as described in the above first aspect and various possible designs of the first aspect.
[0017] In a fourth aspect, the embodiments of the present disclosure provide a computer readable storage medium, in which computer execution instructions are stored. When a processor executes the computer execution instructions, a scheduling method of a cloud native orchestration scheduling system is implemented, as described in the first aspect and various possible designs of the first aspect.
[0018] In a fifth aspect, the embodiments of the present disclosure provide a computer program product, which includes computer execution instructions. When a processor executes the computer execution instructions, a scheduling method of a cloud native orchestration scheduling system is implemented, as described in the first aspect and various possible designs of the first aspect.
[0019] The scheduling method, device and storage medium of the cloud native orchestration scheduling system provided by the embodiments of the present disclosure can determine a target judgment rule plug-in from a plurality of preset judgment rule plug-ins included in a preset judgment rule plug-in set in response to a rule plug-in selection instruction, and load the target judgment rule plug-in in a scheduler of the cloud native orchestration scheduling system. Any judgment rule plug-in is configured with at least one preset judgment rule for judging whether an instance is allowed to be preempted. For a to-be-deployed instance, whether any instance of any node in the cloud native orchestration scheduling system is allowed to be preempted by the to-be-deployed instance is sequentially judged by the target judgment rule plug-in. If there is an instance allowed to be preempted in any node, the node is determined as a candidate to-be-preempted node, and a candidate to-be-preempted instance in the candidate to-be-preempted node is determined according to the to-be-deployed instance and the instance allowed to be preempted in the candidate to-be-preempted node. The preset comparison plug-in in the scheduler is used to sort the candidate to-be-preempted nodes, and a target to-be-preempted node is determined according to a sorting result, and the to-be-deployed instance is controlled to preempt the candidate to-be-preempted instance in the target to-be-preempted node. In the embodiments of the present disclosure, the judgment rule for judging whether an instance is allowed to be preempted is encapsulated in the form of a plug-in, which can reduce the coupling between the scheduler and the judgment rule, flexibly control the loading and unloading of the plug-in, improve the flexibility and expansibility of the scheduler when the judgment rule is configured, facilitate the addition and deletion of the judgment rule, and facilitate the forced stop in the judgment process, thereby meeting the preemption demand with better flexibility. BRIEF DESCRIPTION OF DRAWINGS
[0020] In order to more clearly illustrate the technical solutions in the embodiments of the present disclosure or the prior art, the following will briefly introduce the drawings needed in the embodiments or the prior art description. Obviously, the drawings in the following description are some embodiments of the present disclosure, and those skilled in the art can also obtain other drawings according to these drawings without creative labor.
[0021] Figure 1 The application scenario diagram of the scheduling method of the cloud native orchestration scheduling system provided by an embodiment of the present disclosure is shown in the following figure.
[0022] Figure 2 A flowchart of a scheduling method of a cloud-native orchestration scheduling system provided by an embodiment of the present disclosure is shown in FIG. 1.
[0023] Figure 3 A flowchart of a scheduling method of a cloud-native orchestration scheduling system provided by another embodiment of the present disclosure is shown in FIG. 2.
[0024] Figure 4 An interface diagram of a judgment rule plug-in provided by an embodiment of the present disclosure is shown in FIG. 3.
[0025] Figure 5 A block diagram of a scheduling device of a cloud-native orchestration scheduling system provided by an embodiment of the present disclosure is shown in FIG. 4.
[0026] Figure 6 A hardware structure diagram of an electronic device provided by an embodiment of the present disclosure is shown in FIG. 5. DETAILED DESCRIPTION
[0027] To make the objectives, technical solutions, and advantages of the embodiments of the present disclosure clearer, the technical solutions in the embodiments of the present disclosure will be described below in connection with the drawings in the embodiments of the present disclosure. Obviously, the described embodiments are only part of the embodiments of the present disclosure, rather than all the embodiments. Based on the embodiments in the present disclosure, all other embodiments obtained by those of ordinary skill in the art without any creative work fall within the protection scope of the present disclosure.
[0028] The existing cloud-native orchestration scheduling is usually implemented based on preset preemption rules, and different orchestration systems have different preemption rules. The following are the preemption mechanisms of several common orchestration scheduling technologies:
[0029] 1) K8S default scheduler
[0030] Kubernetes is being accepted and recognized by more and more companies as the de facto standard in the field of cloud-native orchestration scheduling. K8S Default Scheduler, as the default scheduler used by K8S, is also being widely applied. The preemption of K8S Default Scheduler is divided into two stages. The first stage is candidate node screening, and the second stage is to select the most suitable target node from the candidate nodes.
[0031] In the first phase, all nodes need to be traversed to identify all instances on a node with a lower priority than the instance to be scheduled, as "Candidate Victims," and these instances are removed from the node. Then, these Candidate Victims are added back to the node in descending order of priority. If, when any Candidate Victim is added back to the node, the node is still schedulable, then the Candidate Victim does not need to be preempted; otherwise, if the node is no longer schedulable, then the Candidate Victim needs to be preempted.
[0032] In the second stage, the instance of each node that needs to be preempted is scored through the abstracted scoring interface to obtain the score corresponding to each node. The node with the highest score is selected as the most suitable target node and the final preemption is carried out.
[0033] 2) Yarn Scheduler
[0034] Unlike the Kubernetes Default Scheduler, the Yarn Scheduler does not have an explicit preemption mechanism. However, it allows for resource management and scheduling of jobs with different priorities to ensure that critical jobs can obtain resources first. Although there is no direct preemption mechanism, a similar effect can be achieved by adjusting queue priorities and resource allocation strategies, ensuring that critical jobs can be completed on time.
[0035] 3) Yunikorn scheduler
[0036] The Yunikorn Scheduler's preemption strategy is similar to that of the K8S Default Scheduler. However, in the first phase of candidate node selection, it considers queue fairness in addition to priority to ensure that each queue receives its guaranteed resource capacity. Furthermore, in the second phase, it uses fixed, simple rules to score each candidate node, unlike the K8S Default Scheduler which abstracts a generic scoring interface.
[0037] However, existing preemption mechanisms have limited scalability, failing to flexibly add or delete preset preemption rules and thus unable to meet flexible preemption requirements. Furthermore, in current preemption mechanisms, the required preemption rules are written in the program code, and the program must run all preemption rules at runtime, without the flexibility to stop or skip certain rules.
[0038] To solve the above technical problems, the disclosure provides a scheduling method of a cloud-native orchestration scheduling system, which can encapsulate the judgment rule for judging whether an instance is allowed to be preempted into a plug-in form, reduce the coupling between the scheduler and the judgment rule, flexibly control the loading and unloading of the plug-in, improve the flexibility and scalability of the configuration of the judgment rule in the scheduler, facilitate the addition and deletion of the judgment rule, and facilitate the forced stop in the judgment process, thereby meeting the preemption demand with better flexibility.
[0039] Specifically, as shown in Figure 1 , the target judgment rule plug-in can be determined from a plurality of preset judgment rule plug-ins included in a preset judgment rule plug-in set in response to a rule plug-in selection instruction, and the target judgment rule plug-in is loaded in the scheduler of the cloud-native orchestration scheduling system; for a to-be-deployed instance, whether any instance of any node in the cloud-native orchestration scheduling system is allowed to be preempted by the to-be-deployed instance is sequentially judged by the target judgment rule plug-in; if there is an instance in any node that is allowed to be preempted by the to-be-deployed instance, the any node is determined as a candidate to-be-preempted node, and a candidate to-be-preempted instance in the candidate to-be-preempted node is determined according to the to-be-deployed instance and the instance in the candidate to-be-preempted node that is allowed to be preempted; each candidate to-be-preempted node is sorted by a preset comparison plug-in in the scheduler, and a target to-be-preempted node is determined according to a sorting result, and the to-be-deployed instance is controlled to preempt the candidate to-be-preempted instance in the target to-be-preempted node.
[0040] In addition, the preset comparison plug-in in the scheduler can only have one, optionally, the user can set the preset comparison rule of the preset comparison plug-in, or different preset comparison plug-ins can be configured, the preset comparison rules in different preset comparison plug-ins are different, and a plurality of preset comparison plug-ins constitute a preset comparison plug-in set, a preset comparison plug-in can be determined from the preset comparison plug-in set and loaded into the scheduler, as shown in Figure 1 , the flexible selection of the preset comparison rule is realized.
[0041] The scheduling method of the cloud-native orchestration scheduling system of the disclosure will be described in detail below with reference to specific embodiments.
[0042] Reference Figure 2 , Figure 2 is a flowchart of a scheduling method of a cloud-native orchestration scheduling system provided by an embodiment of the disclosure. The method of the embodiment can be applied in a scheduler of a cloud-native orchestration scheduling system, and the scheduling method of the cloud-native orchestration scheduling system provided by the embodiment includes:
[0043] S201, in response to a rule plug-in selection instruction, determining a target judgment rule plug-in from a plurality of preset judgment rule plugs included in a preset judgment rule plug-in set, and loading the target judgment rule plug-in in a scheduler of the cloud-native orchestration and scheduling system; wherein at least one preset judgment rule for judging whether an instance is allowed to be preempted is configured in any judgment rule plug-in.
[0044] In the embodiment, in the case that the remaining resources of all nodes of the cloud-native orchestration and scheduling system are insufficient to deploy the to-be-deployed instance, it is necessary to preempt in the cloud-native orchestration and scheduling system, that is, to delete one or more existing instances in a node to free up resources to deploy the to-be-deployed instance. However, which instances in any node are allowed to be preempted by the to-be-deployed instance and which instances are not allowed to be preempted can be judged by the scheduler of the cloud-native orchestration and scheduling system based on some judgment rules. In different scenarios, the judgment rules can be different. For example, in some scenarios, the judgment is based on priority. The existing instance with a priority higher than that of the to-be-deployed instance is not allowed to be preempted. In some scenarios, the judgment is based on the frequency of preemption. The frequency of preemption of any existing instance cannot exceed a preset frequency threshold. The existing instance with a frequency of preemption reaching the preset frequency threshold is not allowed to be preempted. Of course, there can be various other rules, which are not described here.
[0045] In order to facilitate the scheduler of the cloud-native orchestration and scheduling system to flexibly change the judgment rules, in the embodiment, each kind of or multiple kinds of judgment rules are encapsulated into plug-in form, different preset judgment rule plugs are constructed into a preset judgment rule plug-in set, and then one or more preset judgment rule plugs can be selected as target judgment rule plugs from the preset judgment rule plug-in set according to the demand in the rule plug-in selection instruction, and the target judgment rule plug-in is loaded in the scheduler. Of course, the loaded target judgment rule plug-in can also be unloaded or skipped flexibly according to the demand. By encapsulating each kind of or multiple kinds of judgment rules into plug-in form, the coupling between the scheduler and the judgment rules can be reduced, the flexibility and expansibility of the scheduler when configuring the judgment rules can be improved, the addition and deletion of the judgment rules are more convenient and less invasive, and the code readability is stronger. Optionally, the scheduler can also automatically select the target judgment rule plug-in. The selection process is not limited here.
[0046] S202, for the to-be-deployed instance, sequentially judging whether any instance of any node in the cloud-native orchestration and scheduling system is allowed to be preempted by the to-be-deployed instance through the target judgment rule plug-in.
[0047] In the embodiment, after the target judgment rule plug-in is loaded in the scheduler, whether any instance in any node in the cloud native orchestration and scheduling system is allowed to be preempted by the to-be-deployed instance can be judged by the target judgment rule plug-in in turn. Optionally, each instance in each node in the cloud native orchestration and scheduling system can be traversed, and whether each instance is allowed to be preempted by the to-be-deployed instance can be judged by the target judgment rule plug-in in turn.
[0048] Optionally, input information of the target judgment rule plug-in can be acquired, wherein the input information comprises one or more of information of the to-be-deployed instance, information of the any node, and information of any instance of the any node.
[0049] The input information is input into the target judgment rule plug-in, and whether the any instance is allowed to be preempted by the to-be-deployed instance is judged by a preset judgment rule in the target judgment rule plug-in.
[0050] In the embodiment, when the target judgment rule plug-in judges whether any instance in any node in the cloud native orchestration and scheduling system is allowed to be preempted by the to-be-deployed instance, some information needs to be based on for judgment. The information required by different target judgment rule plug-ins can be different, including but not limited to one or more of information of the to-be-deployed instance, information of the any node, and information of any instance of the any node. Therefore, in the embodiment, the above information required by the target judgment rule plug-in can be acquired as input information and input into the target judgment rule plug-in, and then a preset judgment rule is used to judge whether any instance is allowed to be preempted by the to-be-deployed instance based on the input information in the target judgment rule plug-in.
[0051] Optionally, there can be multiple target judgment rule plug-ins selected and loaded according to the rule plug-in selection instruction, and the multiple target judgment rule plug-ins are configured with a preset triggering sequence. The preset triggering sequence can be configured in the rule plug-in selection instruction, or configured according to a separate triggering sequence setting instruction, or determined by using any other feasible manner, which is not limited here.
[0052] Further, whether any instance is allowed to be preempted by the to-be-deployed instance is judged by a preset judgment rule in the target judgment rule plug-in. Specifically, as shown in Figure 3 , it comprises
[0053] S301, for any current target judgment rule plug-in, the input information is input into the current target judgment rule plug-in, and whether the any instance is allowed to be preempted by the to-be-deployed instance is judged by a preset judgment rule in the current target judgment rule plug-in.
[0054] S302, if it is directly determined that any instance is allowed to be preempted by the to-be-deployed instance or is not allowed to be preempted by the to-be-deployed instance, stop triggering the next target judgment rule plug-in; or
[0055] S303, if it is not directly determined that any instance is allowed to be preempted by the to-be-deployed instance or is not allowed to be preempted by the to-be-deployed instance, trigger the next target judgment rule plug-in, input the input information into the next target judgment rule plug-in to continue judgment.
[0056] In the embodiment, since there are multiple target judgment rule plug-ins, for any instance, each target judgment rule plug-in needs to be used for judgment in sequence, and in order to avoid resource waste and improve judgment efficiency, if it is determined that the instance is allowed to be preempted by the to-be-deployed instance or is not allowed to be preempted by the to-be-deployed instance by any target judgment rule plug-in, the judgment of the subsequent target judgment rule plug-in can be stopped.
[0057] In specific implementation, for any instance, the input information of the first target judgment rule plug-in is acquired first, and is input into the first target judgment rule plug-in, if the first target judgment rule plug-in can directly determine that the instance is allowed to be preempted by the to-be-deployed instance or is not allowed to be preempted by the to-be-deployed instance, the judgment of the second target judgment rule plug-in is stopped; if the first target judgment rule plug-in cannot directly determine that the instance is allowed to be preempted by the to-be-deployed instance or is not allowed to be preempted by the to-be-deployed instance, the input information of the second target judgment rule plug-in is acquired and is input into the second target judgment rule plug-in, if the second target judgment rule plug-in can directly determine that the instance is allowed to be preempted by the to-be-deployed instance or is not allowed to be preempted by the to-be-deployed instance, the judgment of the third target judgment rule plug-in is stopped; if the second target judgment rule plug-in cannot directly determine that the instance is allowed to be preempted by the to-be-deployed instance or is not allowed to be preempted by the to-be-deployed instance, the input information of the third target judgment rule plug-in is acquired and is input into the third target judgment rule plug-in, and the judgment of the third target judgment rule plug-in is continued, and the process is repeated until it is determined that the instance is allowed to be preempted by the to-be-deployed instance or is not allowed to be preempted by the to-be-deployed instance.
[0058] S203, if there is an instance allowed to be preempted by the to-be-deployed instance in any node, the any node is determined as a candidate to-be-preempted node, and a candidate to-be-preempted instance in the candidate to-be-preempted node is determined according to the to-be-deployed instance and the instance allowed to be preempted in the candidate to-be-preempted node.
[0059] In the embodiment, for any instance in any node, if there is an instance allowed to be preempted by the to-be-deployed instance in the node after judgment by the target judgment rule plug-in in sequence, the to-be-deployed instance can be preempted in the node, and the node can be determined as a candidate to-be-preempted node.
[0060] Further, since there can be multiple instances in the candidate to be pre-empted node that are allowed to be pre-empted by the to-be-deployed instance, but it is not necessary to pre-empt all the instances allowed to be pre-empted by the to-be-deployed instance, pre-empting one or more of them can satisfy the deployment of the to-be-deployed instance, therefore, it is necessary to screen one or more from the instances allowed to be pre-empted in the candidate to be pre-empted node as the specified to-be-pre-empted instance of the candidate to be pre-empted node for the to-be-deployed instance, which is recorded as the candidate to-be-pre-empted instance corresponding to the candidate to be pre-empted node, that is, if the to-be-deployed instance is deployed in the candidate to be pre-empted node, pre-empting the candidate to-be-pre-empted instance can realize the deployment of the to-be-deployed instance.
[0061] Optionally, when determining the candidate to-be-pre-empted instance in the candidate to be pre-empted node according to the to-be-deployed instance and the instances allowed to be pre-empted in the candidate to be pre-empted node, the instances allowed to be pre-empted in the candidate to be pre-empted node can be removed, and in the case of deploying the to-be-deployed instance in the candidate to be pre-empted node, the instances allowed to be pre-empted can be deployed back to the candidate to be pre-empted node in turn according to the priority from high to low until the candidate to be pre-empted node cannot continue to be deployed, and the remaining instances allowed to be pre-empted which are not deployed to the candidate to be pre-empted node are determined as the candidate to-be-pre-empted instance in the candidate to be pre-empted node.
[0062] For example, assuming that the instances allowed to be pre-empted in the candidate to be pre-empted node include instance 1, instance 2 and instance 3, wherein the priority of instance 1 is the highest and the priority of instance 3 is the lowest, instance 1, instance 2 and instance 3 are removed from the candidate to be pre-empted node, and the to-be-deployed instance is deployed in the candidate to be pre-empted node, then instance 1 is attempted to be deployed back to the candidate to be pre-empted node according to the priority from high to low, if instance 1 cannot be deployed, it indicates that the remaining resources after the deployment of the to-be-deployed instance are insufficient to deploy instance 1 again, and instance 1 is taken as a candidate to-be-pre-empted instance; whether instance 1 can be deployed or not, instance 2 needs to be continuously attempted to be deployed, if instance 2 cannot be deployed, it indicates that the remaining resources after the deployment of the to-be-deployed instance are insufficient to deploy instance 2 again, and instance 2 is taken as a candidate to-be-pre-empted instance; whether instance 2 can be deployed or not, instance 3 also needs to be continuously attempted to be deployed, if instance 3 cannot be deployed, it indicates that the remaining resources after the deployment of the to-be-deployed instance are insufficient to deploy instance 3 again, and instance 3 is taken as a candidate to-be-pre-empted instance. After the above judgment is completed, all the instances which cannot be deployed back to the candidate to be pre-empted node are taken as the candidate to-be-pre-empted instance. It should be noted that the above process can be actually executed (of course, if the candidate to be pre-empted node is not determined as the final target to-be-pre-empted node, the original state of the candidate to be pre-empted node also needs to be restored), or can be executed in a simulated manner to avoid affecting the normal operation of the instances of the candidate to be pre-empted node.
[0063] Of course, any other feasible scheme can also be adopted in the embodiment to determine the candidate pre-occupied instance in the candidate pre-occupied node, such as selection based on resource size, selection based on cost or cost size, etc., which will not be repeated here.
[0064] S204, sorting each candidate pre-occupied node through a preset comparison plug-in in the scheduler, determining a target pre-occupied node according to the sorting result, and controlling the to-be-deployed instance to pre-occupy the candidate pre-occupied instance in the target pre-occupied node.
[0065] In the embodiment, after determining the candidate pre-occupied instance in each candidate pre-occupied node, a most suitable candidate pre-occupied node can be selected from the candidate pre-occupied nodes as the target pre-occupied node, and finally the to-be-deployed instance is controlled to pre-occupy the candidate pre-occupied instance in the target pre-occupied node, that is, to remove the candidate pre-occupied instance in the target pre-occupied node and deploy the to-be-deployed instance into the target pre-occupied node.
[0066] In the embodiment, when selecting a most suitable candidate pre-occupied node from the candidate pre-occupied nodes, each candidate pre-occupied node can be sorted. In the embodiment, the preset comparison plug-in is also adopted to sort each candidate pre-occupied node in the scheduler. The preset comparison plug-in is configured with a preset comparison rule, and the comparison between each candidate pre-occupied node can be realized through the preset comparison rule, thereby realizing the sorting. The preset comparison rule can be comparison based on cost or cost, or comparison based on affinity with the to-be-deployed instance. In addition, comparison based on the comparison rule associated with the preset judgment rule in the above target judgment rule plug-in can also be performed, such as priority, pre-occupation frequency, etc. Of course, comparison based on any other feasible rule can also be performed, which will not be limited here.
[0067] Further, in an optional embodiment, any two candidate pre-occupied nodes can be compared according to the preset comparison rule in the preset comparison plug-in, and each candidate pre-occupied node can be sorted according to the comparison result of any two candidate pre-occupied nodes. In the embodiment, each candidate pre-occupied node is compared with each other in the preset comparison plug-in, and the sorting method such as bubble method is adopted based on the comparison result of the two-by-two comparison to realize the sorting of each candidate pre-occupied node.
[0068] In specific implementation, the score of any two candidate pre-occupied nodes can be obtained respectively in the preset comparison plug-in according to the preset comparison rule, wherein the score of any candidate pre-occupied node is used to evaluate the suitability of the candidate pre-occupied node to be pre-occupied, that is, the higher the score of the candidate pre-occupied node, the more suitable the candidate pre-occupied node as the target pre-occupied node; and then any two candidate pre-occupied nodes can be compared based on the score. Of course, all candidate pre-occupied nodes can also be sorted directly based on the score.
[0069] In the above embodiment, the user can set the preset comparison rule of the preset comparison plug-in. The user can trigger a preset comparison rule setting instruction. The dispatcher responds to the preset comparison rule setting instruction to complete the setting of the preset comparison rule of the preset comparison plug-in. Alternatively, the preset comparison rule can be carried in the preset comparison rule setting instruction, or a plurality of alternative comparison rules can be provided for the user to select. In addition, different preset comparison plug-ins can be configured. The preset comparison rules in different preset comparison plug-ins are different. A plurality of preset comparison plug-ins constitute a preset comparison plug-in set. One preset comparison plug-in can be selected from the preset comparison plug-in set and loaded into the dispatcher to achieve flexible selection of the preset comparison rule.
[0070] Alternatively, when setting the preset comparison rule of the preset comparison plug-in, the preset comparison rule can be a comparison rule associated with the preset judgment rule in the target judgment rule plug-in. Of course, it can also be other comparison rules.
[0071] The scheduling method of the cloud native orchestration and scheduling system provided in this embodiment determines the target judgment rule plug-in from a plurality of preset judgment rule plug-ins included in the preset judgment rule plug-in set in response to a rule plug-in selection instruction, and loads the target judgment rule plug-in in the dispatcher of the cloud native orchestration and scheduling system. At least one preset judgment rule for judging whether an instance is allowed to be preempted is configured in any judgment rule plug-in. For a to-be-deployed instance, whether any instance of any node in the cloud native orchestration and scheduling system is allowed to be preempted by the to-be-deployed instance is judged in sequence by the target judgment rule plug-in. If there is an instance in the any node that allows to be preempted by the to-be-deployed instance, the any node is determined as a candidate to-be-preempted node, and a candidate to-be-preempted instance in the candidate to-be-preempted node is determined according to the to-be-deployed instance and the instance in the candidate to-be-preempted node that allows to be preempted. The preset comparison plug-in in the dispatcher is used to sort each candidate to-be-preempted node, and a target to-be-preempted node is determined according to the sorting result, and the to-be-deployed instance is controlled to preempt the candidate to-be-preempted instance in the target to-be-preempted node. In this embodiment, the judgment rule for judging whether an instance is allowed to be preempted is encapsulated in the form of a plug-in, which can reduce the coupling between the dispatcher and the judgment rule, flexibly control the loading and unloading of the plug-in, improve the flexibility and expandability of the configuration of the judgment rule in the dispatcher, facilitate the addition and deletion of the judgment rule, and facilitate the forced stop in the judgment process, thereby meeting the better preemption demand for flexibility.
[0072] On the basis of any of the above embodiments, as Figure 4 As shown in the above embodiment, any judgment rule plug-in can include the following interfaces:
[0073] 1) instance information acquisition interface: used to acquire information of any instance in any node, which is used as the basis for judgment by the judgment rule. Optionally, the instance information acquisition interface can acquire information of any instance from the cluster dimension, such as information of each instance included in a certain cluster, Pod Disruption Budget (PDB) information, and resource amount prepared for each cluster, wherein a cluster can be an instance belonging to the same service, the PDB information includes the minimum number of instances included in the cluster (the number of instances in the cluster cannot be less than the minimum number after preemption), and the resource amount prepared for each cluster is the minimum resource amount required by the cluster (the resource amount in the cluster cannot be less than the minimum resource amount after preemption). Optionally, the instance information acquisition interface can input information such as to-be-scheduled instance, to-be-scheduled instance state, cluster state, etc., to calculate the required instance information and store it in the instance state, calculate the required cluster information and store it in the cluster state, to avoid subsequent repeated calculation.
[0074] 2) node information acquisition interface: used to acquire information of any node, which is used as the basis for judgment by the judgment rule. Optionally, the node information acquisition interface can acquire machine features, labels, total resource amount, instances on the node, and instance states of the node, etc. Optionally, the node information acquisition interface can input information such as to-be-scheduled instance, node, to-be-scheduled instance state, node state, etc., to calculate the required node information and store it in the node state, to avoid subsequent repeated calculation.
[0075] 3) instance search interface: used to determine whether an instance is allowed to be preempted by a to-be-deployed instance according to one or more of the information of the to-be-deployed instance, the information of any node, and the information of any instance, using a preset judgment rule, the input information of which can be acquired from the instance information acquisition interface and / or the node information acquisition interface, and the output of the instance search interface has three results: allowed to be preempted by the to-be-deployed instance, not allowed to be preempted by the to-be-deployed instance, and not blocked from preemption, wherein not blocked from preemption means that it cannot be directly determined whether preemption is allowed or not, and the judgment of other judgment rule plug-ins needs to be continued.
[0076] 4) information change interface: after the instance search interface determines that any instance is allowed to be preempted by a to-be-deployed instance, the information of other instances may change, such as PDB information, etc., therefore, the information change interface can be used to determine the to-be-changed information of other instances in the case that the instance is preempted, and then change the information of other instances, so as to find some potential instances allowed to be preempted.
[0077] It should be noted that the above four interfaces are not all necessary for the judgment rule plug-in, wherein the instance search interface is necessary, and the other three interfaces can be configured according to actual needs.
[0078] Optionally, based on the above interface, in the above embodiment, when obtaining the input information of the target judgment rule plug-in, the information of any instance can be obtained through the instance information acquisition interface of the target judgment rule plug-in, and stored; and / or the information of any node can be obtained through the node information acquisition interface of the target judgment rule plug-in, and stored.
[0079] Optionally, after determining whether any instance of any node in the cloud native orchestration scheduling system is allowed to be preempted by the to-be-deployed instance through the target judgment rule plug-in, if it is determined through the target judgment rule plug-in that any instance of any node is allowed to be preempted by the to-be-deployed instance, the information change interface of the target judgment rule plug-in is used to determine the to-be-changed information of other instances in the any node in the case that the any instance is preempted, and information change is performed.
[0080] In the embodiment, the above interface can be used to perform calculation and storage of information from three different levels of cluster, node and instance, and the calculation is front-loaded, so that it is not necessary to recalculate every time when the judgment rule is used for judgment, and the number of repeated calculations is reduced.
[0081] A scheduling method of a cloud native orchestration scheduling system corresponding to the above embodiment, Figure 5 A structural block diagram of a scheduling device of a cloud native orchestration scheduling system is provided in the embodiments of the present disclosure. For ease of illustration, only parts related to the embodiments of the present disclosure are shown. For reference Figure 5 , the scheduling device 500 of the cloud native orchestration scheduling system comprises a rule selection unit 501, a processing unit 502 and a preemption unit 503.
[0082] The rule selection unit 501 is configured to determine a target judgment rule plug-in from a plurality of preset judgment rule plugs included in a preset judgment rule plug set in response to a rule plug selection instruction, and load the target judgment rule plug in a scheduler of the cloud native orchestration scheduling system; wherein at least one preset judgment rule for judging whether an instance is allowed to be preempted is configured in any judgment rule plug.
[0083] The processing unit 502 is configured to determine, for a to-be-deployed instance, whether any instance of any node in the cloud native orchestration scheduling system is allowed to be preempted by the to-be-deployed instance through the target judgment rule plug; if there is an instance in the any node that is allowed to be preempted by the to-be-deployed instance, the any node is determined as a candidate to-be-preempted node, and a candidate to-be-preempted instance in the candidate to-be-preempted node is determined according to the to-be-deployed instance and the instance in the candidate to-be-preempted node that is allowed to be preempted.
[0084] The preemption unit 503 is configured to sort each candidate to-be-preempted node by a preset comparison plug-in in the scheduler, determine a target to-be-preempted node according to a sorting result, and control the to-be-deployed instance to preempt a candidate to-be-preempted instance in the target to-be-preempted node.
[0085] In one or more embodiments of the present disclosure, when the processing unit 502 sequentially judges whether any instance of any node in the cloud-native orchestration and scheduling system is allowed to be preempted by the to-be-deployed instance by the target judgment rule plug-in, the processing unit 502 is configured to:
[0086] obtain input information of the target judgment rule plug-in, wherein the input information includes one or more of information of the to-be-deployed instance, information of the any node, and information of any instance of the any node;
[0087] input the input information into the target judgment rule plug-in, and judge whether the any instance is allowed to be preempted by the to-be-deployed instance by a preset judgment rule in the target judgment rule plug-in.
[0088] In one or more embodiments of the present disclosure, a plurality of target judgment rule plug-ins exist, and the plurality of target judgment rule plug-ins are configured with a preset trigger sequence; when the processing unit 502 inputs the input information into the target judgment rule plug-in and judges whether the any instance is allowed to be preempted by the to-be-deployed instance by a preset judgment rule in the target judgment rule plug-in, the processing unit 502 is configured to:
[0089] for any current target judgment rule plug-in, input the input information into the current target judgment rule plug-in, and judge whether the any instance is allowed to be preempted by the to-be-deployed instance by a preset judgment rule in the current target judgment rule plug-in;
[0090] if it is directly determined that the any instance is allowed to be preempted by the to-be-deployed instance or is not allowed to be preempted by the to-be-deployed instance, stop triggering a next target judgment rule plug-in; or
[0091] if it is not directly determined that the any instance is allowed to be preempted by the to-be-deployed instance or is not allowed to be preempted by the to-be-deployed instance, trigger the next target judgment rule plug-in, and input the input information into the next target judgment rule plug-in for further judgment.
[0092] In one or more embodiments of the present disclosure, after the processing unit 502 sequentially judges whether any instance of any node in the cloud-native orchestration and scheduling system is allowed to be preempted by the to-be-deployed instance by the target judgment rule plug-in, the processing unit 502 is further configured to:
[0093] If it is determined by the target judgment rule plug-in that any instance of any node is allowed to be preempted by the to-be-deployed instance, information of the target judgment rule plug-in is changed through an information change interface of the target judgment rule plug-in to determine to-be-changed information of other instances in the any node in the case that the any instance is preempted, and information is changed.
[0094] In one or more embodiments of the present disclosure, the processing unit 502 is configured to:
[0095] information of any instance is acquired through an instance information acquisition interface of the target judgment rule plug-in, and the information is stored; and / or
[0096] information of any node is acquired through a node information acquisition interface of the target judgment rule plug-in, and the information is stored.
[0097] In one or more embodiments of the present disclosure, the processing unit 502 is configured to:
[0098] instances allowed to be preempted in the candidate to-be-preempted node are removed, and in the case that the to-be-deployed instance is deployed in the candidate to-be-preempted node, the instances allowed to be preempted are sequentially deployed back to the candidate to-be-preempted node in descending order of priority until the candidate to-be-preempted node cannot continue to be deployed, and remaining instances allowed to be preempted which are not deployed in the candidate to-be-preempted node are determined as candidate to-be-preempted instances in the candidate to-be-preempted node.
[0099] In one or more embodiments of the present disclosure, the preemption unit 503 is configured to:
[0100] any two candidate to-be-preempted nodes are compared according to a preset comparison rule in the preset comparison plug-in, and the candidate to-be-preempted nodes are sorted according to comparison results of the any two candidate to-be-preempted nodes.
[0101] In one or more embodiments of the present disclosure, the preemption unit 503 is configured to:
[0102] scores of the any two candidate to-be-preempted nodes are respectively acquired according to the preset comparison rule in the preset comparison plug-in, and the any two candidate to-be-preempted nodes are compared based on the scores, wherein the score of any candidate to-be-preempted node is used to evaluate a degree of suitability of the candidate to-be-preempted node to be preempted.
[0103] In one or more embodiments of this disclosure, the preemption unit 503 is further configured to:
[0104] In response to a preset comparison rule setting instruction, the preset comparison rule of the preset comparison plugin is set, wherein the preset comparison rule is a comparison rule associated with the preset judgment rule in the target judgment rule plugin.
[0105] The device provided in this embodiment can be used to execute the technical solutions of the above method embodiments. Its implementation principle and technical effect are similar, and will not be described again here.
[0106] refer to Figure 6 The diagram illustrates a structural schematic of an electronic device 600 suitable for implementing embodiments of the present disclosure. The electronic device 600 can be a terminal device or a server. The terminal device can include, but is not limited to, mobile terminals such as mobile phones, laptops, digital radio receivers, personal digital assistants (PDAs), portable Android devices (PADs), portable media players (PMPs), and in-vehicle terminals (e.g., in-vehicle navigation terminals), as well as fixed terminals such as digital TVs and desktop computers. Figure 6 The electronic device shown is merely an example and should not be construed as limiting the functionality and scope of the embodiments disclosed herein.
[0107] like Figure 6 As shown, electronic device 600 may include a processing unit (e.g., a central processing unit, a graphics processing unit, etc.) 601, which can perform various appropriate actions and processes according to a program stored in read-only memory (ROM) 602 or a program loaded from storage device 608 into random access memory (RAM) 603. RAM 603 also stores various programs and data required for the operation of electronic device 600. The processing unit 601, ROM 602, and RAM 603 are interconnected via bus 604. Input / output (I / O) interface 605 is also connected to bus 604.
[0108] In general, the following devices can be connected to the I / O interface 605: input devices 606 including, for example, a touch screen, a touch pad, a keyboard, a mouse, a camera, a microphone, an accelerometer, a gyroscope, and the like; output devices 607 including, for example, a Liquid Crystal Display (LCD), a speaker, a vibrator, and the like; storage devices 608 including, for example, a magnetic tape, a hard disk, and the like; and communication devices 609. The communication devices 609 can allow the electronic device 600 to communicate wirelessly or wiredly with other devices to exchange data. Although Figure 6 The electronic device 600 is shown with various devices, but it is understood that all of the illustrated devices are not required to implement or have the electronic device. More or less devices can alternatively be implemented or have.
[0109] In particular, the processes described above with reference to the flowcharts can be implemented as a computer software program according to embodiments of the present disclosure. For example, embodiments of the present disclosure include a computer program product comprising a computer program carried on a computer readable medium, the computer program containing program code for executing the methods illustrated by the flowcharts. In such embodiments, the computer program can be downloaded and installed from a network through the communication devices 609, or installed from the storage devices 608, or installed from the ROM 602. When the computer program is executed by the processing devices 601, the above-mentioned functions defined in the methods of the embodiments of the present disclosure are performed.
[0110] It should be noted that the computer-readable medium in the above disclosure can be a computer-readable signal medium or a computer-readable storage medium or any combination of the two. The computer-readable storage medium may, for example, but is not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or apparatus, or any combination of the above. More specific examples of the computer-readable storage medium can include, but are not limited to, an electrical connection having one or more wires, a portable computer diskette, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present disclosure, the computer-readable storage medium can be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system, device or apparatus. In the present disclosure, the computer-readable signal medium can include a data signal carried in a baseband or as a part of a carrier wave, which carries computer-readable program code. Such a propagated data signal can take many forms, including but not limited to an electromagnetic signal, an optical signal or any suitable combination of the above. The computer-readable signal medium can also be any computer-readable medium other than the computer-readable storage medium, which can send, propagate or transmit a program for use by or in conjunction with an instruction execution system, device or apparatus. The program code contained in the computer-readable medium can be transmitted by any suitable medium, including but not limited to a wire, a cable, an RF (radio frequency) or the like, or any suitable combination of the above.
[0111] The computer-readable medium described above can be contained in the electronic device described above; or can exist separately and not be assembled into the electronic device.
[0112] The computer-readable medium described above carries one or more programs, which, when executed by the electronic device, cause the electronic device to perform the methods shown in the above embodiments.
[0113] Computer program code for carrying out operations of the present disclosure can be written in any combination of one or more programming languages, including an object oriented programming language such as Java, Smalltalk, C++ or the like and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code can execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the latter scenario, the remote computer can be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or the connection can be made to an external computer (for example, through the Internet using an Internet Service Provider).
[0114] The flow diagrams and the block diagrams in the drawings are meant as possible implementations of systems, methods, and computer program products according to various embodiments of the present disclosure. In this regard, each block in the flow diagrams and the block diagrams can represent a module, a segment, or a portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that in some alternative implementations, the functions noted in the blocks can occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently or the blocks can sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and / or flow diagrams, and combinations thereof, can be implemented by special purpose hardware-based systems that perform the specified functions or operations, or combinations of special purpose hardware and computer instructions.
[0115] The units described in the embodiments of the present disclosure can be implemented by software, or by hardware. In some cases, the name of the unit does not constitute a limitation on the unit itself. For example, the first obtaining unit can also be described as a unit for obtaining at least two Internet protocol addresses.
[0116] The functions described above in the specification of the present disclosure can be performed by one or more hardware logic components. For example, and without limitation, illustrative types of hardware logic components that can be used include Field-programmable Gate Arrays (FPGAs), Program-specific Integrated Circuits (ASICs), Application-specific Standard Products (ASSPs), System-on-a-chip systems (SOCs), Complex Programmable Logic Devices (CPLDs), etc.
[0117] In the context of the present disclosure, a machine-readable medium can be a tangible medium that can contain or store a program for use by or in connection with an instruction execution system, apparatus, or device. The machine-readable medium can be a machine-readable signal medium or a machine-readable storage medium. The machine-readable medium can include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any suitable combination of the foregoing. More specific examples of the machine-readable storage medium will include one or more lines of electrical connections, portable computer disks, hard disk drives, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or Flash memory), optical fibers, portable compact disc read-only memories (CD-ROMs), optical storage devices, magnetic storage devices, or any suitable combination of the foregoing.
[0118] In a first aspect, according to one or more embodiments of the present disclosure, a scheduling method of a cloud-native orchestration scheduling system is provided, comprising:
[0119] In response to a rule plug-in selection instruction, a target judgment rule plug-in is determined from a plurality of preset judgment rule plugs included in a preset judgment rule plug-in set, and the target judgment rule plug-in is loaded in a scheduler of the cloud-native orchestration scheduling system; wherein at least one preset judgment rule for judging whether an instance is allowed to be preempted is configured in any judgment rule plug-in;
[0120] For a to-be-deployed instance, whether any instance of any node in the cloud-native orchestration scheduling system is allowed to be preempted by the to-be-deployed instance is sequentially judged by the target judgment rule plug-in;
[0121] If there is an instance in the any node that is allowed to be preempted by the to-be-deployed instance, the any node is determined as a candidate to-be-preempted node, and a candidate to-be-preempted instance in the candidate to-be-preempted node is determined according to the to-be-deployed instance and the instance in the candidate to-be-preempted node that is allowed to be preempted;
[0122] Each candidate to-be-preempted node is sorted by a preset comparison plug-in in the scheduler, a target to-be-preempted node is determined according to a sorting result, and the to-be-deployed instance is controlled to preempt the candidate to-be-preempted instance in the target to-be-preempted node.
[0123] According to one or more embodiments of the present disclosure, the sequentially judging whether any instance of any node in the cloud-native orchestration scheduling system is allowed to be preempted by the to-be-deployed instance by the target judgment rule plug-in comprises:
[0124] obtaining input information of the target judgment rule plug-in, wherein the input information comprises one or more of information of the to-be-deployed instance, information of the any node, and information of any instance of the any node;
[0125] inputting the input information into the target judgment rule plug-in, and determining whether the any instance is allowed to be preempted by the to-be-deployed instance according to a preset judgment rule in the target judgment rule plug-in.
[0126] According to one or more embodiments of the present disclosure, a plurality of target judgment rule plug-ins exist, and the plurality of target judgment rule plug-ins are configured with a preset trigger sequence; the inputting the input information into the target judgment rule plug-in, and determining whether the any instance is allowed to be preempted by the to-be-deployed instance according to a preset judgment rule in the target judgment rule plug-in comprises:
[0127] for any current target judgment rule plug-in, inputting the input information into the current target judgment rule plug-in, and determining whether the any instance is allowed to be preempted by the to-be-deployed instance according to a preset judgment rule in the current target judgment rule plug-in;
[0128] if it is directly determined that the any instance is allowed to be preempted by the to-be-deployed instance or is not allowed to be preempted by the to-be-deployed instance, triggering a next target judgment rule plug-in is stopped; or
[0129] if it is not directly determined that the any instance is allowed to be preempted by the to-be-deployed instance or is not allowed to be preempted by the to-be-deployed instance, triggering a next target judgment rule plug-in, inputting the input information into the next target judgment rule plug-in, and continuing the determination.
[0130] According to one or more embodiments of the present disclosure, after the any instance of the any node in the cloud native orchestration scheduling system is sequentially determined by the target judgment rule plug-in whether the any instance is allowed to be preempted by the to-be-deployed instance, the method further comprises:
[0131] if it is determined by the target judgment rule plug-in that the any instance of the any node is allowed to be preempted by the to-be-deployed instance, determining to-be-changed information of other instances in the any node in the case that the any instance is preempted, and performing information change through an information change interface of the target judgment rule plug-in.
[0132] According to one or more embodiments of the present disclosure, the obtaining the input information of the target judgment rule plug-in comprises:
[0133] obtaining information of the any instance through an instance information obtaining interface of the target judgment rule plug-in, and storing the information; and / or
[0134] The node information acquisition interface of the target judgment rule plug-in is used to acquire information of any node and store the information.
[0135] According to one or more embodiments of the present disclosure, the determining the candidate instance to be preempted in the candidate node to be preempted according to the instance to be deployed and the instance in the candidate node to be preempted that is allowed to be preempted comprises:
[0136] The instance in the candidate node to be preempted that is allowed to be preempted is removed, and in the case that the instance to be deployed is deployed in the candidate node to be preempted, the instance that is allowed to be preempted is sequentially deployed back to the candidate node to be preempted in descending order of priority until the candidate node to be preempted cannot continue to be deployed, and the remaining instance that is allowed to be preempted and is not deployed in the candidate node to be preempted is determined as the candidate instance to be preempted in the candidate node to be preempted.
[0137] According to one or more embodiments of the present disclosure, the sorting the candidate nodes to be preempted by the preset comparison plug-in in the scheduler comprises:
[0138] The preset comparison plug-in is used to compare any two candidate nodes to be preempted according to a preset comparison rule, and sort the candidate nodes to be preempted according to a comparison result of any two candidate nodes to be preempted.
[0139] According to one or more embodiments of the present disclosure, the comparing any two candidate nodes to be preempted according to the preset comparison rule in the preset comparison plug-in comprises:
[0140] The preset comparison plug-in is used to acquire scores of any two candidate nodes to be preempted according to the preset comparison rule respectively, and compare any two candidate nodes to be preempted based on the scores, wherein the score of any candidate node to be preempted is used to evaluate the suitability of the candidate node to be preempted.
[0141] According to one or more embodiments of the present disclosure, the method further comprises:
[0142] In response to a preset comparison rule setting instruction, a preset comparison rule of the preset comparison plug-in is set, wherein the preset comparison rule is a comparison rule associated with the preset judgment rule in the target judgment rule plug-in.
[0143] In a second aspect, according to one or more embodiments of the present disclosure, a scheduling device of a cloud native orchestration scheduling system is provided, comprising:
[0144] A rule selection unit is configured to determine a target judgment rule plug-in from a plurality of preset judgment rule plug-ins included in a preset judgment rule plug-in set in response to a rule plug-in selection instruction, and load the target judgment rule plug-in in a scheduler of the cloud-native orchestration and scheduling system; any judgment rule plug-in is configured with at least one preset judgment rule for judging whether an instance is allowed to be preempted;
[0145] A processing unit is configured to, for a to-be-deployed instance, sequentially judge, by the target judgment rule plug-in, whether any instance of any node in the cloud-native orchestration and scheduling system is allowed to be preempted by the to-be-deployed instance; if there is an instance allowed to be preempted by the to-be-deployed instance in the any node, the any node is determined as a candidate to-be-preempted node, and a candidate to-be-preempted instance in the candidate to-be-preempted node is determined according to the to-be-deployed instance and the instance allowed to be preempted in the candidate to-be-preempted node;
[0146] A preemption unit is configured to sort the candidate to-be-preempted nodes by a preset comparison plug-in in the scheduler, determine a target to-be-preempted node according to a sorting result, and control the to-be-deployed instance to preempt the candidate to-be-preempted instance in the target to-be-preempted node.
[0147] According to one or more embodiments of the present disclosure, when the processing unit sequentially judges, by the target judgment rule plug-in, whether any instance of any node in the cloud-native orchestration and scheduling system is allowed to be preempted by the to-be-deployed instance, the processing unit is configured to:
[0148] Obtain input information of the target judgment rule plug-in, wherein the input information includes one or more of information of the to-be-deployed instance, information of the any node, and information of any instance of the any node;
[0149] Input the input information into the target judgment rule plug-in, and judge, by a preset judgment rule in the target judgment rule plug-in, whether the any instance is allowed to be preempted by the to-be-deployed instance.
[0150] According to one or more embodiments of the present disclosure, there are a plurality of target judgment rule plug-ins, and the plurality of target judgment rule plug-ins are configured with a preset trigger sequence; when the processing unit inputs the input information into the target judgment rule plug-in and judges, by a preset judgment rule in the target judgment rule plug-in, whether the any instance is allowed to be preempted by the to-be-deployed instance, the processing unit is configured to:
[0151] For any current target judgment rule plug-in, input the input information into the current target judgment rule plug-in, and judge, by a preset judgment rule in the current target judgment rule plug-in, whether the any instance is allowed to be preempted by the to-be-deployed instance;
[0152] If it is directly determined that any instance is allowed to be preempted by the to-be-deployed instance or is not allowed to be preempted by the to-be-deployed instance, triggering of a next target judgment rule plug-in is stopped; or
[0153] If it is not directly determined that any instance is allowed to be preempted by the to-be-deployed instance or is not allowed to be preempted by the to-be-deployed instance, a next target judgment rule plug-in is triggered, and the input information is input into the next target judgment rule plug-in for continuous judgment.
[0154] According to one or more embodiments of the present disclosure, after the processing unit sequentially judges, by the target judgment rule plug-in, whether any instance of any node in the cloud native orchestration scheduling system is allowed to be preempted by the to-be-deployed instance, the processing unit is further configured to:
[0155] If it is determined by the target judgment rule plug-in that any instance of any node is allowed to be preempted by the to-be-deployed instance, the information change interface of the target judgment rule plug-in is used to determine to-be-changed information of other instances in the any node in the case that the any instance is preempted, and information change is performed.
[0156] According to one or more embodiments of the present disclosure, when the processing unit acquires the input information of the target judgment rule plug-in, the processing unit is configured to:
[0157] acquire information of any instance by the instance information acquisition interface of the target judgment rule plug-in, and store the information; and / or
[0158] acquire information of any node by the node information acquisition interface of the target judgment rule plug-in, and store the information.
[0159] According to one or more embodiments of the present disclosure, when the processing unit determines the candidate to-be-preempted instance in the candidate to-be-preempted node according to the to-be-deployed instance and the instance in the candidate to-be-preempted node that is allowed to be preempted, the processing unit is configured to:
[0160] remove the instance in the candidate to-be-preempted node that is allowed to be preempted, and in the case that the to-be-deployed instance is deployed in the candidate to-be-preempted node, deploy the instance that is allowed to be preempted back to the candidate to-be-preempted node in a descending order of priority until the candidate to-be-preempted node cannot continue to be deployed, and determine the remaining instance that is allowed to be preempted and is not deployed in the candidate to-be-preempted node as the candidate to-be-preempted instance in the candidate to-be-preempted node.
[0161] According to one or more embodiments of the present disclosure, when the preemption unit sorts each candidate to-be-preempted node by the preset comparison plug-in in the scheduler, the preemption unit is configured to:
[0162] The pre-set comparison plug-in compares any two candidate nodes to be preempted according to a pre-set comparison rule, and sorts the candidate nodes to be preempted according to comparison results of the any two candidate nodes to be preempted.
[0163] According to one or more embodiments of the present disclosure, when the pre-set comparison plug-in compares any two candidate nodes to be preempted according to a pre-set comparison rule, the pre-set comparison plug-in is configured to:
[0164] In the pre-set comparison plug-in, scores of any two candidate nodes to be preempted are obtained according to the pre-set comparison rule respectively, and any two candidate nodes to be preempted are compared based on the scores, wherein the score of any candidate node to be preempted is used to evaluate the suitability of the candidate node to be preempted.
[0165] According to one or more embodiments of the present disclosure, the pre-set comparison plug-in is further configured to:
[0166] In response to a pre-set comparison rule setting instruction, a pre-set comparison rule of the pre-set comparison plug-in is set, wherein the pre-set comparison rule is a comparison rule associated with the pre-set judgment rule in the target judgment rule plug-in.
[0167] In a third aspect, according to one or more embodiments of the present disclosure, an electronic device is provided, comprising at least one processor and a memory;
[0168] The memory stores computer execution instructions;
[0169] The at least one processor executes the computer execution instructions stored in the memory, so that the at least one processor executes the scheduling method of the cloud native orchestration scheduling system as described in the first aspect and various possible designs of the first aspect.
[0170] In a fourth aspect, according to one or more embodiments of the present disclosure, a computer readable storage medium is provided, and the computer readable storage medium stores computer execution instructions, when a processor executes the computer execution instructions, the scheduling method of the cloud native orchestration scheduling system as described in the first aspect and various possible designs of the first aspect is implemented.
[0171] In a fifth aspect, according to one or more embodiments of the present disclosure, a computer program product is provided, comprising computer execution instructions, when a processor executes the computer execution instructions, the scheduling method of the cloud native orchestration scheduling system as described in the first aspect and various possible designs of the first aspect is implemented.
[0172] The above description merely illustrates the preferred embodiments of the disclosure and a principle for applying the technologies. It is understood by those skilled in the art that the disclosed scope of the disclosure is not limited to the technical solutions formed by the specific combinations of the technical features described above, and should also cover other technical solutions formed by the combinations of the technical features described above or their equivalent features without departing from the disclosed concept. For example, the technical solutions formed by the mutual replacement of the above-described features and the technical features with similar functions disclosed in the disclosure (but not limited to) can be formed.
[0173] Further, although operations are depicted in a particular, sequential order, this should not be understood as requiring or implying that the operations are performed in the order illustrated or sequentially. In certain circumstances, multitasking and parallel processing can be advantageous. Likewise, although specific implementation details are included for the purpose of providing a thorough disclosure, these should not be construed as limitations on the scope of the disclosure. Certain features that are described in the context of separate embodiments can also be implemented in combination in a single embodiment. Conversely, various features that are described in the context of a single embodiment can also be implemented in multiple embodiments separately or in any suitable sub-combination.
[0174] Although the subject matter has been described in language specific to structural features and / or methodological acts, it is to be understood that the subject defined in the appended claims is not necessarily limited to the specific features or acts described above. Rather, the specific features and acts described above are disclosed as example forms of implementing the claims.
Claims
1. A scheduling method for a cloud-native orchestration and scheduling system, characterized in that, include: In response to the rule plugin selection instruction, a target judgment rule plugin is determined from multiple preset judgment rule plugins included in the preset judgment rule plugin set, and the target judgment rule plugin is loaded in the scheduler of the cloud-native orchestration and scheduling system. Any of the judgment rule plugins includes an instance search interface. The instance search interface uses a preset judgment rule to determine whether an instance is allowed to be preempted. The output results of the instance search interface include: allowed to be preempted by the instance to be deployed, not allowed to be preempted by the instance to be deployed, and no blocking of preemption. For the instance to be deployed, the target judgment rule plugin sequentially judges whether any instance of any node in the cloud-native orchestration and scheduling system is allowed to be preempted by the instance to be deployed; If any of the nodes contains an instance that can be preempted by the instance to be deployed, then that node is determined as a candidate node to be preempted, and based on the instance to be deployed and the instances that can be preempted in the candidate nodes, the candidate instances to be preempted are determined. The scheduler sorts the candidate nodes to be preempted by a preset comparison plugin, determines the target node to be preempted based on the sorting results, and controls the instance to be deployed to preempt the candidate instances to be preempted from the target node.
2. The method according to claim 1, characterized in that, The step of sequentially determining, through the target judgment rule plugin, whether any instance of any node in the cloud-native orchestration and scheduling system is allowed to be preempted by the instance to be deployed includes: Obtain the input information of the target judgment rule plugin, wherein the input information includes one or more of the information of the instance to be deployed, the information of any node, and the information of any instance of any node; The input information is input into the target judgment rule plugin, and the preset judgment rules in the target judgment rule plugin determine whether any instance is allowed to be preempted by the instance to be deployed.
3. The method according to claim 2, characterized in that, There are multiple target judgment rule plugins, and these plugins are configured with a preset trigger order. The step of inputting the input information into the target judgment rule plugin and determining whether any instance is allowed to be preempted by the instance to be deployed through the preset judgment rules in the plugin includes: For any current target judgment rule plugin, the input information is input into the current target judgment rule plugin, and the preset judgment rule in the current target judgment rule plugin determines whether the instance is allowed to be preempted by the instance to be deployed; If it can be directly determined that any instance can be preempted by the instance to be deployed, or cannot be preempted by the instance to be deployed, then the triggering of the next target judgment rule plugin should be stopped; or If it cannot be directly determined whether any instance is allowed to be preempted by the instance to be deployed, or not allowed to be preempted by the instance to be deployed, then the next target judgment rule plugin is triggered, and the input information is input into the next target judgment rule plugin to continue the judgment.
4. The method according to claim 2, characterized in that, After the step of sequentially determining whether any instance of any node in the cloud-native orchestration and scheduling system is allowed to be preempted by the instance to be deployed through the target judgment rule plugin, the method further includes: If the target judgment rule plugin determines that any instance of any node is allowed to be preempted by the instance to be deployed, then through the information change interface of the target judgment rule plugin, the information to be changed for other instances in any node in the case of preemption of any instance is determined and the information is changed.
5. The method according to claim 2, characterized in that, The step of obtaining the input information of the target judgment rule plugin includes: The instance information of any instance is obtained and stored through the instance information acquisition interface of the target judgment rule plugin; and / or The information of any node is obtained and stored through the node information acquisition interface of the target judgment rule plugin.
6. The method according to claim 1, characterized in that, The step of determining the candidate instances to be preempted from the candidate nodes to be preempted, based on the instance to be deployed and the instances allowed to be preempted from the candidate nodes to be preempted, includes: Remove instances that are allowed to be preempted from the candidate nodes to be preempted. If the instance to be deployed is deployed to the candidate nodes to be preempted, deploy the instances that are allowed to be preempted back to the candidate nodes to be preempted in descending order of priority until the candidate nodes to be preempted can no longer be deployed. The remaining instances that are allowed to be preempted but not deployed to the candidate nodes to be preempted are then used to determine the candidate nodes to be preempted.
7. The method according to claim 1, characterized in that, The step of sorting each candidate node to be preempted using a preset comparison plugin in the scheduler includes: In the preset comparison plugin, any two candidate nodes to be preempted are compared according to preset comparison rules, and the candidate nodes to be preempted are sorted according to the comparison results of any two candidate nodes to be preempted.
8. The method according to claim 7, characterized in that, The step of comparing any two candidate nodes to be preempted according to preset comparison rules in the preset comparison plugin includes: In the preset comparison plugin, the scores of any two candidate nodes to be preempted are obtained according to the preset comparison rules, and the scores are compared between any two candidate nodes to be preempted. The score of any candidate node is used to evaluate the suitability of the candidate node to be preempted.
9. The method according to claim 7, characterized in that, The method further includes: In response to a preset comparison rule setting instruction, the preset comparison rule of the preset comparison plugin is set, wherein the preset comparison rule is a comparison rule associated with the preset judgment rule in the target judgment rule plugin.
10. A scheduling device for a cloud-native orchestration and scheduling system, characterized in that, include: The rule selection unit is used to respond to the rule plugin selection instruction, determine the target judgment rule plugin from multiple preset judgment rule plugins included in the preset judgment rule plugin set, and load the target judgment rule plugin in the scheduler of the cloud-native orchestration and scheduling system. Any of the judgment rule plugins includes an instance search interface. The instance search interface uses a preset judgment rule to determine whether an instance is allowed to be preempted. The output results of the instance search interface include: allowed to be preempted by the instance to be deployed, not allowed to be preempted by the instance to be deployed, and no blocking of preemption. The processing unit is used to determine, for the instance to be deployed, whether any instance of any node in the cloud-native orchestration and scheduling system is allowed to be preempted by the instance to be deployed, through the target judgment rule plugin; if there is an instance in any node that is allowed to be preempted by the instance to be deployed, then the any node is determined as a candidate node to be preempted, and based on the instance to be deployed and the instances in the candidate nodes that are allowed to be preempted, the candidate instances to be preempted in the candidate nodes are determined; The preemption unit is used to sort each candidate node to be preempted through a preset comparison plugin in the scheduler, determine the target node to be preempted based on the sorting result, and control the instance to be deployed to preempt the candidate instances to be preempted among the target nodes.
11. An electronic device, characterized in that, include: At least one processor and memory; The memory stores computer-executed instructions; The at least one processor executes computer execution instructions stored in the memory, causing the at least one processor to perform the method as described in any one of claims 1-9.
12. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer-executable instructions, which, when executed by a processor, implement the method as described in any one of claims 1-9.
13. A computer program product, characterized in that, Includes computer execution instructions, which, when executed by a processor, implement the method as described in any one of claims 1-9.
Citation Information
Patent Citations
Container cloud-oriented task preemption scheduling method and system
CN111399989A
Resource preemption method and device, computer readable storage medium and electronic equipment
CN113127178A