runtime_v2

package
v0.14.6 Latest Latest
Warning

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

Go to latest
Published: Mar 23, 2023 License: Apache-2.0 Imports: 42 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 K3SRuntimeService added in v0.14.6

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

func (*K3SRuntimeService) Client added in v0.14.6

func (*K3SRuntimeService) CreateNamespace added in v0.14.6

func (k3srs *K3SRuntimeService) CreateNamespace(namespace string, opts metav1.CreateOptions) (*corev1.Namespace, error)

CreateNamespace Create namespace if not exist

func (*K3SRuntimeService) CreateQueue added in v0.14.6

func (k3srs *K3SRuntimeService) CreateQueue(queue *api.QueueInfo) error

func (*K3SRuntimeService) DeleteJob added in v0.14.6

func (k3srs *K3SRuntimeService) DeleteJob(job *api.PFJob) error

func (*K3SRuntimeService) DeleteQueue added in v0.14.6

func (k3srs *K3SRuntimeService) DeleteQueue(queue *api.QueueInfo) error

func (*K3SRuntimeService) GetLog added in v0.14.6

func (k3srs *K3SRuntimeService) GetLog(jobLogRequest pfschema.JobLogRequest, mixedLogRequest pfschema.MixedLogRequest) (pfschema.JobLogInfo, error)

func (*K3SRuntimeService) GetQueueUsedQuota added in v0.14.6

func (k3srs *K3SRuntimeService) GetQueueUsedQuota(q *api.QueueInfo) (*resources.Resource, error)

func (*K3SRuntimeService) Init added in v0.14.6

func (k3srs *K3SRuntimeService) Init() error

func (*K3SRuntimeService) Job added in v0.14.6

func (*K3SRuntimeService) ListNodeQuota added in v0.14.6

func (k3srs *K3SRuntimeService) ListNodeQuota() (pfschema.QuotaSummary, []pfschema.NodeQuotaInfo, error)

func (*K3SRuntimeService) ListPods added in v0.14.6

func (k3srs *K3SRuntimeService) ListPods(namespace string, listOptions metav1.ListOptions) (*corev1.PodList, error)

func (*K3SRuntimeService) Name added in v0.14.6

func (k3srs *K3SRuntimeService) Name() string

func (*K3SRuntimeService) Queue added in v0.14.6

Queue quota type???

func (*K3SRuntimeService) StopJob added in v0.14.6

func (k3srs *K3SRuntimeService) StopJob(job *api.PFJob) error

func (*K3SRuntimeService) String added in v0.14.6

func (k3srs *K3SRuntimeService) String() string

func (*K3SRuntimeService) SubmitJob added in v0.14.6

func (k3srs *K3SRuntimeService) SubmitJob(job *api.PFJob) error

func (*K3SRuntimeService) SyncController added in v0.14.6

func (k3srs *K3SRuntimeService) SyncController(stopCh <-chan struct{})

func (*K3SRuntimeService) UpdateJob added in v0.14.6

func (k3srs *K3SRuntimeService) UpdateJob(job *api.PFJob) error

func (*K3SRuntimeService) UpdateQueue added in v0.14.6

func (k3srs *K3SRuntimeService) UpdateQueue(queue *api.QueueInfo) error

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) CreateNamespace added in v0.14.6

func (kr *KubeRuntime) CreateNamespace(namespace string, opts metav1.CreateOptions) (*corev1.Namespace, error)

CreateNamespace Create namespace if not exist

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) GetEvents added in v0.14.6

func (kr *KubeRuntime) GetEvents(namespace, name string) ([]corev1.Event, error)

GetEvents get events by name and namespace

func (*KubeRuntime) GetJobLog

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

func (*KubeRuntime) GetLog added in v0.14.6

func (kr *KubeRuntime) GetLog(jobLogRequest pfschema.JobLogRequest, mixedLogRequest pfschema.MixedLogRequest) (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) GetPod added in v0.14.6

func (kr *KubeRuntime) GetPod(namespace, name string) (*corev1.Pod, error)

GetPod get pod by namespace and name

func (*KubeRuntime) GetPodsByDeployName added in v0.14.6

func (kr *KubeRuntime) GetPodsByDeployName(mixedLogRequest pfschema.MixedLogRequest) ([]corev1.Pod, error)

GetPodsByDeployName return pod list of a deployments

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
	// GetLog get log for job
	GetLog(jobLogRequest schema.JobLogRequest, request schema.MixedLogRequest) (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 NewK3SRuntime added in v0.14.6

func NewK3SRuntime(cluster pfschema.Cluster) RuntimeService

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