testing

package
v2.1.0 Latest Latest
Warning

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

Go to latest
Published: Nov 7, 2025 License: Apache-2.0 Imports: 29 Imported by: 0

Documentation

Index

Constants

View Source
const (
	NotFoundError errorMatcher = iota
	ForbiddenError
	InvalidError
)

Variables

View Source
var (
	PodSetEndpointsCmpOpts = cmp.Transformer("Seq", func(a iter.Seq[string]) []string {
		if a == nil {
			return nil
		}
		return slices.Collect(a)
	})
	TrainJobUpdateReconcileRequestCmpOpts = cmp.Transformer("SeqTrainJobUpdateReconcileRequest",
		func(req iter.Seq[types.NamespacedName]) []types.NamespacedName {
			if req == nil {
				return nil
			}
			return slices.Collect(req)
		},
	)
)

Functions

func AsIndex

func AsIndex(builder *fake.ClientBuilder) client.FieldIndexer

func BeAPIError

func BeAPIError(name errorMatcher) types.GomegaMatcher

func BeForbiddenError

func BeForbiddenError() types.GomegaMatcher

func BeInvalidError

func BeInvalidError() types.GomegaMatcher

func BeNotFoundError

func BeNotFoundError() types.GomegaMatcher

func MPISecretDataComparer

func MPISecretDataComparer(a, b map[string][]byte) bool

func NewClientBuilder

func NewClientBuilder(addToSchemes ...func(s *runtime.Scheme) error) *fake.ClientBuilder

func ToObject

func ToObject(s *runtime.Scheme, objects ...runtime.ApplyConfiguration) ([]runtime.Object, error)

Types

type ClusterTrainingRuntimeWrapper

type ClusterTrainingRuntimeWrapper struct {
	trainer.ClusterTrainingRuntime
}

func MakeClusterTrainingRuntimeWrapper

func MakeClusterTrainingRuntimeWrapper(name string) *ClusterTrainingRuntimeWrapper

func (*ClusterTrainingRuntimeWrapper) DeletionTimestamp

func (*ClusterTrainingRuntimeWrapper) Finalizers

func (*ClusterTrainingRuntimeWrapper) Obj

func (*ClusterTrainingRuntimeWrapper) RuntimeSpec

type ConfigMapWrapper

type ConfigMapWrapper struct {
	corev1.ConfigMap
}

func MakeConfigMapWrapper

func MakeConfigMapWrapper(name, ns string) *ConfigMapWrapper

func (*ConfigMapWrapper) ControllerReference

func (c *ConfigMapWrapper) ControllerReference(gvk schema.GroupVersionKind, name, uid string) *ConfigMapWrapper

func (*ConfigMapWrapper) Obj

func (c *ConfigMapWrapper) Obj() *corev1.ConfigMap

func (*ConfigMapWrapper) WithData

func (c *ConfigMapWrapper) WithData(data map[string]string) *ConfigMapWrapper

type JobSetWrapper

type JobSetWrapper struct {
	jobsetv1alpha2.JobSet
}

func MakeJobSetWrapper

func MakeJobSetWrapper(namespace, name string) *JobSetWrapper

func (*JobSetWrapper) Affinity added in v2.1.0

func (j *JobSetWrapper) Affinity(rJobName string, affinity corev1.Affinity) *JobSetWrapper

func (*JobSetWrapper) Annotation

func (j *JobSetWrapper) Annotation(key, value string) *JobSetWrapper

func (*JobSetWrapper) Completions

func (j *JobSetWrapper) Completions(c int32, rJobNames ...string) *JobSetWrapper

func (*JobSetWrapper) Conditions

func (j *JobSetWrapper) Conditions(conditions ...metav1.Condition) *JobSetWrapper

func (*JobSetWrapper) Container

func (j *JobSetWrapper) Container(rJobName, containerName, image string, command []string, args []string, res corev1.ResourceList) *JobSetWrapper

func (*JobSetWrapper) ContainerTrainerPorts

func (j *JobSetWrapper) ContainerTrainerPorts(ports []corev1.ContainerPort) *JobSetWrapper

func (*JobSetWrapper) ControllerReference

func (j *JobSetWrapper) ControllerReference(gvk schema.GroupVersionKind, name, uid string) *JobSetWrapper

func (*JobSetWrapper) DependsOn

func (j *JobSetWrapper) DependsOn(rJobName string, dependsOn ...jobsetv1alpha2.DependsOn) *JobSetWrapper

func (*JobSetWrapper) Env

func (j *JobSetWrapper) Env(rJobName, containerName string, envs ...corev1.EnvVar) *JobSetWrapper

func (*JobSetWrapper) EnvFrom

func (j *JobSetWrapper) EnvFrom(rJobName, containerName string, envFrom ...corev1.EnvFromSource) *JobSetWrapper

func (*JobSetWrapper) ImagePullSecrets added in v2.1.0

func (j *JobSetWrapper) ImagePullSecrets(rJobName string, imagePullSecrets ...corev1.LocalObjectReference) *JobSetWrapper

func (*JobSetWrapper) InitContainer

func (j *JobSetWrapper) InitContainer(rJobName, containerName, image string, envs ...corev1.EnvVar) *JobSetWrapper

func (*JobSetWrapper) Label

func (j *JobSetWrapper) Label(key, value string) *JobSetWrapper

func (*JobSetWrapper) LauncherReplica

func (j *JobSetWrapper) LauncherReplica() *JobSetWrapper

func (*JobSetWrapper) NodeSelector

func (j *JobSetWrapper) NodeSelector(rJobName string, selector map[string]string) *JobSetWrapper

func (*JobSetWrapper) NumNodes

func (j *JobSetWrapper) NumNodes(numNodes int32) *JobSetWrapper

func (*JobSetWrapper) Obj

func (*JobSetWrapper) Parallelism

func (j *JobSetWrapper) Parallelism(p int32, rJobNames ...string) *JobSetWrapper

func (*JobSetWrapper) PodAnnotation added in v2.1.0

func (j *JobSetWrapper) PodAnnotation(key, value string) *JobSetWrapper

func (*JobSetWrapper) PodAnnotationForJobs added in v2.1.0

func (j *JobSetWrapper) PodAnnotationForJobs(key, value string, rJobNames ...string) *JobSetWrapper

func (*JobSetWrapper) PodLabel

func (j *JobSetWrapper) PodLabel(key, value string) *JobSetWrapper

func (*JobSetWrapper) PodLabelForJobs added in v2.1.0

func (j *JobSetWrapper) PodLabelForJobs(key, value string, rJobNames ...string) *JobSetWrapper

func (*JobSetWrapper) PodPriorityClassName added in v2.1.0

func (j *JobSetWrapper) PodPriorityClassName(value string) *JobSetWrapper

func (*JobSetWrapper) ReplaceContainer added in v2.1.0

func (j *JobSetWrapper) ReplaceContainer(rJobName, containerName, newContainerName, image string, command, args []string, res corev1.ResourceList) *JobSetWrapper

func (*JobSetWrapper) Replicas

func (j *JobSetWrapper) Replicas(replicas int32, rJobNames ...string) *JobSetWrapper

func (*JobSetWrapper) ReplicatedJobLabel

func (j *JobSetWrapper) ReplicatedJobLabel(key, value string, rJobNames ...string) *JobSetWrapper

func (*JobSetWrapper) ReplicatedJobsStatuses added in v2.1.0

func (j *JobSetWrapper) ReplicatedJobsStatuses(statuses []jobsetv1alpha2.ReplicatedJobStatus) *JobSetWrapper

func (*JobSetWrapper) SchedulingGates

func (j *JobSetWrapper) SchedulingGates(rJobName string, schedulingGates ...corev1.PodSchedulingGate) *JobSetWrapper

func (*JobSetWrapper) ServiceAccountName

func (j *JobSetWrapper) ServiceAccountName(rJobName string, serviceAccountName string) *JobSetWrapper

func (*JobSetWrapper) Suspend

func (j *JobSetWrapper) Suspend(suspend bool) *JobSetWrapper

func (*JobSetWrapper) Tolerations

func (j *JobSetWrapper) Tolerations(rJobName string, tolerations ...corev1.Toleration) *JobSetWrapper

func (*JobSetWrapper) VolumeMounts

func (j *JobSetWrapper) VolumeMounts(rJobName, containerName string, vms ...corev1.VolumeMount) *JobSetWrapper

func (*JobSetWrapper) Volumes

func (j *JobSetWrapper) Volumes(rJobName string, v ...corev1.Volume) *JobSetWrapper

type MLPolicySourceWrapper

type MLPolicySourceWrapper struct {
	trainer.MLPolicySource
}

func MakeMLPolicySourceWrapper

func MakeMLPolicySourceWrapper() *MLPolicySourceWrapper

func (*MLPolicySourceWrapper) MPIPolicy

func (m *MLPolicySourceWrapper) MPIPolicy(numProcPerNode *int32, MPImplementation trainer.MPIImplementation, sshAuthMountPath *string, runLauncherAsNode *bool) *MLPolicySourceWrapper

func (*MLPolicySourceWrapper) Obj

func (*MLPolicySourceWrapper) TorchPolicy

func (m *MLPolicySourceWrapper) TorchPolicy(numProcPerNode *intstr.IntOrString, elasticPolicy *trainer.TorchElasticPolicy) *MLPolicySourceWrapper

type MLPolicyWrapper

type MLPolicyWrapper struct {
	trainer.MLPolicy
}

func MakeMLPolicyWrapper

func MakeMLPolicyWrapper() *MLPolicyWrapper

func (*MLPolicyWrapper) Obj

func (m *MLPolicyWrapper) Obj() *trainer.MLPolicy

func (*MLPolicyWrapper) WithMLPolicySource

func (m *MLPolicyWrapper) WithMLPolicySource(source trainer.MLPolicySource) *MLPolicyWrapper

func (*MLPolicyWrapper) WithNumNodes

func (m *MLPolicyWrapper) WithNumNodes(numNodes int32) *MLPolicyWrapper

type SchedulerPluginsPodGroupWrapper

type SchedulerPluginsPodGroupWrapper struct {
	schedulerpluginsv1alpha1.PodGroup
}

func MakeSchedulerPluginsPodGroup

func MakeSchedulerPluginsPodGroup(namespace, name string) *SchedulerPluginsPodGroupWrapper

func (*SchedulerPluginsPodGroupWrapper) ControllerReference

func (*SchedulerPluginsPodGroupWrapper) MinMember

func (*SchedulerPluginsPodGroupWrapper) MinResources

func (*SchedulerPluginsPodGroupWrapper) Obj

func (*SchedulerPluginsPodGroupWrapper) SchedulingTimeout

type SecretWrapper

type SecretWrapper struct {
	corev1.Secret
}

func MakeSecretWrapper

func MakeSecretWrapper(name, ns string) *SecretWrapper

func (*SecretWrapper) ControllerReference

func (s *SecretWrapper) ControllerReference(gvk schema.GroupVersionKind, name, uid string) *SecretWrapper

func (*SecretWrapper) Obj

func (s *SecretWrapper) Obj() *corev1.Secret

func (*SecretWrapper) WithData

func (s *SecretWrapper) WithData(data map[string][]byte) *SecretWrapper

func (*SecretWrapper) WithImmutable

func (s *SecretWrapper) WithImmutable(immutable bool) *SecretWrapper

func (*SecretWrapper) WithType

func (s *SecretWrapper) WithType(t corev1.SecretType) *SecretWrapper

type TrainJobDatasetInitializerWrapper

type TrainJobDatasetInitializerWrapper struct {
	trainer.DatasetInitializer
}

func MakeTrainJobDatasetInitializerWrapper

func MakeTrainJobDatasetInitializerWrapper() *TrainJobDatasetInitializerWrapper

func (*TrainJobDatasetInitializerWrapper) Env

func (*TrainJobDatasetInitializerWrapper) Obj

func (*TrainJobDatasetInitializerWrapper) SecretRef

func (*TrainJobDatasetInitializerWrapper) StorageUri

type TrainJobInitializerWrapper

type TrainJobInitializerWrapper struct {
	trainer.Initializer
}

func MakeTrainJobInitializerWrapper

func MakeTrainJobInitializerWrapper() *TrainJobInitializerWrapper

func (*TrainJobInitializerWrapper) DatasetInitializer

func (t *TrainJobInitializerWrapper) DatasetInitializer(datasetInitializer *trainer.DatasetInitializer) *TrainJobInitializerWrapper

func (*TrainJobInitializerWrapper) ModelInitializer

func (t *TrainJobInitializerWrapper) ModelInitializer(modelInitializer *trainer.ModelInitializer) *TrainJobInitializerWrapper

func (*TrainJobInitializerWrapper) Obj

type TrainJobModelInitializerWrapper

type TrainJobModelInitializerWrapper struct {
	trainer.ModelInitializer
}

func MakeTrainJobModelInitializerWrapper

func MakeTrainJobModelInitializerWrapper() *TrainJobModelInitializerWrapper

func (*TrainJobModelInitializerWrapper) Env

func (*TrainJobModelInitializerWrapper) Obj

func (*TrainJobModelInitializerWrapper) SecretRef

func (*TrainJobModelInitializerWrapper) StorageUri

type TrainJobTrainerWrapper

type TrainJobTrainerWrapper struct {
	trainer.Trainer
}

func MakeTrainJobTrainerWrapper

func MakeTrainJobTrainerWrapper() *TrainJobTrainerWrapper

func (*TrainJobTrainerWrapper) Container

func (t *TrainJobTrainerWrapper) Container(image string, command []string, args []string, resRequests corev1.ResourceList) *TrainJobTrainerWrapper

func (*TrainJobTrainerWrapper) Env

func (*TrainJobTrainerWrapper) NumNodes

func (t *TrainJobTrainerWrapper) NumNodes(numNodes int32) *TrainJobTrainerWrapper

func (*TrainJobTrainerWrapper) NumProcPerNode

func (t *TrainJobTrainerWrapper) NumProcPerNode(numProcPerNode intstr.IntOrString) *TrainJobTrainerWrapper

func (*TrainJobTrainerWrapper) Obj

type TrainJobWrapper

type TrainJobWrapper struct {
	trainer.TrainJob
}

func MakeTrainJobWrapper

func MakeTrainJobWrapper(namespace, name string) *TrainJobWrapper

func (*TrainJobWrapper) Initializer

func (t *TrainJobWrapper) Initializer(initializer *trainer.Initializer) *TrainJobWrapper

func (*TrainJobWrapper) ManagedBy

func (t *TrainJobWrapper) ManagedBy(m string) *TrainJobWrapper

func (*TrainJobWrapper) Obj

func (t *TrainJobWrapper) Obj() *trainer.TrainJob

func (*TrainJobWrapper) PodTemplateOverrides added in v2.1.0

func (t *TrainJobWrapper) PodTemplateOverrides(podTemplateOverrides []trainer.PodTemplateOverride) *TrainJobWrapper

func (*TrainJobWrapper) RuntimeRef

func (t *TrainJobWrapper) RuntimeRef(gvk schema.GroupVersionKind, name string) *TrainJobWrapper

func (*TrainJobWrapper) SpecAnnotation

func (t *TrainJobWrapper) SpecAnnotation(key, value string) *TrainJobWrapper

func (*TrainJobWrapper) SpecLabel

func (t *TrainJobWrapper) SpecLabel(key, value string) *TrainJobWrapper

func (*TrainJobWrapper) Suspend

func (t *TrainJobWrapper) Suspend(suspend bool) *TrainJobWrapper

func (*TrainJobWrapper) Trainer

func (t *TrainJobWrapper) Trainer(trainer *trainer.Trainer) *TrainJobWrapper

