Commit Graph

451 Commits

Author SHA1 Message Date
Kubernetes Prow Robot
5f900f6332
Merge pull request #84389 from ahg-g/ahg-interpod
Predicates use SharedLister interface instead of NodeInfo Map
2019-10-29 13:06:53 -07:00
Jun Gong
b4c2b00690 Make sure score plugins are executed when no priority configured 2019-10-29 17:25:35 +08:00
Jun Gong
2a85727ec5 When schedule begins, run snapshot before prefilter plugins 2019-10-28 14:59:42 +08:00
Abdullah Gharaibeh
05cb382357 Update PredicateMetadataProducer to accept a scheduler SharedLister instead of nodeinfomap 2019-10-25 19:19:23 -04:00
Abdullah Gharaibeh
8ec56aeafb Change all scheduler's Node and Pod list/lookups to be from the snapshot rather than the cache. 2019-10-25 14:24:55 -04:00
zouyee
b86dbb97df rename scheduler fake listers
Signed-off-by: Zou Nengren <zouyee1989@gmail.com>
2019-10-25 13:09:01 +08:00
Jordan Liggitt
feac7a40f5 Feature-gate PDB informer starts 2019-10-24 01:17:39 -04:00
Abdullah Gharaibeh
373cf8c1b1 move nodeinfo/snapshot.go into its own package 2019-10-23 16:12:13 -04:00
Kubernetes Prow Robot
a90b9402c9
Merge pull request #84232 from ahg-g/ahg-tree2
fixed node search starting point
2019-10-23 12:52:16 -07:00
Kubernetes Prow Robot
4f63f61c36
Merge pull request #84193 from ahg-g/ahg-list
Separate scheduler listers into their own package
2019-10-23 12:51:30 -07:00
Abdullah Gharaibeh
d17cf7ddff fixed node search starting point 2019-10-23 07:51:56 -04:00
Abdullah Gharaibeh
d393804237 separate listers into their own package 2019-10-22 18:11:02 -04:00
Guoliang Wang
9d173852c1 Add a metric to track number of scheduler prioritizing goroutines 2019-10-21 16:38:14 +08:00
draveness
ce33fcc311 feat: remove FakePDBLister 2019-10-19 19:10:42 +08:00
draveness
e1f86e3460 feat(scheduler): replace several algorithm listers with client listers 2019-10-19 17:26:32 +08:00
Kubernetes Prow Robot
70f68062ad
Merge pull request #84014 from ahg-g/ahg-tree
Make node tree order part of the snapshot
2019-10-18 15:21:37 -07:00
Abdullah Gharaibeh
63d7733e98 create an ordered list of nodes instead of iterating over the tree 2019-10-18 12:51:46 -04:00
Kubernetes Prow Robot
d1a79f136b
Merge pull request #84054 from ahg-g/ahg-gp
GeneralPredicate as framework plugin config
2019-10-17 21:19:58 -07:00
Abdullah Gharaibeh
517116921b GeneralPredicate as plugin config 2019-10-17 11:13:57 -04:00
Abdullah Gharaibeh
1293facf7b cleanup unnecessary func parameters in genericScheduler methods 2019-10-17 10:31:14 -04:00
Kubernetes Prow Robot
3719fcdffa
Merge pull request #82072 from draveness/feature/use-context-instead-of-channel
feat(scheduler): use context in scheduler package
2019-10-17 01:46:39 -07:00
Abdullah Gharaibeh
17a6a7914c make sure filters are executed when no predicates configured 2019-10-16 21:27:57 -04:00
draveness
47a6c5b693 feat(scheduler): use context in the scheduler package
+ Use context instead of stopCh
+ Add context to the scheduling framework interface
2019-10-17 09:03:55 +08:00
Abdullah Gharaibeh
e073e56095 move scheduler cache ListNodes interface to snapshot 2019-10-14 17:47:42 -04:00
Kubernetes Prow Robot
aee99ce807
Merge pull request #83558 from hprateek43/sortable_list_package
Move Sortable List into its own package
2019-10-12 11:40:38 -07:00
Harsh Singh
589656108e Replaced sortable list with native golang slice. 2019-10-12 21:57:28 +05:30
draveness
1f52bd80d1 feat(scheduler): expand node score range to [0, 100] 2019-10-11 23:43:09 +08:00
Guoliang Wang
d3e8f17987 Add more tracing steps in generic_scheduler 2019-10-11 10:39:41 +08:00
Abdullah Gharaibeh
1751c251d8 Addressed comments 2019-10-08 16:13:13 -04:00
Abdullah Gharaibeh
bc550b0896 Added PredicateMetadata and PriorityMetadata as CycleState to the framework 2019-10-07 22:25:08 -04:00
Abdullah Gharaibeh
66386fdf49 Added the first predicate as a filter plugin: PodToleratesNodeTaints. 2019-10-05 08:43:17 -04:00
Kubernetes Prow Robot
ca038117b2
Merge pull request #83490 from draveness/feature/scale-extender-output
feat(scheduler): scale the extender output in generic scheduler
2019-10-04 10:22:52 -07:00
draveness
27326e4f9a feat(scheduler): scale the extender output in generic scheduler 2019-10-04 17:32:34 +08:00
draveness
c73ff9749b feat(scheduler): rename PluginContext to CycleState 2019-10-04 17:30:36 +08:00
Kubernetes Prow Robot
dc0013a506
Merge pull request #83365 from notpad/feature/83244
A consistent interface for plugin extended functionality
2019-10-01 13:01:11 -07:00
Wei Huang
a01259ef6f
bazel and codegen files 2019-10-01 09:51:40 -07:00
Wei Huang
cbdb4e3fdb
refactor scheduler extender related API
- move extender related API from pkg/scheduler/api to pkg/scheduler/apis/extender/v1

