Skip to content

fix(scheduler): configmap predicate edge cases#992

Merged
enoodle merged 2 commits intomainfrom
erez/fix-optional-configmap
Feb 12, 2026
Merged

fix(scheduler): configmap predicate edge cases#992
enoodle merged 2 commits intomainfrom
erez/fix-optional-configmap

Conversation

@enoodle
Copy link
Collaborator

@enoodle enoodle commented Feb 11, 2026

Description

Fixes edge cases in config maps predicate:

  • avoids considering optional configmaps
  • look into ephemeral containers and projected volumes

Related Issues

Fixes #988

Checklist

  • Self-reviewed
  • Added/updated tests (if needed)
  • Updated documentation (if needed)

Breaking Changes

Additional Notes

@coderabbitai
Copy link

coderabbitai bot commented Feb 11, 2026

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch erez/fix-optional-configmap

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions
Copy link

github-actions bot commented Feb 11, 2026

📊 Performance Benchmark Results

Comparing PR (erez/fix-optional-configmap) vs main branch:

goos: linux
goarch: amd64
pkg: github.com/NVIDIA/KAI-scheduler/pkg/scheduler/actions
cpu: AMD EPYC 7763 64-Core Processor                
                                    │ main-bench.txt │            pr-bench.txt            │
                                    │     sec/op     │    sec/op     vs base              │
AllocateAction_SmallCluster-4            108.4m ± 3%   108.1m ±  0%       ~ (p=0.180 n=6)
AllocateAction_MediumCluster-4           135.7m ± 2%   135.7m ±  1%       ~ (p=0.818 n=6)
AllocateAction_LargeCluster-4            215.4m ± 6%   225.4m ± 14%       ~ (p=0.065 n=6)
ReclaimAction_SmallCluster-4             102.7m ± 0%   102.9m ±  0%       ~ (p=0.310 n=6)
ReclaimAction_MediumCluster-4            105.2m ± 0%   105.3m ±  0%       ~ (p=0.485 n=6)
PreemptAction_SmallCluster-4             103.4m ± 0%   103.5m ±  0%       ~ (p=0.132 n=6)
PreemptAction_MediumCluster-4            112.5m ± 0%   112.6m ±  0%       ~ (p=0.310 n=6)
ConsolidationAction_SmallCluster-4       113.3m ± 0%   113.4m ±  2%       ~ (p=0.240 n=6)
ConsolidationAction_MediumCluster-4      200.3m ± 1%   201.8m ±  2%       ~ (p=0.093 n=6)
FullSchedulingCycle_SmallCluster-4       104.9m ± 0%   105.0m ±  0%       ~ (p=0.180 n=6)
FullSchedulingCycle_MediumCluster-4      118.6m ± 0%   118.9m ±  0%       ~ (p=0.240 n=6)
FullSchedulingCycle_LargeCluster-4       156.7m ± 1%   157.7m ±  1%       ~ (p=0.132 n=6)
ManyQueues_MediumCluster-4               139.2m ± 2%   139.7m ±  2%       ~ (p=0.240 n=6)
GangScheduling_MediumCluster-4           157.0m ± 0%   158.8m ±  1%  +1.16% (p=0.002 n=6)
geomean                                  129.8m        130.5m        +0.57%

                                    │ main-bench.txt │            pr-bench.txt            │
                                    │      B/op      │     B/op      vs base              │
AllocateAction_SmallCluster-4           2.152Mi ± 1%   2.171Mi ± 0%  +0.90% (p=0.002 n=6)
AllocateAction_MediumCluster-4          11.84Mi ± 0%   11.92Mi ± 0%  +0.67% (p=0.002 n=6)
AllocateAction_LargeCluster-4           41.54Mi ± 0%   41.74Mi ± 0%  +0.48% (p=0.002 n=6)
ReclaimAction_SmallCluster-4            891.4Ki ± 1%   887.4Ki ± 1%       ~ (p=0.394 n=6)
ReclaimAction_MediumCluster-4           2.832Mi ± 0%   2.832Mi ± 0%       ~ (p=0.699 n=6)
PreemptAction_SmallCluster-4            1.003Mi ± 1%   1.005Mi ± 1%       ~ (p=0.589 n=6)
PreemptAction_MediumCluster-4           4.018Mi ± 0%   4.016Mi ± 0%       ~ (p=0.394 n=6)
ConsolidationAction_SmallCluster-4      5.607Mi ± 0%   5.623Mi ± 0%  +0.29% (p=0.002 n=6)
ConsolidationAction_MediumCluster-4     46.89Mi ± 0%   46.96Mi ± 0%  +0.15% (p=0.002 n=6)
FullSchedulingCycle_SmallCluster-4      1.373Mi ± 1%   1.382Mi ± 0%  +0.64% (p=0.041 n=6)
FullSchedulingCycle_MediumCluster-4     6.836Mi ± 0%   6.876Mi ± 0%  +0.59% (p=0.002 n=6)
FullSchedulingCycle_LargeCluster-4      22.83Mi ± 0%   22.93Mi ± 0%  +0.44% (p=0.002 n=6)
ManyQueues_MediumCluster-4              16.31Mi ± 0%   16.38Mi ± 0%  +0.49% (p=0.002 n=6)
GangScheduling_MediumCluster-4          17.17Mi ± 0%   17.33Mi ± 0%  +0.92% (p=0.002 n=6)
geomean                                 6.330Mi        6.354Mi       +0.37%

                                    │ main-bench.txt │           pr-bench.txt            │
                                    │   allocs/op    │  allocs/op   vs base              │
AllocateAction_SmallCluster-4            36.21k ± 0%   36.26k ± 0%  +0.13% (p=0.002 n=6)
AllocateAction_MediumCluster-4           325.2k ± 0%   325.4k ± 0%  +0.06% (p=0.002 n=6)
AllocateAction_LargeCluster-4            1.394M ± 0%   1.395M ± 0%  +0.04% (p=0.002 n=6)
ReclaimAction_SmallCluster-4             8.399k ± 0%   8.398k ± 0%       ~ (p=0.411 n=6)
ReclaimAction_MediumCluster-4            26.54k ± 0%   26.54k ± 0%       ~ (p=1.000 n=6)
PreemptAction_SmallCluster-4             11.19k ± 0%   11.19k ± 0%       ~ (p=0.701 n=6)
PreemptAction_MediumCluster-4            38.77k ± 0%   38.77k ± 0%       ~ (p=0.253 n=6)
ConsolidationAction_SmallCluster-4       73.59k ± 0%   73.62k ± 0%       ~ (p=0.234 n=6)
ConsolidationAction_MediumCluster-4      685.9k ± 0%   686.1k ± 0%  +0.02% (p=0.015 n=6)
FullSchedulingCycle_SmallCluster-4       21.37k ± 0%   21.39k ± 0%  +0.10% (p=0.002 n=6)
FullSchedulingCycle_MediumCluster-4      174.7k ± 0%   174.8k ± 0%  +0.06% (p=0.002 n=6)
FullSchedulingCycle_LargeCluster-4       727.3k ± 0%   727.5k ± 0%  +0.03% (p=0.002 n=6)
ManyQueues_MediumCluster-4               363.3k ± 0%   363.5k ± 0%  +0.06% (p=0.002 n=6)
GangScheduling_MediumCluster-4           597.0k ± 0%   597.4k ± 0%  +0.07% (p=0.002 n=6)
geomean                                  111.7k        111.8k       +0.04%

Legend

  • 📉 Negative delta = Performance improvement (faster)
  • 📈 Positive delta = Performance regression (slower)
  • p-value < 0.05 indicates statistically significant change
Raw benchmark data

PR branch:

