-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add scaffold for Yunikorn batch scheduler
Signed-off-by: Jacob Salway <jacob.salway@gmail.com>
- Loading branch information
1 parent
51e4886
commit 4681c9a
Showing
4 changed files
with
42 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
} |