- alias extenderv1 to pkg/scheduler/apis/extender/v1

- use NodeScore and NodeScoreList in non-extender logic
2019-10-01 09:51:24 -07:00
notpad
fc55e74741 A consistent interface for plugin extended functionality 2019-10-01 23:59:48 +08:00
SataQiu
bcaa991676 scheduler: code clean up for predicates/metadata 2019-09-29 10:11:53 +08:00
Kubernetes Prow Robot
0b4cccc9d1
Merge pull request #82912 from ahg-g/ahg-prefilter-update
An interface that allows pre-filter plugins to update their pre-calculated status
2019-09-25 11:06:40 -07:00
Kubernetes Prow Robot
8ad1aba7f5
Merge pull request #82465 from hprateek43/MoveGetPodPriority
Move GetPodPriority from /scheduler/util to /api/pod
2019-09-25 11:06:00 -07:00
Abdullah Gharaibeh
37b9e6d1ea An interface that allows pre-filter plugins to update their pre-calculated.
This is needed to allow efficient preemption simulations: during preemption, we remove/add pods from each node before running the filter plugins again to evaluate whether removing/adding specific pods will allow the incoming pod to be scheduled on the node. Instead of calling prefilter again, we should allow the plugin to do incremental update to its pre-computed state.
2019-09-24 13:01:50 -04:00
Harsh Singh
6a9ef7f04f Move GetPodPriority from /scheduler/util to /api/pod 2019-09-24 22:02:13 +05:30
Kubernetes Prow Robot
40a8d9ebee
Merge pull request #82735 from ahmad-diaa/remove-NewConfigFactory-compatibility-test
Improve Scheduler Compatibility Test
2019-09-20 16:17:37 -07:00
Ahmad Diaa
009ffaf803 validate scheduler policy instead of the decoded policy in compatibility_test 2019-09-20 21:42:12 +02:00
Abdullah Gharaibeh
89f936f6ac Modified the Filter interface to pass in nodeinfo instead of node name.
This is necessary to support preemption, which relies on passing modified nodeinfo objects to the filters to simulate evicting lower-priority pods.
2019-09-18 17:27:33 -04:00
Kubernetes Prow Robot
e53a952fa4
Merge pull request #82283 from ahmad-diaa/fix-field-types-in-scheduler-api-types
Migrate scheduler api types to sized integers
2019-09-12 15:56:32 -07:00
Kubernetes Prow Robot
82f5531df3
Merge pull request #82119 from wgliang/fixbug/fix-scheudle-function-context
Take the context as the first argument of Schedule
2019-09-12 11:46:28 -07:00
Ahmad Diaa
801cc549be migrate scheduler api types to sized integers 2019-09-12 19:06:40 +02:00
Kubernetes Prow Robot
96201b5e57
Merge pull request #82156 from mrkm4ntr/fix-evaluated-nodes
Fix EvaluatedNodes in ScheduleResult
2019-09-11 22:52:39 -07:00
Kubernetes Prow Robot
02433e0a72
Merge pull request #82209 from yutedz/gen-sched-err
Handle pod addition / removal errors
2019-09-11 15:24:34 -07:00
Shintaro Murakami
bb94dfea1e Fix EvaluatedNodes in ScheduleResult 2019-09-11 22:01:25 +09:00
Kubernetes Prow Robot
7351f1acd7
Merge pull request #81777 from mrkm4ntr/remove-pod-lister
Remove unnecessary factory layer
2019-09-10 14:32:15 -07:00
Ted Yu
89a70fa407 Handle pod addition / removal errors 2019-09-06 16:25:11 -07:00
Guoliang Wang
d84a75c140 Fix filter plugins are not been called during preemption 2019-09-06 09:59:01 +08:00
Kubernetes Prow Robot
b33968972b
Merge pull request #82034 from alculquicondor/feat/unschedulable_unresolvable
[Framework] Add UnschedulableAndUnresolvable status code
2019-08-30 11:20:57 -07:00
Guoliang Wang
008f4e2ddc Take the context as the first argument of Schedule 2019-08-29 17:47:49 +08:00
Aldo Culquicondor
3c1f8a8c4e [Framework] Add UnschedulableAndUnresolvable status code
The status can be used by (Pre)Filter plugins to indicate that
preemption wouldn't change the decision of the filter.

