Documentation
¶
Index ¶
- Constants
- Variables
- func CheckCondition(mxJob *mxv1.MXJob, condition commonv1.JobConditionType, reason string) bool
- func ConvertMXJobToUnstructured(mxJob *mxv1.MXJob) (*unstructured.Unstructured, error)
- func GenLabels(jobName string) map[string]string
- func GenOwnerReference(mxjob *mxv1.MXJob) *metav1.OwnerReference
- func GetKey(mxJob *mxv1.MXJob, t *testing.T) string
- func NewBasePod(name string, mxJob *mxv1.MXJob, t *testing.T) *v1.Pod
- func NewBaseService(name string, mxJob *mxv1.MXJob, t *testing.T) *v1.Service
- func NewMXJob(worker, server int) *mxv1.MXJob
- func NewMXJobWithActiveDeadlineSeconds(scheduler, worker, ps int, ads *int64) *mxv1.MXJob
- func NewMXJobWithBackoffLimit(scheduler, worker, ps int, backoffLimit *int32) *mxv1.MXJob
- func NewMXJobWithCleanPolicy(scheduler, worker, server int, policy commonv1.CleanPodPolicy) *mxv1.MXJob
- func NewMXJobWithCleanupJobDelay(scheduler, worker, server int, ttl *int32) *mxv1.MXJob
- func NewMXJobWithScheduler(worker, server int) *mxv1.MXJob
- func NewMXReplicaSpecTemplate() v1.PodTemplateSpec
- func NewPod(mxJob *mxv1.MXJob, typ string, index int, t *testing.T) *v1.Pod
- func NewPodList(count int32, status v1.PodPhase, mxJob *mxv1.MXJob, typ string, start int32, ...) []*v1.Pod
- func NewService(mxJob *mxv1.MXJob, typ string, index int, t *testing.T) *v1.Service
- func NewServiceList(count int32, mxJob *mxv1.MXJob, typ string, t *testing.T) []*v1.Service
- func SetMXJobCompletionTime(mxJob *mxv1.MXJob)
- func SetPodsStatuses(podIndexer cache.Indexer, mxJob *mxv1.MXJob, typ string, ...)
- func SetServices(serviceIndexer cache.Indexer, mxJob *mxv1.MXJob, typ string, ...)
Constants ¶
View Source
const ( TestImageName = "mxjob/mxnet-operator:v1" TestMXJobName = "test-mxjob" LabelScheduler = "scheduler" LabelWorker = "worker" LabelServer = "server" SleepInterval = 500 * time.Millisecond ThreadCount = 1 )
View Source
const ( LabelGroupName = "group-name" LabelMXJobName = "mxnet-job-name" )
Variables ¶
View Source
var ( // KeyFunc is the short name to DeletionHandlingMetaNamespaceKeyFunc. // IndexerInformer uses a delta queue, therefore for deletes we have to use this // key function but it should be just fine for non delete events. KeyFunc = cache.DeletionHandlingMetaNamespaceKeyFunc GroupName = mxv1.GroupName )
View Source
var (
AlwaysReady = func() bool { return true }
)
Functions ¶
func CheckCondition ¶
func ConvertMXJobToUnstructured ¶
func ConvertMXJobToUnstructured(mxJob *mxv1.MXJob) (*unstructured.Unstructured, error)
ConvertMXJobToUnstructured uses JSON to convert MXJob to Unstructured.
func GenOwnerReference ¶
func GenOwnerReference(mxjob *mxv1.MXJob) *metav1.OwnerReference
func NewMXJobWithCleanPolicy ¶
func NewMXJobWithCleanPolicy(scheduler, worker, server int, policy commonv1.CleanPodPolicy) *mxv1.MXJob
func NewMXJobWithScheduler ¶
func NewMXReplicaSpecTemplate ¶
func NewMXReplicaSpecTemplate() v1.PodTemplateSpec
func NewPodList ¶
func NewPodList(count int32, status v1.PodPhase, mxJob *mxv1.MXJob, typ string, start int32, t *testing.T) []*v1.Pod
create count pods with the given phase for the given mxJob
func NewService ¶
func NewServiceList ¶
NewServiceList creates count pods with the given phase for the given mxJob
func SetMXJobCompletionTime ¶
func SetPodsStatuses ¶
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.