common

package
v1.9.5 Latest Latest
Warning

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

Go to latest
Published: Sep 29, 2023 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TensorflowTaskType = "tensorflow"
	MPITaskType        = "mpi"
	PytorchTaskType    = "pytorch"
)

Variables

This section is empty.

Functions

func ExtractCurrentCondition

func ExtractCurrentCondition(jobConditions []commonOp.JobCondition) (commonOp.JobCondition, error)

ExtractCurrentCondition will return the first job condition for tensorflow/pytorch

func GetLogs

func GetLogs(pluginContext k8s.PluginContext, taskType string, objectMeta meta_v1.ObjectMeta, hasMaster bool,
	workersCount int32, psReplicasCount int32, chiefReplicasCount int32) ([]*core.TaskLog, error)

GetLogs will return the logs for kubeflow job

func GetMPIPhaseInfo

func GetMPIPhaseInfo(currentCondition commonOp.JobCondition, occurredAt time.Time,
	taskPhaseInfo pluginsCore.TaskInfo) (pluginsCore.PhaseInfo, error)

GetMPIPhaseInfo will return the phase of MPI job

func GetPhaseInfo

func GetPhaseInfo(currentCondition commonOp.JobCondition, occurredAt time.Time,
	taskPhaseInfo pluginsCore.TaskInfo) (pluginsCore.PhaseInfo, error)

GetPhaseInfo will return the phase of kubeflow job

func OverrideContainerSpec

func OverrideContainerSpec(podSpec *v1.PodSpec, containerName string, image string, resources *core.Resources, args []string) error

OverrideContainerSpec overrides the specified container's properties in the given podSpec. The function updates the image, resources and command arguments of the container that matches the given containerName.

func OverridePrimaryContainerName

func OverridePrimaryContainerName(podSpec *v1.PodSpec, primaryContainerName string, defaultContainerName string)

func ParseCleanPodPolicy

func ParseCleanPodPolicy(flyteCleanPodPolicy kfplugins.CleanPodPolicy) commonOp.CleanPodPolicy

Get k8s clean pod policy from flyte kubeflow plugins clean pod policy.

func ParseRestartPolicy

func ParseRestartPolicy(flyteRestartPolicy kfplugins.RestartPolicy) commonOp.RestartPolicy

Get k8s restart policy from flyte kubeflow plugins restart policy.

func ParseRunPolicy

func ParseRunPolicy(flyteRunPolicy kfplugins.RunPolicy) commonOp.RunPolicy

ParseRunPolicy converts a kubeflow plugin RunPolicy object to a k8s RunPolicy object.

func SetConfig

func SetConfig(cfg *Config) error

Types

type Config

type Config struct {
	// If kubeflow operator doesn't update the status of the task after this timeout, the task will be considered failed.
	Timeout config.Duration `json:"timeout,omitempty"`
}

Config is config for 'pytorch' plugin

func GetConfig

func GetConfig() *Config

func (Config) GetPFlagSet

func (cfg Config) GetPFlagSet(prefix string) *pflag.FlagSet

GetPFlagSet will return strongly types pflags for all fields in Config and its nested types. The format of the flags is json-name.json-sub-name... etc.

type ReplicaEntry

type ReplicaEntry struct {
	PodSpec       *v1.PodSpec
	ReplicaNum    int32
	RestartPolicy commonOp.RestartPolicy
}

Jump to

Keyboard shortcuts

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