managers

package
v0.0.0-...-c220a7a Latest Latest
Warning

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

Go to latest
Published: Feb 29, 2024 License: Apache-2.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// DefaultTargetPort for service
	DefaultTargetPort = 6006
	// DefaultServingPort for service
	DefaultServingPort = 80
	// DefaultServiceReplicas for deployment
	DefaultServiceReplicas = 1
)
View Source
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

func CopyJobFields(from, to *batchv1.Job) bool

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

func CopyServiceFields(from, to *corev1.Service) bool

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

func GetLastPod(pods corev1.PodList) (*corev1.Pod, error)

GetLastPod returns the last pod bassed on the creation time of the items

func GetPodPorts

func GetPodPorts(podSpec corev1.PodSpec, defaultPort int) []int32

GetPodPorts returns the pod's port from the container definition

func GetRayStartParams

func GetRayStartParams(rayStartParams map[string]string) map[string]string

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

func ListMatchingOperations(ctx context.Context, c client.Client, pod metav1.Object) ([]*operationv1.Operation, error)

func ListPods

func ListPods(controllerClient client.Client, namespace string, selector map[string]string) (*corev1.PodList, error)

ListPods returns the list of pods based on selctor

Types

This section is empty.

Jump to

Keyboard shortcuts

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