Volcano社區v1.6.0版本正式發佈

摘要:Volcano社區v1.6.0版本正式發佈。此次版本增加了彈性作業管理、基於真實負載的動態調度、 基於真實負載的重調度、Volcano Job插件——MPI等多個新特性。

本文分享自華為雲社區《Volcano社區v1.6.0版本正式發佈》,作者:雲容器大未來。

近日,Volcano社區v1.6.0版本正式發佈。此次版本增加了彈性作業管理、基於真實負載的動態調度、 基於真實負載的重調度、Volcano Job插件——MPI等多個新特性。

Volcano 是業界首個雲原生批量計算項目,於2019年6月在上海KubeCon正式開源,並在2020年4月成為CNCF官方項目。2022年4月,Volcano正式晉級為CNCF孵化項目。Volcano社區開源以來,受到眾多開發者、合作夥伴和用戶的認可和支持。截止目前,累計有400+全球開發者向項目貢獻了代碼。

Volcano v1.6.0 關鍵特性介紹

1.彈性作業調度

v1.6.0版本新增了彈性作業的調度支持,配合Volcano Job或Pytorch Job的彈性作業管理,實現AI訓練任務、大數據分析的加速,同時結合雲上的Spot instance 實現成本的縮減。

彈性作業允許Job的副本數在[min, max]範圍彈性伸縮,其中min為job的minAvailable,max為job的副本數,彈性調度會優先為minAvailable Pod分配資源,保障每個應用的最小資源需求優先滿足,如果有閑置資源,調度器會為Elastic Pod分配資源,加速計算進程。資源緊張時,調度器優先搶佔Elastic Pod實現縮容。同時調度器也會平衡不同優先級的彈性作業間的資源分配,如支持高優先級作業搶佔低優先級作業的彈性副本部分的資源。

 設計文檔://github.com/volcano-sh/volcano/blob/master/docs/design/elastic-scheduler.md

Issue//github.com/volcano-sh/volcano/issues/1876

2.基於真實負載的動態調度

當前的基於分配率的調度模式在一些場景下會帶來各個節點資源使用率不均衡的現象,如部分節點高分配率、低使用率等。v1.6.0版本中Volcano實現了和Prometheus的協同,藉助Prometheus採集的集群節點負載數據進行調度決策,保證各個節點使用率最大程度均衡,同時允許用戶配置節點cpu,memory的上限值,防止部分節點使用率過高導致節點異常。

調度策略配置樣例如下:

actions: "enqueue, allocate, backfill"
tiers:
- plugins:
- name: priority
- name: gang
- name: conformance
- name: usage  # usage based scheduling plugin
arguments:
thresholds:
CPUUsageAvg.5m: 90 # The node whose average usage in 5 minute is higher than 90% will be filtered in predicating stage
MEMUsageAvg.5m: 80 # The node whose average usage in 5 minute is higher than 80% will be filtered in predicating stage
- plugins:
- name: overcommit
- name: drf
- name: predicates
- name: proportion
- name: nodeorder
- name: binpack
metrics:                    # metrics server related configuration
address: http://192.168.0.10:9090 # mandatory, The Prometheus server address
interval: 30s                    # Optional, The scheduler pull metrics from Prometheus with this interval, 5s by default

設計文檔://github.com/volcano-sh/volcano/blob/master/docs/design/usage-based-scheduling.md

Issue//github.com/volcano-sh/volcano/issues/1777

3.基於真實負載的重調度

不合理的調度策略和作業生命周期的動態變化導致計算節點資源利用率不均衡,v1.6.0版本增加了基於真實負載和用戶自定義重調度策略,驅逐部分高負載節點中的負載至低負載節點,周期性檢測所有節點真實負載。即基於實際資源利用率而不是請求資源重新計劃pod,支持定製配置的重新調度策略。

以上運行進一步平衡了各節點真實負載,提高集群資源利用率。

