scheduler

package
v0.0.0-...-81ccbf4 Latest Latest
Warning

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

Go to latest
Published: Feb 7, 2024 License: Apache-2.0 Imports: 26 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var FeatureUnavailable = errors.New("Feature unavailable")
View Source
var (
	IngressError = errors.New("Error with Ingress-")
)

Functions

This section is empty.

Types

type CloudRun

type CloudRun struct {
	// contains filtered or unexported fields
}

func NewCloudRun

func NewCloudRun(cfg *config.ClusterConfig) *CloudRun

func (*CloudRun) CollectionStatus

func (cr *CloudRun) CollectionStatus(projectID, collectionID int64, eps []*model.ExecutionPlan) (*smodel.CollectionStatus, error)

func (*CloudRun) DeployEngine

func (cr *CloudRun) DeployEngine(projectID, collectionID, planID int64, engineID int, containerConfig *config.ExecutorContainer) error

func (*CloudRun) DeployPlan

func (cr *CloudRun) DeployPlan(projectID, collectionID, planID int64, replicas int, containerConfig *config.ExecutorContainer) error

func (*CloudRun) DownloadPodLog

func (cr *CloudRun) DownloadPodLog(collectionID, planID int64) (string, error)

func (*CloudRun) ExposeProject

func (cr *CloudRun) ExposeProject(projectID int64) error

func (*CloudRun) FetchEngineUrlsByPlan

func (cr *CloudRun) FetchEngineUrlsByPlan(collectionID, planID int64, opts *smodel.EngineOwnerRef) ([]string, error)

This func is used by generateEngines as we need to fetch the engine urls per plan

func (*CloudRun) GetAllNodesInfo

func (cr *CloudRun) GetAllNodesInfo() (smodel.AllNodesInfo, error)

func (*CloudRun) GetCollectionEnginesDetail

func (cr *CloudRun) GetCollectionEnginesDetail(projectID, collectionID int64) (*smodel.CollectionDetails, error)

func (*CloudRun) GetDeployedCollections

func (cr *CloudRun) GetDeployedCollections() (map[int64]time.Time, error)

func (*CloudRun) GetDeployedServices

func (cr *CloudRun) GetDeployedServices() (map[int64]time.Time, error)

func (*CloudRun) GetEnginesByProject

func (cr *CloudRun) GetEnginesByProject(projectID int64) ([]apiv1.Pod, error)

func (*CloudRun) GetPodsMetrics

func (cr *CloudRun) GetPodsMetrics(collectionID, planID int64) (map[string]apiv1.ResourceList, error)

func (*CloudRun) MakeName

func (cr *CloudRun) MakeName(projectID, collectionID, planID int64, engineID int) string

func (*CloudRun) PodReadyCount

func (cr *CloudRun) PodReadyCount(collectionID int64) int

TODO: what we need is actually get the deployed engines account, not only ready ones. We also need to change this in k8s.go

func (*CloudRun) PurgeCollection

func (cr *CloudRun) PurgeCollection(collectionID int64) error

func (*CloudRun) PurgeProjectIngress

func (cr *CloudRun) PurgeProjectIngress(projectID int64) error

type EngineScheduler

type EngineScheduler interface {
	DeployEngine(projectID, collectionID, planID int64, engineID int, containerConfig *config.ExecutorContainer) error
	DeployPlan(projectID, collectionID, planID int64, replicas int, containerConfig *config.ExecutorContainer) error
	CollectionStatus(projectID, collectionID int64, eps []*model.ExecutionPlan) (*smodel.CollectionStatus, error)
	FetchEngineUrlsByPlan(collectionID, planID int64, opts *smodel.EngineOwnerRef) ([]string, error)
	PurgeCollection(collectionID int64) error
	GetDeployedCollections() (map[int64]time.Time, error)
	GetAllNodesInfo() (smodel.AllNodesInfo, error)
	GetPodsMetrics(collectionID, planID int64) (map[string]apiv1.ResourceList, error)
	PodReadyCount(collectionID int64) int
	DownloadPodLog(collectionID, planID int64) (string, error)
	GetCollectionEnginesDetail(projectID, collectionID int64) (*smodel.CollectionDetails, error)
	GetDeployedServices() (map[int64]time.Time, error)
	ExposeProject(projectID int64) error
	PurgeProjectIngress(projectID int64) error
	GetEnginesByProject(projectID int64) ([]apiv1.Pod, error)
}

func NewEngineScheduler

