Skip to content

Commit

Permalink
Set schedulerName to Yunikorn (kubeflow#2153)
Browse files Browse the repository at this point in the history
Signed-off-by: Jacob Salway <jacob.salway@gmail.com>
  • Loading branch information
jacobsalway authored Sep 8, 2024
1 parent c810ece commit 62b4ca6
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
5 changes: 5 additions & 0 deletions internal/scheduler/yunikorn/scheduler.go
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,11 @@ func (s *Scheduler) Schedule(app *v1beta2.SparkApplication) error {
})
}

// Ensure that the driver and executors pods are scheduled by Yunikorn
// if it is installed with the admissions controller disabled
app.Spec.Driver.SchedulerName = util.StringPtr(SchedulerName)
app.Spec.Executor.SchedulerName = util.StringPtr(SchedulerName)

// Yunikorn re-uses the application ID set by the driver under the label "spark-app-selector",
// so there is no need to set an application ID
// https://github.com/apache/yunikorn-k8shim/blob/2278b3217c702ccb796e4d623bc7837625e5a4ec/pkg/common/utils/utils.go#L168-L171
Expand Down
3 changes: 3 additions & 0 deletions internal/scheduler/yunikorn/scheduler_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -242,6 +242,9 @@ func TestSchedule(t *testing.T) {
assert.Equal(t, *options.Queue, tc.app.Spec.Driver.Labels[queueLabel])
assert.Equal(t, *options.Queue, tc.app.Spec.Executor.Labels[queueLabel])
}

assert.Equal(t, "yunikorn", *tc.app.Spec.Driver.SchedulerName)
assert.Equal(t, "yunikorn", *tc.app.Spec.Executor.SchedulerName)
})
}
}
Expand Down

0 comments on commit 62b4ca6

Please sign in to comment.