runtime

package
v0.14.5 Latest Latest
Warning

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

Go to latest
Published: Nov 4, 2022 License: Apache-2.0 Imports: 37 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var PFRuntimeMap sync.Map

Functions

func UpdateRuntime

func UpdateRuntime(clusterInfo model.ClusterInfo) error

Types

type KubeRuntime

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

func (*KubeRuntime) BuildConfig

func (kr *KubeRuntime) BuildConfig() (*rest.Config, error)

func (*KubeRuntime) CloseQueue

func (kr *KubeRuntime) CloseQueue(q *model.Queue) error

func (*KubeRuntime) CreateObject

func (kr *KubeRuntime) CreateObject(obj *unstructured.Unstructured) error

func (*KubeRuntime) CreatePV

func (kr *KubeRuntime) CreatePV(namespace, fsID string) (string, error)

func (*KubeRuntime) CreatePVC

func (kr *KubeRuntime) CreatePVC(namespace, fsId, pv string) error

func (*KubeRuntime) CreateQueue

func (kr *KubeRuntime) CreateQueue(q *model.Queue) error

func (*KubeRuntime) DeleteJob

func (kr *KubeRuntime) DeleteJob(jobInfo *api.PFJob) error

func (*KubeRuntime) DeleteObject

func (kr *KubeRuntime) DeleteObject(namespace, name string, gvk k8sschema.GroupVersionKind) error

func (*KubeRuntime) DeletePersistentVolume added in v0.14.3

func (kr *KubeRuntime) DeletePersistentVolume(name string, deleteOptions metav1.DeleteOptions) error

func (*KubeRuntime) DeletePersistentVolumeClaim added in v0.14.3

func (kr *KubeRuntime) DeletePersistentVolumeClaim(namespace string, name string,
	deleteOptions metav1.DeleteOptions) error

func (*KubeRuntime) DeletePod added in v0.14.3

func (kr *KubeRuntime) DeletePod(namespace, name string) error

func (*KubeRuntime) DeleteQueue

func (kr *KubeRuntime) DeleteQueue(q *model.Queue) error

func (*KubeRuntime) GCJob

func (kr *KubeRuntime) GCJob(stopCh <-chan struct{})

func (*KubeRuntime) GetJobLog

func (kr *KubeRuntime) GetJobLog(jobLogRequest schema.JobLogRequest) (schema.JobLogInfo, error)

func (*KubeRuntime) GetObject

func (kr *KubeRuntime) GetObject(namespace, name string, gvk k8sschema.GroupVersionKind) (interface{}, error)

func (*KubeRuntime) GetQueueUsedQuota added in v0.14.3

func (kr *KubeRuntime) GetQueueUsedQuota(q *model.Queue) (*resources.Resource, error)

func (*KubeRuntime) Init

func (kr *KubeRuntime) Init() error

func (*KubeRuntime) ListNamespaces added in v0.14.3

func (kr *KubeRuntime) ListNamespaces(listOptions metav1.ListOptions) (*v1.NamespaceList, error)

func (*KubeRuntime) ListNodeQuota

func (kr *KubeRuntime) ListNodeQuota() (schema.QuotaSummary, []schema.NodeQuotaInfo, error)

返回quota信息

func (*KubeRuntime) ListPods added in v0.14.3

func (kr *KubeRuntime) ListPods(namespace string, listOptions metav1.ListOptions) (*v1.PodList, error)

func (*KubeRuntime) Name

func (kr *KubeRuntime) Name() string

func (*KubeRuntime) StopJob

func (kr *KubeRuntime) StopJob(jobInfo *api.PFJob) error

func (*KubeRuntime) SubmitJob

func (kr *KubeRuntime) SubmitJob(jobInfo *api.PFJob) error

func (*KubeRuntime) SyncJob

func (kr *KubeRuntime) SyncJob(stopCh <-chan struct{})

func (*KubeRuntime) SyncQueue

func (kr *KubeRuntime) SyncQueue(stopCh <-chan struct{})

func (*KubeRuntime) UpdateJob

