Volcano社区v1.6.0版本正式发布

463 阅读5分钟

本文分享自华为云社区《Volcano社区v1.6.0版本正式发布》,作者:云容器大未来。

近日,Volcano社区v1.6.0版本正式发布。此次版本增加了弹性作业管理、基于真实负载的动态调度、 基于真实负载的重调度、Volcano Job插件——MPI等多个新特性。

cke_149.png

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实现缩容。同时调度器也会平衡不同优先级的弹性作业间的资源分配,如支持高优先级作业抢占低优先级作业的弹性副本部分的资源。

cke_150.png

设计文档:github.com/volcano-sh/…

Issue:github.com/volcano-sh/…

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/…

Issue:github.com/volcano-sh/…

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/…

Issue:github.com/volcano-sh/…

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/…

Issue:github.com/volcano-sh/…

相关链接:

Release note: github.com/volcano-sh/…

Branch: github.com/volcano-sh/…

深入了解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/…

点击关注,第一时间了解华为云新鲜技术~