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

Fix inter-pod affinity scheduler benchmarks #86028

Merged
merged 1 commit into from Dec 10, 2019

Conversation

ahg-g
Copy link
Member

@ahg-g ahg-g commented Dec 7, 2019

What type of PR is this?

/kind feature

What this PR does / why we need it:
Some affinity benchmarks use v1.LabelHostname as the topology in the affinity term, but this label is not set on the nodes, and so the benchmark was not quite accurate in what it evaluates.

This PR fixes that by adding the v1.LabelHostname label to the nodes.

Does this PR introduce a user-facing change?:

NONE

@k8s-ci-robot k8s-ci-robot added release-note-none Denotes a PR that doesn't merit a release note. kind/feature Categorizes issue or PR as related to a new feature. size/M Denotes a PR that changes 30-99 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-priority Indicates a PR lacks a `priority/foo` label and requires one. area/test sig/testing Categorizes an issue or PR as relevant to SIG Testing. and removed needs-sig Indicates an issue or PR lacks a `sig/foo` label and requires one. labels Dec 7, 2019
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: ahg-g

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 Dec 7, 2019
@ahg-g ahg-g force-pushed the ahg1-benchmarks branch 2 times, most recently from 0a39a2c to 589d849 Compare December 7, 2019 22:48
@@ -67,15 +70,24 @@ func BenchmarkScheduling(b *testing.B) {
// PodAntiAffinity rules when the cluster has various quantities of nodes and
// scheduled pods.
func BenchmarkSchedulingPodAntiAffinity(b *testing.B) {
tests := []struct{ nodes, existingPods, minPods int }{
{nodes: 500, existingPods: 100, minPods: 400},
{nodes: 5000, existingPods: 1000, minPods: 1000},
Copy link
Member Author

@ahg-g ahg-g Dec 7, 2019

Choose a reason for hiding this comment

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

since the pods has anti affinity to each other, the number of pods to schedule can't exceed the number of nodes (the topology used in the test)

Copy link
Contributor

Choose a reason for hiding this comment

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

Ack. Can you add the comment in the code?

Copy link
Member Author

Choose a reason for hiding this comment

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

done.

@ahg-g
Copy link
Member Author

ahg-g commented Dec 9, 2019

/cc @Huang-Wei

@ahg-g
Copy link
Member Author

ahg-g commented Dec 9, 2019

/retest

2 similar comments
@ahg-g
Copy link
Member Author

ahg-g commented Dec 9, 2019

/retest

@ahg-g
Copy link
Member Author

ahg-g commented Dec 10, 2019

/retest

@ahg-g
Copy link
Member Author

ahg-g commented Dec 10, 2019

@liu-cong

@@ -67,15 +70,24 @@ func BenchmarkScheduling(b *testing.B) {
// PodAntiAffinity rules when the cluster has various quantities of nodes and
// scheduled pods.
func BenchmarkSchedulingPodAntiAffinity(b *testing.B) {
tests := []struct{ nodes, existingPods, minPods int }{
{nodes: 500, existingPods: 100, minPods: 400},
{nodes: 5000, existingPods: 1000, minPods: 1000},
Copy link
Contributor

Choose a reason for hiding this comment

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

Ack. Can you add the comment in the code?

name := fmt.Sprintf("%vNodes/%vPods", test.nodes, test.existingPods)
b.Run(name, func(b *testing.B) {
benchmarkScheduling(test.nodes, test.existingPods, test.minPods, nodeStrategy, testStrategy, b)
nodeStrategies := []testutils.CountToStrategy{{Count: test.nodes, Strategy: nodeStrategy}}
Copy link
Contributor

Choose a reason for hiding this comment

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

Should we add LabelHostName for this as well?

Copy link
Member Author

Choose a reason for hiding this comment

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

no because we will end up having to schedule all the pods on one node, which does not really make sense unless we create tuples of pods with affinity to each other rather than having all pods having affinity to each other.

The test is still useful in that all the pods will still have affinity to each other at the zone level.

{nodes: 500, existingPods: 500, minPods: 1000},
{nodes: 5000, existingPods: 5000, minPods: 1000},
}
testNamespace = "sched-test"
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we use a single namespace?

Copy link
Member Author

Choose a reason for hiding this comment

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

We could, but some features work at the namespace level, so I find it useful to test that.

@liu-cong
Copy link
Contributor

/lgtm

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

/hold

@k8s-ci-robot k8s-ci-robot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Dec 10, 2019
@ahg-g
Copy link
Member Author

ahg-g commented Dec 10, 2019

/hold cancel

@k8s-ci-robot k8s-ci-robot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Dec 10, 2019
@ahg-g
Copy link
Member Author

ahg-g commented Dec 10, 2019

/retest

@k8s-ci-robot k8s-ci-robot merged commit a8caae5 into kubernetes:master Dec 10, 2019
@k8s-ci-robot k8s-ci-robot added this to the v1.18 milestone Dec 10, 2019
@ahg-g ahg-g deleted the ahg1-benchmarks branch January 10, 2020 15:38
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. area/test cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. kind/feature Categorizes issue or PR as related to a new feature. lgtm "Looks good to me", indicates that a PR is ready to be merged. needs-priority Indicates a PR lacks a `priority/foo` label and requires one. release-note-none Denotes a PR that doesn't merit a release note. sig/testing Categorizes an issue or PR as relevant to SIG Testing. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants