@@ -267,12 +267,16 @@ The basic idea is the following:
267
267
footprint of each device when a common set of attributes and capacities can
268
268
be applied. The mixins themselves are introduced as a list of top-level
269
269
objects directly next to the list of ` Devices ` inside a ` ResourceSlice ` .
270
- They are not allocatable on their own.
270
+ They are not allocatable on their own. Entries in the ` Includes ` list can
271
+ reference mixins in any ` ResourceSlice ` in the same pool. References to
272
+ mixins in other pools are not allowed.
271
273
272
274
1 . The ` ConsumesCapacityFrom ` field contains a list of * other* devices where the
273
275
capacity of the current device should be consumed if the scheduler decides
274
276
to allocate it. This essentially removes that capacity from any referenced
275
- devices, rendering them unallocatable on their own.
277
+ devices, rendering them unallocatable on their own. Entries in the
278
+ ` ConsumesCapacityFrom ` list can reference devices in any ` ResourceSlice ` in
279
+ the same pool. References to devices in other pools are not allowed.
276
280
277
281
With these additions in place, the scheduler has everything it needs to support
278
282
the dynamic allocation of both full devices and their (possibly overlapping)
@@ -385,11 +389,16 @@ type CompositeDevice struct {
385
389
//
386
390
// The propertes of each included mixin are applied to this device in
387
391
// order. Conflicting properties from multiple mixins are taken from the
388
- // last mixin listed that contains them.
392
+ // last mixin listed that contains them. Properties set on the device will
393
+ // always override properties from mixins.
394
+ //
395
+ // The mixins referenced here must be defined in the same pool as the
396
+ // current device, but can be defined in any ResourceSlice within the pool.
389
397
//
390
398
// The maximum number of mixins that can be included is 8.
391
399
//
392
400
// +optional
401
+ // +listType=atomic
393
402
Includes []DeviceMixinRef ` json:"includes,omitempty"`
394
403
395
404
// ConsumesCapacityFrom defines the set of devices where any capacity
@@ -399,10 +408,14 @@ type CompositeDevice struct {
399
408
//
400
409
// Conflicting capacities from multiple devices are taken from the
401
410
// last device listed that contains them.
411
+ //
412
+ // The devices referenced here must be defined in the same pool as the
413
+ // current device, but can be defined in any ResourceSlice within the pool.
402
414
//
403
- // The maximum number of devices that can be referenced is 8 .
415
+ // Only a single entry is allowed. This might be extended in the future .
404
416
//
405
417
// +optional
418
+ // +listType=atomic
406
419
ConsumesCapacityFrom []DeviceRef ` json:"consumesCapacityFrom,omitempty"`
407
420
408
421
// Attributes defines the set of attributes for this device.
@@ -618,20 +631,15 @@ follows:
618
631
" sink" of capacity, pulling from "source" devices in order to satisfy its
619
632
own capacity when allocated.
620
633
621
- The scheduler must track the available capacity from all "source" devices , and
634
+ The scheduler must track the availablity of the "source" device , and
622
635
pull from it whenever it decides to allocate a "sink" device.
623
636
624
637
So long as no other devices have been allocated that reference a given "source"
625
638
device in their `ConsumesCapacityField`, it is free to be allocated by the
626
639
scheduler. However, as soon as its capacity has been pulled down by any given
627
640
" sink" device, it can no longer be allocated until its capacity is freed again.
628
641
629
- Likewise, so long as all of the advertised capacity of a "sink" device can be
630
- satisfied by the set of "source" devices it references in its
631
- ` ConsumesCapacityFrom` field, it is free to be allocated by the scheduler.
632
- However, if any of its advertised capacity cannot be satisfied by one of its
633
- referenced "source" devices, then it cannot be allocated until that capacity is
634
- freed by some other device.
642
+ Likewise, a "sink" device can be allocated if it's "source" device is available.
635
643
636
644
Note that in order to support nested partitioning, a "sink" device *may*
637
645
provide a reference to another "sink" device in its `ConsumesCapacityFrom`
@@ -647,7 +655,12 @@ When such a device is allocated, the scheduler will need to track the full
647
655
capacity required to satisfy each of the sink devices along the chain. In this
648
656
way, all intermediate sink devices will essentially be rendered
649
657
" unschedulable" , with the last-level sink device pulling its capacity from the
650
- devices it references directly.
658
+ device it references directly.
659
+
660
+ The API defines the `ConsumesCapacityFrom` field as a list of `DeviceRef` entries.
661
+ While we only allow a single entry in this list, effectily forcing the partitioning
662
+ of a device to form a tree of devices that consumes capacity, this can be extended
663
+ in the future to allow a device to reference multiple "source" devices.
651
664
652
665
# ## Putting it all together for the MIG use-case
653
666
0 commit comments