Skip to content

Commit

Permalink
Add comments to the schedulingPolicy API
Browse files Browse the repository at this point in the history
Signed-off-by: Yuki Iwai <yuki.iwai.tz@gmail.com>
  • Loading branch information
tenzen-y committed Feb 18, 2023
1 parent c72b527 commit 0eebc9a
Show file tree
Hide file tree
Showing 6 changed files with 85 additions and 14 deletions.
20 changes: 18 additions & 2 deletions deploy/v2beta1/mpi-operator.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7869,6 +7869,10 @@ spec:
e.g. gang-scheduling
properties:
minAvailable:
description: MinAvailable defines the minimal number of member
to run the PodGroup. If the gang-scheduling is set to the
volcano, input is passed to `.spec.mimMember` in PodGroup
for the volcano.
format: int32
type: integer
minResources:
Expand All @@ -7878,14 +7882,26 @@ spec:
- type: string
pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$
x-kubernetes-int-or-string: true
description: ResourceList is a set of (resource name, quantity)
pairs.
description: MinResources defines the minimal resources of
members to run the PodGroup. If the gang-scheduling is set
to the volcano, input is passed to `.spec.mimResources`
in PodGroup for volcano.
type: object
priorityClass:
description: PriorityClass defines the PodGroup's PriorityClass.
If the gang-scheduling is set to the volcano, input is passed
to `.spec.priorityClassName` in PodGroup for volcano.
type: string
queue:
description: Queue defines the queue name to allocate resource
for PodGroup. If the gang-scheduling is set to the volcano,
input is passed to `.spec.queue` in PodGroup for the volcano.
type: string
scheduleTimeoutSeconds:
description: 'SchedulerTimeoutSeconds defines the maximal
time of members to wait before run the PodGroup. Currently,
this parameter isn''t respected in any case. TODO (tenzen-y):
Modify comments when supporting scheduler-plugins.'
format: int32
type: integer
type: object
Expand Down
20 changes: 18 additions & 2 deletions manifests/base/kubeflow.org_mpijobs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7846,6 +7846,10 @@ spec:
e.g. gang-scheduling
properties:
minAvailable:
description: MinAvailable defines the minimal number of member
to run the PodGroup. If the gang-scheduling is set to the
volcano, input is passed to `.spec.mimMember` in PodGroup
for the volcano.
format: int32
type: integer
minResources:
Expand All @@ -7855,14 +7859,26 @@ spec:
- type: string
pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$
x-kubernetes-int-or-string: true
description: ResourceList is a set of (resource name, quantity)
pairs.
description: MinResources defines the minimal resources of
members to run the PodGroup. If the gang-scheduling is set
to the volcano, input is passed to `.spec.mimResources`
in PodGroup for volcano.
type: object
priorityClass:
description: PriorityClass defines the PodGroup's PriorityClass.
If the gang-scheduling is set to the volcano, input is passed
to `.spec.priorityClassName` in PodGroup for volcano.
type: string
queue:
description: Queue defines the queue name to allocate resource
for PodGroup. If the gang-scheduling is set to the volcano,
input is passed to `.spec.queue` in PodGroup for the volcano.
type: string
scheduleTimeoutSeconds:
description: 'SchedulerTimeoutSeconds defines the maximal
time of members to wait before run the PodGroup. Currently,
this parameter isn''t respected in any case. TODO (tenzen-y):
Modify comments when supporting scheduler-plugins.'
format: int32
type: integer
type: object
Expand Down
5 changes: 5 additions & 0 deletions pkg/apis/kubeflow/v2beta1/swagger.json
Original file line number Diff line number Diff line change
Expand Up @@ -415,23 +415,28 @@
"type": "object",
"properties": {
"minAvailable": {
"description": "MinAvailable defines the minimal number of member to run the PodGroup. If the gang-scheduling is set to the volcano, input is passed to `.spec.mimMember` in PodGroup for the volcano.",
"type": "integer",
"format": "int32"
},
"minResources": {
"description": "MinResources defines the minimal resources of members to run the PodGroup. If the gang-scheduling is set to the volcano, input is passed to `.spec.mimResources` in PodGroup for volcano.",
"type": "object",
"additionalProperties": {
"default": {},
"$ref": "#/definitions/resource.Quantity"
}
},
"priorityClass": {
"description": "PriorityClass defines the PodGroup's PriorityClass. If the gang-scheduling is set to the volcano, input is passed to `.spec.priorityClassName` in PodGroup for volcano.",
"type": "string"
},
"queue": {
"description": "Queue defines the queue name to allocate resource for PodGroup. If the gang-scheduling is set to the volcano, input is passed to `.spec.queue` in PodGroup for the volcano.",
"type": "string"
},
"scheduleTimeoutSeconds": {
"description": "SchedulerTimeoutSeconds defines the maximal time of members to wait before run the PodGroup. Currently, this parameter isn't respected in any case.",
"type": "integer",
"format": "int32"
}
Expand Down
34 changes: 29 additions & 5 deletions pkg/apis/kubeflow/v2beta1/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,11 +54,35 @@ const (
// SchedulingPolicy encapsulates various scheduling policies of the distributed training
// job, for example `minAvailable` for gang-scheduling.
type SchedulingPolicy struct {
MinAvailable *int32 `json:"minAvailable,omitempty"`
Queue string `json:"queue,omitempty"`
MinResources *v1.ResourceList `json:"minResources,omitempty"`
PriorityClass string `json:"priorityClass,omitempty"`
ScheduleTimeoutSeconds *int32 `json:"scheduleTimeoutSeconds,omitempty"`
// MinAvailable defines the minimal number of member to run the PodGroup.
// If the gang-scheduling is set to the volcano,
// input is passed to `.spec.mimMember` in PodGroup for the volcano.
// +optional
MinAvailable *int32 `json:"minAvailable,omitempty"`

// Queue defines the queue name to allocate resource for PodGroup.
// If the gang-scheduling is set to the volcano,
// input is passed to `.spec.queue` in PodGroup for the volcano.
// +optional
Queue string `json:"queue,omitempty"`

// MinResources defines the minimal resources of members to run the PodGroup.
// If the gang-scheduling is set to the volcano,
// input is passed to `.spec.mimResources` in PodGroup for volcano.
// +optional
MinResources *v1.ResourceList `json:"minResources,omitempty"`

// PriorityClass defines the PodGroup's PriorityClass.
// If the gang-scheduling is set to the volcano,
// input is passed to `.spec.priorityClassName` in PodGroup for volcano.
// +optional
PriorityClass string `json:"priorityClass,omitempty"`

// SchedulerTimeoutSeconds defines the maximal time of members to wait before run the PodGroup.
// Currently, this parameter isn't respected in any case.
// TODO (tenzen-y): Modify comments when supporting scheduler-plugins.
// +optional
ScheduleTimeoutSeconds *int32 `json:"scheduleTimeoutSeconds,omitempty"`
}

// RunPolicy encapsulates various runtime policies of the distributed training
Expand Down
10 changes: 5 additions & 5 deletions sdk/python/v2beta1/docs/V2beta1SchedulingPolicy.md

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 10 additions & 0 deletions sdk/python/v2beta1/mpijob/models/v2beta1_scheduling_policy.py

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 0eebc9a

Please sign in to comment.