Documentation ¶
Index ¶
- func DynamicAllocationSparkPods(sparkApplicationID string, minExecutors int, maxExecutors int) []v1.Pod
- func NewNode(name string, zone string) v1.Node
- func StaticAllocationSparkPods(sparkApplicationID string, numExecutors int) []v1.Pod
- func StaticAllocationSparkPodsWithExecutorGPUs(sparkApplicationID string, numExecutors int) []v1.Pod
- type Harness
- func (h *Harness) AssertFailedSchedule(t *testing.T, pod v1.Pod, nodeNames []string, errorDetails string)
- func (h *Harness) AssertSuccessfulSchedule(t *testing.T, pod v1.Pod, nodeNames []string, errorDetails string)
- func (h *Harness) Schedule(t *testing.T, pod v1.Pod, nodeNames []string) *schedulerapi.ExtenderFilterResult
- func (h *Harness) TerminatePod(pod v1.Pod) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DynamicAllocationSparkPods ¶
func DynamicAllocationSparkPods(sparkApplicationID string, minExecutors int, maxExecutors int) []v1.Pod
DynamicAllocationSparkPods returns a list of pods corresponding to a Spark Application with 1 driver and maxExecutors executors with the proper dynamic allocation annotations set for min and max executor counts
func StaticAllocationSparkPods ¶
StaticAllocationSparkPods returns a list of pods corresponding to a Spark Application with 1 driver and numExecutors executors with the proper static allocation annotations set
func StaticAllocationSparkPodsWithExecutorGPUs ¶ added in v0.2.0
func StaticAllocationSparkPodsWithExecutorGPUs(sparkApplicationID string, numExecutors int) []v1.Pod
StaticAllocationSparkPodsWithExecutorGPUs returns a list of pods corresponding to a Spark Application with 1 driver and numExecutors executors with the proper static allocation annotations set, executors also request one gpu
Types ¶
type Harness ¶
type Harness struct { Extender *extender.SparkSchedulerExtender UnschedulablePodMarker *extender.UnschedulablePodMarker PodStore cache.Store NodeStore cache.Store ResourceReservationCache *sscache.ResourceReservationCache SoftReservationStore *sscache.SoftReservationStore Ctx context.Context }
Harness is an extension of an extender with in-memory k8s stores
func NewTestExtender ¶
NewTestExtender returns a new extender test harness, initialized with the provided k8s objects
func (*Harness) AssertFailedSchedule ¶
func (h *Harness) AssertFailedSchedule(t *testing.T, pod v1.Pod, nodeNames []string, errorDetails string)
AssertFailedSchedule tries to schedule the provided pods and fails the test if successful
func (*Harness) AssertSuccessfulSchedule ¶
func (h *Harness) AssertSuccessfulSchedule(t *testing.T, pod v1.Pod, nodeNames []string, errorDetails string)
AssertSuccessfulSchedule tries to schedule the provided pods and fails the test if not successful
func (*Harness) Schedule ¶
func (h *Harness) Schedule(t *testing.T, pod v1.Pod, nodeNames []string) *schedulerapi.ExtenderFilterResult
Schedule calls the extender's Predicate method for the given pod and nodes