Documentation ¶
Index ¶
- Constants
- func CopyDeploymentFields(from, to *appsv1.Deployment) bool
- func CopyJobFields(from, to *batchv1.Job) bool
- func CopyKFJobFields(from, to *unstructured.Unstructured) bool
- func CopyServiceFields(from, to *corev1.Service) bool
- func CopyUnstructuredField(from, to *unstructured.Unstructured, field string) bool
- func CopyUnstructuredSpec(from, to *unstructured.Unstructured, fields []string) bool
- func CopyVirtualService(from, to *unstructured.Unstructured) bool
- func GenerateDaskJob(name string, namespace string, labels map[string]string, ...) (*unstructured.Unstructured, error)
- func GenerateDeployment(name string, namespace string, labels map[string]string, ...) (*appsv1.Deployment, error)
- func GenerateJob(name string, namespace string, labels map[string]string, ...) *batchv1.Job
- func GenerateMPIJob(name string, namespace string, labels map[string]string, ...) (*unstructured.Unstructured, error)
- func GenerateMXJob(name string, namespace string, labels map[string]string, ...) (*unstructured.Unstructured, error)
- func GeneratePaddleJob(name string, namespace string, labels map[string]string, ...) (*unstructured.Unstructured, error)
- func GeneratePytorchJob(name string, namespace string, labels map[string]string, ...) (*unstructured.Unstructured, error)
- func GenerateRayJob(name string, namespace string, labels map[string]string, ...) (*unstructured.Unstructured, error)
- func GenerateService(name string, namespace string, labels map[string]string, ...) *corev1.Service
- func GenerateTFJob(name string, namespace string, labels map[string]string, ...) (*unstructured.Unstructured, error)
- func GenerateVirtualService(name, namespace string) (*unstructured.Unstructured, error)
- func GenerateXGBJob(name string, namespace string, labels map[string]string, ...) (*unstructured.Unstructured, error)
- func GetLastPod(pods corev1.PodList) (*corev1.Pod, error)
- func GetPodPorts(podSpec corev1.PodSpec, defaultPort int) []int32
- func GetRayStartParams(rayStartParams map[string]string) map[string]string
- func GetReplicas(dreplicas int, service operationv1.ServiceSpec) int32
- func HasUnschedulablePods(controllerClient client.Client, instance *operationv1.Operation) (operationv1.OperationConditionType, string, string)
- func IsDeploymentRunning(ds appsv1.DeploymentStatus, dc appsv1.DeploymentCondition) bool
- func IsDeploymentWarning(ds appsv1.DeploymentStatus, dc appsv1.DeploymentCondition) bool
- func IsJobFailed(jc batchv1.JobCondition) bool
- func IsJobSucceeded(jc batchv1.JobCondition) bool
- func ListMatchingOperations(ctx context.Context, c client.Client, pod metav1.Object) ([]*operationv1.Operation, error)
- func ListPods(controllerClient client.Client, namespace string, selector map[string]string) (*corev1.PodList, error)
Constants ¶
const ( // DefaultTargetPort for service DefaultTargetPort = 6006 // DefaultServingPort for service DefaultServingPort = 80 // DefaultServiceReplicas for deployment DefaultServiceReplicas = 1 )
const (
// DefaultTimeout for service
DefaultTimeout = "300s"
)
Variables ¶
This section is empty.
Functions ¶
func CopyDeploymentFields ¶
func CopyDeploymentFields(from, to *appsv1.Deployment) bool
CopyDeploymentFields copies the owned fields from one Deployment to another Returns true if the fields copied from don't match to.
func CopyJobFields ¶
CopyJobFields copies the owned fields from one Job to another Returns true if the fields copied from don't match to.
func CopyKFJobFields ¶
func CopyKFJobFields(from, to *unstructured.Unstructured) bool
CopyKFJobFields copies the owned fields from one KFJob to another Returns true if the fields copied from don't match to.
func CopyServiceFields ¶
CopyServiceFields copies the owned fields from one Service to another
func CopyUnstructuredField ¶
func CopyUnstructuredField(from, to *unstructured.Unstructured, field string) bool
CopyUnstructuredField copies the owned fields from one unstructured to another Returns true if the fields copied from don't match to.
func CopyUnstructuredSpec ¶
func CopyUnstructuredSpec(from, to *unstructured.Unstructured, fields []string) bool
CopyUnstructuredSpec copies the owned fields from one unstructured to another Returns true if the fields copied from don't match to.
func CopyVirtualService ¶
func CopyVirtualService(from, to *unstructured.Unstructured) bool
CopyVirtualService copies the owned fields from one VirtualService to another Returns true if the fields copied from don't match to.
func GenerateDaskJob ¶
func GenerateDaskJob( name string, namespace string, labels map[string]string, annotations map[string]string, termination operationv1.TerminationSpec, spec operationv1.DaskJobSpec, ) (*unstructured.Unstructured, error)
GenerateDaskJob returns a DaskJob
func GenerateDeployment ¶
func GenerateDeployment( name string, namespace string, labels map[string]string, annotations map[string]string, ports []int32, replicas int32, spec corev1.PodSpec, ) (*appsv1.Deployment, error)
GenerateDeployment returns a deployment given a MlDeploymentSpec
func GenerateJob ¶
func GenerateJob( name string, namespace string, labels map[string]string, annotations map[string]string, backoffLimit *int32, activeDeadlineSeconds *int64, ttlSecondsAfterFinished *int32, podSpec corev1.PodSpec, ) *batchv1.Job
GenerateJob returns a batch job given a OperationSpec
func GenerateMPIJob ¶
func GenerateMPIJob( name string, namespace string, labels map[string]string, annotations map[string]string, termination operationv1.TerminationSpec, spec operationv1.MPIJobSpec, ) (*unstructured.Unstructured, error)
GenerateMPIJob returns a MPIJob
func GenerateMXJob ¶
func GenerateMXJob( name string, namespace string, labels map[string]string, annotations map[string]string, termination operationv1.TerminationSpec, spec operationv1.MXJobSpec, ) (*unstructured.Unstructured, error)
GenerateMXJob returns a MXJob
func GeneratePaddleJob ¶
func GeneratePaddleJob( name string, namespace string, labels map[string]string, annotations map[string]string, termination operationv1.TerminationSpec, spec operationv1.PaddleJobSpec, ) (*unstructured.Unstructured, error)
GeneratePaddleJob returns a PaddleJob
func GeneratePytorchJob ¶
func GeneratePytorchJob( name string, namespace string, labels map[string]string, annotations map[string]string, termination operationv1.TerminationSpec, spec operationv1.PytorchJobSpec, ) (*unstructured.Unstructured, error)
GeneratePytorchJob returns a PytorchJob
func GenerateRayJob ¶
func GenerateRayJob( name string, namespace string, labels map[string]string, annotations map[string]string, termination operationv1.TerminationSpec, spec operationv1.RayJobSpec, ) (*unstructured.Unstructured, error)
GenerateRayJob returns a RayJob
func GenerateService ¶
func GenerateService(name string, namespace string, labels map[string]string, annotations map[string]string, ports []int32) *corev1.Service
GenerateService returns a service given info from a ServiceSpec
func GenerateTFJob ¶
func GenerateTFJob( name string, namespace string, labels map[string]string, annotations map[string]string, termination operationv1.TerminationSpec, spec operationv1.TFJobSpec, ) (*unstructured.Unstructured, error)
GenerateTFJob returns a TFJob
func GenerateVirtualService ¶
func GenerateVirtualService(name, namespace string) (*unstructured.Unstructured, error)
GenerateVirtualService returns a batch job given a OperationSpec
func GenerateXGBJob ¶
func GenerateXGBJob( name string, namespace string, labels map[string]string, annotations map[string]string, termination operationv1.TerminationSpec, spec operationv1.XGBoostJobSpec, ) (*unstructured.Unstructured, error)
GenerateXGBJob returns a XGBJob
func GetLastPod ¶
GetLastPod returns the last pod bassed on the creation time of the items
func GetPodPorts ¶
GetPodPorts returns the pod's port from the container definition
func GetRayStartParams ¶
GetRayStartParams utils function to handle default case
func GetReplicas ¶
func GetReplicas(dreplicas int, service operationv1.ServiceSpec) int32
GetReplicas Get replicas for ServiceSpec
func HasUnschedulablePods ¶
func HasUnschedulablePods(controllerClient client.Client, instance *operationv1.Operation) (operationv1.OperationConditionType, string, string)
HasUnschedulablePods Detects if entity has unschedulable pods
func IsDeploymentRunning ¶
func IsDeploymentRunning(ds appsv1.DeploymentStatus, dc appsv1.DeploymentCondition) bool
IsDeploymentRunning return true if deploymeny is running
func IsDeploymentWarning ¶
func IsDeploymentWarning(ds appsv1.DeploymentStatus, dc appsv1.DeploymentCondition) bool
IsDeploymentWarning return true if deploymeny is in warning state
func IsJobFailed ¶
func IsJobFailed(jc batchv1.JobCondition) bool
IsJobFailed return true if job is running
func IsJobSucceeded ¶
func IsJobSucceeded(jc batchv1.JobCondition) bool
IsJobSucceeded return true if job is running
func ListMatchingOperations ¶
Types ¶
This section is empty.