Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -8857,6 +8857,7 @@ spec:
format: int32
type: integer
workerReplicas:
default: 0
description: |-
WorkerReplicas defines the number for the worker pod of a role.
Required: Need to set the number of worker-pod replicas.
Expand Down Expand Up @@ -17495,7 +17496,6 @@ spec:
required:
- entryTemplate
- name
- workerReplicas
type: object
maxItems: 4
minItems: 1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -661,7 +661,7 @@ _Appears in:_
| `name` _string_ | The name of a role. Name must be unique within an ServingGroup | | MaxLength: 12 <br />Pattern: `^[a-zA-Z0-9]([-a-zA-Z0-9]*[a-zA-Z0-9])?$` <br /> |
| `replicas` _integer_ | The number of a certain role.<br />For example, in Disaggregated Prefilling, setting the replica count for both the P and D roles to 1 results in 1P1D deployment configuration.<br />This approach can similarly be applied to configure a xPyD deployment scenario.<br />Default to 1. | 1 | |
| `entryTemplate` _[PodTemplateSpec](#podtemplatespec)_ | EntryTemplate defines the template for the entry pod of a role.<br />Required: Currently, a role must have only one entry-pod. | | |
| `workerReplicas` _integer_ | WorkerReplicas defines the number for the worker pod of a role.<br />Required: Need to set the number of worker-pod replicas. | | |
| `workerReplicas` _integer_ | WorkerReplicas defines the number for the worker pod of a role.<br />Required: Need to set the number of worker-pod replicas. | 0 | |

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The description for workerReplicas still states that it is required. Since this field is now optional with a default value of 0, the documentation should be updated to reflect this change.

Suggested change
| `workerReplicas` _integer_ | WorkerReplicas defines the number for the worker pod of a role.<br />Required: Need to set the number of worker-pod replicas. | 0 | |
| `workerReplicas` _integer_ | WorkerReplicas defines the number for the worker pod of a role.<br />Optional: Defaults to 0 if not specified. | 0 | |

| `workerTemplate` _[PodTemplateSpec](#podtemplatespec)_ | WorkerTemplate defines the template for the worker pod of a role. | | |


Expand Down
4 changes: 3 additions & 1 deletion pkg/apis/workload/v1alpha1/servinggroup_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,9 @@ type Role struct {

// WorkerReplicas defines the number for the worker pod of a role.
// Required: Need to set the number of worker-pod replicas.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The comment for WorkerReplicas still states that it is required. Since this field is now optional, the comment should be updated to reflect this.

Suggested change
// Required: Need to set the number of worker-pod replicas.
// Optional: Defaults to 0 if not specified.

WorkerReplicas int32 `json:"workerReplicas"`
// +optional
// +kubebuilder:default=0
WorkerReplicas int32 `json:"workerReplicas,omitempty"`

// WorkerTemplate defines the template for the worker pod of a role.
// +optional
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3765,10 +3765,8 @@ func TestManageHeadlessService(t *testing.T) {
Template: workloadv1alpha1.ServingGroup{
Roles: []workloadv1alpha1.Role{
{
Name: "prefill",
Replicas: ptr.To[int32](1),
WorkerReplicas: 0,
WorkerTemplate: nil, // No worker template
Name: "prefill",
Replicas: ptr.To[int32](1),
},
},
},
Expand Down
Loading