v1

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Jul 9, 2020 License: Apache-2.0, Apache-2.0 Imports: 8 Imported by: 0

Documentation

Overview

Package v1 is the v1 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 = common.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 = "v1"
	// Plural is the Plural for pytorchJob.
	Plural = "pytorchjobs"
	// Singular is the singular for pytorchJob.
	Singular = "pytorchjob"
	// PytorchCRD is the CRD name for PytorchJob.
	PytorchCRD = "pytorchjobs.kubeflow.org"
)

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 PyTorchJob

type PyTorchJob struct {
	// Standard Kubernetes type metadata.
	metav1.TypeMeta `json:",inline"`

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

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

	// Most recently observed status of the PyTorchJob.
	// Read-only (modified by the system).
	Status common.JobStatus `json:"status,omitempty"`
}

Represents a PyTorchJob resource.

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 PyTorchJobList

type PyTorchJobList struct {
	// Standard type metadata.
	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 {
	// Specifies the duration (in seconds) since startTime during which the job can remain active
	// before it is terminated. Must be a positive integer.
	// This setting applies only to pods where restartPolicy is OnFailure or Always.
	// +optional
	ActiveDeadlineSeconds *int64 `json:"activeDeadlineSeconds,omitempty"`

	// Number of retries before marking this job as failed.
	// +optional
	BackoffLimit *int32 `json:"backoffLimit,omitempty"`

	// Defines the policy for cleaning up pods after the PyTorchJob completes.
	// Defaults to None.
	CleanPodPolicy *common.CleanPodPolicy `json:"cleanPodPolicy,omitempty"`

	// Defines the TTL for cleaning up finished PyTorchJobs (temporary
	// before Kubernetes adds the cleanup controller).
	// It may take extra ReconcilePeriod seconds for the cleanup, since
	// reconcile gets called periodically.
	// Defaults to infinite.
	TTLSecondsAfterFinished *int32 `json:"ttlSecondsAfterFinished,omitempty"`

	// A map of PyTorchReplicaType (type) to ReplicaSpec (value). Specifies the PyTorch cluster configuration.
	// For example,
	//   {
	//     "Master": PyTorchReplicaSpec,
	//     "Worker": PyTorchReplicaSpec,
	//   }
	PyTorchReplicaSpecs map[PyTorchReplicaType]*common.ReplicaSpec `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 PyTorchReplicaType

type PyTorchReplicaType common.ReplicaType

PyTorchReplicaType is the type for PyTorchReplica. Can be one of "Master" or "Worker".

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"
)

Jump to

Keyboard shortcuts

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