Commit Graph

79 Commits

Author SHA1 Message Date
Andrea Nodari
2e1042f959 Use NodeWrapper to directly initialize node with labels
Using NodeWrapper in the integration tests gives more flexibility when
creating nodes. For instance, tests can create nodes with labels or
with a specific sets of resources.

Also, NodeWrapper initialises a node with a capacity of 32 pods, which
can be overridden by the caller. This makes sure that a node is usable
as soon as it is created.
2020-06-30 17:18:15 +02:00
Adhityaa Chandrasekar
1b223b861a scheduler: run Unreserve if Reserve fails
If a reserve plugin's Reserve method returns an error, there could be
previously allocated resources from successfully completed reserve
plugins that must be unallocated by the corresponding Unreserve
operation. Since Unreserve operations are idempotent, this patch runs
the Unreserve operation of ALL reserve plugins when a Reserve operation
fails.
2020-06-26 20:41:33 +00:00
Adhityaa Chandrasekar
ec83143342 scheduler: merge Reserve and Unreserve plugins
Previously, separate interfaces were defined for Reserve and Unreserve
plugins. However, in nearly all cases, a plugin that allocates a
resource using Reserve will likely want to register itself for Unreserve
as well in order to free the allocated resource at the end of a failed
scheduling/binding cycle. Having separate plugins for Reserve and
Unreserve also adds unnecessary config toil. To that end, this patch
aims to merge the two plugins into a single interface called a
ReservePlugin that requires implementing both the Reserve and Unreserve
methods.
2020-06-24 21:10:35 +00:00
Wei Huang
d99cc01646
Register and enable defaultpreemption plugin
- Enable defaultpreemption as a PostFilter plugin
- Remote legacy hard-coded preemption logic
2020-06-22 17:22:27 -07:00
Ali Farah
a22e115a0e Split scheduler framework implementation into new runtime package 2020-06-22 00:23:43 +10:00
Amim Knabben
fcb41d3d2c Integration framework table-tests standarization 2020-06-08 14:03:54 -04:00
Wei Huang
69b9ba6012
Introduce PostFilter extension point 2020-06-05 13:23:45 -07:00
Kubernetes Prow Robot
6cf4ab3c8c
Merge pull request #91071 from alculquicondor/integration_new_node
Add test case for a pod becoming schedulable when a node is added
2020-05-19 15:22:33 -07:00
Wei Huang
133a02540f
Move unschedulable Pod to internal schedulingQ synchronously
- use in-cache Pod instead of real-time Pod (by calling API server) to mark it as unschedulable
  in internal schedulingQ
- remove the backoff logic as now we don't call API server
- the whole logic is changed to a synchronous call
2020-05-15 19:27:28 -07:00
Aldo Culquicondor
35b9ab1227 Remove unnecessary clientset arg from initPausePod
Signed-off-by: Aldo Culquicondor <acondor@google.com>
2020-05-14 11:47:12 -04:00
Jan Chaloupka
65e9826f79 integration: start informer and scheduler outside of InitTestScheduler
In case two or more controllers share the informers created through InitTestScheduler,
it's not safe to start the informers until all controllers set their informer
indexers. Otherwise, some controller might fail to register their indexers
in time. Thus, it's responsibility of each consumer to make sure all informers
are started after all controllers had time to get initiliazed.
2020-05-13 18:19:43 +02:00
Aldo Culquicondor
ce05382b58 Use RawExtension and Object for external and internal scheduling plugin args, respectively
Signed-off-by: Aldo Culquicondor <acondor@google.com>
2020-04-14 13:44:42 -04:00
Abdullah Gharaibeh
a5d8172715 move nodeinfo type to framework pkg 2020-04-07 10:25:24 -04:00
Abdullah Gharaibeh
ed3fe054df move scheduler nodeinfo to pkg/scheduler/types 2020-03-31 21:02:09 -04:00
Jordan Liggitt
d8abacba40 client-go: update expansions callers 2020-03-06 16:50:41 -05:00
Mateusz Litwin
b93e3d18e9 fix scheduler.TestCoSchedulinngWithPermitPlugin and test scheduler.PermitPlugin
After moving Permit() to the scheduling cycle test PermitPlugin should
no longer wait inside Permit() for another pod to enter Permit() and become waiting pod.
In the past this was a way to make test work regardless of order in
which pods enter Permit(), but now only one Permit() can be executed at
any given moment and waiting for another pod to enter Permit() inside
Permit() leads to timeouts.

In this change waitAndRejectPermit and waitAndAllowPermit flags make first
pod to enter Permit() a waiting pod and second pod to enter Permit()
either rejecting or allowing pod.

Mentioned in #88469
2020-03-04 08:45:36 -08:00
fengzixu
b67a033de2 Refactor: move generic functions of integration test to util directory 2020-02-29 14:56:39 +09:00
Aldo Culquicondor
c048858471 Support multiple scheduling profiles in a single scheduler
Signed-off-by: Aldo Culquicondor <acondor@google.com>
2020-02-25 11:31:20 -05:00
skilxn-go
8fd0d8028f Remove FilteredNodesStatuses argument from PreScore interface 2020-02-15 13:53:04 +08:00
skilxn-go
f5b7e3cca3 Rename PostFilter plugin to PreScore 2020-02-12 23:25:08 +08:00
Mike Danese
3aa59f7f30 generated: run refactor 2020-02-07 18:16:47 -08:00
Aldo Culquicondor
4a5ab84dcc Move default binding to a plugin
Signed-off-by: Aldo Culquicondor <acondor@google.com>
2020-01-22 14:13:33 -05:00
Mike Danese
d86fcd8c90 rename some declartions named context in tests 2020-01-16 15:09:28 -08:00
Abdullah Gharaibeh
2b3df3587e Deprecate scheduler predicate and priority factory registration 2019-12-25 20:33:08 -05:00
Abdullah Gharaibeh
fe7de96ebe cleanup scheduler's in-tree plugins registry naming 2019-12-24 15:56:36 -05:00
Wei Huang
dc3d1bd238
Eliminate running paths of Predicates in scheduler
- eliminate running paths of Predicates in scheduler; use Filter Plugins instead.
- refactor all unit tests
- adjust the TestPreemptWithPermitPlugin integration test
2019-12-10 19:14:13 -08:00
Jun Gong
81b705960f Cancel context to make sure all plugins are cancelled when each schedule finishes 2019-10-29 22:37:59 +08:00
Kubernetes Prow Robot
7e53c9d808
Merge pull request #83756 from hex108/permit
Refactor scheduler's framework permit API
2019-10-19 06:47:37 -07:00
Jun Gong
38b7668bb3 Refactor scheduler's framework permit API 2019-10-19 16:22:39 +08:00
draveness
39af760930 feat: several cleanups in the scheduling package
+ Remove unused variable in tests.
+ Use more common statement for interface conformance check.
+ Fix several comments in the framework plugins.
2019-10-18 11:14:05 +08: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
Kubernetes Prow Robot
c1a735c642
Merge pull request #83601 from ahg-g/ahg-migration-priority
Implemented taints and tolerations priority function as a Score plugin
2019-10-11 00:05:50 -07:00
Abdullah Gharaibeh
7429b0fe86 Implemented taints and tolerations priority function as a Score plugin 2019-10-10 17:49:40 -04:00
Abdullah Gharaibeh
456df97745 made scheduler cache and volume binder available when instantiating factories for default plugins 2019-10-10 16:21:29 -04:00
Abdullah Gharaibeh
66386fdf49 Added the first predicate as a filter plugin: PodToleratesNodeTaints. 2019-10-05 08:43:17 -04:00
Abdullah Gharaibeh
043166f54b Modified the name of the Extensions method in the scheduler's framework. 2019-10-04 15:53:06 -04:00
draveness
c73ff9749b feat(scheduler): rename PluginContext to CycleState 2019-10-04 17:30:36 +08:00
Kubernetes Prow Robot
0a17315e18
Merge pull request #83418 from ahg-g/ahg-first-priority
Refactor scheduler.New so that all framework-related parameters are options
2019-10-03 10:00:11 -07:00
Abdullah Gharaibeh
30e7016ccf Refactor scheduler.New so that all framework-related parameters are passed as options 2019-10-03 11:39:59 -04:00
draveness
9769d49bb5 feat(scheduler): remove MaxPriority in the scheduler api 2019-10-02 11:24:25 +08:00
notpad
fc55e74741 A consistent interface for plugin extended functionality 2019-10-01 23:59:48 +08:00
draveness
314ec4e504 feat(scheduler): consolidate ScoreWithNormalizePlugin into ScorePlugin 2019-09-26 10:19:06 +08: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
Ahmad Diaa
bf6a70a1ce use scheduler.Option in initTestSchedulerWithOptions 2019-09-21 00:06:42 +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
Abdullah Gharaibeh
54ac023a53 Scheduler PreBind plugins are currently allowed to return Unschedulable status, which should not according to the KEP and comments. 2019-09-11 14:03:18 -04:00
Kubernetes Prow Robot
4b6c32c097
Merge pull request #82121 from Zhuzhenghao/typo/bound
Typo fix: binded -> bound
2019-09-11 10:39:28 -07:00
Kubernetes Prow Robot
e1a432f08e
Merge pull request #81384 from Huang-Wei/fix-preemption-flakes
Apply zero TerminationGracePeriodSeconds to preemption victims
2019-09-10 14:30:17 -07:00
朱正浩,Zhu Zhenghao
aa20910e24 Typo fix: binded -> bound 2019-08-29 18:28:36 +08:00
draveness
af2e0428f6 feat: use PreBind instead of Prebind in the scheduling framework 2019-08-23 02:09:19 +08:00