Skip to content

Commit

Permalink
Add scaffold for Yunikorn batch scheduler
Browse files Browse the repository at this point in the history
Signed-off-by: Jacob Salway <jacob.salway@gmail.com>
  • Loading branch information
jacobsalway committed Jul 25, 2024
1 parent 51e4886 commit 4681c9a
Show file tree
Hide file tree
Showing 4 changed files with 42 additions and 3 deletions.
2 changes: 1 addition & 1 deletion charts/spark-operator-chart/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ apiVersion: v2
name: spark-operator
description: A Helm chart for Spark on Kubernetes operator
version: 1.4.5
appVersion: v1beta2-1.6.2-3.5.0
appVersion: v1beta2-1.6.3-3.5.0
keywords:
- spark
home: https://github.com/kubeflow/spark-operator
Expand Down
2 changes: 1 addition & 1 deletion charts/spark-operator-chart/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# spark-operator

![Version: 1.4.5](https://img.shields.io/badge/Version-1.4.5-informational?style=flat-square) ![AppVersion: v1beta2-1.6.2-3.5.0](https://img.shields.io/badge/AppVersion-v1beta2--1.6.2--3.5.0-informational?style=flat-square)
![Version: 1.4.5](https://img.shields.io/badge/Version-1.4.5-informational?style=flat-square) ![AppVersion: v1beta2-1.6.3-3.5.0](https://img.shields.io/badge/AppVersion-v1beta2--1.6.3--3.5.0-informational?style=flat-square)

A Helm chart for Spark on Kubernetes operator

Expand Down
4 changes: 3 additions & 1 deletion pkg/batchscheduler/scheduler_manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,14 @@ import (

"github.com/kubeflow/spark-operator/pkg/batchscheduler/interface"
"github.com/kubeflow/spark-operator/pkg/batchscheduler/volcano"
"github.com/kubeflow/spark-operator/pkg/batchscheduler/yunikorn"
)

type schedulerInitializeFunc func(config *rest.Config) (schedulerinterface.BatchScheduler, error)

var schedulerContainers = map[string]schedulerInitializeFunc{
volcano.GetPluginName(): volcano.New,
volcano.GetPluginName(): volcano.New,
yunikorn.GetPluginName(): yunikorn.New,
}

func GetRegisteredNames() []string {
Expand Down
37 changes: 37 additions & 0 deletions pkg/batchscheduler/yunikorn/yunikorn_scheduler.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
package yunikorn

import (
"k8s.io/client-go/rest"

"github.com/kubeflow/spark-operator/pkg/apis/sparkoperator.k8s.io/v1beta2"
schedulerinterface "github.com/kubeflow/spark-operator/pkg/batchscheduler/interface"
)

type YunikornBatchScheduler struct{}

func GetPluginName() string {
return "yunikorn"
}

func (y *YunikornBatchScheduler) Name() string {
return GetPluginName()
}

func New(config *rest.Config) (schedulerinterface.BatchScheduler, error) {
return &YunikornBatchScheduler{}, nil
}

func (y *YunikornBatchScheduler) ShouldSchedule(app *v1beta2.SparkApplication) bool {
// Yunikorn doesn't require any additional resources to be created before scheduling
// since it gets all the information it needs from pod annotations
return true
}

func (y *YunikornBatchScheduler) CleanupOnCompletion(app *v1beta2.SparkApplication) error {
// No additional resources are created so nothing to clean up
return nil
}

func (y *YunikornBatchScheduler) DoBatchSchedulingOnSubmission(app *v1beta2.SparkApplication) error {
return nil
}

0 comments on commit 4681c9a

Please sign in to comment.