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

Revendor CA against tip of k8s.io/kubernetes #2515

Merged
merged 9 commits into from
Nov 22, 2019

Conversation

losipiuk
Copy link
Contributor

@losipiuk losipiuk commented Nov 8, 2019

Preparatory for 1.17 release

/assign @MaciekPytel

cc: @ahg-g (Migrate scheduler creation to scheduler.New() commit)

Fixes: #2449

@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. labels Nov 8, 2019
@ahg-g
Copy link
Member

ahg-g commented Nov 9, 2019

if err != nil {
return nil, fmt.Errorf("couldn't create scheduler using provider %q: %v", algorithmProvider, err)
defaultProviderName := schedulerconfig.SchedulerDefaultProviderName
algorithmSource := schedulerconfig.SchedulerAlgorithmSource{
Copy link
Member

Choose a reason for hiding this comment

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

@ahg-g maybe we should move this to an option as well. WDYT?

Copy link
Member

Choose a reason for hiding this comment

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

sgtm, can you send a PR?

Copy link
Member

@alculquicondor alculquicondor Nov 12, 2019

Choose a reason for hiding this comment

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

@@ -261,7 +228,16 @@ func (p *PredicateChecker) GetPredicateMetadata(pod *apiv1.Pod, nodeInfos map[st
if !p.enableAffinityPredicate {
return nil
}
return p.predicateMetadataProducer(pod, nodeInfos)
nodeInfoList := make([]*schedulernodeinfo.NodeInfo, 0, len(nodeInfos))
Copy link
Member

Choose a reason for hiding this comment

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

how is nodeInfos created? Maybe you should try to use NewSnapshot or provide your own implementation of listers.SharedLister
This usage of snapshot seems to be relying too much on internals.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Multiple versions of nodeInfos are created as part of scale-down simulation here:

func findPlaceFor(removedNode string, pods []*apiv1.Pod, nodes []*apiv1.Node, nodeInfos map[string]*schedulernodeinfo.NodeInfo,
.

It does not seem feasible to migrate the code to NewSnapshot. If possible at all major refactor of the method would be needed.

Do you think I should create our own implementation of SharedLister? It would be a copy of what you have. Yet I agree it will improve the separation of CA and scheduler.

Copy link
Member

Choose a reason for hiding this comment

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

middle ground: if CA wants to maintain the NodeInfoMap, then we can have a NewSnapshotFromNodeInfoMap func to create the snapshot.

Note that we do a little more than just create the NodeInfoList, but also a HavePodsWithAffinityNodeInfoList: https://github.com/kubernetes/kubernetes/blob/bcb171b375df0dd9326bf5d3a23428beea1aeb89/pkg/scheduler/nodeinfo/snapshot/snapshot.go#L52

Copy link
Member

Choose a reason for hiding this comment

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

Once kubernetes/kubernetes#85139 is merged, you should be able to use NewSnapshot.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks! Updated the PR.

Copy link
Member

Choose a reason for hiding this comment

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

wait for this one as well kubernetes/kubernetes#85151 , should allow you to not specify algorithm source explicitly

@alculquicondor
Copy link
Member

/reopen

@k8s-ci-robot
Copy link
Contributor

@alculquicondor: Reopened this PR.

In response to this:

/reopen

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.

@k8s-ci-robot k8s-ci-robot reopened this Nov 12, 2019
@losipiuk losipiuk force-pushed the lo/ca-update-vendor-master branch from 6a7f3da to b5ed259 Compare November 13, 2019 15:55
@losipiuk losipiuk force-pushed the lo/ca-update-vendor-master branch from b5ed259 to 8161ca6 Compare November 22, 2019 13:09
@losipiuk
Copy link
Contributor Author

Updated

@aleksandra-malinowska
Copy link
Contributor

/lgtm
/approve

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

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: aleksandra-malinowska

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 Nov 22, 2019
@k8s-ci-robot k8s-ci-robot merged commit 3413247 into kubernetes:master Nov 22, 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. lgtm "Looks good to me", indicates that a PR is ready to be merged. 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.

Action required: Move to scheduler.New to instantiate a scheduler
6 participants