Documentation ¶
Index ¶
- Constants
- func BuildEnvVars(baseEnvs []corev1.EnvVar, EnvVars map[string]string) []corev1.EnvVar
- func BuildJobMetadata(metadata *metav1.ObjectMeta, job *api.PFJob)
- func BuildPod(pod *corev1.Pod, task schema.Member) error
- func BuildPodSpec(podSpec *corev1.PodSpec, task schema.Member) error
- func BuildPodTemplateSpec(podSpec *corev1.PodTemplateSpec, jobID string, task *schema.Member) error
- func BuildTaskMetadata(metadata *metav1.ObjectMeta, jobID string, taskConf *schema.Conf)
- func BuildVolumeMounts(volumeMounts []corev1.VolumeMount, fileSystem []schema.FileSystem) []corev1.VolumeMount
- func BuildVolumes(volumes []corev1.Volume, fileSystem []schema.FileSystem) []corev1.Volume
- func CreateKubeJobFromYaml(jobEntity interface{}, groupVersionKind kubeschema.GroupVersionKind, ...) error
- func GenerateResourceRequirements(request, limitFlavour schema.Flavour) (corev1.ResourceRequirements, error)
- func GetKubeflowJobStatus(jobCond kubeflowv1.JobCondition) (schema.JobStatus, string, error)
- func GetParentJobID(obj *unstructured.Unstructured) string
- func GetTaskMessage(podStatus *v1.PodStatus) string
- func GetTaskStatus(podStatus *v1.PodStatus) (schema.TaskStatus, error)
- func JobAddFunc(obj interface{}, getStatusFunc api.GetStatusFunc) (*api.JobSyncInfo, error)
- func JobDeleteFunc(obj interface{}, getStatusFunc api.GetStatusFunc) (*api.JobSyncInfo, error)
- func JobUpdateFunc(old, new interface{}, getStatusFunc api.GetStatusFunc) (*api.JobSyncInfo, error)
- func KubePriorityClass(priority string) string
- func KubeflowReplicaSpec(replicaSpec *kubeflowv1.ReplicaSpec, jobID string, task *schema.Member) error
- func KubeflowRunPolicy(runPolicy *kubeflowv1.RunPolicy, minResources *corev1.ResourceList, ...) error
- func ResponsibleForJob(obj interface{}) bool
- func TaskUpdate(oldObj, newObj interface{}, ...)
- func TaskUpdateFunc(obj interface{}, action schema.ActionType, ...)
- func UpdateKubeJob(job *api.PFJob, runtimeClient framework.RuntimeClientInterface, ...) error
- func ValidatePodResources(spec *corev1.PodSpec) error
- type ContainerStatusMessage
- type KubeBaseJob
- func (kj *KubeBaseJob) AddJobEventListener(ctx context.Context, jobQueue workqueue.RateLimitingInterface, ...) error
- func (kj *KubeBaseJob) Delete(ctx context.Context, job *api.PFJob) error
- func (kj *KubeBaseJob) GetLog(ctx context.Context, jobLogRequest schema.JobLogRequest) (schema.JobLogInfo, error)
- func (kj *KubeBaseJob) Stop(ctx context.Context, job *api.PFJob) error
- func (kj *KubeBaseJob) String(name string) string
- func (kj *KubeBaseJob) Update(ctx context.Context, job *api.PFJob) error
- type PodStatusMessage
Constants ¶
const ( DefaultJobPendingTTLSeconds = 300 RuntimeStatusKey = "status" PodInitializing = "PodInitializing" ContainerCreating = "ContainerCreating" )
const (
DefaultReplicas = 1
)
Variables ¶
This section is empty.
Functions ¶
func BuildEnvVars ¶
BuildEnvVars merge EnvVars
func BuildJobMetadata ¶
func BuildJobMetadata(metadata *metav1.ObjectMeta, job *api.PFJob)
BuildJobMetadata build metadata for kubernetes job
func BuildPodTemplateSpec ¶
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 ¶
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
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 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 ¶
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 NewKubeBaseJob ¶ added in v0.14.6
func NewKubeBaseJob(gvk kubeschema.GroupVersionKind, fv schema.FrameworkVersion, c framework.RuntimeClientInterface) KubeBaseJob
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) GetLog ¶ added in v0.14.6
func (kj *KubeBaseJob) GetLog(ctx context.Context, jobLogRequest schema.JobLogRequest) (schema.JobLogInfo, error)
func (*KubeBaseJob) String ¶ added in v0.14.6
func (kj *KubeBaseJob) String(name string) string
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