v1alpha2

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Jan 3, 2019 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Overview

Package v1alpha2 is the v1alpha2 version of the API. +groupName=kubeflow.org

Index

Constants

View Source
const (
	// EnvKubeflowNamespace is ENV for kubeflow namespace specified by user.
	EnvKubeflowNamespace = "KUBEFLOW_NAMESPACE"

	// DefaultPortName is name of the port used to communicate between Master and
	// workers.
	DefaultPortName = "pytorchjob-port"
	// DefaultContainerName is the name of the PyTorchJob container.
	DefaultContainerName = "pytorch"
	// DefaultPort is default value of the port.
	DefaultPort = 23456
	// DefaultRestartPolicy is default RestartPolicy for PyTorchReplicaSpec.
	DefaultRestartPolicy = RestartPolicyOnFailure
)
View Source
const (
	// GroupName is the group name use in this package.
	GroupName = "kubeflow.org"
	// Kind is the kind name.
	Kind = "PyTorchJob"
	// GroupVersion is the version.
	GroupVersion = "v1alpha2"
	// Plural is the Plural for pytorchJob.
	Plural = "pytorchjobs"
	// Singular is the singular for pytorchJob.
	Singular = "pytorchjob"
)

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_PyTorchJob

func SetDefaults_PyTorchJob(job *PyTorchJob)

SetDefaults_PyTorchJob sets any unspecified values to defaults.

func SetObjectDefaults_PyTorchJob

func SetObjectDefaults_PyTorchJob(in *PyTorchJob)

func SetObjectDefaults_PyTorchJobList

func SetObjectDefaults_PyTorchJobList(in *PyTorchJobList)

Types

type CleanPodPolicy

type CleanPodPolicy string

CleanPodPolicy describes how to deal with pods when the PyTorchJob is finished.

const (
	CleanPodPolicyUndefined CleanPodPolicy = ""
	CleanPodPolicyAll       CleanPodPolicy = "All"
	CleanPodPolicyNone      CleanPodPolicy = "None"
)

type PyTorchJob

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

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

	// Specification of the desired behavior of the PyTorchJob.
	Spec PyTorchJobSpec `json:"spec,omitempty"`

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

PyTorchJob represents the configuration of PyTorchJob

func (*PyTorchJob) DeepCopy

func (in *PyTorchJob) DeepCopy() *PyTorchJob

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

func (*PyTorchJob) DeepCopyInto

func (in *PyTorchJob) DeepCopyInto(out *PyTorchJob)

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

func (*PyTorchJob) DeepCopyObject

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

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

type PyTorchJobCondition

type PyTorchJobCondition struct {
	// Type of PyTorchJob condition.
	Type PyTorchJobConditionType `json:"type"`
	// Status of the condition, one of True, False, Unknown.
	Status v1.ConditionStatus `json:"status"`
	// The reason for the condition's last transition.
	Reason string `json:"reason,omitempty"`
	// A human readable message indicating details about the transition.
	Message string `json:"message,omitempty"`
	// The last time this condition was updated.
	LastUpdateTime metav1.Time `json:"lastUpdateTime,omitempty"`
	// Last time the condition transitioned from one status to another.
	LastTransitionTime metav1.Time `json:"lastTransitionTime,omitempty"`
}

PyTorchJobCondition describes the state of the PyTorchJob at a certain point.

func (*PyTorchJobCondition) DeepCopy

func (in *PyTorchJobCondition) DeepCopy() *PyTorchJobCondition

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

func (*PyTorchJobCondition) DeepCopyInto

func (in *PyTorchJobCondition) DeepCopyInto(out *PyTorchJobCondition)

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

type PyTorchJobConditionType

type PyTorchJobConditionType string

PyTorchJobConditionType defines all kinds of types of PyTorchJobStatus.

