v1

package
v0.2.0 Latest Latest
Warning

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

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

Documentation

Overview

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

Index

Constants

View Source
const (
	// DefaultRestartPolicy is default RestartPolicy for ReplicaSpec.
	DefaultRestartPolicy  = v1.RestartPolicyNever
	DefaultCleanPodPolicy = v1.CleanPodPolicyRunning

	DefaultContainerName = "mpi"
	DefaultPortName      = "mpi-port"
	DefaultPort          = 2222
)
View Source
const (
	// GroupName is the group name use in this package.
	GroupName = "kubeflow.org"
	// Kind is the kind name.
	Kind = "MPIJob"
	// GroupVersion is the version.
	GroupVersion = "v1"
)
View Source
const (
	// MPIReplicaTypeLauncher is the type for launcher replica.
	MPIReplicaTypeLauncher apiv1.ReplicaType = "Launcher"

	// MPIReplicaTypeWorker is the type for worker replicas.
	MPIReplicaTypeWorker apiv1.ReplicaType = "Worker"
)

Variables

View Source
var (
	SchemeBuilder          = runtime.NewSchemeBuilder(addKnownTypes, addDefaultingFuncs)
	AddToScheme            = SchemeBuilder.AddToScheme
	SchemeGroupVersion     = schema.GroupVersion{Group: GroupName, Version: GroupVersion}
	SchemeGroupVersionKind = schema.GroupVersionKind{Group: GroupName, Version: GroupVersion, Kind: 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_MPIJob

func SetDefaults_MPIJob(mpiJob *MPIJob)

func SetObjectDefaults_MPIJob

func SetObjectDefaults_MPIJob(in *MPIJob)

func SetObjectDefaults_MPIJobList

func SetObjectDefaults_MPIJobList(in *MPIJobList)

Types

type LegacyV1Alpha1

type LegacyV1Alpha1 struct {
	// Deprecated. Specifies the desired number of DeprecatedGPUs the MPIJob should run on.
	// Mutually exclusive with the `Replicas` field.
	// Note that this is deprecated in favor of `ProcessingUnits` field.
	// +optional
	DeprecatedGPUs *int32 `json:"gpus,omitempty"`

	// The maximum number of GPUs available per node.
	// Note that this will be ignored if the GPU resources are explicitly
	// specified in the MPIJob pod spec.
	// This is deprecated in favor of `ProcessingUnitsPerNode` field.
	GPUsPerNode *int32 `json:"gpusPerNode,omitempty"`

	// Specifies the desired number of processing units the MPIJob should run on.
	// Mutually exclusive with the `Replicas` field.
	// +optional
	ProcessingUnits *int32 `json:"processingUnits,omitempty"`

	// The maximum number of processing units available per node.
	// Note that this will be ignored if the processing resources are explicitly
	// specified in the MPIJob pod spec.
	// +optional
	ProcessingUnitsPerNode *int32 `json:"processingUnitsPerNode,omitempty"`

	// The processing resource type, e.g. 'nvidia.com/gpu' or 'cpu'.
	// Defaults to 'nvidia.com/gpu'
	// +optional
	ProcessingResourceType string `json:"processingResourceType,omitempty"`

	// Run the launcher on the master.
	// Defaults to false.
	// +optional
	LauncherOnMaster bool `json:"launcherOnMaster,omitempty"`

	// Specifies the desired number of replicas the MPIJob should run on.
	// The `PodSpec` should specify the number of processing units.
	// Mutually exclusive with the `GPUs` or `ProcessingUnits` fields.
	// +optional
	Replicas *int32 `json:"replicas,omitempty"`

	// Describes the pod that will be created when executing an MPIJob.
	Template corev1.PodTemplateSpec `json:"template,omitempty"`
}

func (*LegacyV1Alpha1) DeepCopy

func (in *LegacyV1Alpha1) DeepCopy() *LegacyV1Alpha1

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

func (*LegacyV1Alpha1) DeepCopyInto

func (in *LegacyV1Alpha1) DeepCopyInto(out *LegacyV1Alpha1)

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

type LegacyV1Alpha2

type LegacyV1Alpha2 struct {
	// MPIDistribution specifies name of the MPI framwork which is used
	// Defaults to "OpenMPI"
	// Options includes "OpenMPI", "IntelMPI" and "MPICH"
	MPIDistribution *MPIDistributionType `json:"mpiDistribution,omitempty"`
}

func (*LegacyV1Alpha2) DeepCopy

func (in *LegacyV1Alpha2) DeepCopy() *LegacyV1Alpha2

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

func (*LegacyV1Alpha2) DeepCopyInto

func (in *LegacyV1Alpha2) DeepCopyInto(out *LegacyV1Alpha2)

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

type MPIDistributionType

type MPIDistributionType string

MPIDistributionType is the type for MPIDistribution.

const (
	// MPIDistributionTypeOpenMPI is the type for Open MPI.
	MPIDistributionTypeOpenMPI MPIDistributionType = "OpenMPI"

	// MPIDistributionTypeIntelMPI is the type for Intel MPI.
	MPIDistributionTypeIntelMPI MPIDistributionType = "IntelMPI"

	// MPIDistributionTypeMPICH is the type for MPICh.
	MPIDistributionTypeMPICH MPIDistributionType = "MPICH"
)

type MPIJob

type MPIJob struct {
	metav1.TypeMeta   `json:",inline"`
	metav1.ObjectMeta `json:"metadata,omitempty"`
	Spec              MPIJobSpec      `json:"spec,omitempty"`
	Status            apiv1.JobStatus `json:"status,omitempty"`
}

func (*MPIJob) DeepCopy

func (in *MPIJob) DeepCopy() *MPIJob

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

func (*MPIJob) DeepCopyInto

func (in *MPIJob) DeepCopyInto(out *MPIJob)

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

func (*MPIJob) DeepCopyObject

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

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

type MPIJobLegacySpec

type MPIJobLegacySpec struct {
	// RunPolicy is inline embedded in MPIJobSpec in both v1alpha1.
	*apiv1.RunPolicy `json:",inline"`

	// LegacyV1Alpha1 is legacy fields in v1alpha1 api definition.
	*LegacyV1Alpha1 `json:",inline"`

	// LegacyV1Alpha2 is legacy fields in v1alpha2 api definition.
	*LegacyV1Alpha2 `json:",inline"`
}

MPIJobLegacySpec is a collection of legacy fields that were used in v1alpha1/v1alpha2 but deprecated in v1 version, we reserve legacy fields for backward compatibility.

func (*MPIJobLegacySpec) DeepCopy

func (in *MPIJobLegacySpec) DeepCopy() *MPIJobLegacySpec

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

func (*MPIJobLegacySpec) DeepCopyInto

func (in *MPIJobLegacySpec) DeepCopyInto(out *MPIJobLegacySpec)

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

type MPIJobList

type MPIJobList struct {
	metav1.TypeMeta `json:",inline"`
	metav1.ListMeta `json:"metadata"`
	Items           []MPIJob `json:"items"`
}

func (*MPIJobList) DeepCopy

func (in *MPIJobList) DeepCopy() *MPIJobList

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

func (*MPIJobList) DeepCopyInto

func (in *MPIJobList) DeepCopyInto(out *MPIJobList)

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

func (*MPIJobList) DeepCopyObject

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

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

type MPIJobSpec

type MPIJobSpec struct {
	// Specifies the number of slots per worker used in hostfile.
	// Defaults to 1.
	// +optional
	SlotsPerWorker *int32 `json:"slotsPerWorker,omitempty"`

	// `MPIReplicaSpecs` contains maps from `MPIReplicaType` to `ReplicaSpec` that
	// specify the MPI replicas to run.
	MPIReplicaSpecs map[apiv1.ReplicaType]*apiv1.ReplicaSpec `json:"mpiReplicaSpecs"`

	// MainContainer specifies name of the main container which
	// executes the MPI code.
	MainContainer string `json:"mainContainer,omitempty"`

	// `RunPolicy` encapsulates various runtime policies of the distributed training
	// job, for example how to clean up resources and how long the job can stay
	// active.
	RunPolicy apiv1.RunPolicy `json:"runPolicy,omitempty"`

	// LegacySpec reserves the deprecated fields for backward compatibility.
	*MPIJobLegacySpec `json:",inline"`
}

func (*MPIJobSpec) DeepCopy

func (in *MPIJobSpec) DeepCopy() *MPIJobSpec

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

func (*MPIJobSpec) DeepCopyInto

func (in *MPIJobSpec) DeepCopyInto(out *MPIJobSpec)

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