executor

package
v0.14.4 Latest Latest
Warning

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

Go to latest
Published: Sep 9, 2022 License: Apache-2.0 Imports: 36 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Create

func Create(resource interface{}, gvk schema.GroupVersionKind, clientOpt *k8s.DynamicClientOption) error

func Delete

func Delete(namespace string, name string, gvk schema.GroupVersionKind, clientOpt *k8s.DynamicClientOption) error

func Get

func Get(namespace string, name string, gvk schema.GroupVersionKind, clientOpt *k8s.DynamicClientOption) (*unstructured.Unstructured, error)

func GetPodGroupName added in v0.14.3

func GetPodGroupName(jobID string) string

func KubePriorityClass added in v0.14.3

func KubePriorityClass(priority string) string

func NewKubeJob

func NewKubeJob(job *api.PFJob, dynamicClientOpt *k8s.DynamicClientOption) (api.PFJobInterface, error)

func Patch

func Patch(namespace, name string, gvk schema.GroupVersionKind, data []byte, clientOpt *k8s.DynamicClientOption) error

func Update

func Update(resource interface{}, gvk schema.GroupVersionKind, clientOpt *k8s.DynamicClientOption) error

Types

type JobModeParams

type JobModeParams struct {
	JobFlavour string // flavour of job in pod or collective mode

	CollectiveJobReplicas string // parameters for Collective job

	PServerReplicas string // server.replicas or driver.replicas of job
	PServerFlavour  string // server.flavour or driver.flavour of job
	PServerCommand  string // server.command or driver.command of job
	WorkerReplicas  string // worker.replicas or executor.replicas of job
	WorkerFlavour   string // worker.flavour or executor.flavour of job
	WorkerCommand   string // worker.command or executor.command of job
}

JobModeParams records the parameters related to job mode Deprecated

type KubeJob

type KubeJob struct {
	ID string
	// Name the name of job on kubernetes
	Name        string
	Namespace   string
	JobType     schema.JobType
	JobMode     string
	Image       string
	Command     string
	Env         map[string]string
	Priority    string
	QueueName   string
	Labels      map[string]string
	Annotations map[string]string
	// 存储资源
	FileSystems []schema.FileSystem

	// job framework
	Framework schema.Framework
	// YamlTemplateContent indicate template content of job
	YamlTemplateContent []byte
	IsCustomYaml        bool
	Tasks               []model.Member
	GroupVersionKind    kubeschema.GroupVersionKind
	DynamicClientOption *k8s.DynamicClientOption
}

func (*KubeJob) Cluster added in v0.14.4

func (j *KubeJob) Cluster() string

func (*KubeJob) CreateJob

func (j *KubeJob) CreateJob() (string, error)

func (*KubeJob) DeleteJob

func (j *KubeJob) DeleteJob() error

func (*KubeJob) GetID

func (j *KubeJob) GetID() string

func (*KubeJob) StopJobByID

func (j *KubeJob) StopJobByID(id string) error

func (*KubeJob) String added in v0.14.4

func (j *KubeJob) String() string

func (*KubeJob) UpdateJob

func (j *KubeJob) UpdateJob(data []byte) error

type KubeJobInterface

type KubeJobInterface interface {
	// contains filtered or unexported methods
}

KubeJobInterface define methods for create kubernetes job

type PaddleJob

type PaddleJob struct {
	KubeJob
}

func (*PaddleJob) CreateJob

func (pj *PaddleJob) CreateJob() (string, error)

type PyTorchJob added in v0.14.4

type PyTorchJob struct {
	KubeJob
}

func (*PyTorchJob) CreateJob added in v0.14.4

func (pj *PyTorchJob) CreateJob() (string, error)

type SingleJob

type SingleJob struct {
	KubeJob
	Flavour schema.Flavour
}

SingleJob is a executor struct that runs a single pod

func (*SingleJob) CreateJob

func (sp *SingleJob) CreateJob() (string, error)

CreateJob creates a job

type SparkJob

type SparkJob struct {
	KubeJob
	SparkMainFile    string
	SparkMainClass   string
	SparkArguments   string
	DriverFlavour    string
	ExecutorFlavour  string
	ExecutorReplicas string
}

SparkJob is the executor for spark job

func (*SparkJob) CreateJob

func (sj *SparkJob) CreateJob() (string, error)

CreateJob creates a SparkJob

type TFJob added in v0.14.4

type TFJob struct {
	KubeJob
}

func (*TFJob) CreateJob added in v0.14.4

func (j *TFJob) CreateJob() (string, error)

type VCJob

type VCJob struct {
	KubeJob
	JobModeParams
}

VCJob deprecated

func (*VCJob) CreateJob

func (vj *VCJob) CreateJob() (string, error)

type WorkflowJob

type WorkflowJob struct {
	KubeJob
}

WorkflowJob is a executor struct that runs a workflow

func (*WorkflowJob) CreateJob

func (wfj *WorkflowJob) CreateJob() (string, error)

Jump to

Keyboard shortcuts

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