Skip to content

Commit 9b90cd9

Browse files
committed
Adressed comments
1 parent 2d7df62 commit 9b90cd9

File tree

2 files changed

+43
-39
lines changed

2 files changed

+43
-39
lines changed

keps/sig-scheduling/4816-dra-prioritized-list/README.md

Lines changed: 38 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -255,36 +255,40 @@ nitty-gritty.
255255
The `ResourceClaim` object contains a `DeviceClaim`, which in turn contains a
256256
list of `DeviceRequest` objects. This allows the user to allocate different
257257
types of devices for the same claim, and apply constraints and configuration
258-
across those different requests.
259-
260-
The proposal restructures the `DeviceRequest` object so there will be a
261-
`Name` field just like today, but for supporting either a single request
262-
or a prioritized list there will be the fields `Exactly` for a request without
263-
alternatives (type `SpecificDeviceRequest`) and `FirstAvailable` for providing a
264-
prioritized list of requests (type `DeviceSubRequest`). The other fields that are
265-
currently in the `DeviceRequest` object will be moved into one or both of the
266-
`SpecifiecDeviceRequest` and `DeviceSubRequest` objects.
267-
The list provided in the `FirstAvailable` field is
268-
considered a priority order, such that the scheduler will only try to use
269-
the second item in the list if it is unable to satisfy the first item,
270-
and so on. The `Exactly` and `FirstAvailable` fields are mutually exclusive.
271-
This is a breaking change to the `v1beta1` API, so this will be added in a
272-
new `v1beta2` resource API.
273-
274-
For the `v1beta1` API, there will be a new field called `FirstAvailable`
258+
across those different requests. These changes allow some flexibility for the
259+
user to create, say, a "gpu" request, but allow it to be satisfied by one of
260+
several models of GPU.
261+
262+
To avoid introducing a breaking API change and to ensure round-tripping
263+
between the APIs, the `v1beta1` API will remain backward compatible
264+
(only extended) and the final change will be made in `v1beta2`.
265+
266+
The `v1beta1` API will be extended with a new field called `FirstAvailable`
275267
which will contain an ordered list of `DeviceSubRequest` objects. In order to
276268
satisfy the main (containing) request, exactly one of the requests listed in
277269
`FirstAvailable` must be satisfied. The order listed is considered a priority
278270
order, such that the scheduler will only try to use the second item in the list
279271
if it is unable to satisfy the first item, and so on. This extension to the API
280272
is not breaking, but it makes for a somewhat awkward API where many fields on
281-
the `DeviceRequest` (in fact all existing fields except `Name`) should not be
282-
used whenever `FirstAvailable` is used. To avoid this long term we are
283-
adding the `v1beta2` API described above, while doing the backwards-compatible
284-
change in the `v1beta1` API to ensure round-tripping between the APIs will work.
285-
286-
These changes allow some flexibility for the user to create, say, a "gpu"
287-
request, but allow it to be satisfied by one of several models of GPU.
273+
the `DeviceRequest` (in fact all existing fields except `Name`) must not be
274+
set whenever `FirstAvailable` is set. To avoid this API in the long term, we are
275+
adding the `v1beta2` API described next.
276+
277+
For the `v1beta2` API, the `DeviceRequest` object will be restructured
278+
so that there will be the `Name` field just like today, and for supporting
279+
either a single request or a prioritized list of subrequests, there will
280+
be separate fields:
281+
282+
* `Exactly` for a request of type `SpecificDeviceRequest` without alternatives.
283+
`SpecificDeviceRequest` will include all the fields that exists on the
284+
`DeviceRequest` type in `v1beta1`, except the `Name` field.
285+
* `FirstAvailable` for providing a prioritized list of requests, each of
286+
type `DeviceSubRequest`. The `DeviceSubRequest` type is similar to
287+
`SpecificDeviceRequest`, except for the `AdminAccess` field that is not
288+
available when providing multiple alternatives. The list provided in the
289+
`FirstAvailable` field is considered a priority order, such that the
290+
scheduler will only try to use the second item in the list if it is unable
291+
to satisfy the first item, and so on.
288292

289293
### User Stories
290294

@@ -621,13 +625,13 @@ type DeviceRequest struct {
621625
// is not supported by the client yet, in which case it must refuse to
622626
// handle the request.
623627
type DeviceSubRequest struct {
624-
// Name can be used to reference this subrequest in a pod.spec.containers[].resources.claims
625-
// entry and in a constraint of the claim. References must use the
626-
// format <parent request>/<subrequest>.
627-
//
628-
// Must be a DNS label.
629-
//
630-
// +required
628+
// Name can be used to reference this subrequest in the list of constraints
629+
// or the list of configurations for the claim. References must use the
630+
// format <main request>/<subrequest>.
631+
//
632+
// Must be a DNS label.
633+
//
634+
// +required
631635
Name string `json:"name" protobuf:"bytes,1,name=name"`
632636

633637
// DeviceClassName references a specific DeviceClass, which can define
@@ -1007,7 +1011,7 @@ they are all local to the control plane.
10071011

10081012
The proposed API change relaxes a `required` constraint on the
10091013
`DeviceRequest.DeviceClassName` field. The `DeviceRequest` thus becomes a one-of
1010-
that must have either the `DeviceClassName` or the `FirstAvailableOf` field
1014+
that must have either the `DeviceClassName` or the `FirstAvailable` field
10111015
populated.
10121016

10131017
Older clients have been advised in the current implementation to check this
@@ -1070,7 +1074,7 @@ This is an add-on on top of the `DynamicResourceAllocation` feature gate, which
10701074
also must be enabled for this feature to work.
10711075

10721076
- [x] Feature gate (also fill in values in `kep.yaml`)
1073-
- Feature gate name: DRAFirstAvailableOf
1077+
- Feature gate name: DRAFirstAvailable
10741078
- Components depending on the feature gate:
10751079
- kube-apiserver
10761080
- kube-scheduler
@@ -1506,7 +1510,7 @@ type ResourceClaimSpec struct {
15061510
This is arguably simpler and allows them to be essentially complete, alternate
15071511
claims. It would be more difficult for the user, though, as it would require
15081512
duplication of other device requests. Additionally, if there were multiple
1509-
separate `FirstAvailableOf` requests in a claim, the user would have to specify
1513+
separate `FirstAvailable` requests in a claim, the user would have to specify
15101514
all the combinations of those in order to get the same flexibility.
15111515

15121516
## Infrastructure Needed (Optional)

keps/sig-scheduling/4816-dra-prioritized-list/kep.yaml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,18 +28,18 @@ stage: alpha
2828
# The most recent milestone for which work toward delivery of this KEP has been
2929
# done. This can be the current (upcoming) milestone, if it is being actively
3030
# worked on.
31-
latest-milestone: "v1.32"
31+
latest-milestone: "v1.33"
3232

3333
# The milestone at which this feature was, or is targeted to be, at each stage.
3434
milestone:
35-
alpha: "v1.32"
36-
beta: "v1.33"
37-
stable: "v1.34"
35+
alpha: "v1.33"
36+
beta: "v1.34"
37+
stable: "v1.35"
3838

3939
# The following PRR answers are required at alpha release
4040
# List the feature gate name and the components for which it must be enabled
4141
feature-gates:
42-
- name: DRAFirstAvailableOf
42+
- name: DRAPrioritizedList
4343
components:
4444
- kube-apiserver
4545
- kube-controller-manager

0 commit comments

Comments
 (0)