## Configuration Option actions: "enqueue, allocate, backfill, shuffle"  ## add 'shuffle' at the end of the actionstiers:
  - plugins:
      - name: priority
      - name: gang
      - name: conformance
      - name: rescheduling       ## rescheduling plugin
        arguments:
          interval: 5m           ## optional, the strategies will be called in this duration periodcally. 5 minuters by default.
          strategies:            ## required, strategies working in order
            - name: offlineOnly
            - name: lowPriorityFirst
            - name: lowNodeUtilization
              params:
                thresholds:
                  "cpu" : 20
                  "memory": 20
                  "pods": 20
                targetThresholds:
                  "cpu" : 50
                  "memory": 50
                  "pods": 50
          queueSelector:         ## optional, select workloads in specified queues as potential evictees. All queues by default.
            - default
            - test-queue
          labelSelector:         ## optional, select workloads with specified labels as potential evictees. All labels by default.
            business: offline
            team: test
  - plugins:
      - name: overcommit
      - name: drf
      - name: predicates
      - name: proportion
      - name: nodeorder
      - name: binpack

設計文檔://github.com/volcano-sh/volcano/blob/master/docs/design/rescheduling.md

Issue://github.com/volcano-sh/volcano/issues/1777

4. Volcano 作業插件——MPI

使用Volcano Job可以運行MPI任務,Volcano作業插件(即svc,env和ssh作業插件)也為MPI任務的master和worker自動配置了免密通信、環境變量注入等工作。

新版本提供了一種新的運行MPI任務的方式,進一步簡化用戶的配置,優化使用體驗。用戶無需熟悉shell語法、無需關心master和worker的通信問題、無需手動配置ssh認證,非常簡潔優雅的就可以啟動一個MPI任務。

配置文件樣例:

apiVersion: batch.volcano.sh/v1alpha1
kind: Job
metadata:
 name: lm-mpi-job
spec:
 minAvailable: 1
 schedulerName: volcano
 plugins:
   mpi: ["--master=mpimaster","--worker=mpiworker","--port=22"]  ## MPI plugin register
 tasks:
   - replicas: 1
     name: mpimaster
     policies:
       - event: TaskCompleted
         action: CompleteJob
     template:
       spec:
         containers:
           - command:
               - /bin/sh
               - -c
               - |
                 mkdir -p /var/run/sshd; /usr/sbin/sshd;
                 mpiexec --allow-run-as-root --host ${MPI_HOST} -np 2 mpi_hello_world;
             image: volcanosh/example-mpi:0.0.1
             name: mpimaster
             workingDir: /home
         restartPolicy: OnFailure
   - replicas: 2
     name: mpiworker
     template:
       spec:
         containers:
           - command:
               - /bin/sh
               - -c
               - |
                 mkdir -p /var/run/sshd; /usr/sbin/sshd -D;
             image: volcanosh/example-mpi:0.0.1
             name: mpiworker
             workingDir: /home
            
         restartPolicy: OnFailure

設計文檔://github.com/volcano-sh/volcano/blob/master/docs/design/distributed-framework-plugins.md

Issue://github.com/volcano-sh/volcano/pull/2194

– 相關鏈接 – 

Release note: //github.com/volcano-sh/volcano/releases/tag/v1.6.0

Branch://github.com/volcano-sh/volcano/tree/release-1.6

深入了解Volcano

Volcano雲原生批量計算項目主要用於 AI、大數據、基因、渲染等諸多高性能計算場景,對主流通用計算框架均有很好的支持。社區已吸引2.6萬全球開發者,並獲得2.4k Star和550+ Fork,參與貢獻企業包括華為、AWS、百度、騰訊、京東、小紅書等。目前,Volcano在人工智能、大數據、基因測序等海量數據計算和分析場景已得到快速應用,已完成對Spark、Flink、Tensorflow、PyTorch、Argo、MindSpore、Paddlepaddle 、Kubeflow、MPI、Horovod、mxnet、KubeGene等眾多主流計算框架的支持,並構建起完善的上下游生態。

Volcano官網://volcano.sh

Github : //github.com/volcano-sh/volcano

 

點擊關注,第一時間了解華為雲新鮮技術~