Signed-off-by: Aldo Culquicondor <acondor@google.com>
2019-08-28 10:10:47 -04:00
Kubernetes Prow Robot
e57bee7332
Merge pull request #81840 from draveness/feature/move-node-info-snapshot-to-framework
feat(scheduler): move node info snapshot out of internal package
2019-08-26 16:42:54 -07:00
Kubernetes Prow Robot
12e6930d8a
Merge pull request #81842 from verb/range-scheduler
Add test for HTTPExtender.IsInterested
2019-08-25 15:48:20 -07:00
Shintaro Murakami
a0c93b10c9 Remove unnecessary factory layer 2019-08-24 08:08:30 +09:00
Kubernetes Prow Robot
4680ec8fde
Merge pull request #81346 from mrkm4ntr/fits-on-node-fast-path
Add fast path to podFitsOnNode
2019-08-23 15:48:26 -07:00
Lee Verberne
cb03a332fd Add test for HTTPExtender.IsInterested 2019-08-23 17:07:34 +00:00
draveness
ffef11f768 feat(scheduler): move node info snapshot out of internal package 2019-08-23 22:32:16 +08:00
draveness
f3816fb757 feat: use PreFilter instead of Prefilter in the scheduling framework 2019-08-23 02:09:00 +08:00
Shintaro Murakami
acd82613ef Add fast path to podFitsOnNode
Add test
2019-08-22 17:21:00 +09:00
Kubernetes Prow Robot
90df64b75b
Merge pull request #81614 from liu-cong/score-refactor
Move RunNormalizeScorePlugins and ApplyScoreWeights into RunScorePlugins; Also add unit tests for RunScorePlugins.
2019-08-21 10:37:29 -07:00
Cong Liu
e50a24d64c Move RunNormalizeScorePlugins and ApplyScoreWeights into RunScorePlugins; Also add unit tests for RunScorePlugins. 2019-08-20 13:18:32 -04:00
Wei Huang
8f559ea53b
Optimize internal data structure of EvenPodsSpread
- Rename 'topologyPairsPodSpreadMap' to 'podSpreadCache'
- New struct `criticalPaths criticalPaths`
- Add unified method `*criticalPaths.update()` for:
    - regular update
    - addPod in preemption case
    - remotePod in preemption case
2019-08-20 09:26:41 -07:00
Kubernetes Prow Robot
1906650d92
Merge pull request #80901 from draveness/feature/use-map-instead-of-array
feat: use named array instead of array in normalizing score
2019-08-14 03:28:25 -07:00
Kubernetes Prow Robot
2ad2795136
Merge pull request #79641 from yqwang-ms/yqwang/fix-ds-crash
Fix default scheduler crash if scheduler extender filter returns a not found node
2019-08-14 02:08:37 -07:00
Yuqi Wang
5927ec4f8b Fix default scheduler crash if scheduler extender filter returns a not found node 2019-08-14 10:38:42 +08:00
Kubernetes Prow Robot
f3c94c9c42
Merge pull request #81151 from mrkm4ntr/remove-node-lister
Remove algorithm.NodeLister from scheduler interface
2019-08-13 12:29:55 -07:00
Shintaro Murakami
11f043c784 Remove algorithm.NodeLister from scheduler interface
Will fixup
2019-08-13 10:30:30 +09:00
draveness
aa5f9fda52 feat: use named array instead of score array in normalizing score 2019-08-08 08:19:49 +08:00
Wei Huang
b6b2838a95
Fix a racing issue in FakeFilterPlugin
Filter() is called simultaneously, so the member of its (fake) implementation
cannot be written without lock.

The issue can be triggered by:

go test k8s.io/kubernetes/pkg/scheduler/core --race --count=50
2019-08-07 10:33:44 -07:00
Joe Betz
46a04d50af Replace string concatination with trace fields 2019-08-05 12:18:57 -07:00
draveness
feb64858aa feat: implement "post-filter" extension point for scheduling framework 2019-08-02 10:12:54 +08:00
Kubernetes Prow Robot
aaad4c4afa
Merge pull request #80533 from alculquicondor/refactor/find_nodes
Query nodes in Schedule only when there are no predicates
2019-08-01 13:38:28 -07:00
Kubernetes Prow Robot
ac1cde5577
Merge pull request #78009 from hainesc/develop
Use reservoir sampling to select one host from priority list
2019-08-01 00:52:15 -07:00
Cong Liu
34373662d3 Add NormalizeScore extension point for scheduler framework. 2019-07-30 20:02:13 -04:00
Aldo Culquicondor
e703226522 Optimize Schedule by querying nodes only when needed.
Signed-off-by: Aldo Culquicondor <acondor@google.com>
2019-07-25 08:24:05 -04:00
Wei Huang
2027525abf
EvenPodsSpread: Preemption UT on generic_scheduler 2019-07-24 15:27:55 -07:00
Kubernetes Prow Robot
d83cf5f274
Merge pull request #77828 from Huang-Wei/eps-pred-core
Even Pods Spread - 3. Predicates Core
2019-07-24 15:19:52 -07:00
Kubernetes Prow Robot
cbae6ed036
Merge pull request #80220 from alculquicondor/refactor/scheduler-cache
Use scheduler cache in affinity priority functions
2019-07-24 13:50:06 -07:00
Wei Huang
b99fb9187b
EvenPodsSpread: UT on genericScheduler.Schedule() 2019-07-24 10:28:46 -07:00
Aldo Culquicondor
f58abdf966 Use scheduler cache in affinity priority functions
Make the cache implement NodeLister and expose it to the priority
functions. This way, the priority functions make use of a single cache,
the scheduler's, instead of mixing it with the lister's caches.

Signed-off-by: Aldo Culquicondor <acondor@google.com>
2019-07-23 22:10:49 -04:00
Youbing Li
7f9dd949e0 The implementation of Filter extension for the new framework 2019-07-17 03:28:30 -04:00
Abdullah Gharaibeh
c54c4d1962 Score plugin for the scheduling framework. 2019-07-16 09:38:37 -04:00
Jianfei Bai
95bd52cfe9 Trace step should be at the end of calls rather than the begin. 2019-07-08 16:54:04 +08:00
Kubernetes Prow Robot
fa65154a58
Merge pull request #78412 from draveness/feature/assign=start-time-for-test-pod
fix: assign default value for pod.Status.StartTime in TestSelectNodes…
2019-06-28 08:05:39 -07:00
Abdullah Gharaibeh
a61a437ef2 prefilter extension point implementation. 2019-06-10 17:01:50 -04:00
ahg-g
ece3e3cdba
Revert "Faster scheduler" 2019-06-06 22:34:18 -04:00
wangqingcan
52f3380ef3 change preempting to PreemptionPolicy 2019-05-31 12:42:05 +08:00
wangqingcan
5c9438c691 non-preempting-priorityclass
Co-authored-by: Vallery Lancey <vallery@zeitgeistlabs.io>
Co-authored-by: Tan shanshan <tan.shanshan@zte.com.cn>
2019-05-31 12:37:07 +08:00
draveness
196a6d65c7 fix: assign default value for pod.Status.StartTime in TestSelectNodesForPreemption 2019-05-29 20:18:54 +08:00
Haines Chan
f977863f70 Use reservoir sampling to select one host from priority list 2019-05-27 22:25:58 +08:00
JieJhih Jhang
2cd5fc54a1 add scheduling framework configuration
update bazel build

fix get plugin config method

initialize only needed plugins

fix unit test

fix import duplicate package

update bazel

add docstrings

add weight field to plugin

add plugin to v1alpha1

add plugins at appropriate extension points

remove todo statement

fix import package file path

set plugin json schema

add plugin unit test to option

initial plugin in test integration

initialize only needed plugins

update bazel

rename func

change plugins needed logic

remove v1 alias

change the comment

fix alias shorter

remove blank line

change docstrings

fix map bool to struct

add some docstrings

add unreserve plugin

fix docstrings

move variable inside the for loop

make if else statement cleaner

remove plugin config from reserve plugin unit test

add plugin config and reduce unnecessary options for unit test

update bazel

fix race condition

fix permit plugin integration

change plugins to be pointer

change weight to int32

fix package alias

initial queue sort plugin

rename unreserve plugin

redesign plugin struct

update docstrings

check queue sort plugin amount

fix error message

fix condition

change plugin struct

add disabled plugin for unit test

fix docstrings

handle nil plugin set
2019-05-18 06:30:28 +08:00
draveness
d60bccc6a4 feat: implement "queue-sort" extension point for scheduling framework 2019-05-15 09:40:15 +08:00
Wei Huang
c4df3a2c44
prevent predicatesOrdering from escaping from UT
- sets `predicatesOrdering` back to original value in UT
2019-05-08 18:05:34 -07:00
Abdullah Gharaibeh
e660e84459 Faster scheduler. 2019-05-08 09:49:01 -04:00
Bobby (Babak) Salamat
83828bcb2d autogenerated files 2019-04-29 16:40:56 -07:00
Bobby (Babak) Salamat
404dc1ed79 Update scheduler framework plugins to align with the latest changes to the framework design 2019-04-29 16:40:56 -07:00
Jun Gong
49832cf887 Save pod priority to avoid repeated calculation 2019-04-11 11:09:47 +08:00
Kubernetes Prow Robot
fdeedf4431
Merge pull request #75911 from marsno1/fix-forloop-in-preemption
Improve for-loop in nodesWherePreemptionMightHelp function
2019-04-09 11:21:01 -07:00
madianjun
d84a8c563e Improve for-loop in nodesWherePreemptionMightHelp function 2019-04-09 15:24:50 +08:00
Kubernetes Prow Robot
1ac4cc7980
Merge pull request #75703 from tedyu/master
Simplify the loop for latest start time in pickOneNodeForPreemption
2019-04-01 13:18:58 -07:00
Jun Gong
042b83ba73 Pick pods for preemption based on StartTime of pods when priorities are equal 2019-03-26 09:04:50 +08:00
Ted Yu
dbdc782412 Simplify the loop for latest start time in pickOneNodeForPreemption 2019-03-25 15:53:03 -07:00
Kubernetes Prow Robot
057ad6d4ce
Merge pull request #75571 from Huang-Wei/shorten-alias
shorten scheduler package alias for better readability
2019-03-22 02:34:17 -07:00
Wei Huang
49346c1e04
shorten scheduler package alias for better readability
- schedulerinternalcache -> internalcache
2019-03-21 18:14:19 -07:00
Jun Gong
2755373470 Avoid unnecessary sort for some cases in selectVictimsOnNode 2019-03-20 17:52:37 +08:00
Kubernetes Prow Robot
8592098e60
Merge pull request #74974 from goodluckbot/pick-node-preempt-start-time
Pick node for preemption based on start time of pods
2019-03-19 21:26:49 -07:00
goodluckbot
8d991e6ee2 Pick node for preemption based on start time of pods 2019-03-12 12:30:15 +08:00
Kubernetes Prow Robot
7bcdbc5a51
Merge pull request #74446 from yanghaichao12/comm0223
Fix typos
2019-03-05 23:24:00 -08:00
yanghaichao12
b475cdf7fc Fix typos
change SupportsPreemption

change comment again
2019-03-05 02:12:55 -05:00
Bobby (Babak) Salamat
a1b8777d42 Revert "Merge pull request #73934 from bsalamat/num_cpu"
This reverts commit cfe4ca8012, reversing
changes made to f16035600a.
2019-03-04 13:14:25 -08:00
Kubernetes Prow Robot
cfe4ca8012
Merge pull request #73934 from bsalamat/num_cpu
Use runtime.NumCPU() instead of a fixed value for parallel scheduler threads
2019-03-01 23:04:17 -08:00
danielqsj
f7b437cae0 convert latency in mertics name to duration 2019-02-22 21:40:13 +08:00
Bobby (Babak) Salamat
e0ad271891 Optimize scheduler cache snapshotting using an MRU structure. 2019-02-20 13:38:37 -08:00
Bobby (Babak) Salamat
d0ebeefbc4 Use runtime.NumCPU() instead of a fixed value for parallel scheduler threads. 2019-02-11 13:37:30 -08:00
Andrew Kim
93b086f6ea replace k8s.io/apiserver/pkg/util/trace with k8s.io/utils/trace 2019-01-24 15:34:21 -05:00
Bobby (Babak) Salamat
fa6d17f400 Cleanup todo 2019-01-15 17:03:59 -08:00
Kubernetes Prow Robot
14b2014c4a
Merge pull request #72079 from sonasingh46/cleanup
refactor(scheduler): Move priority types to priorities package
2019-01-15 09:24:15 -08:00
Kubernetes Prow Robot
148248353b
Merge pull request #72895 from bsalamat/no_refresh_preemption
Do not snapshot scheduler cache before starting preemption
2019-01-14 22:06:14 -08:00
Bobby (Babak) Salamat
127321296c Fix and improve preemption test to work with the new logic 2019-01-14 14:27:16 -08:00
Bobby (Babak) Salamat
e3f4e1e378 Do not snapshot scheduler cache before starting preemption 2019-01-14 12:07:50 -08:00
sonasingh46
1fe7ce21bc refactor(scheduler): Move priority types to priorities package
This moves the priority types from the algorithm package
to priorities package.
Idea is to move the type to the packages where it is
implemented. This will ease the future refactor process.
2019-01-09 02:39:11 +05:30
danielqsj
5b42a84cde Change scheduler metrics to conform guideline 2019-01-08 11:16:01 +08:00
Kubernetes Prow Robot
2a1560061e
Merge pull request #65546 from ravigadde/ext-api
Add missing json tags to extender config
2019-01-04 01:08:29 -08:00
Kubernetes Prow Robot
1c2624effc
Merge pull request #71926 from wgliang/feature/modify-scheduler-result-and-add-log
[scheduler] Modify the scheduling result struct and improve logging f…
2019-01-03 14:37:50 -08:00
Ravi Gadde
4fcc712cc9 Add missing json tags to extender config 2019-01-03 14:20:24 -08:00
Guoliang Wang
3e69638772 [scheduler] Modify the scheduling result struct and improve logging for successful binding 2019-01-03 11:00:35 +08:00
Kubernetes Prow Robot
65f87b5a4a
Merge pull request #72259 from bsalamat/fix_nominated_node
Fix a race in setting nominated node and the scheduling cycle after it.
2018-12-30 00:01:26 -08:00
Bobby (Babak) Salamat
7044145920 Fix race in setting nominated node 2018-12-29 22:54:15 -08:00
Kubernetes Prow Robot
d6e0d5a9e8
Merge pull request #71929 from tanshanshan/schedulerlittle10
add description about namespace for  pod in log
2018-12-28 10:52:12 -08:00
wangqingcan
b82a1d4600 Move predicate types from algorithm to predicates 2018-12-21 22:26:47 +08:00
Kubernetes Prow Robot
0d63cf9caa
Merge pull request #67037 from Huang-Wei/cleanup-ood
cleanup logic related with OutOfDisk
2018-12-20 17:30:27 -08:00
Guoliang Wang
6515c4e09b Set percentage of nodes scored in each cycle dynamically based on the cluster size 2018-12-20 11:20:00 +08:00
Wei Huang
8f87e71e0c
cleanup logic related with OutOfDisk
- cleanup OOD logic in scheduling and node controller
- update comments and testcases
2018-12-18 11:28:02 -08:00
Harry Zhang
797601d99d Fixed outdated bazel 2018-12-17 17:05:49 -08:00
wangqingcan
1081e919e3 Eclass Task 1: clean up old equiv class code
Co-authored-by: Harry Zhang <resouer@gmail.com>
Co-authored-by: Wang Qingcan <wangqingcan@baidu.com>
2018-12-17 17:05:49 -08:00
Kubernetes Prow Robot
1d59ab05fa
Merge pull request #71118 from ping035627/k8s-181115
Add some exception handling of Preempt
2018-12-17 12:10:31 -08:00
Jonathan Basseri
8e25361320 Move ScheduleAlgorithm to the core package.
This moves the type `ScheduleAlgorithm` from `pkg/scheduler/algorithm`
to `pkg/scheduler/core`. The reason for this move is to fix our import
dependency graph and allow predicate & priority types to be moved into
their appropriate packages.