const (
	// PyTorchJobCreated means the pytorchjob has been accepted by the system,
	// but one or more of the pods/services has not been started.
	// This includes time before pods being scheduled and launched.
	PyTorchJobCreated PyTorchJobConditionType = "Created"

	// PyTorchJobRunning means all sub-resources (e.g. services/pods) of this PyTorchJob
	// have been successfully scheduled and launched.
	// The training is running without error.
	PyTorchJobRunning PyTorchJobConditionType = "Running"

	// PyTorchJobRestarting means one or more sub-resources (e.g. services/pods) of this PyTorchJob
	// reached phase failed but maybe restarted according to it's restart policy
	// which specified by user in v1.PodTemplateSpec.
	// The training is freezing/pending.
	PyTorchJobRestarting PyTorchJobConditionType = "Restarting"

	// PyTorchJobSucceeded means all sub-resources (e.g. services/pods) of this PyTorchJob
	// reached phase have terminated in success.
	// The training is complete without error.
	PyTorchJobSucceeded PyTorchJobConditionType = "Succeeded"

	// PyTorchJobFailed means one or more sub-resources (e.g. services/pods) of this PyTorchJob
	// reached phase failed with no restarting.
	// The training has failed its execution.
	PyTorchJobFailed PyTorchJobConditionType = "Failed"
)

type PyTorchJobList

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

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

	// List of PyTorchJobs.
	Items []PyTorchJob `json:"items"`
}

PyTorchJobList is a list of PyTorchJobs.

func (*PyTorchJobList) DeepCopy

func (in *PyTorchJobList) DeepCopy() *PyTorchJobList

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

func (*PyTorchJobList) DeepCopyInto

func (in *PyTorchJobList) DeepCopyInto(out *PyTorchJobList)

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

func (*PyTorchJobList) DeepCopyObject

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

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

type PyTorchJobSpec

type PyTorchJobSpec struct {
	// CleanPodPolicy defines the policy to kill pods after PyTorchJob is
	// succeeded.
	// Default to Running.
	CleanPodPolicy *CleanPodPolicy `json:"cleanPodPolicy,omitempty"`

	// TTLSecondsAfterFinished is the TTL to clean up pytorch-jobs (temporary
	// before kubernetes adds the cleanup controller).
	// It may take extra ReconcilePeriod seconds for the cleanup, since
	// reconcile gets called periodically.
	// Default to infinite.
	TTLSecondsAfterFinished *int32 `json:"ttlSecondsAfterFinished,omitempty"`

	// PyTorchReplicaSpecs is map of PyTorchReplicaType and PyTorchReplicaSpec
	// specifies the PyTorch replicas to run.
	// For example,
	//   {
	//     "Master": PyTorchReplicaSpec,
	//     "Worker": PyTorchReplicaSpec,
	//   }
	PyTorchReplicaSpecs map[PyTorchReplicaType]*PyTorchReplicaSpec `json:"pytorchReplicaSpecs"`
}

PyTorchJobSpec is a desired state description of the PyTorchJob.

func (*PyTorchJobSpec) DeepCopy

func (in *PyTorchJobSpec) DeepCopy() *PyTorchJobSpec

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

func (*PyTorchJobSpec) DeepCopyInto

func (in *PyTorchJobSpec) DeepCopyInto(out *PyTorchJobSpec)

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

type PyTorchJobStatus

type PyTorchJobStatus struct {
	// Conditions is an array of current observed PyTorchJob conditions.
	Conditions []PyTorchJobCondition `json:"conditions"`

	// PyTorchReplicaStatuses is map of PyTorchReplicaType and PyTorchReplicaStatus,
	// specifies the status of each PyTorchReplica.
	PyTorchReplicaStatuses map[PyTorchReplicaType]*PyTorchReplicaStatus `json:"pytorchReplicaStatuses"`

	// Represents time when the PyTorchJob was acknowledged by the PyTorchJob controller.
	// It is not guaranteed to be set in happens-before order across separate operations.
	// It is represented in RFC3339 form and is in UTC.
	StartTime *metav1.Time `json:"startTime,omitempty"`

	// Represents time when the PyTorchJob was completed. It is not guaranteed to
	// be set in happens-before order across separate operations.
	// It is represented in RFC3339 form and is in UTC.
	CompletionTime *metav1.Time `json:"completionTime,omitempty"`

	// Represents last time when the PyTorchJob was reconciled. It is not guaranteed to
	// be set in happens-before order across separate operations.
	// It is represented in RFC3339 form and is in UTC.
	LastReconcileTime *metav1.Time `json:"lastReconcileTime,omitempty"`
}

