作者投稿和查稿 主编审稿 专家审稿 编委审稿 远程编辑

计算机工程 ›› 2023, Vol. 49 ›› Issue (2): 31-36,45. doi: 10.19678/j.issn.1000-3428.0063709

• 热点与综述 • 上一篇    下一篇

Kubernetes异构资源细粒度调度策略的设计与实现

刘志彬1,2, 黄秋兰1, 胡庆宝1, 程耀东1,4, 胡誉1, 田浩来1,3   

  1. 1. 中国科学院高能物理研究所, 北京 100049;
    2. 中国科学院大学, 北京 100049;
    3. 散裂中子源科学中心, 广东 东莞 523803;
    4. 中国科学院高能物理研究所 天府宇宙线研究中心, 成都 610041
  • 收稿日期:2022-01-06 修回日期:2022-03-16 发布日期:2022-07-05
  • 作者简介:刘志彬(1996-),男,硕士研究生,主研方向为容器编排与调度;黄秋兰,副研究员、博士;胡庆宝,助理研究员、硕士;程耀东(通信作者),研究员、博士;胡誉,助理研究员、博士;田浩来,副研究员、博士。
  • 基金资助:
    国家自然科学基金(11875283)。

Design and Implementation of Fine-Grained Scheduling Strategy for Kubernetes Heterogeneous Resources

LIU Zhibin1,2, HUANG Qiulan1, HU Qingbao1, CHENG Yaodong1,4, HU Yu1, TIAN Haolai1,3   

  1. 1. Institute of High Energy Physics, Chinese Academy of Sciences, Beijing 100049, China;
    2. University of Chinese Academy of Sciences, Beijing 100049, China;
    3. Spallation Neutron Source Science Center, Dongguan 523803, Guangdong, China;
    4. Tianfu Cosmic Ray Research Center, Institute of High Energy Physics, Chinese Academy of Sciences, Chengdu 610041, China
  • Received:2022-01-06 Revised:2022-03-16 Published:2022-07-05

摘要: 在异构资源环境中高效利用计算资源是提升任务效率和集群利用率的关键。Kuberentes作为容器编排领域的首选方案,在异构资源调度场景下调度器缺少GPU细粒度信息无法满足用户自定义需求,并且CPU/GPU节点混合部署下调度器无法感知异构资源从而导致资源竞争。综合考虑异构资源在节点上的分布及其硬件状态,提出一种基于Kubernetes的CPU/GPU异构资源细粒度调度策略。利用设备插件机制收集每个节点上GPU的详细信息,并将GPU资源指标提交给调度算法。在原有CPU和内存过滤算法的基础上,增加自定义GPU信息的过滤,从而筛选出符合用户细粒度需求的节点。针对CPU/GPU节点混合部署的情况,改进调度器的打分算法,动态感知应用类型,对CPU和GPU应用分别采用负载均衡算法和最小最合适算法,保证异构资源调度策略对不同类型应用的正确调度,并且在CPU资源不足的情况下充分利用GPU节点的碎片资源。通过对GPU细粒度调度和CPU/GPU节点混合部署情况下的调度效果进行实验验证,结果表明该策略能够有效进行GPU调度并且避免资源竞争。

关键词: 云计算, Kubernetes调度, 异构资源, 资源调度, CPU/GPU集群

Abstract: In a heterogeneous environment, efficient utilization of computing resources is critical for improving task efficiency and cluster utilization.As a preferred solution in container orchestration, Kubernetes lacks Graphics Processing Unit(GPU) fine-grained information in heterogeneous resource scheduling and can not satisfy user-defined requirements.Moreover, the scheduler can not perceive heterogeneous resources under the hybrid deployment of Central Processing Unit(CPU)/GPU nodes, leading to resource competition.For these reasons, a fine-grained scheduling strategy for CPU/GPU heterogeneous resources based on Kubernetes is proposed to comprehensively reflect the distribution of heterogeneous resources on nodes and hardware usage.First, GPU resource metrics are input in the scheduling algorithm, which uses the device plugin mechanism to collect detailed information regarding the GPUs on each node.Second, the filtering algorithm of the scheduler is improved based on the original filtering method of the CPU and memory, and the filtering of custom GPU information is added to screen out the nodes that satisfy the fine-grained requirements of users.Finally, for the hybrid deployment of the CPU/GPU nodes, the scoring algorithm of the scheduler is improved.The application types are dynamically sensed:the load balancing algorithm is used for CPU applications, and the least-fit algorithm is used for GPU applications.This ensures that the heterogeneous resource scheduling strategy can correctly schedule different types of applications and fully utilize the fragmented GPU node resources when CPU resources are insufficient.Experiments are conducted to verify the scheduling effect of GPU fine-grained scheduling and the scheduling under hybrid deployment of CPU/GPU nodes.The experimental results show that this strategy can effectively achieve GPU scheduling and prevent resource competition.

Key words: cloud computing, Kubernetes scheduling, heterogeneous resource, resource scheduling, CPU/GPU cluster

中图分类号: