scheduler

package
v0.0.0-...-4c0c8b4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 2, 2018 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// OptionsWaitForDestroy Wait for the destroy to finish before returning
	OptionsWaitForDestroy = "WAIT_FOR_DESTROY"
	// OptionsWaitForResourceLeak Wait for all the resources to be cleaned up after destroying
	OptionsWaitForResourceLeakCleanup = "WAIT_FOR_RESOURCE_LEAK_CLEANUP"
)

Options specifies keys for a key-value pair that can be passed to scheduler methods

Variables

This section is empty.

Functions

func Register

func Register(name string, d Driver) error

Register registers the given scheduler driver

Types

type Context

type Context struct {
	UID string
	App *spec.AppSpec
}

Context holds the execution context of a test task.

type Driver

type Driver interface {
	spec.Parser

	// Init initializes the scheduler driver
	Init(string, string, string) error

	// String returns the string name of this driver.
	String() string

	// IsNodeReady checks if node is in ready state. Returns nil if ready.
	IsNodeReady(n node.Node) error

	// GetNodesForApp returns nodes on which given app context is running
	GetNodesForApp(*Context) ([]node.Node, error)

	// Schedule starts applications and returns a context for each one of them
	Schedule(instanceID string, opts ScheduleOptions) ([]*Context, error)

	// WaitForRunning waits for application to start running.
	WaitForRunning(*Context) error

	// Destroy removes a application. It does not delete the volumes of the task.
	Destroy(*Context, map[string]bool) error

	// WaitForDestroy waits for application to destroy.
	WaitForDestroy(*Context) error

	// DeleteTasks deletes all tasks of the application (not the applicaton)
	DeleteTasks(*Context) error

	// GetVolumeParameters Returns a maps, each item being a volume and it's options
	GetVolumeParameters(*Context) (map[string]map[string]string, error)

	// InspectVolumes inspects a storage volume.
	InspectVolumes(*Context) error

	// DeleteVolumes will delete all storage volumes for the given context
	DeleteVolumes(*Context) ([]*volume.Volume, error)

	// GetVolumes returns all storage volumes for the given context
	GetVolumes(*Context) ([]*volume.Volume, error)

	// GetSnapshots returns all storage snapshots for the given context
	GetSnapshots(*Context) ([]*volume.Snapshot, error)

	// Describe generates a bundle that can be used by support - logs, cores, states, etc
	Describe(*Context) (string, error)

	// Scale the current applications using the new scales from the GetScaleFactorMap.
	ScaleApplication(*Context, map[string]int32) error

	// Get a map of current applications to their new scales, based on "factor"
	GetScaleFactorMap(*Context) (map[string]int32, error)
}

Driver must be implemented to provide test support to various schedulers.

func Get

func Get(name string) (Driver, error)

Get returns a registered scheduler test provider.

type ErrFailedToDeleteTasks

type ErrFailedToDeleteTasks struct {
	// App is the app for which we failed to delete the tasks
	App *spec.AppSpec
	// Cause is the underlying cause of the error
	Cause string
}

ErrFailedToDeleteTasks error type for failing to delete the tasks for an app

func (*ErrFailedToDeleteTasks) Error

func (e *ErrFailedToDeleteTasks) Error() string

type ErrFailedToDeleteVolumeDirForPod

type ErrFailedToDeleteVolumeDirForPod struct {
	// App is the app whose volume directories are not deleted
	App *spec.AppSpec
	// Cause is the underlying cause of the error
	Cause string
}

ErrFailedToDeleteVolumeDirForPod error type for failing to delete volume dir path for pods

func (*ErrFailedToDeleteVolumeDirForPod) Error

type ErrFailedToDestroyApp

type ErrFailedToDestroyApp struct {
	// App is the app that failed to destroy
	App *spec.AppSpec
	// Cause is the underlying cause of the error
	Cause string
}

ErrFailedToDestroyApp error type for failing to destroy an app

func (*ErrFailedToDestroyApp) Error

func (e *ErrFailedToDestroyApp) Error() string

type ErrFailedToDestroyPod

type ErrFailedToDestroyPod struct {
	// App is the app that failed to destroy
	App *spec.AppSpec
	// Cause is the underlying cause of the error
	Cause string
}

ErrFailedToDestroyPod error type for failing to validate destory of a pod

func (*ErrFailedToDestroyPod) Error

func (e *ErrFailedToDestroyPod) Error() string

type ErrFailedToDestroyStorage

type ErrFailedToDestroyStorage struct {
	// App is the app that failed to destroy
	App *spec.AppSpec
	// Cause is the underlying cause of the error
	Cause string
}

ErrFailedToDestroyStorage error type for failing to destroy an app's storage

func (*ErrFailedToDestroyStorage) Error

func (e *ErrFailedToDestroyStorage) Error() string

type ErrFailedToGetAppStatus

type ErrFailedToGetAppStatus struct {
	// App is the app for which we want to get the status
	App *spec.AppSpec
	// Cause is the underlying cause of the error
	Cause string
}

ErrFailedToGetAppStatus error type for failing to get app's status

func (*ErrFailedToGetAppStatus) Error

func (e *ErrFailedToGetAppStatus) Error() string

type ErrFailedToGetNodesForApp

type ErrFailedToGetNodesForApp struct {
	// App is the app that failed to get to get nodes
	App *spec.AppSpec
	// Cause is the underlying cause of the error
	Cause string
}

ErrFailedToGetNodesForApp error type for failing to get nodes on which app is running

func (*ErrFailedToGetNodesForApp) Error

func (e *ErrFailedToGetNodesForApp) Error() string

type ErrFailedToGetPodStatus

type ErrFailedToGetPodStatus struct {
	// App is the app for which we want to get the status
	App *spec.AppSpec
	// Cause is the underlying cause of the error
	Cause string
}

ErrFailedToGetPodStatus error type for failing to get pod's status

func (*ErrFailedToGetPodStatus) Error

func (e *ErrFailedToGetPodStatus) Error() string

type ErrFailedToGetStorage

type ErrFailedToGetStorage struct {
	// App is the app whose storage could not be retrieved
	App *spec.AppSpec
	// Cause is the underlying cause of the error
	Cause string
}

ErrFailedToGetStorage error type for failing to get an app's storage

func (*ErrFailedToGetStorage) Error

func (e *ErrFailedToGetStorage) Error() string

type ErrFailedToGetStorageStatus

type ErrFailedToGetStorageStatus struct {
	// App whose storage status couldn't be obtained
	App *spec.AppSpec
	// Cause is the underlying cause of the error
	Cause string
}

ErrFailedToGetStorageStatus error type for failing to get the status of the app's storage

func (*ErrFailedToGetStorageStatus) Error

type ErrFailedToGetVolumeParameters

type ErrFailedToGetVolumeParameters struct {
	// App is the app for which we failed to get volume parameters
	App *spec.AppSpec
	// Cause is the underlying cause of the error
	Cause string
}

ErrFailedToGetVolumeParameters error type for failing to get an app's volume paramters

func (*ErrFailedToGetVolumeParameters) Error

type ErrFailedToScheduleApp

type ErrFailedToScheduleApp struct {
	// App is the app that failed to schedule
	App *spec.AppSpec
	// Cause is the underlying cause of the error
	Cause string
}

ErrFailedToScheduleApp error type for failing to schedule an app

func (*ErrFailedToScheduleApp) Error

func (e *ErrFailedToScheduleApp) Error() string

type ErrFailedToSchedulePod

type ErrFailedToSchedulePod struct {
	// Pod is the pod that failed to schedule
	App *spec.AppSpec
	// Cause is the underlying cause of the error
	Cause string
}

ErrFailedToSchedulePod error type for failing to schedule a pod

func (*ErrFailedToSchedulePod) Error

func (e *ErrFailedToSchedulePod) Error() string

type ErrFailedToUpdateApp

type ErrFailedToUpdateApp struct {
	// App is the app whose validation failed
	App *spec.AppSpec
	// Cause is the underlying cause of the error
	Cause string
}

ErrFailedToUpdateApp error type for failing to update an app

func (*ErrFailedToUpdateApp) Error

func (e *ErrFailedToUpdateApp) Error() string

type ErrFailedToValidateApp

type ErrFailedToValidateApp struct {
	// App is the app whose validation failed
	App *spec.AppSpec
	// Cause is the underlying cause of the error
	Cause string
}

ErrFailedToValidateApp error type for failing to validate an app

func (*ErrFailedToValidateApp) Error

func (e *ErrFailedToValidateApp) Error() string

type ErrFailedToValidateAppDestroy

type ErrFailedToValidateAppDestroy struct {
	// App is the app that failed to destroy
	App *spec.AppSpec
	// Cause is the underlying cause of the error
	Cause string
}

ErrFailedToValidateAppDestroy error type for failing to validate destory of an app

func (*ErrFailedToValidateAppDestroy) Error

type ErrFailedToValidatePod

type ErrFailedToValidatePod struct {
	// App is the app whose validation failed
	App *spec.AppSpec
	// Cause is the underlying cause of the error
	Cause string
}

ErrFailedToValidatePod error type for failing to validate a pod

func (*ErrFailedToValidatePod) Error

func (e *ErrFailedToValidatePod) Error() string

type ErrFailedToValidatePodDestroy

type ErrFailedToValidatePodDestroy struct {
	// App is the app that failed to destroy
	App *spec.AppSpec
	// Cause is the underlying cause of the error
	Cause string
}

ErrFailedToValidatePodDestroy error type for failing to validate destroy of an pod

func (*ErrFailedToValidatePodDestroy) Error

type ErrFailedToValidateStorage

type ErrFailedToValidateStorage struct {
	// App is the app whose storage validation failed
	App *spec.AppSpec
	// Cause is the underlying cause of the error
	Cause string
}

ErrFailedToValidateStorage error type for failing to validate an app's storage

func (*ErrFailedToValidateStorage) Error

type ErrNodeNotReady

type ErrNodeNotReady struct {
	// Node is not which is not ready
	Node node.Node
	// Cause is the underlying cause of the error
	Cause string
}

ErrNodeNotReady error type when a node is not ready

func (*ErrNodeNotReady) Error

func (e *ErrNodeNotReady) Error() string

type ScheduleOptions

type ScheduleOptions struct {
	// AppKeys identified a list of applications keys that users wants to schedule (Optional)
	AppKeys []string
	// Nodes restricts the applications to get scheduled only on these nodes (Optional)
	Nodes []node.Node
}

ScheduleOptions are options that callers to pass to influence the apps that get schduled

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL