v1

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Dec 5, 2022 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Overview

Package v1 is the v1 version of the API. +groupName=training.kubedl.io

Index

Constants

View Source
const (

	// DefaultPortName is name of the port used to communicate between workers.
	DefaultPortName = "job-port"
	// DefaultContainerName is the name of the TestJob container.
	DefaultContainerName = "test-container"
	// DefaultPort is default value of the port.
	DefaultPort = 2222
	// DefaultRestartPolicy is default RestartPolicy for TFReplicaSpec.
	DefaultRestartPolicy = apiv1.RestartPolicyNever
)
View Source
const (
	// GroupName is the group name use in this package.
	GroupName = "kubedl.io"
	// Kind is the kind name.
	Kind = "TestJob"
	// GroupVersion is the version.
	GroupVersion = "v1"
	// Plural is the Plural for TestJob.
	Plural = "testjobs"
	// Singular is the singular for TestJob.
	Singular = "testjob"
	// TESTCRD is the CRD name for TestJob.
	TESTCRD = "testjobs.kubedl.io"
)
View Source
const (
	TestReplicaTypeWorker apiv1.ReplicaType = "Worker"
	TestReplicaTypeMaster apiv1.ReplicaType = "Master"
)

Variables

View Source
var (
	// TODO: move SchemeBuilder with zz_generated.deepcopy.go to k8s.io/api.
	// localSchemeBuilder and AddToScheme will stay in k8s.io/kubernetes.
	SchemeBuilder runtime.SchemeBuilder

	AddToScheme = localSchemeBuilder.AddToScheme
)
View Source
var (
	// SchemeGroupVersion is the group version used to register these objects.
	SchemeGroupVersion = schema.GroupVersion{Group: GroupName, Version: GroupVersion}
	// SchemeGroupVersionKind is the GroupVersionKind of the resource.
	SchemeGroupVersionKind = SchemeGroupVersion.WithKind(Kind)
)

Functions

func Int32

func Int32(v int32) *int32

Int32 is a helper routine that allocates a new int32 value to store v and returns a pointer to it.

func RegisterDefaults

func RegisterDefaults(scheme *runtime.Scheme) error

RegisterDefaults adds defaulters functions to the given scheme. Public to allow building arbitrary schemes. All generated defaulters are covering - they call all nested defaulters.

func Resource

func Resource(resource string) schema.GroupResource

Resource takes an unqualified resource and returns a Group-qualified GroupResource.

func SetDefaults_TestJob

func SetDefaults_TestJob(testjob *TestJob)

SetDefaults_TestJob sets any unspecified values to defaults.

func SetObjectDefaults_TestJob

func SetObjectDefaults_TestJob(in *TestJob)

func SetObjectDefaults_TestJobList

func SetObjectDefaults_TestJobList(in *TestJobList)

Types

type TestJob

type TestJob struct {
	metav1.TypeMeta `json:",inline"`

	// Standard object's metadata.
	metav1.ObjectMeta `json:"metadata,omitempty"`

	// Specification of the desired behavior of the TestJob.
	Spec TestJobSpec `json:"spec,omitempty"`

	// Most recently observed status of the TestJob.
	// This data may not be up to date.
	// Populated by the system.
	// Read-only.
	Status apiv1.JobStatus `json:"status,omitempty"`
}

A generic job used for unit tests.

func (*TestJob) DeepCopy

func (in *TestJob) DeepCopy() *TestJob

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TestJob.

func (*TestJob) DeepCopyInto

func (in *TestJob) DeepCopyInto(out *TestJob)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*TestJob) DeepCopyObject

func (in *TestJob) DeepCopyObject() runtime.Object

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.

func (*TestJob) GetObjectKind added in v0.4.0

func (in *TestJob) GetObjectKind() schema.ObjectKind

type TestJobController

type TestJobController struct {
	Job      *TestJob
	Pods     []*corev1.Pod
	Services []*corev1.Service
	runtime.EmptyScaleImpl
}

func (TestJobController) ControllerName

func (TestJobController) ControllerName() string

func (*TestJobController) CreatePod

func (t *TestJobController) CreatePod(job interface{}, pod *corev1.Pod) error

func (*TestJobController) CreateService

func (t *TestJobController) CreateService(job interface{}, service *corev1.Service) error

func (*TestJobController) DeepCopy

func (in *TestJobController) DeepCopy() *TestJobController

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TestJobController.

func (*TestJobController) DeepCopyInto

func (in *TestJobController) DeepCopyInto(out *TestJobController)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*TestJobController) DeleteJob

func (t *TestJobController) DeleteJob(job interface{}) error

func (*TestJobController) DeletePod

func (t *TestJobController) DeletePod(job interface{}, pod *corev1.Pod) error

func (*TestJobController) DeleteService

func (t *TestJobController) DeleteService(job interface{}, name string, namespace string) error

func (TestJobController) GetAPIGroupVersion

func (TestJobController) GetAPIGroupVersion() schema.GroupVersion

func (TestJobController) GetAPIGroupVersionKind

func (TestJobController) GetAPIGroupVersionKind() schema.GroupVersionKind

func (*TestJobController) GetDefaultContainerName

func (t *TestJobController) GetDefaultContainerName() string

func (TestJobController) GetDefaultContainerPortName

func (TestJobController) GetDefaultContainerPortName() string

func (TestJobController) GetDefaultContainerPortNumber

func (TestJobController) GetDefaultContainerPortNumber() int32

func (TestJobController) GetGroupNameLabelValue

func (TestJobController) GetGroupNameLabelValue() string

func (*TestJobController) GetJobFromAPIClient

func (t *TestJobController) GetJobFromAPIClient(namespace, name string) (v1.Object, error)

func (*TestJobController) GetJobFromInformerCache

func (t *TestJobController) GetJobFromInformerCache(namespace, name string) (v1.Object, error)

func (TestJobController) GetJobRoleKey

func (TestJobController) GetJobRoleKey() string

func (*TestJobController) GetNodeForModelOutput added in v0.4.0

func (in *TestJobController) GetNodeForModelOutput(pods []*corev1.Pod) (nodeName string)

func (TestJobController) GetPodsForJob

func (t TestJobController) GetPodsForJob(job interface{}) ([]*corev1.Pod, error)

func (TestJobController) GetReconcileOrders

func (t TestJobController) GetReconcileOrders() []apiv1.ReplicaType

func (TestJobController) GetServicesForJob

func (t TestJobController) GetServicesForJob(job interface{}) ([]*corev1.Service, error)

func (*TestJobController) IsMasterRole

func (t *TestJobController) IsMasterRole(replicas map[apiv1.ReplicaType]*apiv1.ReplicaSpec, rtype apiv1.ReplicaType, index int) bool

func (*TestJobController) SetClusterSpec

func (t *TestJobController) SetClusterSpec(ctx context.Context, job interface{}, podTemplate *corev1.PodTemplateSpec, rtype, index string) error

func (*TestJobController) UpdateJobStatus

func (t *TestJobController) UpdateJobStatus(job interface{}, replicas map[apiv1.ReplicaType]*apiv1.ReplicaSpec,
	jobStatus *apiv1.JobStatus, restart bool) error

func (*TestJobController) UpdateJobStatusInApiServer

func (t *TestJobController) UpdateJobStatusInApiServer(job interface{}, jobStatus *apiv1.JobStatus) error

type TestJobList

type TestJobList struct {
	metav1.TypeMeta `json:",inline"`

	// Standard list metadata.
	metav1.ListMeta `json:"metadata,omitempty"`

	// List of TestJobs.
	Items []TestJob `json:"items"`
}

TestJobList is a list of TestJobs.

func (*TestJobList) DeepCopy

func (in *TestJobList) DeepCopy() *TestJobList

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TestJobList.

func (*TestJobList) DeepCopyInto

func (in *TestJobList) DeepCopyInto(out *TestJobList)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*TestJobList) DeepCopyObject

func (in *TestJobList) DeepCopyObject() runtime.Object

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.

type TestJobSpec

type TestJobSpec struct {
	RunPolicy        *apiv1.RunPolicy                         `json:"runPolicy,omitempty"`
	TestReplicaSpecs map[apiv1.ReplicaType]*apiv1.ReplicaSpec `json:"testReplicaSpecs"`
}

TestJobSpec is a desired state description of the TestJob.

func (*TestJobSpec) DeepCopy

func (in *TestJobSpec) DeepCopy() *TestJobSpec

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TestJobSpec.

func (*TestJobSpec) DeepCopyInto

func (in *TestJobSpec) DeepCopyInto(out *TestJobSpec)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

Jump to

Keyboard shortcuts

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