A method, device and cloud management server for obtaining cloud services
The cloud management server allocates and reallocates preemptive instances based on job attribute information, and combines breakpoint calculation and hibernation mechanisms to solve the problem of price fluctuation and resource release of preemptive instances, achieving efficient cost control and on-time completion of tasks.
Patent Information
- Application Number
- CN201911344792.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2019-12-24
- Publication Date
- 2024-09-06
- Estimated Expiration
- 2039-12-24
AI Technical Summary
When high-performance computing users use preemptible instances on public clouds, it is difficult to effectively control job running costs due to price fluctuations and resource release issues, and the prepaid model is not suitable for the imbalance of business computing volume.
The cloud management server determines the priority level based on the attribute information of the job, allocates the preemption instance, and continuously tries to reallocate it when it is about to be released. It combines the breakpoint calculation and hibernation mechanism to optimize resource usage and ensure that the job is completed on time.
Make full use of low-cost preemptible instances to reduce job running costs, ensure that computing tasks are completed on time, and control costs to the maximum extent.
Smart Images

Figure CN113034166B
Abstract
Description
Technical Field
[0001] The present application relates to but is not limited to cloud computing technology, and in particular to a method, device and cloud management server for obtaining cloud services. Background Art
[0002] More and more high performance computing (HPC) users are deploying HPC clusters on public clouds for large-scale computing.
[0003] Public clouds generally provide payment modes of prepaid and postpaid. Prepaid includes annual and monthly packages. The longer the prepaid one-time purchase period, the higher the price discount you enjoy. Postpaid is on-demand and payment is based on the length of use. Large cloud vendors can basically settle in seconds. The postpaid model allows users to fully enjoy the elasticity brought by cloud computing. However, the unit cost of postpaid is generally higher than that of prepaid. For HPC users in certain fields, such as animation rendering users, the business computing volume is not evenly distributed on an annual basis. Often, a large-scale cluster is required to complete the rendering task in a very short period of time. Therefore, the prepaid model is not suitable, and if postpaid is used, the price factor will become a bottleneck.
[0004] As the scale of public cloud computing grows, large cloud vendors will provide a post-payment model, such as preemptible instances (also known as spot instances). The price of this post-payment model is floating, which is relatively large. Users can set bids or purchase preemptible instances at market floating prices. However, due to public cloud inventory scheduling or prices exceeding user bids, the instances purchased by users may be actively released and taken back by the cloud service. In other words, it is not possible to truly guarantee that jobs can make good use of preemptible instances, and thus it is not possible to control job operating costs well. Summary of the invention
[0005] The present application provides a method, device and cloud management server for obtaining cloud services, which can make full use of low-cost preemptible instances and reduce job operation costs.
[0006] An embodiment of the present invention provides a method for obtaining a cloud service, comprising:
[0007] The cloud management server determines the priority level of the job according to the attribute information of the job;
[0008] Allocate a preemptible instance to a job with a low priority level and run the job;
[0009] Knowing that the running preemptible instance is about to be released, it continuously tries to allocate the preemptible instance to the job until the job is finished.
[0010] In an exemplary embodiment, the attribute information of the job includes: expected computing time, expected job end time;
[0011] Determining the priority level of the job includes:
[0012] The priority level of the job is obtained according to the expected computing time of the job, the expected job end time of the job, the running time of the job, and the time interval from the submission of the job to the current time.
[0013] In an exemplary embodiment, the priority level of the acquisition job includes:
[0014] The priority value is calculated according to the following formula: Priority = ((ExpectedFinishTime – ElapsedTime) – (WallTime – AlreadyRunningTime)) × factor; where factor represents the preset global impact factor, and its value range is [0, 1]; ExpectedFinishTime represents the time length expected by the user from the time the job is submitted to the time the job is completed; ElapsedTime represents the time interval from the time the job is submitted to the current time; AlreadyRunningTime represents the time length of the job that has been running, and WallTime represents the time length of the job that needs to be running;
[0015] When the calculated Priority is less than the preset first threshold, it indicates that the priority level is high priority; when the calculated Priority is greater than or equal to the preset second threshold, it indicates that the priority level is low priority; when the calculated Priority is greater than or equal to the first threshold and less than the second threshold, it indicates that the priority level is medium priority; wherein the first threshold is less than the second threshold.
[0016] In an exemplary embodiment, the cloud management server periodically determines the priority level of the job according to a preset period.
[0017] In an exemplary embodiment, the attribute information of the job also includes: expected cost;
[0018] The allocation preempts the instance and runs the job, including:
[0019] Computing resources are allocated to the job according to the expected cost, and the cost incurred by the job is counted in real time.
[0020] In an exemplary embodiment, the attribute information of the job further includes: an expected maximum operating cost; and the method further includes:
[0021] The cloud management server expands the computing resources of the preemptible instance whose operating cost is lower than the expected maximum operating cost according to the calculated cost already spent by the job and the expected maximum operating cost.
[0022] In an exemplary embodiment, the method further comprises:
[0023] The cloud management server assigns a prepaid mode to a job with a medium priority level;
[0024] The cloud management server allocates a scaled instance to a job with a high priority level.
[0025] In an exemplary embodiment, the continuously attempting to allocate a preemptible instance to the job includes:
[0026] If the application software used by the user in the job supports breakpoint resumption, the job status is reset to queue and the running status information of the job is saved to wait for new computing resources to continue the calculation;
[0027] If the application software used by the user in the job does not support breakpoint resumption, the current preemptive instance is set to sleep before the preemptive instance is released; the status of the job is reset to queue, and the sleep file information is recorded to wait for new computing resources; and the sleep file is used to continue the computing when the computing resources are expanded.
[0028] In an exemplary embodiment, the method further comprises:
[0029] It is determined whether the current time is close to the expected job end time in the attribute information of the job. If it is close, it is still impossible to expand the capacity or retain the preemptible instance for a sufficient period of time, and the cloud management server expands the pay-as-you-go instance to run the job.
[0030] In an exemplary embodiment, the determining whether the current time is close to the expected job end time in the job attribute information includes:
[0031] A time interval threshold is set in advance, and the absolute value of the difference between the current time and the expected job end time in the attribute information of the job is calculated; if the absolute value is less than or equal to the time interval threshold, it is determined that the current time is close to the expected job end time in the attribute information of the job.
[0032] The present application also provides a computer-readable storage medium storing computer-executable instructions, wherein the computer-executable instructions are used to execute any of the above methods for acquiring cloud services.
[0033] The present application further provides a device for implementing cloud computing resource allocation, including a memory and a processor, wherein the memory stores the following instructions executable by the processor: used to execute the steps of any of the above-mentioned methods for obtaining cloud services.
[0034] The present application further provides a device for obtaining cloud services, comprising: a first processing module, a resource allocation module, and a second processing module; wherein:
[0035] A first processing module, used for determining a priority level of a job according to attribute information of the job;
[0036] A resource allocation module, configured to allocate a preemptive instance to a job with a low priority level and run the job; upon receiving a notification from the second processing module, continuously trying to allocate a preemptive instance to the job until the job is finished;
[0037] The second processing module is used to learn that the running preemptible instance is about to be released, and to notify the resource allocation module.
[0038] In an exemplary embodiment, the first processing module periodically determines the priority level of the job according to a preset period.
[0039] In an exemplary embodiment, the resource allocation module is further configured to:
[0040] Assigning a prepaid mode to jobs with a medium priority level;
[0041] Assign pay-as-you-go instances to jobs with a high priority level.
[0042] In an exemplary embodiment, the resource allocation module receives a notification from the second processing module and continuously attempts to allocate a preemptible instance to the job until the job runs to completion, specifically for:
[0043] Upon learning that a running preemptible instance is about to be released, if the application software used by the user in the job itself supports breakpoint resumption, the job status is reset to queue and the running status information of the job is saved to wait for new computing resources to continue the calculation; if the application software used by the user in the job itself does not support breakpoint resumption, the current preemptible instance is set to hibernation before the preemptible instance is released; the job status is reset to queue, and the hibernation file information is recorded to wait for new computing resources; and the calculation is continued using the hibernation file when the computing resources are expanded.
[0044] In an exemplary embodiment, the resource allocation module is further configured to:
[0045] It is determined whether the current time is close to the expected job end time in the attribute information of the job. If so, it is still impossible to expand the capacity or retain the preemptible instance for a sufficient period of time, and the pay-as-you-go instance is expanded to run the job.
[0046] In an exemplary embodiment, the resource allocation module allocates the preempted instance and runs the job, including: allocating computing resources to the job according to the expected cost in the attribute information of the job, and calculating the cost spent by the job in real time;
[0047] The attribute information of the job also includes: an expected maximum operating cost; the resource allocation module is also used to: expand the computing resources of the preemptible instance with a cost lower than the expected maximum operating cost based on the statistical cost already spent by the job and the expected maximum operating cost.
[0048] The present application also provides a cloud management server, comprising any of the above-mentioned devices for acquiring cloud services.
[0049] This application prioritizes jobs and assigns preemptive instances to low-priority jobs, ensuring that low-priority jobs use preemptive instances for calculation continuously or intermittently, making full use of low-cost preemptive instances and reducing job running costs.
[0050] In an exemplary embodiment, if the expected job end time in the job attribute information is approaching and it is still impossible to expand the capacity or retain the preemptible instance for a sufficient period of time, the cloud management server will further automatically expand the pay-as-you-go instance to run the job. In this way, the job is guaranteed to be completed on time and the job operation cost is minimized.
[0051] In an exemplary embodiment, the present application further expands the computing resources of the preemptible instance with a cost lower than the expected maximum operating cost, thereby fully ensuring that the job completes the calculation within a controllable cost.
[0052] Other features and advantages of the present invention will be described in the following description, and partly become apparent from the description, or understood by practicing the present invention. The purpose and other advantages of the present invention can be realized and obtained by the structures particularly pointed out in the description, claims and drawings. BRIEF DESCRIPTION OF THE DRAWINGS
[0053] The accompanying drawings are used to provide further understanding of the technical solution of the present application and constitute a part of the specification. Together with the embodiments of the present application, they are used to explain the technical solution of the present application and do not constitute a limitation on the technical solution of the present application.
[0054] Figure 1 A flowchart of a method for obtaining cloud services for this application;
[0055] Figure 2 A schematic diagram of an application scenario of the method for obtaining cloud services for this application;
[0056] Figure 3 A schematic diagram of the composition structure of the device for obtaining cloud services for this application;
[0057] Figure 4 A schematic diagram of the process of obtaining a cloud service in the first embodiment of the present application;
[0058] Figure 5 A flowchart of the second embodiment of obtaining cloud services for this application. DETAILED DESCRIPTION
[0059] In order to make the purpose, technical solution and advantages of the present application more clear, the embodiments of the present application will be described in detail below with reference to the accompanying drawings. It should be noted that the embodiments and features in the embodiments of the present application can be combined with each other arbitrarily without conflict.
[0060] In a typical configuration of the present application, a computing device includes one or more processors (CPU), an input / output interface, a network interface, and a memory.
[0061] The memory may include non-permanent storage in a computer-readable medium, random access memory (RAM) and / or non-volatile memory in the form of read-only memory (ROM) or flash RAM. The memory is an example of a computer-readable medium.
[0062] Computer readable media include permanent and non-permanent, removable and non-removable media that can be implemented by any method or technology to store information. Information can be computer readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, magnetic tape disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined herein, computer readable media does not include non-transitory media such as modulated data signals and carrier waves.
[0063] The steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions. Also, although a logical sequence is shown in the flowchart, in some cases, the steps shown or described can be performed in a sequence different from that shown here.
[0064] Preemptible instances are on-demand instances that are designed to reduce the cost of using Elastic Compute Service (ECS) in certain application scenarios. When creating a preemptible instance, the user needs to specify a bidding mode. When the current market price of the specified instance specification is lower than the user's bid, the user can successfully create a preemptible instance and be charged according to the current market price. After the preemptible instance is successfully created, the operation is the same as that of a pay-as-you-go instance. Users can also use it in combination with other cloud products (such as cloud disks, EIP addresses, etc.). Once a preemptible instance is created, it has a specified duration, such as a one-hour protection period. That is, within the first hour after creation, the user's instance will not be released due to market supply and demand, and the user can run normal business on the preemptible instance. After the protection period exceeds, such as one hour, the current market price and inventory of the instance specification will be checked every 5 minutes according to a preset period. If the market price at a certain moment is higher than the user's bid or the resource inventory is insufficient, the user's preemptible instance will be released; otherwise, the user can continue to use it. The user can actively release the preemptible instance during use.
[0065] Figure 1 A flowchart of a method for obtaining cloud services for this application, such as Figure 1 As shown, including:
[0066] Step 100: The cloud management server determines the priority level of the job according to the attribute information of the job.
[0067] In an exemplary embodiment, the job submitted by the user is a specific task of running a certain application software, such as simulation software.
[0068] In an exemplary embodiment, the attribute information of the job includes at least:
[0069] Expected computing time WallTime, which indicates the length of time the job needs to run;
[0070] ExpectedFinishTime: The expected job end time indicates the time length expected by the user from the time the job is submitted to the time the job is completed, such as 2 days or 48 hours.
[0071] The priority levels for determining jobs in this step include:
[0072] Get the priority level of the job based on the expected calculation time WallTime of the job, the running time AlreadyRunningTime of the job, the expected job end time ExpectedFinishTime, and the time interval from job submission to the current time ElapsedTime;
[0073] In an exemplary embodiment, the priority information (Priority) of a job may be determined as shown in formula (1):
[0074] Priority=((ExpectedFinishTime–ElapsedTime)–(WallTime-AlreadyRunningTime))×factor (1)
[0075] Among them, factor represents the preset global impact factor, and the value range is [0, 1]. The value of the global impact factor factor can be set according to actual needs. The default value of the global impact factor factor can be 1. The lower the calculated Priority value is, the higher the priority level is.
[0076] In an exemplary instance, the first threshold and the second threshold can be pre-set according to the actual application scenario, and the first threshold is less than the second threshold, so that: when the calculated Priority is less than the first threshold, it indicates that the priority level is high priority; when the calculated Priority is greater than or equal to the second threshold, it indicates that the priority level is low priority; when the calculated Priority is greater than or equal to the first threshold and less than the second threshold, it indicates that the priority level is medium priority, and the medium priority is between the high priority and the low priority.
[0077] In an exemplary embodiment, the cloud management server may periodically determine the priority level of the job according to a preset period.
[0078] In an exemplary embodiment, jobs of the same priority level can be placed in the same queue for subsequent processing. In the embodiment of the present application, the priority level of the job is determined in real time, so the job queue is also adjusted in real time, which provides a guarantee for the job to be assigned to a suitable running instance.
[0079] Step 101: The cloud management server allocates a preemptive instance to a job with a low priority level and runs the job.
[0080] In an exemplary embodiment, the attribute information of the job further includes: expected cost; in this step, allocating a preemptible instance and running the job may include:
[0081] Allocate appropriate computing resources to the job based on the expected cost in the job's attribute information, that is, set an appropriate bid to ensure that the expected cost is not exceeded to automatically scale up the preemptible instance, and count the cost spent by the job in real time.
[0082] In an exemplary embodiment, this step further includes:
[0083] The cloud management server allocates prepaid modes such as annual and monthly instances to jobs with a medium priority level.
[0084] In an exemplary embodiment, this step further includes:
[0085] The cloud management server allocates a pay-as-you-go instance to a job with a high priority level for immediate computing.
[0086] For example, assuming the first threshold is 10 and the second threshold is 20, then,
[0087] If Priority>=20, place the job in queue Low;
[0088] If 20>Priority>=10, the job is placed in the Normal queue;
[0089] If Priority < 10, the job is placed in the queue High;
[0090] In this way, the cloud management server will obtain the job information of each queue. For example, it will obtain the job information queued in the Low queue, calculate the number of cores required for expansion, and try to automatically expand preemptible instances of various specifications. Another example is to obtain the job information queued in the High queue, calculate the number of cores required for expansion, and try to automatically expand pay-as-you-go instances of various specifications to ensure that the job is completed as soon as possible. Another example is that jobs in the Normal queue will queue up and wait for computing resources to be idle.
[0091] Step 102: The cloud management server learns that the running preemptible instance is about to be released, and continuously attempts to allocate the preemptible instance to the job until the job is finished.
[0092] In an exemplary embodiment, the step of continuously trying to allocate a preemptible instance to the job may include:
[0093] If the application software used by the user in the job supports breakpoint resumption, then the job status is reset to queue. The application software used by the user in the job will automatically save the checkpoint file, which will store the running status information of the job. The job will continue computing at the previous progress while waiting for new computing resources.
[0094] If the application software used by the user in the job does not support breakpoint resumption, then before the preemptible instance is released, the current preemptible instance is set to sleep (that is, other jobs cannot be expanded to the preemptible instance); the job status is reset to queue, and the sleep file information is recorded to wait for new computing resources; when the computing resources are expanded, the sleep file is used to continue the computing. The sleep file information includes information such as the operating system and all memory files when the user job is running.
[0095] Figure 2 A schematic diagram of an application scenario of the method for obtaining cloud services for this application, such as Figure 2 As shown, the present application prioritizes jobs and allocates preemptive instances to low-priority jobs, thereby ensuring that low-priority jobs use preemptive instances for calculation continuously or intermittently, making full use of low-cost preemptive instances and reducing job running costs.
[0096] In one exemplary embodiment, Figure 1 In the method for obtaining cloud services shown, while continuously trying to allocate preemptible instances to run low-priority jobs, the application also includes:
[0097] Determine whether the current time is close to the expected job end time ExpectedFinishTime in the job attribute information. If it is close, and the capacity cannot be expanded or the preemptible instance cannot be retained for a sufficient period of time, the cloud management server automatically expands the pay-as-you-go instance to run the job.
[0098] In this way, the job is guaranteed to be completed on time and the operation cost is minimized.
[0099] In an exemplary embodiment, determining whether the current time is close to the expected job finish time ExpectedFinishTime in the job attribute information may include:
[0100] A time interval threshold is set in advance, and the absolute value of the difference between the current time and the expected job end time ExpectedFinishTime in the job's attribute information is calculated. If the absolute value is less than or equal to the time interval threshold, it is determined that the current time is close to the expected job end time ExpectedFinishTime in the job's attribute information.
[0101] In an exemplary embodiment, the attribute information of the job also includes: an expected maximum operating cost for indicating the upper limit of the cost that the user expects the job to calculate; the method for obtaining cloud services in the present application also includes:
[0102] The computing resources of the preemptible instance whose running cost is lower than the expected maximum running cost are expanded according to the cost already spent by the job and the expected maximum running cost calculated in step 101. In this way, it is fully ensured that the job completes the computing within the controllable cost.
[0103] In one embodiment of the present application, expected computing time, expected computing cost, etc. are used as factors for obtaining cloud services, and more acquisition methods are provided based on relevant technologies; moreover, low-cost preemptible instances on the cloud are fully utilized to minimize computing costs while ensuring that the job is completed on time, thereby controlling the job running costs.
[0104] The present application also provides a computer-readable storage medium storing computer-executable instructions, wherein the computer-executable instructions are used to execute any of the above methods for obtaining cloud services.
[0105] The present application further provides a device for acquiring cloud services, including a memory and a processor, wherein the memory stores the following instructions executable by the processor: used to execute the steps of any of the above methods for acquiring cloud services.
[0106] Figure 3 A schematic diagram of the composition structure of the device for obtaining cloud services for this application, such as Figure 3 As shown, it at least includes: a first processing module, a resource allocation module, and a second processing module; wherein,
[0107] A first processing module, used for determining a priority level of a job according to attribute information of the job;
[0108] A resource allocation module, configured to allocate a preemptive instance to a job with a low priority level and run the job; upon receiving a notification from the second processing module, continuously trying to allocate a preemptive instance to the job until the job is finished;
[0109] The second processing module is used to learn that the running preemptible instance is about to be released, and to notify the resource allocation module.
[0110] In an exemplary embodiment, the attribute information of the job includes at least: expected computing core time WallTime, and expected job end time ExpectedFinishTime.
[0111] In an exemplary embodiment, the first processing module is specifically configured to:
[0112] Calculate the job priority information Priority based on the expected computing time WallTime, the expected job end time ExpectedFinishTime, the job running time AlreadyRunningTime, and the time interval from job submission to the current time;
[0113] When the calculated Priority is less than the preset first threshold, it indicates that the priority level is high priority; when the calculated Priority is greater than or equal to the preset second threshold, it indicates that the priority level is low priority; when the calculated Priority is greater than or equal to the first threshold and less than the second threshold, it indicates that the priority level is medium priority, which is between high priority and low priority. Among them, the first threshold is less than the second threshold.
[0114] In an exemplary embodiment, the first processing module periodically determines the priority level of the job according to a preset period.
[0115] In an exemplary embodiment, the resource allocation module is further configured to:
[0116] Assign prepaid modes such as annual or monthly instances to jobs with medium priority level;
[0117] Jobs with a priority level of High Priority are assigned pay-as-you-go instances for immediate computation.
[0118] In an exemplary embodiment, the resource allocation module receives a notification from the second processing module and continuously attempts to allocate a preemptible instance to the job until the job runs to completion, specifically for:
[0119] Upon learning that a running preemptible instance is about to be released, if the application software used by the user in the job supports breakpoint resumption, the job status is reset to queue, and the application software used by the user in the job automatically saves the checkpoint file, which saves the running status information of the job; while waiting for new computing resources, the job continues computing according to the previous progress; if the application software used by the user in the job does not support breakpoint resumption, before the preemptible instance is released, the current preemptible instance is set to hibernate (that is, other jobs cannot be expanded to the preemptible instance); the job status is reset to queue, and the hibernation file information is recorded to wait for new computing resources; when the computing resources are expanded, the hibernation file is used to continue computing.
[0120] This application prioritizes jobs and assigns preemptive instances to low-priority jobs, ensuring that low-priority jobs use preemptive instances for calculation continuously or intermittently, making full use of low-cost preemptive instances and reducing job running costs.
[0121] In an exemplary embodiment, the resource allocation module is further configured to:
[0122] Determine whether the current time is close to the expected job end time ExpectedFinishTim in the job attribute information. If it is close, and it is still impossible to expand the capacity or retain the preemptible instance for a sufficient period of time, then automatically expand the capacity of the pay-as-you-go instance to run the job.
[0123] In this way, the job is guaranteed to be completed on time and the operation cost is minimized.
[0124] In an exemplary embodiment, the resource allocation module allocates the preempted instance and runs the job, including: allocating computing resources to the job according to the expected cost in the attribute information of the job, and counting the cost already spent by the job in real time;
[0125] The job attribute information also includes: an expected maximum operating cost for indicating the upper limit of the cost that the user expects the job to calculate; the resource allocation module is also used to:
[0126] According to the statistically calculated cost already spent on the job and the expected maximum operating cost, computing resources of the preemptible instance whose operating cost is lower than the expected maximum operating cost are expanded.
[0127] In this way, it is fully guaranteed that the calculation is completed within a controllable cost.
[0128] The present application also provides a cloud management server, comprising any of the above-mentioned devices for obtaining cloud services.
[0129] The technical solution of the present application is described in detail below in conjunction with specific embodiments.
[0130] First embodiment, Figure 4 This is a flowchart of the first embodiment of obtaining cloud services for this application. The first embodiment describes the process of a user submitting a job and using a preemptible instance for computing. In this embodiment, it is assumed that the functions of the cloud management server are completed by the queue service, job scheduling service, and resource scheduling service. Figure 4 As shown, including:
[0131] Step 400: The queue service receives a job submitted by a user.
[0132] In the first embodiment, it is assumed that the attribute information of the submitted job includes: the expected calculation time WallTime is 10 hours, and the expected job end time ExpectedFinishTime is two days, that is, the calculation of the job is expected to be completed within two days.
[0133] Step 401 to step 402: The job scheduling service calculates the priority level of the job. Assuming that the priority level of the job is low according to formula (1), the job is placed in the queue Low.
[0134] Steps 403 to 405: The resource scheduling service queries the job queue information, automatically scales up the preemptible instance for the job in the queue Low through a cloud service such as an ECS service, and adds the node to the cluster to run the job.
[0135] Steps 406 to 408: During the running of the job, the resource scheduling service receives a notification that the preemptible instance of the ECS service is about to be automatically released. In this embodiment, the resource scheduling service sets the current preemptible instance to sleep, resets the job status to queue and places it in the corresponding queue, and saves the sleep file or checkpoint file.
[0136] Step 409: The resource scheduling service continuously attempts to automatically expand the capacity of the preemptible instance, and after being allocated to the preemptible instance, adds the node to the cluster to continue running the job using the dormancy file until the calculation of the job is completed.
[0137] This embodiment aims at low-priority jobs, and ensures that low-priority jobs use preemptive instances for calculation continuously or intermittently, making full use of low-cost preemptive instances and reducing job running costs.
[0138] Second embodiment, Figure 5 This is a flow chart of the second embodiment of obtaining cloud services for this application. The second embodiment describes the process of a user submitting a job and the change of the priority of the job during the calculation and waiting process. In this embodiment, it is assumed that the functions of the cloud management server are completed by the queue service, job scheduling service and resource scheduling service, such as Figure 5 As shown, including:
[0139] Step 500: The queue service receives a job submitted by a user.
[0140] In the first embodiment, it is assumed that the attribute information of the submitted job includes: the expected calculation time WallTime is 5 hours, and the expected job end time ExpectedFinishTime is one day, that is, it is expected that the calculation of the job will be completed within one day.
[0141] Step 501 to step 502: The job scheduling service calculates the priority level of the job. Assuming that the priority level of the job is low according to formula (1), the job is placed in the queue Low.
[0142] Steps 503 to 505: The resource scheduling service queries the job queue information, automatically expands the preemptible instance for the job in the queue Low through a cloud service such as an ECS service, and adds the node to the cluster to run the job.
[0143] Steps 506 to 508: During the operation of the job, the resource scheduling service receives a notification that the preemptible instance of the ECS service is about to be automatically released. In this embodiment, the resource scheduling service sets the current preemptible instance to sleep, resets the job status to queue, and saves the sleep file or checkpoint file.
[0144] Steps 509 to 510: According to the preset timer, the job scheduling service recalculates the priority level of the job regularly. Assuming that the priority level of the job is calculated as medium priority according to formula (1), the job is placed in the queue Normal. However, the queue Normal has no idle resources, and the job is always in a waiting state.
[0145] Steps 511 to 512: According to a preset timer, the job scheduling service periodically recalculates the priority level of the job. Assuming that the priority level of the job calculated according to formula (1) is medium priority, the job is placed in the queue High.
[0146] Steps 513 to 515: The resource scheduling service queries the job queue information, automatically scales up the pay-as-you-go instance for the job in the queue High through a cloud service such as an ECS service, and adds the node to the cluster to run the job.
[0147] This embodiment ensures that the job is completed on time and minimizes the cost of job operation.
[0148] Although the embodiments disclosed in this application are as above, the contents described are only embodiments adopted to facilitate understanding of this application and are not intended to limit this application. Any technician in the field to which this application belongs can make any modifications and changes in the form and details of implementation without departing from the spirit and scope disclosed in this application, but the scope of patent protection of this application shall still be based on the scope defined in the attached claims.
Claims
1. A method for obtaining a cloud service, comprising: The cloud management server determines the priority level of the job according to the attribute information of the job; The attribute information of the job includes: expected computing time, expected job end time; Allocate a preemptible instance to a job with a low priority level and run the job; Knowing that the running preemptible instance is about to be released, the system continuously tries to allocate the preemptible instance to the job until the job is finished. Determining the priority level of the job includes: The first difference is obtained by subtracting the time interval from the time when the job is submitted to the current time from the time when the job is submitted to the time when the job is completed from the time when the user expects the job to run. The second difference is obtained by subtracting the time the job has been running from the time the job needs to run. Subtract the second difference from the first difference to obtain a third difference, Determine the product of the third difference and the preset global impact factor as the priority value; The priority level of the job is determined according to the priority value and a preset threshold.
2. The method according to claim 1, wherein: Determining the priority level of the job includes: The priority value is calculated according to the following formula: Priority = ((ExpectedFinishTime – ElapsedTime) – (WallTime – AlreadyRunningTime)) × factor; where factor represents the preset global impact factor, and its value range is [0, 1]; ExpectedFinishTime represents the time length expected by the user from the time the job is submitted to the time the job is completed; ElapsedTime represents the time interval from the time the job is submitted to the current time; AlreadyRunningTime represents the time length of the job that has been running, and WallTime represents the time length of the job that needs to be running; When the calculated Priority is less than the preset first threshold, it indicates that the priority level is high priority; when the calculated Priority is greater than or equal to the preset second threshold, it indicates that the priority level is low priority; when the calculated Priority is greater than or equal to the first threshold and less than the second threshold, it indicates that the priority level is medium priority; wherein the first threshold is less than the second threshold.
3. The method according to claim 1, wherein: The cloud management server regularly determines the priority level of the job according to a preset period.
4. The method according to claim 1, wherein the attribute information of the job further comprises: Expected costs; The allocation preempts the instance and runs the job, including: Computing resources are allocated to the job according to the expected cost, and the cost incurred by the job is counted in real time.
5. The method according to claim 4, wherein the attribute information of the job further comprises: expected maximum operating cost; the method further comprising: The cloud management server expands the computing resources of the preemptible instance whose operating cost is lower than the expected maximum operating cost according to the calculated cost already spent by the job and the expected maximum operating cost.
6. The method according to claim 1 or 3, further comprising: The cloud management server assigns a prepaid mode to a job with a medium priority level; The cloud management server allocates a scaled instance to a job with a high priority level.
7. The method according to claim 1, wherein: The continuous attempt to allocate a preemptible instance to the job includes: If the application software used by the user in the job supports breakpoint resumption, the job status is reset to queue and the running status information of the job is saved to wait for new computing resources to continue the calculation; If the application software used by the user in the job does not support breakpoint resumption, the current preemptive instance is set to sleep before the preemptive instance is released; the status of the job is reset to queue, and the sleep file information is recorded to wait for new computing resources; and the sleep file is used to continue the computing when the computing resources are expanded.
8. The method according to claim 1, further comprising: It is determined whether the current time is close to the expected job end time in the attribute information of the job. If it is close, it is still impossible to expand the capacity or retain the preemptible instance for a sufficient period of time, and the cloud management server expands the pay-as-you-go instance to run the job.
9. The method according to claim 8, wherein: The step of judging whether the current time is close to the expected job end time in the job attribute information includes: A time interval threshold is set in advance, and the absolute value of the difference between the current time and the expected job end time in the attribute information of the job is calculated; if the absolute value is less than or equal to the time interval threshold, it is determined that the current time is close to the expected job end time in the attribute information of the job.
10. A computer-readable storage medium storing computer-executable instructions, wherein the computer-executable instructions are used to execute the method for acquiring cloud services according to any one of claims 1 to 9.
11. A device for implementing cloud computing resource allocation, comprising a memory and a processor, wherein: The memory stores the following instructions executable by the processor: used to execute the steps of the method for obtaining cloud services as described in any one of claims 1 to 9.
12. A device for obtaining cloud services, comprising: A first processing module, a resource allocation module, and a second processing module; wherein, A first processing module is used to determine the priority level of the job according to the attribute information of the job; the attribute information of the job includes: expected computing time and expected job end time; A resource allocation module, configured to allocate a preemptive instance to a job with a low priority level and run the job; upon receiving a notification from the second processing module, continuously trying to allocate a preemptive instance to the job until the job is finished; The second processing module is used to learn that the running preemptible instance is about to be released and notify the resource allocation module; The first processing module is specifically used to obtain a first difference by subtracting the time interval from job submission to the current time from the time the job is submitted to the time the job is completed, from the length of time the user expects; to obtain a second difference by subtracting the time the job needs to run from the time the job has been running; to obtain a third difference by subtracting the second difference from the first difference, and to determine the product of the third difference and a preset global impact factor as the priority value; and to determine the priority level of the job based on the priority value and a preset threshold.
13. The device according to claim 12, wherein the first processing module periodically determines the priority level of the job according to a preset period.
14. The device according to claim 12 or 13, wherein the resource allocation module is further configured to: Assigning a prepaid mode to jobs with a medium priority level; Assign pay-as-you-go instances to jobs with a high priority level.
15. The device according to claim 12, wherein: The resource allocation module receives the notification from the second processing module and continuously attempts to allocate a preemptive instance to the job until the job runs to completion, specifically for: Upon learning that a running preemptible instance is about to be released, if the application software used by the user in the job itself supports breakpoint resumption, the job status is reset to queue and the running status information of the job is saved to wait for new computing resources to continue the calculation; if the application software used by the user in the job itself does not support breakpoint resumption, the current preemptible instance is set to hibernation before the preemptible instance is released; the job status is reset to queue, and the hibernation file information is recorded to wait for new computing resources; and the calculation is continued using the hibernation file when the computing resources are expanded.
16. The device according to claim 12 or 15, wherein the resource allocation module is further configured to: It is determined whether the current time is close to the expected job end time in the attribute information of the job. If so, it is still impossible to expand the capacity or retain the preemptible instance for a sufficient period of time, and the pay-as-you-go instance is expanded to run the job.
17. The device according to claim 12 or 15, wherein the resource allocation module allocates the preempted instance and runs the job, comprising: Allocate computing resources to the job according to the expected cost in the attribute information of the job, and calculate the cost spent by the job in real time; The attribute information of the job also includes: an expected maximum operating cost; the resource allocation module is also used to: expand the computing resources of the preemptible instance with a cost lower than the expected maximum operating cost based on the statistical cost already spent by the job and the expected maximum operating cost.
18. A cloud management server, comprising the device for acquiring cloud services according to any one of claims 12 to 17.