goos: linux
goarch: amd64
pkg: github.com/NVIDIA/KAI-scheduler/pkg/scheduler/actions
cpu: AMD EPYC 7763 64-Core Processor                
BenchmarkAllocateAction_SmallCluster-4         	      10	 108463566 ns/op	 2276947 B/op	   36257 allocs/op
BenchmarkAllocateAction_SmallCluster-4         	      10	 108265090 ns/op	 2276487 B/op	   36256 allocs/op
BenchmarkAllocateAction_SmallCluster-4         	      10	 107935585 ns/op	 2276925 B/op	   36256 allocs/op
BenchmarkAllocateAction_SmallCluster-4         	      10	 108015718 ns/op	 2277296 B/op	   36253 allocs/op
BenchmarkAllocateAction_SmallCluster-4         	      10	 107936109 ns/op	 2277463 B/op	   36258 allocs/op
BenchmarkAllocateAction_SmallCluster-4         	      10	 108410477 ns/op	 2275923 B/op	   36253 allocs/op
BenchmarkAllocateAction_MediumCluster-4        	       8	 136180882 ns/op	12500124 B/op	  325400 allocs/op
BenchmarkAllocateAction_MediumCluster-4        	       8	 134336662 ns/op	12510169 B/op	  325394 allocs/op
BenchmarkAllocateAction_MediumCluster-4        	       8	 134363906 ns/op	12501019 B/op	  325392 allocs/op
BenchmarkAllocateAction_MediumCluster-4        	       8	 136311891 ns/op	12499285 B/op	  325393 allocs/op
BenchmarkAllocateAction_MediumCluster-4        	       8	 137274190 ns/op	12503768 B/op	  325395 allocs/op
BenchmarkAllocateAction_MediumCluster-4        	       8	 135143797 ns/op	12499732 B/op	  325386 allocs/op
BenchmarkAllocateAction_LargeCluster-4         	       5	 221879246 ns/op	43781017 B/op	 1394797 allocs/op
BenchmarkAllocateAction_LargeCluster-4         	       5	 218206111 ns/op	43795332 B/op	 1394800 allocs/op
BenchmarkAllocateAction_LargeCluster-4         	       5	 232654189 ns/op	43770190 B/op	 1394781 allocs/op
BenchmarkAllocateAction_LargeCluster-4         	       5	 228991869 ns/op	43765096 B/op	 1394791 allocs/op
BenchmarkAllocateAction_LargeCluster-4         	       5	 219243892 ns/op	43762398 B/op	 1394775 allocs/op
BenchmarkAllocateAction_LargeCluster-4         	       5	 257659934 ns/op	43764667 B/op	 1394789 allocs/op
BenchmarkReclaimAction_SmallCluster-4          	      10	 102841741 ns/op	  905584 B/op	    8370 allocs/op
BenchmarkReclaimAction_SmallCluster-4          	      10	 102903599 ns/op	  906930 B/op	    8390 allocs/op
BenchmarkReclaimAction_SmallCluster-4          	      10	 102863022 ns/op	  910404 B/op	    8398 allocs/op
BenchmarkReclaimAction_SmallCluster-4          	      10	 102786766 ns/op	  919098 B/op	    8399 allocs/op
BenchmarkReclaimAction_SmallCluster-4          	      10	 102867123 ns/op	  906452 B/op	    8397 allocs/op
BenchmarkReclaimAction_SmallCluster-4          	      10	 102884197 ns/op	  910397 B/op	    8398 allocs/op
BenchmarkReclaimAction_MediumCluster-4         	      10	 105285113 ns/op	 2969464 B/op	   26541 allocs/op
BenchmarkReclaimAction_MediumCluster-4         	      10	 105034055 ns/op	 2961728 B/op	   26539 allocs/op
BenchmarkReclaimAction_MediumCluster-4         	      10	 105337515 ns/op	 2969445 B/op	   26541 allocs/op
BenchmarkReclaimAction_MediumCluster-4         	      10	 105256377 ns/op	 2969573 B/op	   26541 allocs/op
BenchmarkReclaimAction_MediumCluster-4         	      10	 105472111 ns/op	 2969455 B/op	   26541 allocs/op
BenchmarkReclaimAction_MediumCluster-4         	      10	 105319868 ns/op	 2969685 B/op	   26542 allocs/op
BenchmarkPreemptAction_SmallCluster-4          	      10	 103399453 ns/op	 1048071 B/op	   11186 allocs/op
BenchmarkPreemptAction_SmallCluster-4          	      10	 103653382 ns/op	 1052077 B/op	   11189 allocs/op
BenchmarkPreemptAction_SmallCluster-4          	      10	 103494151 ns/op	 1062482 B/op	   11190 allocs/op
BenchmarkPreemptAction_SmallCluster-4          	      10	 103515703 ns/op	 1056036 B/op	   11190 allocs/op
BenchmarkPreemptAction_SmallCluster-4          	      10	 103439928 ns/op	 1048220 B/op	   11187 allocs/op
BenchmarkPreemptAction_SmallCluster-4          	      10	 103478326 ns/op	 1055898 B/op	   11189 allocs/op
BenchmarkPreemptAction_MediumCluster-4         	       9	 112594928 ns/op	 4211072 B/op	   38771 allocs/op
BenchmarkPreemptAction_MediumCluster-4         	       9	 112431421 ns/op	 4206515 B/op	   38770 allocs/op
BenchmarkPreemptAction_MediumCluster-4         	       9	 112839486 ns/op	 4206504 B/op	   38769 allocs/op
BenchmarkPreemptAction_MediumCluster-4         	       9	 112580065 ns/op	 4211036 B/op	   38772 allocs/op
BenchmarkPreemptAction_MediumCluster-4         	       9	 112463306 ns/op	 4211210 B/op	   38772 allocs/op
BenchmarkPreemptAction_MediumCluster-4         	       9	 112639878 ns/op	 4211045 B/op	   38772 allocs/op
BenchmarkConsolidationAction_SmallCluster-4    	       9	 113222596 ns/op	 5902755 B/op	   73657 allocs/op
BenchmarkConsolidationAction_SmallCluster-4    	       9	 113666496 ns/op	 5907191 B/op	   73627 allocs/op
BenchmarkConsolidationAction_SmallCluster-4    	       9	 113348574 ns/op	 5896147 B/op	   73614 allocs/op
BenchmarkConsolidationAction_SmallCluster-4    	       9	 113415479 ns/op	 5891208 B/op	   73566 allocs/op

