ToReplicaSpecWithOverrides
Converts a kfDistributedReplicaSpec into a kubeflowv1.ReplicaSpec, applying overrides for resources, image, command, and restart policy. It also handles master replica specific configurations and resource sanitization.
def ToReplicaSpecWithOverrides(
ctx: context.Context,
taskCtx: pluginsCore.TaskExecutionContext,
rs: kfDistributedReplicaSpec,
primaryContainerName: string,
isMaster: bool
) - > *kubeflowv1.ReplicaSpec, error
Converts a distributed replica specification into a Kubeflow ReplicaSpec, applying overrides for resources, image, and command. This function handles both common replica specifications and individual replica specifications, ensuring that resource requirements are sanitized and master replicas are correctly configured.
Parameters
| Name | Type | Description |
|---|---|---|
| ctx | context.Context | The context for the operation, used for cancellation and deadlines. |
| taskCtx | pluginsCore.TaskExecutionContext | The task execution context, providing access to task metadata and resources for applying overrides. |
| rs | kfDistributedReplicaSpec | The distributed replica specification containing details like replicas, image, resources, and restart policy. |
| primaryContainerName | string | The name of the primary container within the replica spec to which overrides will be applied. |
| isMaster | bool | A boolean indicating whether this replica is the master. If true, the replica count will be forced to 1. |
Returns
| Type | Description |
|---|---|
*kubeflowv1.ReplicaSpec, error | A Kubeflow ReplicaSpec with applied overrides or an error if conversion fails. |