PyTorchJobStatus represents the current observed state of the PyTorchJob.

func (*PyTorchJobStatus) DeepCopy

func (in *PyTorchJobStatus) DeepCopy() *PyTorchJobStatus

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

func (*PyTorchJobStatus) DeepCopyInto

func (in *PyTorchJobStatus) DeepCopyInto(out *PyTorchJobStatus)

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

type PyTorchReplicaSpec

type PyTorchReplicaSpec struct {
	// Replicas is the desired number of replicas of the given template.
	// If unspecified, defaults to 1.
	Replicas *int32 `json:"replicas,omitempty"`

	// Template is the object that describes the pod that
	// will be created for this PyTorchReplica. RestartPolicy in PodTemplateSpec
	// will be overide by RestartPolicy in PyTorchReplicaSpec
	Template v1.PodTemplateSpec `json:"template,omitempty"`

	// Restart policy for all PyTorchReplicas within the PyTorchJob.
	// One of Always, OnFailure, Never and ExitCode.
	// Default to Never.
	RestartPolicy RestartPolicy `json:"restartPolicy,omitempty"`
}

PyTorchReplicaSpec is a description of the PyTorchReplica

func (*PyTorchReplicaSpec) DeepCopy

func (in *PyTorchReplicaSpec) DeepCopy() *PyTorchReplicaSpec

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

func (*PyTorchReplicaSpec) DeepCopyInto

func (in *PyTorchReplicaSpec) DeepCopyInto(out *PyTorchReplicaSpec)

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

type PyTorchReplicaStatus

type PyTorchReplicaStatus struct {
	// The number of actively running pods.
	Active int32 `json:"active,omitempty"`

	// The number of pods which reached phase Succeeded.
	Succeeded int32 `json:"succeeded,omitempty"`

	// The number of pods which reached phase Failed.
	Failed int32 `json:"failed,omitempty"`
}

PyTorchReplicaStatus represents the current observed state of the PyTorchReplica.

func (*PyTorchReplicaStatus) DeepCopy

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

func (*PyTorchReplicaStatus) DeepCopyInto

func (in *PyTorchReplicaStatus) DeepCopyInto(out *PyTorchReplicaStatus)

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

type PyTorchReplicaType

type PyTorchReplicaType string

PyTorchReplicaType is the type for PyTorchReplica.

const (
	// PyTorchReplicaTypeMaster is the type of Master of distributed PyTorch
	PyTorchReplicaTypeMaster PyTorchReplicaType = "Master"

	// PyTorchReplicaTypeWorker is the type for workers of distributed PyTorch.
	PyTorchReplicaTypeWorker PyTorchReplicaType = "Worker"
)

type RestartPolicy

type RestartPolicy string

RestartPolicy describes how the PyTorchReplicas should be restarted. Only one of the following restart policies may be specified. If none of the following policies is specified, the default one is RestartPolicyAlways.

const (
	RestartPolicyAlways    RestartPolicy = "Always"
	RestartPolicyOnFailure RestartPolicy = "OnFailure"
	RestartPolicyNever     RestartPolicy = "Never"

	// `ExitCode` policy means that user should add exit code by themselves,
	// `pytorch-operator` will check these exit codes to
	// determine the behavior when an error occurs:
	// - 1-127: permanent error, do not restart.
	// - 128-255: retryable error, will restart the pod.
	RestartPolicyExitCode RestartPolicy = "ExitCode"
)

Jump to

Keyboard shortcuts

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