func (kr *KubeRuntime) UpdateJob(jobInfo *api.PFJob) error

func (*KubeRuntime) UpdateObject

func (kr *KubeRuntime) UpdateObject(obj *unstructured.Unstructured) error

func (*KubeRuntime) UpdateQueue

func (kr *KubeRuntime) UpdateQueue(q *model.Queue) error

type LocRuntime

type LocRuntime struct {
	schema.Cluster
}

func (*LocRuntime) CloseQueue

func (l *LocRuntime) CloseQueue(q *model.Queue) error

func (*LocRuntime) CreateQueue

func (l *LocRuntime) CreateQueue(q *model.Queue) error

func (*LocRuntime) DeleteJob

func (l *LocRuntime) DeleteJob(job *api.PFJob) error

func (*LocRuntime) DeleteQueue

func (l *LocRuntime) DeleteQueue(q *model.Queue) error

func (*LocRuntime) GCJob

func (l *LocRuntime) GCJob(stopCh <-chan struct{})

func (*LocRuntime) GetJobLog

func (l *LocRuntime) GetJobLog(jobLogRequest schema.JobLogRequest) (schema.JobLogInfo, error)

func (*LocRuntime) Init

func (l *LocRuntime) Init() error

func (*LocRuntime) ListNodeQuota

func (l *LocRuntime) ListNodeQuota() (schema.QuotaSummary, []schema.NodeQuotaInfo, error)

func (*LocRuntime) Name

func (l *LocRuntime) Name() string

func (*LocRuntime) StopJob

func (l *LocRuntime) StopJob(job *api.PFJob) error

func (*LocRuntime) SubmitJob

func (l *LocRuntime) SubmitJob(job *api.PFJob) error

func (*LocRuntime) SyncJob

func (l *LocRuntime) SyncJob(stopCh <-chan struct{})

func (*LocRuntime) SyncQueue

func (l *LocRuntime) SyncQueue(stopCh <-chan struct{})

func (*LocRuntime) UpdateJob

func (l *LocRuntime) UpdateJob(job *api.PFJob) error

func (*LocRuntime) UpdateQueue

func (l *LocRuntime) UpdateQueue(q *model.Queue) error

type RuntimeService

type RuntimeService interface {
	Name() string
	// Init create client for runtime
	Init() error

	// SubmitJob submit job to cluster
	SubmitJob(job *api.PFJob) error
	// StopJob stop job on cluster
	StopJob(job *api.PFJob) error
	// UpdateJob update job on cluster
	UpdateJob(job *api.PFJob) error
	// DeleteJob delete job from cluster
	DeleteJob(job *api.PFJob) error
	// SyncJob sync job status from cluster
	SyncJob(stopCh <-chan struct{})
	// GCJob garbage collect
	GCJob(stopCh <-chan struct{})

	GetJobLog(jobLogRequest schema.JobLogRequest) (schema.JobLogInfo, error)

	// SyncQueue sync queue information from cluster
	SyncQueue(stopCh <-chan struct{})
	// CreateQueue create a queue on cluster
	CreateQueue(q *model.Queue) error
	// DeleteQueue delete a queue on cluster
	DeleteQueue(q *model.Queue) error
	// CloseQueue close a queue on cluster
	CloseQueue(q *model.Queue) error
	// UpdateQueue update a queue on cluster
	UpdateQueue(q *model.Queue) error

	ListNodeQuota() (schema.QuotaSummary, []schema.NodeQuotaInfo, error)
}

func CreateRuntime

func CreateRuntime(clusterInfo model.ClusterInfo) (RuntimeService, error)

CreateRuntime create RuntimeService and stored in Cache

func GetOrCreateRuntime

func GetOrCreateRuntime(clusterInfo model.ClusterInfo) (RuntimeService, error)

func NewKubeRuntime

func NewKubeRuntime(cluster schema.Cluster) RuntimeService

func NewLocalRuntime

func NewLocalRuntime(cluster schema.Cluster) RuntimeService

Directories

Path Synopsis
kubernetes

Jump to

Keyboard shortcuts

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