func (*TrainJobWrapper) UID

func (t *TrainJobWrapper) UID(uid string) *TrainJobWrapper

type TrainingRuntimeSpecWrapper

type TrainingRuntimeSpecWrapper struct {
	trainer.TrainingRuntimeSpec
}

func (*TrainingRuntimeSpecWrapper) Container

func (s *TrainingRuntimeSpecWrapper) Container(rJobName, containerName, image string, command []string, args []string, res corev1.ResourceList) *TrainingRuntimeSpecWrapper

func (*TrainingRuntimeSpecWrapper) Env

func (s *TrainingRuntimeSpecWrapper) Env(rJobName, containerName string, envs ...corev1.EnvVar) *TrainingRuntimeSpecWrapper

func (*TrainingRuntimeSpecWrapper) InitContainer

func (s *TrainingRuntimeSpecWrapper) InitContainer(rJobName, containerName, image string, envs ...corev1.EnvVar) *TrainingRuntimeSpecWrapper

func (*TrainingRuntimeSpecWrapper) JobSetSpec

func (*TrainingRuntimeSpecWrapper) LauncherReplica

func (*TrainingRuntimeSpecWrapper) Obj

func (*TrainingRuntimeSpecWrapper) PodGroupPolicyCoscheduling

func (*TrainingRuntimeSpecWrapper) PodGroupPolicyCoschedulingSchedulingTimeout

func (s *TrainingRuntimeSpecWrapper) PodGroupPolicyCoschedulingSchedulingTimeout(timeout int32) *TrainingRuntimeSpecWrapper

func (*TrainingRuntimeSpecWrapper) Replicas

func (s *TrainingRuntimeSpecWrapper) Replicas(replicas int32, rJobNames ...string) *TrainingRuntimeSpecWrapper

func (*TrainingRuntimeSpecWrapper) WithMLPolicy

type TrainingRuntimeWrapper

type TrainingRuntimeWrapper struct {
	trainer.TrainingRuntime
}

func MakeTrainingRuntimeWrapper

func MakeTrainingRuntimeWrapper(namespace, name string) *TrainingRuntimeWrapper

func (*TrainingRuntimeWrapper) Annotation

func (r *TrainingRuntimeWrapper) Annotation(key, value string) *TrainingRuntimeWrapper

func (*TrainingRuntimeWrapper) DeletionTimestamp

func (r *TrainingRuntimeWrapper) DeletionTimestamp(t metav1.Time) *TrainingRuntimeWrapper

func (*TrainingRuntimeWrapper) Finalizers

func (*TrainingRuntimeWrapper) Label

func (*TrainingRuntimeWrapper) Obj

func (*TrainingRuntimeWrapper) RuntimeSpec

type VolcanoPodGroupWrapper added in v2.1.0

type VolcanoPodGroupWrapper struct {
	volcanov1beta1.PodGroup
}

func MakeVolcanoPodGroup added in v2.1.0

func MakeVolcanoPodGroup(namespace, name string) *VolcanoPodGroupWrapper

func (*VolcanoPodGroupWrapper) ControllerReference added in v2.1.0

func (p *VolcanoPodGroupWrapper) ControllerReference(gvk schema.GroupVersionKind, name, uid string) *VolcanoPodGroupWrapper

func (*VolcanoPodGroupWrapper) MinMember added in v2.1.0

func (p *VolcanoPodGroupWrapper) MinMember(members int32) *VolcanoPodGroupWrapper

func (*VolcanoPodGroupWrapper) MinResources added in v2.1.0

func (*VolcanoPodGroupWrapper) NetworkTopology added in v2.1.0

func (*VolcanoPodGroupWrapper) Obj added in v2.1.0

func (*VolcanoPodGroupWrapper) PriorityClassName added in v2.1.0

func (p *VolcanoPodGroupWrapper) PriorityClassName(pc string) *VolcanoPodGroupWrapper

func (*VolcanoPodGroupWrapper) Queue added in v2.1.0

Jump to

Keyboard shortcuts

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