Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move informer event handlers to scheduler #69504

Merged
merged 1 commit into from
Feb 1, 2019

Conversation

krmayankk
Copy link

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 #68955

NONE

/kind cleanup

@k8s-ci-robot k8s-ci-robot added release-note-none Denotes a PR that doesn't merit a release note. kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. needs-sig Indicates an issue or PR lacks a `sig/foo` label and requires one. needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. labels Oct 8, 2018
@k8s-ci-robot k8s-ci-robot added sig/scheduling Categorizes an issue or PR as relevant to SIG Scheduling. and removed needs-sig Indicates an issue or PR lacks a `sig/foo` label and requires one. labels Oct 8, 2018
@krmayankk
Copy link
Author

/assign @misterikkit

@krmayankk krmayankk changed the title Move informer event handlers to genericScheduler [WIP]Move informer event handlers to genericScheduler Oct 8, 2018
@k8s-ci-robot k8s-ci-robot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Oct 8, 2018
@k8s-ci-robot k8s-ci-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Oct 8, 2018
Copy link

@misterikkit misterikkit left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall looks good. I haven't done a careful review of the handlers themselves.

I think the only other change I'd hope to see in this PR would be to make sure that the functions in generic_scheduler.go are organized sensibly.

@@ -125,12 +172,12 @@ func (g *genericScheduler) snapshot() error {
// 3. snapshot ecache
// 4. evaludate predicates
// 5. stale result will be written to ecache
if g.equivalenceCache != nil {
g.equivalenceCache.Snapshot()
if g.equivalencePodCache != nil {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems like an old variable name. What did you base this commit on?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i rebased on latest upstream master. I decided to rename it that way. Will fix if it doesnt make sense

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you have a reason for renaming it that way? If not, then I'd prefer to leave it as is.

// Enable equivalence class cache
enableEquivalenceClassCache bool

nodeInformer coreinformers.NodeInformer

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's not clear to me that all of these informers need to be in the struct. Which ones do we need after NewGenericScheduler() has finished?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

will get back

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am trying to reuse the informers passed from cmd/kube-scheduler via NewConfigFactory. I think they are not used after the NewGenericScheduler finishes. Is it ok to not use the ones passed from cmd/kube-scheduler and just a local copy to add the event handlers ?

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The expectation is that NewGenericScheduler() takes informer args for each kind that it cares about. If we add event handlers to those informers, then we might not need to keep a reference to the informer itself.

@misterikkit
Copy link

This is going to need a rebase, as a small change just went in. ( #69592 )

Also, can you provide an update on the progress of this PR? It's still marked as WIP and I haven't seen responses to my previous questions. If you're stuck, reach out here or on slack.

@k8s-ci-robot k8s-ci-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Oct 10, 2018
@krmayankk krmayankk force-pushed the refactor-sched1 branch 2 times, most recently from ba830d0 to 383dac7 Compare October 14, 2018 09:15
@k8s-ci-robot k8s-ci-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Oct 14, 2018
@krmayankk krmayankk force-pushed the refactor-sched1 branch 2 times, most recently from 46af42b to 4df2248 Compare October 15, 2018 04:41
@k8s-ci-robot k8s-ci-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Oct 16, 2018
@k8s-ci-robot k8s-ci-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Oct 19, 2018
@krmayankk
Copy link
Author

/retest

@krmayankk
Copy link
Author

/test pull-kubernetes-e2e-gce-100-performance

Copy link

@misterikkit misterikkit left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please address 1 new comment and squash commits, then we can get this merged. ^_^

informerFactory.Storage().V1().StorageClasses(),
)

go func() {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this goroutine is redundant with the one created in factory.NewConfigFactory

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed

@wgliang
Copy link
Contributor

wgliang commented Jan 30, 2019

/assign @wgliang
Can you take a look at this PR and check how it will interact with your WIP PR to move everyone to scheduler.New?

This change should not impose any additional burden, and I am more worried about completing the code we need to modify a lot of integration tests. I'm trying... :)

@krmayankk
Copy link
Author

/test pull-kubernetes-e2e-kops-aws

1 similar comment
@krmayankk
Copy link
Author

/test pull-kubernetes-e2e-kops-aws

Copy link

@misterikkit misterikkit left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/lgtm
🐳 🚢
/assign @k82cn @bsalamat
please review for approval

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Jan 30, 2019
@misterikkit
Copy link

@wgliang Yeah, I've tried tweaking some of the integration test code in an experimental branch, and it's a lot of work to remove configFactory. Seems like you need to start with the TestContext type.

Copy link
Member

@bsalamat bsalamat left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/approve

Thanks a lot, @krmayankk!

@krmayankk
Copy link
Author

/assign @timothysc

@krmayankk
Copy link
Author

/test pull-kubernetes-e2e-kops-aws

@k82cn
Copy link
Member

k82cn commented Jan 31, 2019

/unassign @timothysc

@kubernetes/sig-testing-pr-reviews

@krmayankk
Copy link
Author

/test pull-kubernetes-e2e-kops-aws

@k8s-ci-robot
Copy link
Contributor

@krmayankk: The following test failed, say /retest to rerun them all:

Test name Commit Details Rerun command
pull-kubernetes-e2e-kops-aws e0a7d96 link /test pull-kubernetes-e2e-kops-aws

Full PR test history. Your PR dashboard. Please help us cut down on flakes by linking to an open issue when you hit one in your PR.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here.

@cblecker
Copy link
Member

cblecker commented Feb 1, 2019

/skip

@deads2k
Copy link
Contributor

deads2k commented Feb 1, 2019

/approve

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: bsalamat, deads2k, krmayankk

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Feb 1, 2019
@k8s-ci-robot k8s-ci-robot merged commit 2e01637 into kubernetes:master Feb 1, 2019
@krmayankk
Copy link
Author

thanks @misterikkit @bsalamat @deads2k

WanLinghao added a commit to WanLinghao/kubernetes that referenced this pull request Mar 15, 2019
k8s-ci-robot added a commit that referenced this pull request Mar 20, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. lgtm "Looks good to me", indicates that a PR is ready to be merged. release-note-none Denotes a PR that doesn't merit a release note. sig/apps Categorizes an issue or PR as relevant to SIG Apps. sig/scheduling Categorizes an issue or PR as relevant to SIG Scheduling. sig/testing Categorizes an issue or PR as relevant to SIG Testing. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[scheduler cleanup phase 1]: Move informer event handlers to pkg/scheduler
9 participants