The new location makes sense because `core` is the only package that
exports an implementation of this type.
2018-12-13 15:08:38 -08:00
Kubernetes Prow Robot
05183bffe5
Merge pull request #71872 from yuexiao-wang/scheduler-nodeinfo
[scheduler cleanup phase 2]: Rename `pkg/scheduler/cache` to `pkg/scheduler/nodeinfo`
2018-12-12 08:08:33 -08:00
yuexiao-wang
7b6f60f085 modify BUILD
Signed-off-by: yuexiao-wang <wang.yuexiao@zte.com.cn>
2018-12-11 11:22:06 +08:00
yuexiao-wang
f3353c358d [scheduler cleanup phase 2]: Rename to
Signed-off-by: yuexiao-wang <wang.yuexiao@zte.com.cn>
2018-12-11 11:21:12 +08:00
tanshanshan
a26074802f add description about namespace for pod in log 2018-12-11 10:42:27 +08:00
PingWang
98f852a441 Add some exception handling of Preempt
Signed-off-by: PingWang <wang.ping5@zte.com.cn>

revert options

Signed-off-by: PingWang <wang.ping5@zte.com.cn>

update returns for Preempt

Signed-off-by: PingWang <wang.ping5@zte.com.cn>

revert Preempt returns

Signed-off-by: PingWang <wang.ping5@zte.com.cn>

go fmt

Signed-off-by: PingWang <wang.ping5@zte.com.cn>

update the preempt

Signed-off-by: PingWang <wang.ping5@zte.com.cn>

move preemptionStartTime := time.Now() from line 496 to the else block.

Signed-off-by: PingWang <wang.ping5@zte.com.cn>
2018-12-10 08:44:10 +08:00
Kubernetes Prow Robot
f62b530f4d
Merge pull request #57057 from greghaynes/reschedule-with-backoff
Reschedule with backoff
2018-12-07 21:13:57 -08:00
Gregory Haynes
5e4ccede4c Reschedule with backoff
With the alpha scheduling queue we move pods from unschedulable to
active on certain events without a backoff. As a result we can cause
starvation issues if high priority pods are in the unschedulable queue.
Implement a backoff mechanism for pods being moved to active.

Closes #56721
2018-12-06 16:38:34 +00:00
Bobby (Babak) Salamat
ece8f42ea2 Run old-style priority functions in parallel to the map-reduce style ones 2018-12-04 17:58:28 -08:00
Bobby (Babak) Salamat
76591db7d4 Avoid copying Extender struct while running priority functions 2018-12-04 13:50:59 -08:00
Bobby (Babak) Salamat
70f923ed05 Avoid copying PriorityConfig struct while running priority functions 2018-12-04 11:28:25 -08:00
Bobby (Babak) Salamat
e60f510e38 Autogenerated files 2018-11-30 16:03:47 -08:00
Bobby (Babak) Salamat
f74b30868c Add plugin invocation for 'reserve' and 'prebind' plugins to the scheduler. 2018-11-30 16:03:47 -08:00
k8s-ci-robot
527d1c34cc
Merge pull request #70947 from Adirio/nodetree-thread-safety
Scheduler internal NodeTree thread-safe NumNodes
2018-11-29 07:36:48 -08:00
k8s-ci-robot
7e621ccb08
Merge pull request #71063 from Huang-Wei/nodeinfo-clone-panic
fix a scheduler panic due to internal cache inconsistency
2018-11-16 20:27:44 -08:00
Wei Huang
b4fd11512a
ensure scheduler preemptor behaves in an efficient/correct path
- don't update nominatedMap cache when Pop() an element from activeQ
- instead, delete the nominated info from cache when it's "assumed"
- unit test behavior adjusted
- expose SchedulingQueue in factory.Config
2018-11-16 14:22:15 -08:00
Wei Huang
a86ba8b3c4
fix a scheduler panic due to internal cache inconsistency 2018-11-16 13:02:13 -08:00
Adrián Orive
c7cba7370f Scheduler internal NodeTree thread-safe NumNodes
Signed-off-by: Adrián Orive <adrian.orive.oneca@gmail.com>
2018-11-13 08:40:48 +01:00
Davanum Srinivas
954996e231
Move from glog to klog
- Move from the old github.com/golang/glog to k8s.io/klog
- klog as explicit InitFlags() so we add them as necessary
- we update the other repositories that we vendor that made a similar
change from glog to klog
  * github.com/kubernetes/repo-infra
  * k8s.io/gengo/
  * k8s.io/kube-openapi/
  * github.com/google/cadvisor
- Entirely remove all references to glog
- Fix some tests by explicit InitFlags in their init() methods

Change-Id: I92db545ff36fcec83afe98f550c9e630098b3135
2018-11-10 07:50:31 -05:00
Mike Danese
62c3ec969d Fix a race in the scheduler.
Loop over priorityConfigs seperately. The node loop can only safely
modify result[i][index]. Before this change it sometimes modified
result[i] concurrently with other loops.

Fixes: 7164967662

==================== Test output for //pkg/scheduler/core:go_default_test:
==================
WARNING: DATA RACE
Read at 0x00c0005e8ed0 by goroutine 22:
  k8s.io/kubernetes/pkg/scheduler/core.PrioritizeNodes.func2()
      pkg/scheduler/core/generic_scheduler.go:667 +0x2ea
  k8s.io/kubernetes/vendor/k8s.io/client-go/util/workqueue.ParallelizeUntil.func1()
      staging/src/k8s.io/client-go/util/workqueue/parallelizer.go:65 +0x9e

