Commit Graph

55 Commits

Author SHA1 Message Date
Wojciech Tyczynski
fc6d38baa2 Avoid locking when computing predicates. 2016-07-21 08:21:07 +02:00
Wojciech Tyczynski
cab7db3a64 Use []*api.Node instead of NodeLister in priority functions. 2016-07-21 08:21:07 +02:00
Wojciech Tyczynski
d14fe0f269 Change storeToNodeConditionLister to return []*api.Node instead of api.NodeList for performance 2016-07-11 21:02:33 +02:00
Wojciech Tyczynski
dcb2ca54ad Avoid unnecessary copies 2016-07-11 15:41:27 +02:00
k8s-merge-robot
a261776f3e Merge pull request #28670 from wojtek-t/scheduler_metadata
Automatic merge from submit-queue

Add meta field to predicate signature to avoid computing the same things multiple times

This PR only uses it to avoid computing QOS of a pod for every node from scratch.

Ref #28590
2016-07-09 22:28:14 -07:00
Wojciech Tyczynski
49934c05c0 Avoid creating NodeInfoMap from scratch on every scheduling. 2016-07-08 18:09:49 +02:00
Wojciech Tyczynski
b92eadfd1a Avoid computing QOS multiple times 2016-07-08 12:57:40 +02:00
Wojciech Tyczynski
6890868823 Add meta field to predicates signature 2016-07-08 12:25:48 +02:00
Wojciech Tyczynski
58c95c136f Quick returns in predicates 2016-07-07 12:34:54 +02:00
David McMahon
ef0c9f0c5b Remove "All rights reserved" from all the headers. 2016-06-29 17:47:36 -07:00
k8s-merge-robot
4e6e4ee1f9 Merge pull request #25934 from ping035627/ping035627-patch-3
Automatic merge from submit-queue

Fix  #25606: Add the length detection of the "predicateFuncs" in generic_scheduler.go

Fix  #25606

The PR add the length detection of the "predicateFuncs" for "findNodesThatFit" function of generic_scheduler.go. 
In “findNodesThatFit” function, if the length of the "predicateFuncs" parameter is 0, it can set filtered equals nodes.Items, and needn't to traverse the nodes.Items.
2016-06-25 03:04:44 -07:00
Hongchao Deng
e2704c9168 scheduler: remove unused random generator 2016-05-24 20:12:21 -07:00
PingWang
e2af16b1d5 Update generic_scheduler.go 2016-05-23 09:18:15 +08:00
PingWang
36740719d9 exec gofmt -s 2016-05-23 09:17:17 +08:00
PingWang
b973670344 Add the length detection of the "predicateFuncs" in generic_scheduler.go
The PR add the length detection of the "predicateFuncs" for "findNodesThatFit" function of generic_scheduler.go. 
In “findNodesThatFit” function, if the length of the "predicateFuncs" parameter is 0, it can set filtered equals nodes.Items, and needn't to traverse the nodes.Items.
2016-05-20 08:49:53 +08:00
Wojciech Tyczynski
a51f266ebf Remove nodeName from predicate signature. 2016-05-06 11:23:37 +02:00
Wojciech Tyczynski
80901a5542 Add traces to scheduler 2016-04-20 15:19:19 +02:00
Wojciech Tyczynski
5a73a9d235 Parallelize computing predicates 2016-04-14 16:32:52 +02:00
Wojciech Tyczynski
545bf184ef Simplify FailedPredicateMap 2016-04-14 10:58:35 +02:00
goltermann
a3104ba96c Final vet fixes; enabling vet checks in verify scripts. 2016-04-13 13:51:51 -07:00
HaiyangDING
41ed85479a move predicates into library (address #12744)
DONE:
1. refactor all predicates: predicates return fitOrNot(bool) and error(Error) in which the latter is of type
	PredicateFailureError or InsufficientResourceError. (For violation of either MaxEBSVolumeCount or
        MaxGCEPDVolumeCount, returns one same error type as ErrMaxVolumeCountExceeded)
2. GeneralPredicates() is a predicate function, which includes serveral other predicate functions (PodFitsResource,
        PodFitsHost, PodFitsHostPort). It is registered as one of the predicates in DefaultAlgorithmProvider, and
        is also called in canAdmitPod() in Kubelet and should be called by other components (like rescheduler, etc)
        if necessary. See discussion in issue #12744
3. remove podNumber check from GeneralPredicates
4. HostName is now verified in Kubelet's canAdminPod(). add TestHostNameConflicts in kubelet_test.go
5. add getNodeAnyWay() method in Kubelet to get node information in standaloneMode

TODO:
1. determine which predicates should be included in GeneralPredicates()
2. separate GeneralPredicates() into:
	a. GeneralPredicatesEvictPod() and
	b. GeneralPredicatesNotEvictPod()
3. DaemonSet should use GeneralPredicates()
2016-04-11 00:57:03 +08:00
Hongchao Deng
ae88f08af0 Scheduler: replace system modeler with scheduler cache 2016-03-14 09:03:41 -07:00
gmarek
2c52e62622 Change scheduler logic from random to round-robin 2016-03-07 13:47:56 +01:00
Marek Grabowski
eb2f5153b3 Revert "Scheduler: replace system modeler with scheduler cache and do O(1) lookup for resource req" 2016-03-02 15:38:56 +01:00
Hongchao Deng
f29a1d6c5c scheduler: Scheduler: replace system modeler with scheduler cache
We're using the scheduler cache to do O(1) lookup for resource request
2016-02-26 09:22:29 -08:00
Hongchao Deng
9236e4a0b4 scheduler: change fit predicates and priority func as needed for optimization 2016-02-09 09:38:28 -08:00
Oleg Shaldybin
3a36dfb306 Minor selectHost optimization in scheduler
Instead of sorting hosts by score, find max score and choose one of
the hosts with max score directly. Saves a little time on sorting and
avoids extra copying of HostPriorityList entries.

Test had to be updated as one of the test cases relied on having a
stable order from pre-sorting.
2016-02-08 12:37:37 -05:00
k8s-merge-robot
3e04a45a95 Merge pull request #19910 from hongchaodeng/res
Auto commit by PR queue bot
2016-02-01 00:08:28 -08:00
Hongchao Deng
8e1bfad490 insufficient resource error: details of failure in failedPredicateMap 2016-01-21 21:49:00 -08:00
Hongchao Deng
5331ffc82f FitError: return details of failure on each node 2016-01-20 22:38:41 -08:00
Hongchao Deng
252a956150 return error if got InsufficientResourceError and fit=true 2016-01-12 08:46:35 -08:00
Hongchao Deng
111b603c95 Remove FailedResourceType and return custom error 2016-01-12 08:41:30 -08:00
Saad Ali
9b415f0300 Revert "Remove FailedResourceType and return custom error" 2016-01-11 11:27:50 -08:00
Hongchao Deng
40e5e688cc Remove FailedResourceType and return custom error 2016-01-07 13:47:23 -08:00
Xiang Li
f3ced64a80 scheduler: a small refactor for generic scheduler 2015-12-22 15:36:41 -08:00
Xiang Li
7f4f754106 scheduler: calculate priority in parallel.
To improve the throughput of current scheduler, we can do
a simple optimization by calcluating priorities in parallel.

This doubles the throughput of density test, which has the default
config with 3 priority funcs (the spreading one does not actually
consume any computation time). It matches the expectation.
2015-12-18 19:13:54 -08:00
Brendan Burns
0ee0e16bcd Don't recreate the same map 3 times 2015-12-16 20:39:28 -08:00
Ravi Gadde
cadc24e9fd Scheduler extension 2015-11-25 08:19:27 -08:00
Aaron Crickenberger
fad1968023 Adjust V level for scheduler messages
The "Combined requested resources" message becomes excessive as
the cluster fills up, drop it down to V(2)

Put an explicit V(2) on the only other scheduler Infof call that didn't
have V specified already.
2015-11-19 15:12:13 -05:00
David Oppenheimer
a45c98299a Revert "Avoid full sort when selecting host with highest priority."
This reverts commit c64048d73e.

Address #17332.
2015-11-16 15:16:00 -08:00
Andrew M Bursavich
c64048d73e Avoid full sort when selecting host with highest priority. 2015-10-31 22:33:02 -07:00
eulerzgy
71b96422f4 set capital in some files 2015-09-30 14:46:20 +08:00
Wojciech Tyczynski
53ae56f205 Replace "minion" with "node" in bunch of places. 2015-09-14 11:07:11 +02:00
tummychow
78ce5da988 Move util.StringSet into its own package
A lot of packages use StringSet, but they don't use anything else from
the util package. Moving StringSet into another package will shrink
their dependency trees significantly.
2015-09-10 12:04:15 -07:00
dinghaiyang
dab7280ae4 Improve clarity around PodFitsResource by showing pods limits in kubectl describe node 2015-08-07 16:58:11 +08:00
Mike Danese
17defc7383 run gofmt on everything we touched 2015-08-05 17:52:56 -07:00
Mike Danese
8e33cbfa28 rewrite go imports 2015-08-05 17:30:03 -07:00
Mike Danese
ba87868577 changed unused fmt statement to be a log statement 2015-08-03 15:12:44 -07:00
Zach Loafman
8278928b66 Merge pull request #10661 from davidopp/somebranch
When scheduling, treat zero limit-pods as having nonzero limit when calculating priorities
2015-07-06 13:18:54 -07:00
David Oppenheimer
53518e37a6 Add a test for DumbSpreadingPriority. 2015-07-03 01:34:07 -07:00