kuberuntime

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

Documentation

Index

Constants

View Source
const (
	DefaultJobPendingTTLSeconds = 300

	RuntimeStatusKey = "status"

	PodInitializing   = "PodInitializing"
	ContainerCreating = "ContainerCreating"
)
View Source
const (
	DefaultReplicas = 1
)

Variables

This section is empty.

Functions

func BuildEnvVars

func BuildEnvVars(baseEnvs []corev1.EnvVar, EnvVars map[string]string) []corev1.EnvVar

BuildEnvVars merge EnvVars

func BuildJobMetadata

func BuildJobMetadata(metadata *metav1.ObjectMeta, job *api.PFJob)

BuildJobMetadata build metadata for kubernetes job

func BuildPod

func BuildPod(pod *corev1.Pod, task schema.Member) error

func BuildPodSpec

func BuildPodSpec(podSpec *corev1.PodSpec, task schema.Member) error

func BuildPodTemplateSpec

func BuildPodTemplateSpec(podSpec *corev1.PodTemplateSpec, jobID string, task *schema.Member) error

BuildPodTemplateSpec build PodTemplateSpec for built-in distributed job, such as PaddleJob, PyTorchJob, TFJob and so on

func BuildTaskMetadata

func BuildTaskMetadata(metadata *metav1.ObjectMeta, jobID string, taskConf *schema.Conf)

func BuildVolumeMounts

func BuildVolumeMounts(volumeMounts []corev1.VolumeMount, fileSystem []schema.FileSystem) []corev1.VolumeMount

BuildVolumeMounts covert PaddleFlow FileSystem to kubernetes VolumeMount

func BuildVolumes

func BuildVolumes(volumes []corev1.Volume, fileSystem []schema.FileSystem) []corev1.Volume

BuildVolumes convert PaddleFlow FileSystem to kubernetes volumes

func CreateKubeJobFromYaml

func CreateKubeJobFromYaml(jobEntity interface{}, groupVersionKind kubeschema.GroupVersionKind, job *api.PFJob) error

func GenerateResourceRequirements added in v0.14.6

func GenerateResourceRequirements(request, limitFlavour schema.Flavour) (corev1.ResourceRequirements, error)

func GetKubeflowJobStatus

func GetKubeflowJobStatus(jobCond kubeflowv1.JobCondition) (schema.JobStatus, string, error)

GetKubeflowJobStatus covert job status of kubeflow application to paddleflow job status

func GetParentJobID

func GetParentJobID(obj *unstructured.Unstructured) string

func GetTaskMessage added in v0.14.6

func GetTaskMessage(podStatus *v1.PodStatus) string

GetTaskMessage construct message from pod status

func GetTaskStatus added in v0.14.6

func GetTaskStatus(podStatus *v1.PodStatus) (schema.TaskStatus, error)

func JobAddFunc

func JobAddFunc(obj interface{}, getStatusFunc api.GetStatusFunc) (*api.JobSyncInfo, error)

func JobDeleteFunc

func JobDeleteFunc(obj interface{}, getStatusFunc api.GetStatusFunc) (*api.JobSyncInfo, error)

func JobUpdateFunc

func JobUpdateFunc(old, new interface{}, getStatusFunc api.GetStatusFunc) (*api.JobSyncInfo, error)

func KubePriorityClass

func KubePriorityClass(priority string) string

func KubeflowReplicaSpec

func KubeflowReplicaSpec(replicaSpec *kubeflowv1.ReplicaSpec, jobID string, task *schema.Member) error

KubeflowReplicaSpec build ReplicaSpec for kubeflow job, such as PyTorchJob, TFJob and so on.

func KubeflowRunPolicy

func KubeflowRunPolicy(runPolicy *kubeflowv1.RunPolicy, minResources *corev1.ResourceList, queueName, priority string) error

KubeflowRunPolicy build RunPolicy for kubeflow job, such as PyTorchJob, TFJob and so on.

func ResponsibleForJob

func ResponsibleForJob(obj interface{}) bool

ResponsibleForJob filter job belong to PaddleFlow

func TaskUpdate

func TaskUpdate(oldObj, newObj interface{}, taskQueue, jobQueue workqueue.RateLimitingInterface)

func TaskUpdateFunc

func TaskUpdateFunc(obj interface{}, action schema.ActionType, taskQueue workqueue.RateLimitingInterface)

func UpdateKubeJob

func UpdateKubeJob(job *api.PFJob, runtimeClient framework.RuntimeClientInterface, fv schema.FrameworkVersion) error

func ValidatePodResources

func ValidatePodResources(spec *corev1.PodSpec) error

Types

type ContainerStatusMessage added in v0.14.6

type ContainerStatusMessage struct {
	Name            string                       `json:"name,omitempty"`
	ContainerID     string                       `json:"containerID,omitempty"`
	RestartCount    int32                        `json:"restartCount,omitempty"`
	WaitingState    *v1.ContainerStateWaiting    `json:"waitingState,omitempty"`
	TerminatedState *v1.ContainerStateTerminated `json:"terminatedState,omitempty"`
}

func (*ContainerStatusMessage) String added in v0.14.6

func (cs *ContainerStatusMessage) String() string

type KubeBaseJob added in v0.14.6

type KubeBaseJob struct {
	GVK              kubeschema.GroupVersionKind
	FrameworkVersion schema.FrameworkVersion
	RuntimeClient    framework.RuntimeClientInterface
	JobQueue         workqueue.RateLimitingInterface
	// contains filtered or unexported fields
}

func (*KubeBaseJob) AddJobEventListener added in v0.14.6

func (kj *KubeBaseJob) AddJobEventListener(ctx context.Context,
	jobQueue workqueue.RateLimitingInterface,
	listener interface{},
	jobStatus api.GetStatusFunc,
	filterFunc func(interface{}) bool) error

func (*KubeBaseJob) Delete added in v0.14.6

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

func (*KubeBaseJob) GetLog added in v0.14.6

func (kj *KubeBaseJob) GetLog(ctx context.Context, jobLogRequest schema.JobLogRequest) (schema.JobLogInfo, error)

func (*KubeBaseJob) Stop added in v0.14.6

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

func (*KubeBaseJob) String added in v0.14.6

func (kj *KubeBaseJob) String(name string) string

func (*KubeBaseJob) Update added in v0.14.6

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

type PodStatusMessage added in v0.14.6

type PodStatusMessage struct {
	Phase             v1.PodPhase              `json:"phase,omitempty"`
	Message           string                   `json:"message,omitempty"`
	Reason            string                   `json:"reason,omitempty"`
	ContainerMessages []ContainerStatusMessage `json:"containerMessages,omitempty"`
}

func (*PodStatusMessage) String added in v0.14.6

func (ps *PodStatusMessage) String() string

Jump to

Keyboard shortcuts

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