Commit Graph

567 Commits (1778d64a59305e43675fba75d7ec84d42e4e342a)

Author SHA1 Message Date
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
Kubernetes Prow Robot a521285b7c
Merge pull request #72073 from misterikkit/cleanup
Minor cleanup in scheduler/PriorityQueue
2018-12-14 23:23:19 -08:00
Jonathan Basseri d27d28a44e Flatten nominated pod logic in PriorityQueue.
This replaces deeply nested ifs & fors with early returns & continues.
2018-12-14 18:11:12 -08:00
Jonathan Basseri fae4f69d36 Fix return value of PriorityQueue.Add.
This function was returning a non-nil error for the common, non-failure
case. The fix is to properly scope local error values and add early
returns.
2018-12-14 16:44:21 -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
mlmhl 2fe9b1438c activate unschedulable pods only if the node became more schedulable 2018-12-10 09:48:23 +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 73710f06db Check for shutdown in TryBackoffAndWait 2018-12-06 16:57:20 +00: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
Kubernetes Prow Robot 720c10282c
Merge pull request #71722 from bsalamat/fix_priorityconfig
Avoid copying PriorityConfig and SchedulerExtender structs for every node while running priority functions
2018-12-05 20:31:51 -08: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
Gregory Haynes 082b48240a Implement scheduler.util.backoff as a queue
We are going to use PodBackoff for controlling backoff when adding
unschedulable pods back to the active scheduling queue. In order to do
this more easily, limit the interface for PodBackoff to only this struct
(rather than exposing BackoffEntry) and change the backing expiry
implementation to be queue based.
2018-12-04 18:01:43 +00:00
Gregory Haynes c821f2ed2f Move scheduling Heap in to scheduler.core.utils
The Heap data structure is useful for our backoff system in addition to
scheduling queue. Move it to somewhere it can be consumed by both
systems and properly export needed names. Also adding unit tests
from client-go/tools/cache/heap.go.
2018-12-04 18:01:42 +00:00
Jonathan Basseri b864a5a808 Remove scheduler "TestGroup" utility.
This util was used to fake certain aspects of apiserver behavior, such
as resource paths and JSON encoding. Our unit tests have been refactored
so they don't rely on the REST or JSON aspects of apiserver. This util
is no longer needed.
2018-12-03 16:28:21 -08:00
Kubernetes Prow Robot 2c322a2ff5
Merge pull request #70227 from bsalamat/reserve
Add plugin interfaces for reserve and prebind extension points of the scheduling framework
2018-12-01 05:25:12 -08:00
Kubernetes Prow Robot 82abbdc11a
Merge pull request #71488 from bsalamat/queue-sort
Change sort function of the scheduling queue to avoid starvation
2018-12-01 03:59:51 -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
Bobby (Babak) Salamat f6f81fb1f3 Add Context as a mechanism to pass data between plugins. 2018-11-30 16:02:09 -08:00
Bobby (Babak) Salamat 7221589dde Add "reserve" and "prebind" plugin interfaces for the scheduling framework. 2018-11-30 16:02:09 -08:00
k8s-ci-robot 79e5cb2cb7
Merge pull request #71302 from liggitt/verify-unit-test-feature-gates
Split mutable and read-only access to feature gates, limit tests to readonly access
2018-11-29 21:45:12 -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 6d87c074e2
Merge pull request #63664 from xchapter7x/pkg-scheduler-api-validation
use subtest for table units (pkg/scheduler/api/validation)
2018-11-29 02:00:43 -08:00
Bobby (Babak) Salamat 36f8859fa0 autogenerated files 2018-11-27 17:08:58 -08:00
Bobby (Babak) Salamat 554acf2b38 Change sort function of the scheduling queue to avoid starvation 2018-11-27 17:08:40 -08:00
Jordan Liggitt 2498ca7606 drop VerifyFeatureGatesUnchanged 2018-11-21 11:51:33 -05:00
Yecheng Fu 8fc00ebda6 Clear pod binding cache. 2018-11-21 11:24:53 +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
k8s-ci-robot 1f3057b7fb
Merge pull request #70898 from Huang-Wei/preemption-issue
ensure scheduler preemptor behaves in an efficient/correct path
2018-11-16 20:27:35 -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
Jordan Liggitt 733dd9dfd7 Add tests to ensure feature gate changes don't escape kubelet/scheduler packages 2018-11-16 10:52:53 -05:00
Jordan Liggitt de8bf9b63d fix scheduler and kubelet unit tests leaking feature flag changes 2018-11-16 10:52:53 -05:00
Jordan Liggitt 358c092abe fix storage unit tests leaking feature flag changes 2018-11-16 10:52:52 -05:00
PingWang 9e760732c3 Refactor New function
Signed-off-by: PingWang <wang.ping5@zte.com.cn>

add comments for InitPolicyFromFile

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

make the methods package private

Signed-off-by: PingWang <wang.ping5@zte.com.cn>
2018-11-15 14:30:19 +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
k8s-ci-robot b8fece50f5
Merge pull request #70892 from mikedanese/schedrace
Fix a race in the scheduler.
2018-11-09 23:01:15 -08: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
Babak "Bobby" Salamat a2c0958428
Revert "Hold mutex lock shorter when processing inter-pod affinity/anti-affin…" 2018-11-08 18:26:26 -08:00
k8s-ci-robot be800e623a
Merge pull request #69663 from sttts/sttts-scheduler-secure-serving
scheduler: enable secure port and authn/z
2018-11-08 17:36:14 -08:00
Dr. Stefan Schimanski d91feb6d18 kube-scheduler: move stopCh creation out of scheduler factory code
Enforces clean ownership of the channel.
2018-11-08 16:43:59 +01:00