Main branch:

goos: linux
goarch: amd64
pkg: github.com/NVIDIA/KAI-scheduler/pkg/scheduler/actions
cpu: AMD EPYC 7763 64-Core Processor                
BenchmarkAllocateAction_SmallCluster-4         	       9	 112209004 ns/op	 2272515 B/op	   36220 allocs/op
BenchmarkAllocateAction_SmallCluster-4         	      10	 108965812 ns/op	 2256388 B/op	   36209 allocs/op
BenchmarkAllocateAction_SmallCluster-4         	      10	 108112549 ns/op	 2256312 B/op	   36203 allocs/op
BenchmarkAllocateAction_SmallCluster-4         	      10	 108139080 ns/op	 2257004 B/op	   36208 allocs/op
BenchmarkAllocateAction_SmallCluster-4         	      10	 108194893 ns/op	 2255943 B/op	   36204 allocs/op
BenchmarkAllocateAction_SmallCluster-4         	      10	 108699688 ns/op	 2256888 B/op	   36209 allocs/op
BenchmarkAllocateAction_MediumCluster-4        	       8	 135151926 ns/op	12418314 B/op	  325202 allocs/op
BenchmarkAllocateAction_MediumCluster-4        	       8	 136315295 ns/op	12419349 B/op	  325191 allocs/op
BenchmarkAllocateAction_MediumCluster-4        	       8	 134688671 ns/op	12417907 B/op	  325199 allocs/op
BenchmarkAllocateAction_MediumCluster-4        	       8	 137023406 ns/op	12416975 B/op	  325191 allocs/op
BenchmarkAllocateAction_MediumCluster-4        	       8	 137213023 ns/op	12416257 B/op	  325187 allocs/op
BenchmarkAllocateAction_MediumCluster-4        	       8	 133552279 ns/op	12416896 B/op	  325191 allocs/op
BenchmarkAllocateAction_LargeCluster-4         	       5	 221549532 ns/op	43557716 B/op	 1394294 allocs/op
BenchmarkAllocateAction_LargeCluster-4         	       5	 218350016 ns/op	43554646 B/op	 1394271 allocs/op
BenchmarkAllocateAction_LargeCluster-4         	       5	 212406003 ns/op	43556614 B/op	 1394285 allocs/op
BenchmarkAllocateAction_LargeCluster-4         	       5	 227930622 ns/op	43556398 B/op	 1394295 allocs/op
BenchmarkAllocateAction_LargeCluster-4         	       5	 205401468 ns/op	43557588 B/op	 1394293 allocs/op
BenchmarkAllocateAction_LargeCluster-4         	       5	 204629949 ns/op	43556376 B/op	 1394290 allocs/op
BenchmarkReclaimAction_SmallCluster-4          	      10	 102703371 ns/op	  901186 B/op	    8364 allocs/op
BenchmarkReclaimAction_SmallCluster-4          	      10	 103053907 ns/op	  911429 B/op	    8393 allocs/op
BenchmarkReclaimAction_SmallCluster-4          	      10	 102899509 ns/op	  914196 B/op	    8399 allocs/op
BenchmarkReclaimAction_SmallCluster-4          	      10	 102705332 ns/op	  910351 B/op	    8398 allocs/op
BenchmarkReclaimAction_SmallCluster-4          	      10	 102724072 ns/op	  914423 B/op	    8400 allocs/op
BenchmarkReclaimAction_SmallCluster-4          	      10	 102705437 ns/op	  919266 B/op	    8400 allocs/op
BenchmarkReclaimAction_MediumCluster-4         	      10	 105223541 ns/op	 2969599 B/op	   26541 allocs/op
BenchmarkReclaimAction_MediumCluster-4         	      10	 105078091 ns/op	 2969828 B/op	   26543 allocs/op
BenchmarkReclaimAction_MediumCluster-4         	      10	 105478794 ns/op	 2965668 B/op	   26540 allocs/op
BenchmarkReclaimAction_MediumCluster-4         	      10	 105119633 ns/op	 2969503 B/op	   26541 allocs/op
BenchmarkReclaimAction_MediumCluster-4         	      10	 105302030 ns/op	 2969506 B/op	   26541 allocs/op
BenchmarkReclaimAction_MediumCluster-4         	      10	 105203188 ns/op	 2965653 B/op	   26540 allocs/op
BenchmarkPreemptAction_SmallCluster-4          	      10	 103583337 ns/op	 1052069 B/op	   11189 allocs/op
BenchmarkPreemptAction_SmallCluster-4          	      10	 103429524 ns/op	 1052072 B/op	   11188 allocs/op
BenchmarkPreemptAction_SmallCluster-4          	      10	 103449042 ns/op	 1052068 B/op	   11189 allocs/op
BenchmarkPreemptAction_SmallCluster-4          	      10	 103358170 ns/op	 1048055 B/op	   11187 allocs/op
BenchmarkPreemptAction_SmallCluster-4          	      10	 103367473 ns/op	 1058620 B/op	   11189 allocs/op
BenchmarkPreemptAction_SmallCluster-4          	      10	 103326546 ns/op	 1052188 B/op	   11189 allocs/op
BenchmarkPreemptAction_MediumCluster-4         	       9	 112734074 ns/op	 4211004 B/op	   38771 allocs/op
BenchmarkPreemptAction_MediumCluster-4         	       9	 112387393 ns/op	 4215351 B/op	   38773 allocs/op
BenchmarkPreemptAction_MediumCluster-4         	       9	 112472358 ns/op	 4210960 B/op	   38772 allocs/op
BenchmarkPreemptAction_MediumCluster-4         	       9	 112499717 ns/op	 4215422 B/op	   38773 allocs/op
BenchmarkPreemptAction_MediumCluster-4         	       9	 112268688 ns/op	 4215157 B/op	   38772 allocs/op
BenchmarkPreemptAction_MediumCluster-4         	       9	 112482776 ns/op	 4210933 B/op	   38771 allocs/op
BenchmarkConsolidationAction_SmallCluster-4    	       9	 113097511 ns/op	 5875452 B/op	   73554 allocs/op
BenchmarkConsolidationAction_SmallCluster-4    	       9	 113442490 ns/op	 5875687 B/op	   73570 allocs/op
BenchmarkConsolidationAction_SmallCluster-4    	       9	 113272827 ns/op	 5879157 B/op	   73603 allocs/op
BenchmarkConsolidationAction_SmallCluster-4    	       9	 113312176 ns/op	 5882494 B/op	   73534 allocs/op

