runtime_v2

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: 34 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) Client

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(queue *api.QueueInfo) error

func (*KubeRuntime) DeleteJob

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

func (*KubeRuntime) DeleteObject

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

func (*KubeRuntime) DeletePersistentVolume

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

func (*KubeRuntime) DeletePersistentVolumeClaim

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

func (*KubeRuntime) DeletePod

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

func (*KubeRuntime) DeleteQueue

func (kr *KubeRuntime) DeleteQueue(queue *api.QueueInfo) error

func (*KubeRuntime) GetJobLog

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

func (*KubeRuntime) GetObject

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

func (*KubeRuntime) GetPersistentVolumeClaims

func (kr *KubeRuntime) GetPersistentVolumeClaims(namespace, name string, getOptions metav1.GetOptions) (*corev1.PersistentVolumeClaim, error)

func (*KubeRuntime) GetQueueUsedQuota

func (kr *KubeRuntime) GetQueueUsedQuota(q *api.QueueInfo) (*resources.Resource, error)

func (*KubeRuntime) Init

func (kr *KubeRuntime) Init() error

func (*KubeRuntime) Job

func (*KubeRuntime) ListNamespaces

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

func (*KubeRuntime) ListNodeQuota

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

ListNodeQuota return node resources, including cpu, memory, and extend resources

func (*KubeRuntime) ListPods

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

func (*KubeRuntime) Name

func (kr *KubeRuntime) Name() string

func (*KubeRuntime) PatchPVCFinalizerNull

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

func (*KubeRuntime) Queue

func (*KubeRuntime) StopJob

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

func (*KubeRuntime) String

func (kr *KubeRuntime) String() string

func (*KubeRuntime) SubmitJob

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

func (*KubeRuntime) SyncController

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

func (*KubeRuntime) UpdateJob

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

func (*KubeRuntime) UpdateObject

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

func (*KubeRuntime) UpdateQueue

func (kr *KubeRuntime) UpdateQueue(queue *api.QueueInfo) error

type RuntimeService

type RuntimeService interface {
	Name() string
	// Init create client for runtime
	Init() error
	// Client return runtime service client
	Client() framework.RuntimeClientInterface
	// SyncController start sync controller
	SyncController(stopCh <-chan struct{})

	// 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
	// GetJobLog get log for job
	GetJobLog(jobLogRequest schema.JobLogRequest) (schema.JobLogInfo, error)

	// CreateQueue create a queue on cluster
	CreateQueue(q *api.QueueInfo) error
	// DeleteQueue delete a queue on cluster
	DeleteQueue(q *api.QueueInfo) error
	// UpdateQueue update a queue on cluster
	UpdateQueue(q *api.QueueInfo) error

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

	framework.JobGetter
	framework.QueueGetter
}

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 pfschema.Cluster) RuntimeService

Jump to

Keyboard shortcuts

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