Skip to main content

ToReplicaSpec

No overview available.

def ToReplicaSpec(
ctx: context.Context,
taskCtx: pluginsCore.TaskExecutionContext,
primaryContainerName: string
) - > *kubeflowv1.ReplicaSpec, error

Builds a Kubeflow ReplicaSpec from the provided task context and primary container name. This function is used to configure the replica's pod template, including metadata, pod specifications, and restart policy, for execution within a Kubernetes environment.

Parameters

NameTypeDescription
ctxcontext.ContextThe context for the operation, used for cancellation and deadlines.
taskCtxpluginsCore.TaskExecutionContextThe task execution context providing metadata and configuration for the task.
primaryContainerNamestringThe name to assign to the primary container within the pod spec.

Returns

TypeDescription
*kubeflowv1.ReplicaSpec, errorA pointer to a kubeflowv1.ReplicaSpec object configured for the task, or an error if the pod spec cannot be created.