@github-actions
Copy link

Merging this branch will increase overall coverage

Impacted Packages Coverage Δ 🤖
github.com/NVIDIA/KAI-scheduler/pkg/env-tests 75.68% (ø)
github.com/NVIDIA/KAI-scheduler/pkg/scheduler/k8s_internal/predicates 64.02% (+4.29%) 👍

Coverage by file

Changed files (no unit tests)

Changed File Coverage Δ Total Covered Missed 🤖
github.com/NVIDIA/KAI-scheduler/pkg/scheduler/k8s_internal/predicates/config_maps.go 97.18% (+2.54%) 71 (+15) 69 (+16) 2 (-1) 👍

Please note that the "Total", "Covered", and "Missed" counts above refer to code statements instead of lines of code. The value in brackets refers to the test coverage of that file in the old version of the code.

Changed unit test files

  • github.com/NVIDIA/KAI-scheduler/pkg/env-tests/scheduler_test.go
  • github.com/NVIDIA/KAI-scheduler/pkg/scheduler/k8s_internal/predicates/config_maps_test.go

@enoodle
Copy link
Collaborator Author

enoodle commented Feb 11, 2026

@coderabbitai review

@coderabbitai
Copy link

coderabbitai bot commented Feb 11, 2026

✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@enoodle enoodle force-pushed the erez/fix-optional-configmap branch from 37ffe96 to 90ee60a Compare February 11, 2026 15:01
@github-actions
Copy link