Previous write at 0x00c0005e8ed0 by goroutine 21:
  k8s.io/kubernetes/pkg/scheduler/core.PrioritizeNodes.func2()
      pkg/scheduler/core/generic_scheduler.go:668 +0x450
  k8s.io/kubernetes/vendor/k8s.io/client-go/util/workqueue.ParallelizeUntil.func1()
      staging/src/k8s.io/client-go/util/workqueue/parallelizer.go:65 +0x9e

Goroutine 22 (running) created at:
  k8s.io/kubernetes/vendor/k8s.io/client-go/util/workqueue.ParallelizeUntil()
      staging/src/k8s.io/client-go/util/workqueue/parallelizer.go:57 +0x1a3
  k8s.io/kubernetes/pkg/scheduler/core.PrioritizeNodes()
      pkg/scheduler/core/generic_scheduler.go:682 +0x592
  k8s.io/kubernetes/pkg/scheduler/core.(*genericScheduler).Schedule()
      pkg/scheduler/core/generic_scheduler.go:186 +0x77d
  k8s.io/kubernetes/pkg/scheduler/core.TestGenericScheduler.func1()
      pkg/scheduler/core/generic_scheduler_test.go:464 +0x91f
  testing.tRunner()
      GOROOT/src/testing/testing.go:827 +0x162

Goroutine 21 (running) created at:
  k8s.io/kubernetes/vendor/k8s.io/client-go/util/workqueue.ParallelizeUntil()
      staging/src/k8s.io/client-go/util/workqueue/parallelizer.go:57 +0x1a3
  k8s.io/kubernetes/pkg/scheduler/core.PrioritizeNodes()
      pkg/scheduler/core/generic_scheduler.go:682 +0x592
  k8s.io/kubernetes/pkg/scheduler/core.(*genericScheduler).Schedule()
      pkg/scheduler/core/generic_scheduler.go:186 +0x77d
  k8s.io/kubernetes/pkg/scheduler/core.TestGenericScheduler.func1()
      pkg/scheduler/core/generic_scheduler_test.go:464 +0x91f
  testing.tRunner()
      GOROOT/src/testing/testing.go:827 +0x162
==================
--- FAIL: TestGenericScheduler (0.01s)
    --- FAIL: TestGenericScheduler/test_6 (0.00s)
        testing.go:771: race detected during execution of test
    testing.go:771: race detected during execution of test
FAIL
2018-11-09 15:21:22 -08:00
Jun Gong
9fc369dd0d Add debug info: scheduler extenders's score and its name for each pod 2018-11-08 13:02:57 +08:00
k8s-ci-robot
7984a2bf60
Merge pull request #70564 from KevinWang15/master
Fix typos
2018-11-05 19:04:45 -08:00
k8s-ci-robot
c0daab0e03
Merge pull request #70274 from zhangmingld/combinesimilercode
combine similar code where calucate schedule priority
2018-11-05 08:14:05 -08:00
Ke Wang
946c701b05 Fix Typo: mataData -> metaData; masquared -> masquerade 2018-11-05 21:19:25 +08:00
zhangmingld
7164967662 combine similar code where calucate schedule priority 2018-10-31 08:59:53 +08:00
zhangmingld
429e67a12f duplicated glog.V(10) when had a if glog.V(10) 2018-10-29 11:30:16 +08:00
k8s-ci-robot
c00f19bd15
Merge pull request #68403 from wgliang/master.deprecate-Parallelize
Replace Parallelize with function ParallelizeUntil and formally depre…
2018-10-06 09:40:07 -07:00
Guoliang Wang
187e2e01c9 Move scheduler cache interface and implementation to pkg/scheduler/internal/cache 2018-10-06 20:48:59 +08:00
Christoph Blecker
97b2992dc1
Update gofmt for go1.11 2018-10-05 12:59:38 -07:00
Guoliang Wang
c2622dd9d8 Replace Parallelize with function ParallelizeUntil and formally deprecate the Parallelize 2018-10-05 17:56:56 +08:00
Wei Huang
9da576f03c
move SchedulingQueue to pkg/scheduler/internal/queue 2018-09-28 11:51:02 -07:00
Wei Huang
2e7461c087
auto-generated files 2018-09-28 11:51:01 -07:00
k8s-ci-robot
db1d1c8674
Merge pull request #68700 from Huang-Wei/schedulingQ-graceful-shutdown
shutdown schedulingQueue gracefully
2018-09-28 00:46:14 -07:00
Wei Huang
be661fddb4
shutdown schedulingQueue gracefully
- add Close() to interface SchedulingQueue
- implement Close() for FIFO and PriorityQueue
- add unit test
2018-09-27 14:32:58 -07:00
k8s-ci-robot
a6bc5aa49e
Merge pull request #68563 from DylanBLE/dev
fix scheduler crash when Prioritize Map function failed
2018-09-26 22:59:04 -07:00
Bobby (Babak) Salamat
f340f8baf8 Remove PDB and its event handlers from the scheduler cache 2018-09-26 14:22:21 -07:00
hongjian.sun
f33c2c11f2 fix scheduler crash when Prioritize Map function failed 2018-09-26 20:16:05 +08:00
k8s-ci-robot
28d86ac47d
Merge pull request #67308 from cofyc/fix67260
Use monotonically increasing generation to prevent equivalence cache race
2018-09-25 00:18:00 -07:00
Yecheng Fu
2f46bc8a18 Use seqeuence number to represent generation of equivalence cache.
- snapshot equivalence cache generation numbers before snapshotting the
scheduler cache
- skip update when generation does not match live generation
- keep the node and increment its generation to invalidate it instead of
deletion
- use predicates order ID as key to improve performance
2018-09-22 12:08:21 +08:00
Yecheng Fu
a2cc1b1a20 Revert "Use sync.map to scale ecache better"
This reverts commit 17d0190706.
2018-09-22 11:33:06 +08:00
Kubernetes Submit Queue
ca43f007a3
Merge pull request #67731 from gnufied/fix-csi-attach-limit
Automatic merge from submit-queue (batch tested with PRs 68161, 68023, 67909, 67955, 67731). If you want to cherry-pick this change to another branch, please follow the instructions here: https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md.

