runtimev2

package
v1.9.0 Latest Latest
Warning

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

Go to latest
Published: Jan 21, 2025 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Info

type Info struct {
	// Labels and Annotations to add to the RuntimeJobTemplate.
	Labels      map[string]string
	Annotations map[string]string
	// Original policy values from the runtime.
	RuntimePolicy RuntimePolicy
	// Trainer parameters to add to the RuntimeJobTemplate.
	Trainer
	// Scheduler parameters to add to the RuntimeJobTemplate.
	*Scheduler
}

func NewInfo

func NewInfo(opts ...InfoOption) *Info

type InfoOption

type InfoOption func(options *InfoOptions)

func WithAnnotations

func WithAnnotations(annotations map[string]string) InfoOption

func WithLabels

func WithLabels(labels map[string]string) InfoOption

func WithMLPolicy

func WithMLPolicy(mlPolicy *kubeflowv2.MLPolicy) InfoOption

func WithPodGroupPolicy

func WithPodGroupPolicy(pgPolicy *kubeflowv2.PodGroupPolicy) InfoOption

func WithPodSpecReplicas

func WithPodSpecReplicas(replicaName string, replicas int32, podSpec corev1.PodSpec) InfoOption

type InfoOptions

type InfoOptions struct {
	// contains filtered or unexported fields
}

type ReconcilerBuilder

type ReconcilerBuilder func(*builder.Builder, client.Client, cache.Cache) *builder.Builder

type Runtime

type Runtime interface {
	NewObjects(ctx context.Context, trainJob *kubeflowv2.TrainJob) ([]client.Object, error)
	TerminalCondition(ctx context.Context, trainJob *kubeflowv2.TrainJob) (*metav1.Condition, error)
	EventHandlerRegistrars() []ReconcilerBuilder
	ValidateObjects(ctx context.Context, old, new *kubeflowv2.TrainJob) (admission.Warnings, field.ErrorList)
}

type RuntimePolicy

type RuntimePolicy struct {
	MLPolicy       *kubeflowv2.MLPolicy
	PodGroupPolicy *kubeflowv2.PodGroupPolicy
}

type Scheduler

type Scheduler struct {
	PodLabels     map[string]string
	TotalRequests map[string]TotalResourceRequest
}

TODO (andreyvelich): Potentially, we can add ScheduleTimeoutSeconds to the Scheduler for consistency.

type TotalResourceRequest

type TotalResourceRequest struct {
	Replicas    int32
	PodRequests corev1.ResourceList
}

type Trainer

type Trainer struct {
	NumNodes *int32
	// TODO (andreyvelich). Potentially, we can use map for env and sort it to improve code.
	// Context: https://github.com/kubeflow/training-operator/pull/2308#discussion_r1823267183
	Env           []corev1.EnvVar
	ContainerPort *corev1.ContainerPort
}

Jump to

Keyboard shortcuts

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