v1

package
v0.0.0-...-5da5fe6 Latest Latest
Warning

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

Go to latest
Published: May 20, 2022 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Overview

Package v1 contains API Schema definitions for the training v1 API group +kubebuilder:object:generate=true +groupName=training.artway.ai

Index

Constants

View Source
const KIND = "TJob"

Variables

View Source
var (
	// GroupVersion is group version used to register these objects
	GroupVersion = schema.GroupVersion{Group: "training.artway.ai", Version: "v1"}

	// SchemeBuilder is used to add go types to the GroupVersionKind scheme
	SchemeBuilder = &scheme.Builder{GroupVersion: GroupVersion}

	// AddToScheme adds the types in this group-version to the given scheme.
	AddToScheme = SchemeBuilder.AddToScheme
)

Functions

This section is empty.

Types

type CleanPolicy

type CleanPolicy string
const (
	// CleanAlways policy will always clean pods
	CleanAlways CleanPolicy = "Always"
	// CleanNever policy will nerver clean pods
	CleanNever CleanPolicy = "Never"
	// CleanOnFailure policy will clean pods only on job failed
	CleanOnFailure CleanPolicy = "OnFailure"
	// CleanOnCompletion policy will clean pods only on job completed
	CleanOnCompletion CleanPolicy = "OnCompletion"
)

type Intranet

type Intranet string
const (
	Default     Intranet = "Default"
	PodIP       Intranet = "PodIP"
	Service     Intranet = "Service"
	HostNetwork Intranet = "HostNetwork"
)

type JobPhase

type JobPhase string
const (
	Starting    JobPhase = "Starting"
	Pending     JobPhase = "Pending"
	Scaling     JobPhase = "Scaling"
	Aborting    JobPhase = "Aborting"
	Aborted     JobPhase = "Aborted"
	Running     JobPhase = "Running"
	Restarting  JobPhase = "Restarting"
	Completing  JobPhase = "Completing"
	Completed   JobPhase = "Completed"
	Terminating JobPhase = "Terminating"
	Terminated  JobPhase = "Terminated"
	Failed      JobPhase = "Failed"
	Succeed     JobPhase = "Succeed"
	Unknown     JobPhase = "Unknown"
)

type StartPolicy

type StartPolicy string
const (
	StartImmediately    StartPolicy = "Immediately"
	StartAfterRunning   StartPolicy = "AfterRunning"
	StartAfterSucceeded StartPolicy = "AfterSucceeded"
)

type TJob

type TJob struct {
	metav1.TypeMeta   `json:",inline"`
	metav1.ObjectMeta `json:"metadata,omitempty"`

	Spec   TJobSpec   `json:"spec,omitempty"`
	Status TJobStatus `json:"status,omitempty"`
}

TJob is the Schema for the tjobs API

func (*TJob) DeepCopy

func (in *TJob) DeepCopy() *TJob

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

func (*TJob) DeepCopyInto

func (in *TJob) DeepCopyInto(out *TJob)

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

func (*TJob) DeepCopyObject

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

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

type TJobList

type TJobList struct {
	metav1.TypeMeta `json:",inline"`
	metav1.ListMeta `json:"metadata,omitempty"`
	Items           []TJob `json:"items"`
}

TJobList contains a list of TJob

func (*TJobList) DeepCopy

func (in *TJobList) DeepCopy() *TJobList

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

func (*TJobList) DeepCopyInto

func (in *TJobList) DeepCopyInto(out *TJobList)

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

func (*TJobList) DeepCopyObject

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

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

type TJobSpec

type TJobSpec struct {

	// CleanPodPolicy defines whether to clean pod after job finished, default Never
	// +optional
	CleanPodPolicy CleanPolicy `json:"cleanPodPolicy,omitempty"`

	// Intranet defines the communication mode inter pods : PodIP, Service or Host
	// +optional
	Intranet Intranet `json:"intranet,omitempty"`

	// Elastic indicates the elastic level
	// +optional
	Elastic *int32 `json:"elastic,omitempty"`

	// Tasks defines the resources in list, the order determinate the running order
	Tasks []*TaskSpec `json:"tasks,omitempty"`

	// Framework defines the framework of the job
	// +optional
	Framework *string `json:"framework,omitempty"`

	// StartPolicy indicates how the tasks in the list start depend on previous status
	// +optional
	StartPolicy *StartPolicy `json:"startPolicy,omitempty"`
}

TJobSpec defines the desired state of TJob

func (*TJobSpec) DeepCopy

func (in *TJobSpec) DeepCopy() *TJobSpec

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

func (*TJobSpec) DeepCopyInto

func (in *TJobSpec) DeepCopyInto(out *TJobSpec)

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

type TJobStatus

type TJobStatus struct {

	// The latest available observations of an object's current state.
	Conditions []batchv1.JobCondition `json:"conditions,omitempty"`

	// The phase of TJob.
	Phase JobPhase `json:"phase,omitempty"`

	// ResourceStatues of tasks
	Tasks map[string]*TaskStatus `json:"tasks,omitempty"`

	// StartTime indicate when the job started
	StartTime *metav1.Time `json:"startTime,omitempty"`

	// CompletionTime indicate when the job completed/failed
	CompletionTime *metav1.Time `json:"completionTime,omitempty"`

	ObservedGeneration int `json:"observedGeneration,omitempty"`
}

TJobStatus defines the observed state of TJob

func (*TJobStatus) DeepCopy

func (in *TJobStatus) DeepCopy() *TJobStatus

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

func (*TJobStatus) DeepCopyInto

func (in *TJobStatus) DeepCopyInto(out *TJobStatus)

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

type TaskSpec

type TaskSpec struct {
	// Replicas replica
	Replicas int `json:"replicas"`

	// Requests set the minimal replicas of server to be run
	Requests *int `json:"requests,omitempty"`

	// Requests set the maximal replicas of server to be run
	Limits *int `json:"limits,omitempty"`

	// Template specifies the podspec of a server
	Template corev1.PodTemplateSpec `json:"template,omitempty"`

	// Name name the resource, validated by
	Name string `json:"name"`
}

func (*TaskSpec) DeepCopy

func (in *TaskSpec) DeepCopy() *TaskSpec

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

func (*TaskSpec) DeepCopyInto

func (in *TaskSpec) DeepCopyInto(out *TaskSpec)

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

type TaskStatus

type TaskStatus struct {
	// Pending
	Pending int `json:"pending,omitempty"`
	// Starting
	Starting int `json:"starting,omitempty"`
	// Running
	Running int `json:"running,omitempty"`
	// Failed
	Failed int `json:"failed,omitempty"`
	// Success
	Succeeded int `json:"succeeded,omitempty"`
	// Unknown
	Unknown int `json:"unknown,omitempty"`
	// A list of pointer to pods
	Refs []corev1.ObjectReference `json:"refs,omitempty"`
}

func (*TaskStatus) DeepCopy

func (in *TaskStatus) DeepCopy() *TaskStatus

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

func (*TaskStatus) DeepCopyInto

func (in *TaskStatus) DeepCopyInto(out *TaskStatus)

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