天天看點

Volcano社群v1.6.0版本正式釋出

摘要:Volcano社群v1.6.0版本正式釋出。此次版本增加了彈性作業管理、基于真實負載的動态排程、 基于真實負載的重排程、Volcano Job插件——MPI等多個新特性。

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

近日,Volcano社群v1.6.0版本正式釋出。此次版本增加了彈性作業管理、基于真實負載的動态排程、 基于真實負載的重排程、Volcano Job插件——MPI等多個新特性。

Volcano社群v1.6.0版本正式釋出

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實作縮容。同時排程器也會平衡不同優先級的彈性作業間的資源配置設定,如支援高優先級作業搶占低優先級作業的彈性副本部分的資源。

Volcano社群v1.6.0版本正式釋出

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

Issue:​​https://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      

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

Issue:​​https://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      

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

Issue:​​https://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      

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

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

- 相關連結 - 

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

Branch:​​https://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官網:​​https://volcano.sh​​