* Filter: Calculate the pod's total resource footprint by combining spec requests and DRA allocations, respecting accounting policies. Perform node resource fit checks. Cache the resulting NodeAllocatableResourceClaimStatus in CycleState.
* PreBind: Retrieve result from CycleState and patch it into Pod.Status.
* placement score plugin, grounded on count of scheduled pods and pods for placement
* align with v1alpha2 api changes
* addressing review comments
* plugin renaming
- update expectations for the default BindingTimeout in KubeSchedulerConfiguration
- DRA unit tests:
- enable DRADeviceBindingConditions by default
- add allocationTimestamp to expected ResourceClaims for PreBind cases
- disable DRADeviceBindingConditions when testing the stable allocator in TestSchedulerPerf
Signed-off-by: Tsubasa Watanabe <w.tsubasa@fujitsu.com>
DeviceTaintRule is off by default because the corresponding v1beta2 API group
is off. When enabled, the potentially still disabled v1alpha3 API version was
used instead of the new v1beta2, causing the scheduler to fail while setting up
informers and then not scheduling pods.
This commit introduces metrics and improves log outputs for
DRA Device Binding Conditions (KEP-5007):
- scheduler_dra_bindingconditions_allocations_total
Counts the number of per-device scheduling attempts
during PreBind where BindingConditions are in use
- scheduler_dra_bindingconditions_wait_duration_seconds
Observes the time spent waiting for BindingConditions
to be satisfied during PreBind.
Signed-off-by: Tsubasa Watanabe <w.tsubasa@fujitsu.com>
Gang scheduler will add the pod into the podGroupInfo before pod
enqueue, if there are thousands of pods in a podGroupInfo, The
call of AssumedPods, AssignedPods and AllPods will hold the lock and
clone the map, so that new Pods should wait there for a long time to add into
the podGroupInfo, also it will be a long wait to enqueue the pod.
In our test, a pod will wait seconds to enqueue if we have 50000 pod in
a gang group.
In this PR, we can avoid the traverse and clone of the map by adding
AllPodsCount, AssumedPodsCount, AssignedPodsCount method, and we make
sure that assumed pods and assigned pods are disjoint.
The code paths for adding AllocationTimestamp were not tested well. None of
the test cases verified that an AllocationTimestamp gets added at all because
go-cmp was instructed to ignore the unpredictable field.
We can do better than that and at least check for existence by normalizing all
non-nil time stamps to the empty time. This affects all tests where the binding
conditions and thus AllocationTimestamp support is enabled.
The retry loop for status updates was untested. The fake client has to return a
conflict status error to trigger it. This enables writing a test case where a
concurrent deallocation would have caused the nil panic without the previous
fix.
For binding conditions, one test case gets added which runs through the full
flow of allocating a claim and trying to bind it. All other test cases seem to
have started with the claim already allocated.
Altogether this increases coverage from 82.4% to 83.7%.
* Drop WorkloadRef field and introduce SchedulingGroup field in Pod API
* Introduce v1alpha2 Workload and PodGroup APIs, drop v1alpha1 Workload API
Co-authored-by: yongruilin <yongrlin@outlook.com>
* Run hack/update-codegen.sh
* Adjust kube-scheduler code and integration tests to v1alpha2 API
* Drop v1alpha1 scheduling API group and run make update
---------
Co-authored-by: yongruilin <yongrlin@outlook.com>
When DRAExtendedResource is enabled, the dynamicresources test setup
registers an event handler for DeviceClasses but was not waiting for it
to sync. This can lead to flaky tests where the cache is not fully
populated when the test starts.
This change captures the event handler registration and includes its
DoneChecker in a WaitFor call.