func NewEngineScheduler(cfg *config.ClusterConfig) EngineScheduler

type K8sClientManager

type K8sClientManager struct {
	*config.ExecutorConfig
	// contains filtered or unexported fields
}

func NewK8sClientManager

func NewK8sClientManager(cfg *config.ClusterConfig) *K8sClientManager

func (*K8sClientManager) CollectionStatus

func (kcm *K8sClientManager) CollectionStatus(projectID, collectionID int64, eps []*model.ExecutionPlan) (*smodel.CollectionStatus, error)

func (*K8sClientManager) CreateIngress

func (kcm *K8sClientManager) CreateIngress(ingressClass, ingressName, serviceName string, collectionID, projectID int64) error

func (*K8sClientManager) CreateService

func (kcm *K8sClientManager) CreateService(serviceName string, engine appsv1.Deployment) error

func (*K8sClientManager) DeployEngine

func (kcm *K8sClientManager) DeployEngine(projectID, collectionID, planID int64,
	engineID int, containerConfig *config.ExecutorContainer) error

func (*K8sClientManager) DeployPlan

func (kcm *K8sClientManager) DeployPlan(projectID, collectionID, planID int64, enginesNo int, containerconfig *config.ExecutorContainer) error

func (*K8sClientManager) DownloadPodLog

func (kcm *K8sClientManager) DownloadPodLog(collectionID, planID int64) (string, error)

func (*K8sClientManager) ExposeProject

func (kcm *K8sClientManager) ExposeProject(projectID int64) error

func (*K8sClientManager) FetchEngineUrlsByPlan

func (kcm *K8sClientManager) FetchEngineUrlsByPlan(collectionID, planID int64, opts *smodel.EngineOwnerRef) ([]string, error)

func (*K8sClientManager) FetchLogFromPod

func (kcm *K8sClientManager) FetchLogFromPod(pod apiv1.Pod) (string, error)

func (*K8sClientManager) GetAllNodesInfo

func (kcm *K8sClientManager) GetAllNodesInfo() (smodel.AllNodesInfo, error)

func (*K8sClientManager) GetCollectionEnginesDetail

func (kcm *K8sClientManager) GetCollectionEnginesDetail(projectID, collectionID int64) (*smodel.CollectionDetails, error)

func (*K8sClientManager) GetDeployedCollections

func (kcm *K8sClientManager) GetDeployedCollections() (map[int64]time.Time, error)

func (*K8sClientManager) GetDeployedServices

func (kcm *K8sClientManager) GetDeployedServices() (map[int64]time.Time, error)

func (*K8sClientManager) GetEnginesByProject

func (kcm *K8sClientManager) GetEnginesByProject(projectID int64) ([]apiv1.Pod, error)

func (*K8sClientManager) GetIngressUrl

func (kcm *K8sClientManager) GetIngressUrl(projectID int64) (string, error)

func (*K8sClientManager) GetNodesByCollection

func (kcm *K8sClientManager) GetNodesByCollection(collectionID string) ([]apiv1.Node, error)

func (*K8sClientManager) GetPods

func (kcm *K8sClientManager) GetPods(labelSelector, fieldSelector string) ([]apiv1.Pod, error)

func (*K8sClientManager) GetPodsByCollection

func (kcm *K8sClientManager) GetPodsByCollection(collectionID int64, fieldSelector string) []apiv1.Pod

func (*K8sClientManager) GetPodsByCollectionPlan

func (kcm *K8sClientManager) GetPodsByCollectionPlan(collectionID, planID int64) ([]apiv1.Pod, error)

func (*K8sClientManager) GetPodsMetrics

func (kcm *K8sClientManager) GetPodsMetrics(collectionID, planID int64) (map[string]apiv1.ResourceList, error)

func (*K8sClientManager) PodReadyCount

func (kcm *K8sClientManager) PodReadyCount(collectionID int64) int

func (*K8sClientManager) PurgeCollection

func (kcm *K8sClientManager) PurgeCollection(collectionID int64) error

func (*K8sClientManager) PurgeProjectIngress

func (kcm *K8sClientManager) PurgeProjectIngress(projectID int64) error

func (*K8sClientManager) ServiceReachable

func (kcm *K8sClientManager) ServiceReachable(engineUrl string) bool

type NoResourcesFoundErr

type NoResourcesFoundErr struct {
	Err     error
	Message string
}

func (*NoResourcesFoundErr) Error

func (e *NoResourcesFoundErr) Error() string

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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