Volcano社区v1.6.0版本已正式发布。此次版本增加了弹性作业管理、基于真实负载的动态调度、 基于真实负载的重调度、Volcano Job插件——MPI等多个新特性。
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实现缩容。同时调度器也会平衡不同优先级的弹性作业间的资源分配,如支持高优先级作业抢占低优先级作业的弹性副本部分的资源。
设计文档: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 是基于 Kubernetes 构建的批量计算平台,源自于华为云 AI 容器,提供作业管理、批量调度、依赖管理、资源预留等能力,支持包括 TensorFlow、Spark、MPI、Slurm 在内的多个业界主流计算框架,主要帮助用户将 AI、大数据等资源消耗波动大、计算密集型的业务从传统的 Batch、HPC 系统快速迁移到云原生。Volcano 也是 CNCF 首个和唯一的容器批量计算项目。