managers

package
v0.0.0-...-873903b Latest Latest
Warning

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

Go to latest
Published: Nov 11, 2021 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// DefaultBackoffLimit for Jobs
	DefaultBackoffLimit = 0
	// DefaultRestartPolicy for Jobs
	DefaultRestartPolicy = "Never"
)
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 CopyMPIJobFields

func CopyMPIJobFields(from, to *unstructured.Unstructured) bool

CopyMPIJobFields copies the owned fields from one MPIJob to another Returns true if the fields copied from don't match to.

func CopyPytorchJobFields

func CopyPytorchJobFields(from, to *unstructured.Unstructured) bool

CopyPytorchJobFields copies the owned fields from one PytorchJob 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 CopyTFJobFields

func CopyTFJobFields(from, to *unstructured.Unstructured) bool

CopyTFJobFields copies the owned fields from one TFJob to another Returns true if the fields copied from don't match to.

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 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,
	termination operationv1.TerminationSpec,
	spec operationv1.MPIJobSpec,
) (*unstructured.Unstructured, error)

GenerateMPIJob returns a MPIJob

func GeneratePytorchJob

func GeneratePytorchJob(
	name string,
	namespace string,
	labels map[string]string,
	termination operationv1.TerminationSpec,
	spec operationv1.PytorchJobSpec,
) (*unstructured.Unstructured, error)

GeneratePytorchJob returns a PytorchJob

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,
	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 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 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