framework

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: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CleanupJobPlugins

func CleanupJobPlugins(runtimeType string)

func CleanupQueuePlugin

func CleanupQueuePlugin(runtimeType string)

func ListJobPlugins

func ListJobPlugins(runtimeType string) map[schema.FrameworkVersion]JobPlugin

func ListQueuePlugins

func ListQueuePlugins(runtimeType string) map[schema.FrameworkVersion]QueuePlugin

func RegisterJobPlugin

func RegisterJobPlugin(runtimeType string, frameworkVersion schema.FrameworkVersion, job JobPlugin)

func RegisterQueuePlugin

func RegisterQueuePlugin(runtimeType string, quotaType schema.FrameworkVersion, queue QueuePlugin)

Types

type JobGetter

type JobGetter interface {
	Job(fwVersion pfschema.FrameworkVersion) JobInterface
}

JobGetter return FrameworkJobInterface

type JobInterface

type JobInterface interface {
	// Submit PaddleFlow Server operate on cluster
	Submit(ctx context.Context, job *api.PFJob) error

	Stop(ctx context.Context, job *api.PFJob) error

	Update(ctx context.Context, job *api.PFJob) error

	Delete(ctx context.Context, job *api.PFJob) error

	GetLog(ctx context.Context, jobLogRequest pfschema.JobLogRequest) (pfschema.JobLogInfo, error)

	// AddEventListener add jobListener, taskLister to notify PaddleFlow Server when job is updated
	AddEventListener(ctx context.Context, listenerType string, eventQueue workqueue.RateLimitingInterface, informer interface{}) error
}

type JobPlugin

type JobPlugin = func(RuntimeClientInterface) JobInterface

JobPlugin defines job interface

func GetJobPlugin

func GetJobPlugin(runtimeType string, frameworkVersion schema.FrameworkVersion) (JobPlugin, bool)

type JobSample

type JobSample struct {
}

func (*JobSample) AddEventListener

func (j *JobSample) AddEventListener(ctx context.Context, listenerType string,
	eventQueue workqueue.RateLimitingInterface, informer interface{}) error

func (*JobSample) Delete

func (j *JobSample) Delete(ctx context.Context, job *api.PFJob) error

func (*JobSample) GetLog

func (j *JobSample) GetLog(ctx context.Context, jobLogRequest pfschema.JobLogRequest) (pfschema.JobLogInfo, error)

func (*JobSample) Stop

func (j *JobSample) Stop(ctx context.Context, job *api.PFJob) error

func (*JobSample) Submit

func (j *JobSample) Submit(ctx context.Context, job *api.PFJob) error

func (*JobSample) Update

func (j *JobSample) Update(ctx context.Context, job *api.PFJob) error

type QueueGetter

type QueueGetter interface {
	Queue(quotaType pfschema.FrameworkVersion) QueueInterface
}

QueueGetter return RuntimeQueueInterface

type QueueInterface

type QueueInterface interface {
	// PaddleFlow Server operate on Cluster
	Create(ctx context.Context, q *api.QueueInfo) error

	Delete(ctx context.Context, q *api.QueueInfo) error

	Update(ctx context.Context, q *api.QueueInfo) error

	// AddEventListener add queueListener to notify PaddleFlow Server when queue is updated
	AddEventListener(ctx context.Context, listenerType string, eventQueue workqueue.RateLimitingInterface, informer interface{}) error
}

QueueInterface defines Queue operator methods

type QueuePlugin

type QueuePlugin = func(RuntimeClientInterface) QueueInterface

QueuePlugin defines queue interface

func GetQueuePlugin

func GetQueuePlugin(runtimeType string, quotaType schema.FrameworkVersion) (QueuePlugin, bool)

type QueueSample

type QueueSample struct {
}

func (*QueueSample) AddEventListener

func (qs *QueueSample) AddEventListener(ctx context.Context, listenerType string,
	eventQueue workqueue.RateLimitingInterface, informer interface{}) error

func (*QueueSample) Create

func (qs *QueueSample) Create(ctx context.Context, q *api.QueueInfo) error

func (*QueueSample) Delete

func (qs *QueueSample) Delete(ctx context.Context, q *api.QueueInfo) error

func (*QueueSample) Update

func (qs *QueueSample) Update(ctx context.Context, q *api.QueueInfo) error

type RuntimeClientInterface

type RuntimeClientInterface interface {
	Cluster() string

	ClusterID() string

	ClusterName() string

	Get(namespace string, name string, fv pfschema.FrameworkVersion) (interface{}, error)

	Create(resource interface{}, fv pfschema.FrameworkVersion) error

	Delete(namespace string, name string, fv pfschema.FrameworkVersion) error

	Patch(namespace, name string, fv pfschema.FrameworkVersion, data []byte) error

	Update(resource interface{}, fv pfschema.FrameworkVersion) error

	// RegisterListener register job/task/queue listener
	RegisterListener(listenerType string, workQueue workqueue.RateLimitingInterface) error

	StartListener(listenerType string, stopCh <-chan struct{}) error

	// ListNodeQuota resource api for cluster nodes
	ListNodeQuota(ctx context.Context) (pfschema.QuotaSummary, []pfschema.NodeQuotaInfo, error)

	GetJobTypeFramework(fv pfschema.FrameworkVersion) (pfschema.JobType, pfschema.Framework)

	JobFrameworkVersion(jobType pfschema.JobType, fw pfschema.Framework) pfschema.FrameworkVersion
}

Jump to

Keyboard shortcuts

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