Merging this branch will increase overall coverage

Impacted Packages Coverage Δ 🤖
github.com/NVIDIA/KAI-scheduler/pkg/env-tests 75.68% (ø)
github.com/NVIDIA/KAI-scheduler/pkg/scheduler/k8s_internal/predicates 64.02% (+4.29%) 👍

Coverage by file

Changed files (no unit tests)

Changed File Coverage Δ Total Covered Missed 🤖
github.com/NVIDIA/KAI-scheduler/pkg/scheduler/k8s_internal/predicates/config_maps.go 97.18% (+2.54%) 71 (+15) 69 (+16) 2 (-1) 👍

Please note that the "Total", "Covered", and "Missed" counts above refer to code statements instead of lines of code. The value in brackets refers to the test coverage of that file in the old version of the code.

Changed unit test files

  • github.com/NVIDIA/KAI-scheduler/pkg/env-tests/scheduler_test.go
  • github.com/NVIDIA/KAI-scheduler/pkg/scheduler/k8s_internal/predicates/config_maps_test.go

@enoodle enoodle enabled auto-merge February 12, 2026 10:42
@enoodle enoodle added this pull request to the merge queue Feb 12, 2026
Merged via the queue into main with commit 66bf3ec Feb 12, 2026
11 checks passed
@enoodle enoodle deleted the erez/fix-optional-configmap branch February 12, 2026 11:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ConfigMap predicate does not respect the Optional field, blocking scheduling for optional ConfigMaps

2 participants