Documentation ¶
Index ¶
- Constants
- func ApplyPodPolicies(_ context.Context, cfg *Config, pod *corev1.Pod) *corev1.Pod
- func FetchPodStatusAndLogs(ctx context.Context, client core.KubeClient, name k8sTypes.NamespacedName, ...) (info core.PhaseInfo, err error)
- func FlyteArrayJobToK8sPodTemplate(ctx context.Context, tCtx core.TaskExecutionContext, namespaceTemplate string) (podTemplate v1.Pod, job *idlPlugins.ArrayJob, err error)
- func GetK8sClient(config ClusterConfig) (client.Client, error)
- func GetNamespaceForExecution(tCtx core.TaskExecutionContext, namespaceTemplate string) string
- func GetNewExecutorPlugin(ctx context.Context, iCtx core.SetupContext) (core.Plugin, error)
- func IsResourceConfigSet(resourceConfig ResourceConfig) bool
- func LaunchAndCheckSubTasksState(ctx context.Context, tCtx core.TaskExecutionContext, ...) (newState *arrayCore.State, logLinks []*idlCore.TaskLog, subTaskIDs []*string, ...)
- func NewKubeClientObj(c client.Client) core.KubeClient
- func RemoteClusterConfig(host string, auth Auth) (*restclient.Config, error)
- func TerminateSubTasks(ctx context.Context, tCtx core.TaskExecutionContext, ...) error
- type Auth
- type ClusterConfig
- type Config
- type Executor
- func (e Executor) Abort(ctx context.Context, tCtx core.TaskExecutionContext) error
- func (e Executor) Finalize(ctx context.Context, tCtx core.TaskExecutionContext) error
- func (e Executor) GetID() string
- func (Executor) GetProperties() core.PluginProperties
- func (e Executor) Handle(ctx context.Context, tCtx core.TaskExecutionContext) (core.Transition, error)
- func (e Executor) Start(ctx context.Context) error
- type KubeClientObj
- type LaunchResult
- type LogConfig
- type MonitorResult
- type ResourceConfig
- type Task
- func (t Task) Abort(ctx context.Context, tCtx core.TaskExecutionContext, ...) error
- func (t Task) Finalize(ctx context.Context, tCtx core.TaskExecutionContext, ...) error
- func (t Task) Launch(ctx context.Context, tCtx core.TaskExecutionContext, ...) (LaunchResult, error)
- func (t *Task) Monitor(ctx context.Context, tCtx core.TaskExecutionContext, ...) (MonitorResult, []*idlCore.TaskLog, error)
Constants ¶
View Source
const ( ErrBuildPodTemplate errors2.ErrorCode = "POD_TEMPLATE_FAILED" ErrReplaceCmdTemplate errors2.ErrorCode = "CMD_TEMPLATE_FAILED" ErrSubmitJob errors2.ErrorCode = "SUBMIT_JOB_FAILED" ErrGetTaskTypeVersion errors2.ErrorCode = "GET_TASK_TYPE_VERSION_FAILED" JobIndexVarName string = "BATCH_JOB_ARRAY_INDEX_VAR_NAME" FlyteK8sArrayIndexVarName string = "FLYTE_K8S_ARRAY_INDEX" )
View Source
const (
ErrCheckPodStatus errors2.ErrorCode = "CHECK_POD_FAILED"
)
View Source
const PodKind = "pod"
Variables ¶
This section is empty.
Functions ¶
func ApplyPodPolicies ¶
func FetchPodStatusAndLogs ¶ added in v0.5.45
func FlyteArrayJobToK8sPodTemplate ¶
func FlyteArrayJobToK8sPodTemplate(ctx context.Context, tCtx core.TaskExecutionContext, namespaceTemplate string) ( podTemplate v1.Pod, job *idlPlugins.ArrayJob, err error)
FlyteArrayJobToK8sPodTemplate returns a pod template for the given task context. Note that Name is not set on the result object. It's up to the caller to set the Name before creating the object in K8s.
func GetK8sClient ¶ added in v0.5.29
func GetK8sClient(config ClusterConfig) (client.Client, error)
func GetNamespaceForExecution ¶ added in v0.5.45
func GetNamespaceForExecution(tCtx core.TaskExecutionContext, namespaceTemplate string) string
func GetNewExecutorPlugin ¶
func IsResourceConfigSet ¶ added in v0.5.29
func IsResourceConfigSet(resourceConfig ResourceConfig) bool
func LaunchAndCheckSubTasksState ¶ added in v0.5.29
func LaunchAndCheckSubTasksState(ctx context.Context, tCtx core.TaskExecutionContext, kubeClient core.KubeClient, config *Config, dataStore *storage.DataStore, outputPrefix, baseOutputDataSandbox storage.DataReference, currentState *arrayCore.State) ( newState *arrayCore.State, logLinks []*idlCore.TaskLog, subTaskIDs []*string, err error)
func NewKubeClientObj ¶ added in v0.5.29
func NewKubeClientObj(c client.Client) core.KubeClient
func RemoteClusterConfig ¶ added in v0.5.29
func RemoteClusterConfig(host string, auth Auth) (*restclient.Config, error)
RemoteClusterConfig reads secret values from paths specified in the config to initialize a Kubernetes rest client Config. TODO: Move logic to flytestdlib
func TerminateSubTasks ¶
func TerminateSubTasks(ctx context.Context, tCtx core.TaskExecutionContext, kubeClient core.KubeClient, config *Config, currentState *arrayCore.State) error
Types ¶
type Auth ¶ added in v0.5.29
type ClusterConfig ¶ added in v0.5.29
type ClusterConfig struct { Name string `json:"name" pflag:",Friendly name of the remote cluster"` Endpoint string `json:"endpoint" pflag:", Remote K8s cluster endpoint"` Auth Auth `json:"auth" pflag:"-, Auth setting for the cluster"` Enabled bool `json:"enabled" pflag:", Boolean flag to enable or disable"` }
type Config ¶
type Config struct { DefaultScheduler string `json:"scheduler" pflag:",Decides the scheduler to use when launching array-pods."` MaxErrorStringLength int `json:"maxErrorLength" pflag:",Determines the maximum length of the error string returned for the array."` MaxArrayJobSize int64 `json:"maxArrayJobSize" pflag:",Maximum size of array job."` ResourceConfig ResourceConfig `json:"resourceConfig" pflag:"-,ResourceConfiguration to limit number of resources used by k8s-array."` RemoteClusterConfig ClusterConfig `json:"remoteClusterConfig" pflag:"-,Configuration of remote K8s cluster for array jobs"` NodeSelector map[string]string `json:"node-selector" pflag:"-,Defines a set of node selector labels to add to the pod."` Tolerations []v1.Toleration `json:"tolerations" pflag:"-,Tolerations to be applied for k8s-array pods"` NamespaceTemplate string `json:"namespaceTemplate" pflag:"-,Namespace pattern to spawn array-jobs in. Defaults to parent namespace if not set"` OutputAssembler workqueue.Config ErrorAssembler workqueue.Config LogConfig LogConfig `json:"logs" pflag:",Config for log links for k8s array jobs."` }
Config defines custom config for K8s Array plugin
type Executor ¶
type Executor struct {
// contains filtered or unexported fields
}
func NewExecutor ¶
func (Executor) GetProperties ¶
func (Executor) GetProperties() core.PluginProperties
func (Executor) Handle ¶
func (e Executor) Handle(ctx context.Context, tCtx core.TaskExecutionContext) (core.Transition, error)
type KubeClientObj ¶ added in v0.5.29
type KubeClientObj struct {
// contains filtered or unexported fields
}
func (KubeClientObj) GetCache ¶ added in v0.5.29
func (k KubeClientObj) GetCache() cache.Cache
func (KubeClientObj) GetClient ¶ added in v0.5.29
func (k KubeClientObj) GetClient() client.Client
type LaunchResult ¶ added in v0.5.29
type LaunchResult int8
const ( LaunchSuccess LaunchResult = iota LaunchError LaunchWaiting LaunchReturnState )
type MonitorResult ¶ added in v0.5.29
type MonitorResult int8
const ( MonitorSuccess MonitorResult = iota MonitorError )
type ResourceConfig ¶ added in v0.5.29
type Task ¶ added in v0.5.29
type Task struct { State *arrayCore.State NewArrayStatus *arraystatus.ArrayStatus Config *Config ChildIdx int OriginalIndex int MessageCollector *errorcollector.ErrorMessageCollector SubTaskIDs []*string }
func (Task) Abort ¶ added in v0.5.29
func (t Task) Abort(ctx context.Context, tCtx core.TaskExecutionContext, kubeClient core.KubeClient) error
func (Task) Finalize ¶ added in v0.5.29
func (t Task) Finalize(ctx context.Context, tCtx core.TaskExecutionContext, kubeClient core.KubeClient) error
func (Task) Launch ¶ added in v0.5.29
func (t Task) Launch(ctx context.Context, tCtx core.TaskExecutionContext, kubeClient core.KubeClient) (LaunchResult, error)
func (*Task) Monitor ¶ added in v0.5.29
func (t *Task) Monitor(ctx context.Context, tCtx core.TaskExecutionContext, kubeClient core.KubeClient, dataStore *storage.DataStore, outputPrefix, baseOutputDataSandbox storage.DataReference, logPlugin tasklog.Plugin) (MonitorResult, []*idlCore.TaskLog, error)
Click to show internal directories.
Click to hide internal directories.