Resource isolation method, device, equipment, medium and product in off-line mixed part
By deploying the colocation proxy plug-in and redirection proxy plug-in on the nodes of the container orchestration platform, the resource isolation problem of offline tasks in the container orchestration platform is solved, the stable operation and resource management of offline jobs are achieved, and resource utilization is improved.
Patent Information
- Application Number
- CN202510793734.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-13
- Publication Date
- 2025-09-26
Smart Images

Figure CN120704874A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of Internet technology, and in particular to a resource isolation method, device, equipment, medium, and product in offline colocation. Background Art
[0002] Data centers are crucial information infrastructure and a key enabler for enterprise internet applications. However, currently, server resource utilization in data centers is low, leading to significant resource waste and significant additional operational and maintenance costs, becoming a key issue hindering the ability of major enterprises to improve computing performance.
[0003] Container orchestration platforms, which are used to automate the deployment, expansion, and management of containerized applications, have an important position and development prospects in the development and deployment of cloud-native applications. More and more enterprises and organizations are beginning to use container orchestration platforms to manage and deploy their applications.
[0004] Colocation, which involves 1) deploying a mix of online and offline jobs and 2) deploying a mix of high- and low-priority applications, is an important technical tool that can effectively improve data center resource utilization. The rational resource management of offline tasks in colocation deployment within container orchestration platforms has become a research hotspot in academia and industry. Summary of the Invention
[0005] The present invention provides a method, apparatus, device, medium and product for resource isolation in offline co-location to solve the problem that the existing technology lacks effective resource isolation for offline tasks co-located in a container orchestration platform.
[0006] According to one aspect of the present invention, a resource isolation method for offline colocation is provided. The method is executed by a node in a container orchestration platform, wherein the node is deployed with a colocation proxy plug-in and a redirection proxy plug-in. The method includes:
[0007] When deploying jobs in the container orchestration platform, the container creation request is intercepted by the colocation proxy plug-in;
[0008] If the current job is an offline job, forwarding the container creation request to the redirection proxy plug-in through the colocation proxy plug-in;
[0009] The control group parent path in the container creation request is modified by the redirection proxy plug-in to redirect the current job to the control group root of the offline job.
[0010] According to another aspect of the present invention, a resource isolation device for offline colocation is provided. The device is deployed on a node in a container orchestration platform. The node is deployed with a colocation proxy plug-in and a redirection proxy plug-in. The device includes:
[0011] A request interception module, configured to intercept container creation requests through the colocation proxy plug-in when deploying jobs in the container orchestration platform;
[0012] a forwarding module, configured to forward the container creation request to the redirection proxy plug-in through the colocation proxy plug-in if the current job is an offline job;
[0013] The redirection module is used to modify the control group parent path in the container creation request through the redirection proxy plug-in to redirect the current job to the control group root of the offline job.
[0014] According to another aspect of the present invention, a computer program product is provided, including a computer program. When executed by a processor, the computer program implements the resource isolation method in offline colocation according to any embodiment of the present invention.
[0015] According to another aspect of the present invention, an electronic device is provided, comprising:
[0016] At least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor to enable the at least one processor to perform the resource isolation method in offline colocation according to any embodiment of the present invention.
[0017] According to another aspect of the present invention, a computer-readable storage medium is provided. The computer-readable storage medium stores computer instructions, which are used to cause a processor to implement the resource isolation method for offline colocation according to any embodiment of the present invention when executed.
[0018] According to another aspect of the present invention, a computer program product is provided, including a computer program / instruction, which, when executed by a processor, implements the resource isolation method for offline colocation according to any embodiment of the present invention.
[0019] The embodiment of the present invention deploys a colocation proxy plug-in and a redirection proxy plug-in on the nodes of the container orchestration platform, and implements resource isolation between online and offline jobs through the colocation proxy plug-in and the redirection proxy plug-in. It can accurately intercept container creation requests during job deployment. When an offline job is identified, the redirection proxy plug-in modifies the control group parent path of the offline job and guides it to the offline job control group root, effectively implementing the isolation of offline job resources. The control group root of the offline job implements unified resource management of the offline job, avoiding interference of offline jobs with the resources of online jobs, ensuring the stable operation of different job types in the cluster, and at the same time helping to more reasonably allocate and manage cluster resources and improve resource utilization efficiency.
[0020] It should be understood that the content described in this section is not intended to identify the key or important features of the embodiments of the present invention, nor is it intended to limit the scope of the present invention. Other features of the present invention will become readily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS
[0021] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0022] Figure 1.1 This is a first flow chart of a resource isolation method in offline colocation provided by an embodiment of the present invention;
[0023] Figure 1.2 This is a schematic diagram of the relationship between the control group and container group of a node in a container orchestration platform deployed based on the resource isolation method for offline colocation provided by an embodiment of the present invention;
[0024] Figure 2 This is a second flow chart of a resource isolation method in offline colocation provided by an embodiment of the present invention;
[0025] Figure 3 This is a schematic diagram of the structure of a resource isolation device in offline colocation provided by an embodiment of the present invention;
[0026] Figure 4 It is a schematic structural diagram of an electronic device implementing an embodiment of the present invention. DETAILED DESCRIPTION
[0027] In order to enable those skilled in the art to better understand the solutions of the present invention, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the embodiments described are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative efforts should fall within the scope of protection of the present invention.
[0028] It should be noted that the terms "first", "second", etc. in the description and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that the numbers used in this way can be interchanged where appropriate so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions. For example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0029] Figure 1.1 This is the first flow chart of a resource isolation method in offline mixed deployment provided by an embodiment of the present invention. This embodiment is applicable to the situation where effective resource isolation is performed on online tasks and offline tasks that are mixed and deployed in a container orchestration platform. The method can be executed by a resource isolation device in offline mixed deployment. The device can be implemented in the form of hardware and / or software. The device can be configured in an electronic device with corresponding data processing capabilities, for example, a node in a container orchestration platform, wherein the node is deployed with a mixed deployment proxy plug-in and a redirection proxy plug-in. Figure 1.1 As shown, the method includes:
[0030] S110: When deploying a job in a container orchestration platform, intercept a container creation request through the colocation proxy plug-in.
[0031] Online jobs typically experience peaks and troughs. Offline jobs (such as data analysis and batch processing) can reuse resources during these peaks and troughs. Colocation reduces idle resources and lowers hardware or cloud resource costs. Online jobs require low latency and high availability, while offline tasks are less sensitive to latency and can tolerate resource preemption.
[0032] A node in a container orchestration platform is a physical or virtual machine within the platform. It serves as the fundamental computing unit for running containerized workloads, responsible for running container groups and providing compute, storage, and network resources. Each node corresponds to a node daemon. The node daemon is responsible for communicating with the control plane of the master node and performing container group and container management tasks. Based on the configuration information received from the control plane, the node daemon interacts with the container runtime component through the container runtime interface to perform operations such as creating, starting, stopping, and deleting containers. The container runtime component is the underlying software responsible for running containers and is responsible for container lifecycle management (creation, starting, stopping, and deletion).
[0033] Implementing a hybrid deployment of online and offline jobs within a container orchestration platform is a key strategy for improving resource utilization and reducing costs. Hybrid deployment improves node resource utilization while ensuring the Service Level Objective (SLO) of online resources.
[0034] When deploying a job on a container orchestration platform, the node daemon sends a container creation request. The pre-deployed colocation agent plug-in intercepts the container creation request and determines whether the currently deployed job is an online job or an offline job.
[0035] S120: If the current job is an offline job, forward the container creation request to the redirection proxy plug-in through the colocation proxy plug-in, modify the control group parent path in the container creation request through the redirection proxy plug-in, and redirect the current job to the control group root of the offline job.
[0036] When the current job is an offline job, the colocation proxy plug-in forwards the container creation request to the redirection proxy plug-in pre-deployed on the node. The redirection proxy plug-in modifies the control group parent path in the container creation request and redirects the current job to the control group root of the offline job.
[0037] Control Groups (CGroups) are a core dependency of container technology, used to implement resource isolation and restrictions. In the container orchestration platform, resource requests and limits for a container group are ultimately implemented through the control group. For example, if you set a CPU limit of 500m (0.5 CPU cores) for a container group, the container orchestration platform will limit the container group's CPU usage through the control group's CPU subsystem.
[0038] Control groups organize process groups into hierarchies, each of which can host multiple subsystems. Each control group is a collection of processes, which can contain nested sub-control groups. Resource limits for control groups are set using configuration files or tools.
[0039] Optionally, modifying the control group parent path in the container creation request by the redirect proxy plug-in to redirect the current job to the control group root of the offline job includes: modifying the value of the control group parent path in the container creation request to the control group root of the offline job by the redirect proxy plug-in, and forwarding the modified container creation request to the container runtime component; and creating a container under the control group root of the offline job by the container runtime component.
[0040] The control group root of the offline job is the parent directory of the control group of the offline job in the node. The control group root directory of the offline job is created in the node in advance, and the hybrid proxy plug-in intercepts the container creation request, determines the category of the current job according to the job status parameter in the container creation request, and forwards the container creation request to the redirect proxy plug-in when the current job is an offline job. The redirect proxy plug-in modifies the value of the control group parent path (cgroup-parent) of the offline job in the container creation request to the control group root of the offline job. The redirect proxy plug-in forwards the container creation request after the control group parent path is redirected to the container runtime component, so that the container runtime component creates a container according to the redirected control group parent path, and deploys the offline job under the control group root directory of the offline job. Exemplarily, when the control group root of the offline job is offline-cgroup, the redirected control group parent path is:
[0041] "cgroup-parent":" / offline-cgroup".
[0042] A control group root directory for offline jobs is created in the node in advance. The colocation proxy plug-in intercepts container creation requests and identifies the job category. During offline jobs, the request is forwarded to the redirection proxy plug-in, which modifies the control group parent path to the offline job control group root before forwarding it to the container runtime component. This allows offline jobs to be accurately deployed to the preset offline job control group root directory, effectively isolating and managing offline job resources. This helps optimize system resource allocation, improves resource utilization, and ensures stable operation and performance of online and offline jobs in colocation scenarios.
[0043] Optionally, if the current job is an online job, the container creation request is forwarded to the container runtime component through the colocation proxy plug-in, so that the container runtime component creates the container according to the default configuration of the online job.
[0044] When the current job is an online job, the hybrid scheduling agent plugin directly forwards the container creation request to the container runtime component. The container runtime component creates a container for the online job according to the default configuration of the online job, and the online job is deployed under the default control group.
[0045] Furthermore, for both online jobs and offline jobs, resource isolation and QoS (Quality of Service) guarantee in the hybrid scheduling scenario of the container orchestration platform are adopted.
[0046] The QoS category division includes: Guaranteed: All containers in the container group are set with requests and limits and the two are equal, ensuring stable resource supply. Burstable: At least one container in the container group is set with requests and limits but the two are not equal, requests < limits, providing certain resource elasticity. BestEffort: The container group is not set with requests or limits, there is no control group limit, and resources may be preempted, which is suitable for scenarios with low resource requirements. Among them, requests represents the minimum resource amount required for container operation, which is the lower limit of the resources allocated to the container during scheduling. Limits represents the maximum resource amount that the container can use, which is the upper limit of the container resource usage. Resource isolation includes: achieving logical isolation through namespaces, resource quotas, LimitRange, etc.; or implementing node-level resource isolation using technologies such as control groups.
[0047] The schematic diagram of the relationship between the control group of the node and the container group in the container orchestration platform deployed based on the resource isolation method for online and offline hybrid scheduling described in the embodiments of the present invention is as follows Figure 1.2 shown.
[0048] In the embodiments of the present invention, by deploying a hybrid scheduling agent plugin and a redirection agent plugin on the nodes of the container orchestration platform, resource isolation of online jobs and offline jobs is achieved through the hybrid scheduling agent plugin and the redirection agent plugin, which can accurately intercept container creation requests during job deployment. When an offline job is recognized, the redirection agent plugin modifies the control group parent path of the offline job to guide it to the root of the offline job control group, effectively achieving isolation of the resources of the offline job. Unified resource management of the offline job is achieved through the root of the offline job control group, avoiding interference of the offline job on the resources of the online job, ensuring the stable operation of different job types in the cluster, and at the same time helping to more reasonably allocate and manage cluster resources and improve resource utilization efficiency.
[0049] In an optional implementation manner, the method further includes: modifying the container group specification through the redirection agent plugin, so that the container runtime component creates a container according to the modified container group specification.
[0050] In a container orchestration platform, a container group specification is the core component that defines the behavior and configuration of a container group. It describes key information such as the container group's operating mode, the containers it contains, resource requirements, and environment variables. A container group is the smallest scheduling unit in a container orchestration platform and typically contains one or more closely related containers. In addition to modifying the control group parent path in an offline job's container creation request, redirecting the current job to the offline job's control group root, the redirect proxy plug-in can also modify the container group specification, causing the container runtime component to create containers according to the modified container group specification.
[0051] By dynamically modifying container group specifications through the redirect proxy plug-in, traffic proxying, load balancing, or security policy injection can be achieved by modifying the specifications without rebuilding the image or adjusting the deployment configuration, reducing O&M complexity and meeting dynamic adaptation network / security requirements. It supports dynamic adjustment of container behavior based on the environment (such as development / production) or strategy (such as A / B testing), avoiding hard-coded configuration and enhancing deployment flexibility. By implementing unified specification modifications through the plug-in, the network or resource restrictions of multiple container groups can be optimized in batches, avoiding the inefficient operation of manual adjustment one by one and improving resource utilization. It can flexibly adapt to complex network environments or security policies, ensuring that containers run on demand, and improving deployment flexibility, security, and resource utilization.
[0052] Figure 2 This is the second flow chart of a resource isolation method in offline colocation provided by an embodiment of the present invention. This embodiment is optimized and improved on the basis of the above embodiment. The method is executed by a node in the container orchestration platform, and the node is also deployed with an offline resource setting plug-in, such as Figure 2 As shown, the method includes:
[0053] S210: Create a control group root for the offline job through the offline resource setting plug-in, periodically count resource usage of online jobs in the node, and determine the total available resources for the offline job based on the total resources of the node and the resource usage of the online job.
[0054] S220: Set resource limits for the control group root of the offline job according to the total available resources of the offline job.
[0055] After a node on the container orchestration platform starts, deploy the offline resource configuration plug-in on the node. This plug-in creates a control group root directory for offline jobs. The plug-in periodically collects statistics on the resource usage of online jobs on the node and determines the total available resources for offline jobs based on the node's total resources and the resource usage of online jobs.
[0056] Optionally, the total available resources for offline jobs are calculated by subtracting the resources used by online jobs from the total resources of the node. Alternatively, historical data (such as periodic fluctuations and trends in CPU, memory, and network metrics) and task characteristics (such as load type, user access patterns, and concurrency) can be combined with time series analysis, machine learning models, or statistical methods to predict the future resource requirements of online jobs. The total available resources for offline jobs can then be determined based on the total resources of the node and the future resource requirements of online jobs.
[0057] The offline resource setting plug-in sets resource limits for the control group root of the offline job based on the total available resources of the offline job. Specifically, the offline resource setting plug-in sets resource limits (such as allocating a specific number of CPU cores and memory thresholds) for the control group root of the offline job based on the dynamically determined total available resources of the offline job, thereby ensuring that the offline job runs efficiently within the available resources while avoiding resource competition or system overload for online jobs or other critical tasks.
[0058] By combining historical data (such as periodic fluctuations and trends in CPU, memory, and network metrics) with task characteristics (load type, user access patterns, and concurrency), time series analysis, machine learning models, or statistical methods are used to predict future resource requirements for online jobs. Based on this, the total available resources for offline jobs are dynamically determined. The offline resource setting plug-in then precisely assigns resource limits (such as setting a specific number of CPU cores and memory thresholds) to the control group root of offline jobs. This effectively balances resource allocation between online and offline jobs, ensuring stable online job performance while maximizing the use of idle cluster resources. This prevents excessive resource usage by offline jobs, which could lead to system overload. This achieves the dual goals of full resource utilization and performance optimization during offline colocation.
[0059] S230: When deploying a job in the container orchestration platform, intercept the container creation request through the colocation proxy plug-in.
[0060] S240: If the current job is an offline job, forward the container creation request to the redirection proxy plug-in through the colocation proxy plug-in, modify the control group parent path in the container creation request through the redirection proxy plug-in, and redirect the current job to the control group root of the offline job.
[0061] In this embodiment of the present invention, an offline resource setting plug-in is used to dynamically create an offline job control group root and periodically count the usage of online job resources. In combination with the total resources of the node, the available resources for offline jobs are dynamically determined and restrictions are set. At the same time, a colocation proxy plug-in is used to intercept container creation requests and redirect offline job requests to the offline job control group root, thereby realizing intelligent colocation of online and offline jobs in the container orchestration platform. This ensures stable online job performance and dynamically optimizes offline job resource allocation, improving the overall resource utilization of the cluster. At the same time, the offline job control group root is used to isolate online and offline jobs, reducing the risk of resource contention between jobs, and realizing efficient and flexible cluster resource management.
[0062] In an optional implementation, the method further includes: allocating resources to each container of the offline job according to the resource request of each container of the offline job and the resource limit of the control group root of the offline job by a node daemon process in the node.
[0063] All offline jobs are deployed under the control group root of the offline job. The offline resource setting plug-in sets the total available resource limit for the offline job's control group root. The node daemon allocates resources to each container of the offline job based on the resource request of each container and the resource limit of the offline job's control group root.
[0064] All offline jobs are deployed under a unified control group root, and total resource limits are set through the offline resource setting plug-in. The node daemon dynamically allocates resources based on container resource requests and control group root limits, achieving centralized management and precise allocation of offline job resources. This not only ensures the fairness of resource allocation within offline jobs, but also effectively avoids excessive resource occupation, improving the overall resource utilization and stability of the cluster.
[0065] Optionally, the node daemon process allocates resources to each container of the offline job according to the resource requests of each container of the offline job and the resource limits of the control group root of the offline job, including: determining the proportion of the resource request of any container of the offline job in the resource requests of all containers of the offline job, and determining the actual available resources of the container according to the proportion and the resource limits of the control group root of the offline job.
[0066] When determining the resource allocation for offline job containers, determine the proportion of the container resource request (such as CPU, memory) in the total resource requests of all containers in the offline job. Based on the set offline job control group root resource limit (such as the total number of available CPU cores and memory threshold for offline jobs), dynamically allocate the actual available resources for the offline job container according to this proportion. Specifically, multiply this proportion by the resource limit of the offline job control group root, and determine the actual available resources for the container based on the multiplication result. This enables on-demand resource allocation and precise control within the offline job, ensuring that each container runs efficiently within the limited resource range. At the same time, it prevents offline jobs from preempting the resources of online jobs, ensuring the rationality and fairness of overall resource utilization.
[0067] Figure 3 This is a schematic diagram of a resource isolation device for offline colocation provided by an embodiment of the present invention. The device is deployed on a node in a container orchestration platform, and the node is deployed with a colocation proxy plug-in and a redirection proxy plug-in, such as Figure 3 As shown, the device includes:
[0068] A request interception module 310 is configured to intercept container creation requests through the colocation proxy plug-in when deploying jobs in the container orchestration platform;
[0069] The forwarding module 320 is configured to forward the container creation request to the redirection proxy plug-in through the colocation proxy plug-in if the current job is an offline job;
[0070] The redirection module 330 is configured to modify the control group parent path in the container creation request through the redirection proxy plug-in, and redirect the current job to the control group root of the offline job.
[0071] The resource isolation device for offline colocation provided by an embodiment of the present invention can execute the resource isolation method for offline colocation provided by any embodiment of the present invention, and has the corresponding functional modules and beneficial effects of the execution method.
[0072] Optionally, the redirection module includes:
[0073] A path modification unit, configured to modify the value of the control group parent path in the container creation request to be the control group root of the offline job through the redirect proxy plug-in, and forward the modified container creation request to the container runtime component;
[0074] The container creation unit is configured to create a container under the control group root of the offline job through the container runtime component.
[0075] Optionally, the node is further deployed with an offline resource setting plug-in; the device further includes:
[0076] An offline total resource determination module is used to create a control group root for the offline job using the offline resource setting plug-in before deploying the job in the container orchestration platform, periodically collect statistics on the resource usage of online jobs in the node, and determine the total available resources for the offline job based on the total resources of the node and the resource usage of the online job;
[0077] The offline total resource setting module is configured to set resource limits for the control group root of the offline job according to the total available resources of the offline job.
[0078] Optionally, the device further includes:
[0079] The container group specification modification module is used to modify the container group specification through the redirection proxy plug-in, so that the container runtime component creates a container according to the modified container group specification.
[0080] Optionally, the device further includes:
[0081] The resource allocation module is used to allocate resources to each container of the offline job according to the resource request of each container of the offline job and the resource limit of the control group root of the offline job through the node daemon process in the node.
[0082] Optionally, the resource allocation module is specifically used to determine the proportion of resource requests of any container of the offline job in the resource requests of all containers of the offline job, and determine the actual available resources of the container based on the proportion and the resource limit of the control group root of the offline job.
[0083] The resource isolation device for offline colocation described further can also execute the resource isolation method for offline colocation provided by any embodiment of the present invention, and has the corresponding functional modules and beneficial effects of the execution method.
[0084] According to an embodiment of the present invention, the present invention further provides an electronic device, a readable storage medium and a computer program product.
[0085] Figure 4 A schematic diagram of the structure of an electronic device 40 that can be used to implement an embodiment of the present invention is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices (such as helmets, glasses, watches, etc.) and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present invention described and / or claimed herein.
[0086] like Figure 4 As shown, the electronic device 40 includes at least one processor 41 and a memory, such as a read-only memory (ROM) 42, a random access memory (RAM) 43, etc., which is communicatively connected to the at least one processor 41. The memory stores a computer program that can be executed by the at least one processor, and the processor 41 can perform various appropriate actions and processes according to the computer program stored in the read-only memory (ROM) 42 or the computer program loaded from the storage unit 48 into the random access memory (RAM) 43. Various programs and data required for the operation of the electronic device 40 can also be stored in the RAM 43. The processor 41, ROM 42, and RAM 43 are connected to each other via a bus 44. An input / output (I / O) interface 45 is also connected to the bus 44.
[0087] Multiple components in the electronic device 40 are connected to the I / O interface 45, including an input unit 46, such as a keyboard, a mouse, etc.; an output unit 47, such as various types of displays, speakers, etc.; a storage unit 48, such as a magnetic disk, an optical disk, etc.; and a communication unit 49, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 49 allows the electronic device 40 to exchange information / data with other devices via a computer network such as the Internet and / or various telecommunication networks.
[0088] Processor 41 can be any general-purpose and / or specialized processing component with processing and computing capabilities. Examples of processor 41 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various specialized artificial intelligence (AI) computing chips, various processors that run machine learning model algorithms, digital signal processors (DSPs), and any other suitable processors, controllers, microcontrollers, and the like. Processor 41 executes the various methods and processes described above, such as the resource isolation method for offline colocation.
[0089] In some embodiments, the resource isolation method for offline colocation can be implemented as a computer program tangibly embodied in a computer-readable storage medium, such as storage unit 48. In some embodiments, part or all of the computer program can be loaded and / or installed on electronic device 40 via ROM 42 and / or communication unit 49. When the computer program is loaded into RAM 43 and executed by processor 41, one or more steps of the resource isolation method for offline colocation described above can be performed. Alternatively, in other embodiments, processor 41 can be configured to perform the resource isolation method for offline colocation in any other appropriate manner (e.g., via firmware).
[0090] Various embodiments of the systems and techniques described herein can be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), system-on-chip systems (SOCs), programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various embodiments can include being implemented in one or more computer programs that are executable and / or interpreted on a programmable system that includes at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.
[0091] Computer programs for implementing the methods of the present invention may be written in any combination of one or more programming languages. These computer programs may be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, such that when the computer program is executed by the processor, the functions / operations specified in the flowcharts and / or block diagrams are implemented. The computer program may be executed entirely on the machine, partially on the machine, as a stand-alone software package, partially on the machine and partially on a remote machine, or entirely on a remote machine or server.
[0092] In the context of the present invention, computer-readable storage media can be tangible media that can contain or store a computer program for use with an instruction execution system, device or equipment or used in combination with an instruction execution system, device or equipment. Computer-readable storage media can include but are not limited to electronic, magnetic, optical, electromagnetic, infrared or semiconductor systems, devices or equipment, or any suitable combination of the foregoing. Alternatively, computer-readable storage media can be machine-readable signal media. More specific examples of machine-readable storage media can include electrical connections based on one or more lines, portable computer disks, hard disks, random access memories (RAM), read-only memories (ROM), erasable programmable read-only memories (EPROM or flash memory), optical fibers, portable compact disk read-only memories (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination of the foregoing.
[0093] To provide interaction with a user, the systems and techniques described herein can be implemented on an electronic device having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and pointing device (e.g., a mouse or trackball) through which the user can provide input to the electronic device. Other types of devices can also be used to provide interaction with the user; for example, the feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including acoustic input, voice input, or tactile input).
[0094] The systems and techniques described herein can be implemented in a computing system that includes back-end components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes front-end components (e.g., a user computer with a graphical user interface or web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such back-end components, middleware components, or front-end components. The components of the system can be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: a local area network (LAN), a wide area network (WAN), a blockchain network, and the Internet.
[0095] A computing system may include clients and servers. The clients and servers are typically remote from each other and typically interact via a communication network. This client-server relationship arises through computer programs running on the respective computers, creating a client-server relationship. The server may be a cloud server, also known as a cloud computing server or cloud host. This server is a hosting product within the cloud computing service ecosystem that addresses the management difficulties and limited scalability of traditional physical hosting and VPS services.
[0096] It should be understood that the various forms of the processes shown above can be used to reorder, add, or delete steps. For example, the steps described in the present invention can be performed in parallel, sequentially, or in a different order, as long as the desired results of the technical solution of the present invention can be achieved. This is not limited herein.
[0097] The above specific embodiments do not limit the scope of protection of the present invention. Those skilled in the art will appreciate that various modifications, combinations, sub-combinations, and substitutions may be made based on design requirements and other factors. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of the present invention are intended to be included within the scope of protection of the present invention.
Claims
1. A resource isolation method in offline colocation, characterized in that: The method is executed by a node in a container orchestration platform, where a colocation proxy plug-in and a redirection proxy plug-in are deployed. The method includes: When deploying jobs in the container orchestration platform, the container creation request is intercepted by the colocation proxy plug-in; If the current job is an offline job, forwarding the container creation request to the redirection proxy plug-in through the colocation proxy plug-in; The control group parent path in the container creation request is modified by the redirection proxy plug-in to redirect the current job to the control group root of the offline job.
2. The method according to claim 1, characterized in that The modifying the control group parent path in the container creation request by the redirection proxy plug-in to redirect the current job to the control group root of the offline job includes: Modify the control group parent path in the container creation request to the control group root of the offline job through the redirect proxy plug-in, and forward the modified container creation request to the container runtime component; A container is created under the control group root of the offline job through the container runtime component.
3. The method according to claim 1, characterized in that The node is also deployed with an offline resource setting plug-in; Before deploying the job in the container orchestration platform, the method further includes: Creating a control group root for the offline job through the offline resource setting plug-in, periodically counting resource usage of online jobs in the node, and determining the total available resources for the offline job based on the total resources of the node and the resource usage of the online job; A resource limit is set for a control group root of the offline job based on total available resources of the offline job.
4. The method according to claim 1, wherein The method further comprises: The container group specification is modified by the redirection proxy plug-in, so that the container runtime component creates a container according to the modified container group specification.
5. The method according to claim 1, wherein The method further comprises: Resources are allocated to each container of the offline job by the node daemon process in the node according to the resource request of each container of the offline job and the resource limit of the control group root of the offline job.
6. The method according to claim 5, characterized in that The node daemon process allocates resources to each container of the offline job according to the resource request of each container of the offline job and the resource limit of the control group root of the offline job, including: Determine the proportion of resource requests of any container of the offline job in the resource requests of all containers of the offline job, and determine actual available resources for the container based on the proportion and the resource limit of the control group root of the offline job.
7. A resource isolation device in offline colocation, characterized in that: The device comprises: A request interception module, configured to intercept container creation requests through the colocation proxy plug-in when deploying jobs in the container orchestration platform; a forwarding module, configured to forward the container creation request to the redirection proxy plug-in through the colocation proxy plug-in if the current job is an offline job; The redirection module is used to modify the control group parent path in the container creation request through the redirection proxy plug-in to redirect the current job to the control group root of the offline job.
8. An electronic device, characterized in that: The electronic device comprises: at least one processor; and a memory communicatively coupled to the at least one processor; The memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can perform the resource isolation method in offline colocation according to any one of claims 1 to 6.
9. A computer-readable storage medium, characterized in that The computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a processor to implement the resource isolation method in offline colocation according to any one of claims 1 to 6 when executed.
10. A computer program product, comprising a computer program, wherein when executed by a processor, the computer program implements the resource isolation method for offline colocation according to any one of claims 1 to 6.