Skip to content

Commit 62b4ca6

Browse files
authored
Set schedulerName to Yunikorn (kubeflow#2153)
Signed-off-by: Jacob Salway <jacob.salway@gmail.com>
1 parent c810ece commit 62b4ca6

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

internal/scheduler/yunikorn/scheduler.go

+5
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,11 @@ func (s *Scheduler) Schedule(app *v1beta2.SparkApplication) error {
109109
})
110110
}
111111

112+
// Ensure that the driver and executors pods are scheduled by Yunikorn
113+
// if it is installed with the admissions controller disabled
114+
app.Spec.Driver.SchedulerName = util.StringPtr(SchedulerName)
115+
app.Spec.Executor.SchedulerName = util.StringPtr(SchedulerName)
116+
112117
// Yunikorn re-uses the application ID set by the driver under the label "spark-app-selector",
113118
// so there is no need to set an application ID
114119
// https://github.com/apache/yunikorn-k8shim/blob/2278b3217c702ccb796e4d623bc7837625e5a4ec/pkg/common/utils/utils.go#L168-L171

internal/scheduler/yunikorn/scheduler_test.go

+3
Original file line numberDiff line numberDiff line change
@@ -242,6 +242,9 @@ func TestSchedule(t *testing.T) {
242242
assert.Equal(t, *options.Queue, tc.app.Spec.Driver.Labels[queueLabel])
243243
assert.Equal(t, *options.Queue, tc.app.Spec.Executor.Labels[queueLabel])
244244
}
245+
246+
assert.Equal(t, "yunikorn", *tc.app.Spec.Driver.SchedulerName)
247+
assert.Equal(t, "yunikorn", *tc.app.Spec.Executor.SchedulerName)
245248
})
246249
}
247250
}

0 commit comments

Comments
 (0)