Fix csi attach limit

Add support for volume limits for CSI.

xref: https://github.com/kubernetes/community/pull/2051

```release-note
Add support for volume attach limits for CSI volumes
```
2018-09-05 14:51:55 -07:00
Kubernetes Submit Queue
a0b457d0e5
Merge pull request #67555 from wgliang/opt/improve-performance
Automatic merge from submit-queue (batch tested with PRs 67555, 68196). If you want to cherry-pick this change to another branch, please follow the instructions here: https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md.

Not split nodes when searching for nodes but doing it all at once

**What this PR does / why we need it**:
Not split nodes when searching for nodes but doing it all at once.

**Which issue(s) this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close the issue(s) when PR gets merged)*:
Fixes #

**Special notes for your reviewer**:
@bsalamat 

This is a follow up PR of #66733.

https://github.com/kubernetes/kubernetes/pull/66733#discussion_r205932531

**Release note**:

```release-note
Not split nodes when searching for nodes but doing it all at once.
```
2018-09-04 11:41:34 -07:00
Guoliang Wang
6c63dcfffe Not split nodes when searching for nodes but doing it all at once 2018-09-04 14:07:24 +08:00
Kubernetes Submit Queue
66fa85c837
Merge pull request #67760 from houjun41544/20180823
Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

 Complement unit test case TestNodesWherePreemptionMightHelp for scheduler/core

**What this PR does / why we need it**:

**Which issue(s) this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close the issue(s) when PR gets merged)*:
Fixes #

**Special notes for your reviewer**:

**Release note**:

```release-note

```
2018-08-26 19:39:06 -07:00
houjun
08e5f4573a Complement unit test case TestNodesWherePreemptionMightHelp for scheduler/core 2018-08-23 18:54:23 +08:00
Hemant Kumar
8e4b33d1a8 Move volume limit feature to beta 2018-08-22 19:36:01 -04:00
Hemant Kumar
4b17a48def Implement support for updating volume limits
Create a new predicate to count CSI volumes
2018-08-22 19:36:00 -04:00
Kubernetes Submit Queue
4cca6a89a0
Merge pull request #66862 from resouer/sync-map
Automatic merge from submit-queue (batch tested with PRs 66862, 67618). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Use sync.map to scale equiv class cache better

**What this PR does / why we need it**:

Change the current lock in first level ecache into  `sync.Map`, which is known for scaling better than `sync. Mutex ` on machines with >8 CPUs

ref: https://golang.org/pkg/sync/#Map
 
And the code is much cleaner in this way.

5k Nodes, 10k Pods benchmark with ecache enabled in 64 cores VM:

```bash
// before
BenchmarkScheduling/5000Nodes/0Pods-64             10000          17550089 ns/op

// after
BenchmarkScheduling/5000Nodes/0Pods-64             10000          16975098 ns/op
```
Comparing to current implementation, the improvement after this change is noticeable, and the test is stable in 8, 16, 64 cores VM.

**Special notes for your reviewer**:

**Release note**:

```release-note
Use sync.map to scale ecache better
```
2018-08-21 00:24:01 -07:00
Bobby (Babak) Salamat
abb70aee98 Add a scheduler config argument to set the percentage of nodes to score 2018-08-17 11:18:51 -07:00
Jonathan Basseri
b874d2789b Add metrics to equivalence cache.
This adds counters to equiv. cache reads & writes. Reads are labeled by
hit/miss, while writes are labeled to indicate whether the write was
discarded.

This will give us visibility into,
- hit rate of cache reads
- ratio of reads to writes
- rate of discarded writes
2018-08-15 15:51:13 -07:00
Kubernetes Submit Queue
d7634dcf23
Merge pull request #66856 from charrywanganthony/scheduler_space
Automatic merge from submit-queue (batch tested with PRs 66491, 66587, 66856, 66657, 66923). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

add space for output

**Release note**:
```release-note
NONE
```
2018-08-14 17:55:11 -07:00
Kubernetes Submit Queue
6274590518
Merge pull request #66656 from wackxu/fixappversion
Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

 use apps/v1 version for scheduler

/kind cleanup

**Release note**:

```release-note
NONE
```
2018-08-11 23:25:33 -07:00
Harry Zhang
17d0190706 Use sync.map to scale ecache better 2018-08-07 14:06:09 +08:00
Chao Wang
895b6d441d add space for output 2018-08-01 18:08:31 +08:00
foxyriver
3b4f250c4a fix error log 2018-07-26 19:48:48 +08:00
wackxu
ab35fa0414 update bazel 2018-07-26 17:37:29 +08:00
xushiwei 00425595
fed8572745 use apps/v1 version for scheduler 2018-07-26 17:37:29 +08:00