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

Decouple yaml based integration test from legacy test #89106

Merged
merged 1 commit into from
Mar 27, 2020

Conversation

chendave
Copy link
Member

@chendave chendave commented Mar 13, 2020

  • Move utilities and constants out so that both of them should be able
    to run independently.
  • Rename the legacy test so that it can eventually be deleted when the
    perf dash changes is done

There are two approaches to run scheduler_perf testcases with different ways to define the test spec, both of them could be able to run independently.

  • test spec is defined in the yaml
- template:
    desc: SchedulingPodAntiAffinity
    nodes:
      uniqueNodeLabelStrategy:
        labelKey: kubernetes.io/hostname
    initPods:
      podTemplatePath: config/pod-with-pod-anti-affinity.yaml
    podsToSchedule:
      podTemplatePath: config/pod-with-pod-anti-affinity.yaml
  params:
    - numNodes: 500
      numInitPods: 100
      numPodsToSchedule: 400
    - numNodes: 5000
      numInitPods: 1000
      numPodsToSchedule: 1000
  • test spec is defined in the golang source.
func BenchmarkSchedulingPodAntiAffinity(b *testing.B) {
	// 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)
	tests := []struct{ nodes, existingPods, minPods int }{
		{nodes: 500, existingPods: 100, minPods: 400},
		{nodes: 5000, existingPods: 1000, minPods: 1000},
	}
       ...
}

The second one becomes duplicated along with the merge of defining the test spec in the yaml file. There is no need to maintain both of them in the code base, this change refactor the code to decouple one from the other and drop the support of the legacy way to run the scheduler_perf.

What type of PR is this?

Uncomment only one /kind <> line, hit enter to put that in a new line, and remove leading whitespace from that line:

/kind cleanup

What this PR does / why we need it:

Special notes for your reviewer:

Does this PR introduce a user-facing change?:

NONE

Additional documentation e.g., KEPs (Kubernetes Enhancement Proposals), usage docs, etc.:


@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/S Denotes a PR that changes 10-29 lines, ignoring generated files. 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. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. labels Mar 13, 2020
@k8s-ci-robot k8s-ci-robot added 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 Mar 13, 2020
@chendave
Copy link
Member Author

/test pull-kubernetes-conformance-kind-ipv6-parallel
/test pull-kubernetes-integration
/test pull-kubernetes-e2e-gce
/test pull-kubernetes-bazel-build

@chendave
Copy link
Member Author

/test pull-kubernetes-verify
/test pull-kubernetes-e2e-kind-ipv6
/test pull-kubernetes-e2e-gce

@chendave
Copy link
Member Author

/test pull-kubernetes-verify

@chendave
Copy link
Member Author

/test pull-kubernetes-e2e-kind-ipv6

@chendave
Copy link
Member Author

/test pull-kubernetes-kubemark-e2e-gce-big

@chendave
Copy link
Member Author

I think we can remove the legacy way to run scheduler perf directly, or mark the legacy way as deprecated?
Will push another PR later.

@hex108
Copy link
Contributor

hex108 commented Mar 16, 2020

@chendave It seems that what the PR does is different from its description? It only moves a function and some variables to the util file.

@k8s-ci-robot k8s-ci-robot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. and removed size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Mar 16, 2020
@chendave
Copy link
Member Author

@chendave It seems that what the PR does is different from its description? It only moves a function and some variables to the util file.

I think there are two approaches to run those benchmarks, one is based on the yaml template, and another one is based on inline test spec, they are peer-to-peer instead of one approach depends on another one.

But current code base has some method and consts defined in the legacy inline test spec, this doesn't make sense in my opinion, simply because I should be able to run the benchmark without any dependencies in the legacy code (which eventually should be removed in the future).

@chendave chendave changed the title spec from yaml shouldn't dependent on the legacy way spec from yaml shouldn't dependent on the inline test spec Mar 16, 2020
@chendave
Copy link
Member Author

@hex108 , thank you for the review and comment! hope you get my points.

@chendave
Copy link
Member Author

remove this file: test/integration/scheduler_perf/scheduler_bench_test.go (eventually, this should be deleted in the future).

and then run the scheduler perf with the new way,
make test-integration WHAT=./test/integration/scheduler_perf KUBE_TEST_VMODULE="''" KUBE_TEST_ARGS="-alsologtostderr=false -logtostderr=false -run=^$$ -benchtime=1ns -bench=BenchmarkPerfScheduling/SchedulingBasic/5000Nodes/5000InitPods/1000PodsToSchedule"

you will find it will fail with some constants / method missing.

@chendave
Copy link
Member Author

/test pull-kubernetes-verify

2 similar comments
@chendave
Copy link
Member Author

/test pull-kubernetes-verify

@chendave
Copy link
Member Author

/test pull-kubernetes-verify

@chendave
Copy link
Member Author

@hex108 how about deprecate those test suit? at least the new one should not depends on the old one (see my first PR).

@Huang-Wei
Copy link
Member

@ahg-g @liu-cong @ingvagabund, is this PR resolve part of what you discussed in #88195 to replace legacy BenchmarkScheduling suite with new BenchmarkPerfScheduling suite? I suppose there is some change needed for test-infra/dashboard as well?

@k8s-ci-robot k8s-ci-robot added size/S Denotes a PR that changes 10-29 lines, ignoring generated files. and removed size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. labels Mar 23, 2020
@chendave chendave changed the title Remove the duplicated testcases Decouple yaml based integration test from legacy test Mar 23, 2020
@chendave
Copy link
Member Author

/test pull-kubernetes-e2e-kind

@ingvagabund
Copy link
Contributor

It makes sense to do scheduler_bench_test.go → scheduler_perf_legacy_test.go as noted in #88195 (comment). Though, it no longer make sense to change anything in scheduler_bench_test.go unless it's a bug fix. We will keep both suites running in parallel for few releases to compare the measurements. The new test suite is already running here: http://perf-dash.k8s.io/#/?jobname=scheduler-perf-benchmark&metriccategoryname=Scheduler&metricname=BenchmarkPerfResults&Metric=scheduler_scheduling_algorithm_predicate_evaluation_seconds&Name=BenchmarkPerfScheduling%2FSchedulingBasic%2F500Nodes%2F500InitPods%2F1000PodsToSchedule

@chendave
Copy link
Member Author

Though, it no longer make sense to change anything in scheduler_bench_test.go unless it's a bug fix.

The refactor makes it possible to run those integration test without the code dependencies in the legacy approach. This is somehow align with what you said below.

We will keep both suites running in parallel for few releases to compare the measurements.

@k8s-ci-robot k8s-ci-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Mar 25, 2020
@ingvagabund
Copy link
Contributor

ingvagabund commented Mar 26, 2020

The refactor makes it possible to run those integration test without the code dependencies in the legacy approach. This is somehow align with what you said below.

@chendave oh, I see what you mean. The code you moved from scheduler_bench_test.go to util.go is used in both scheduler_bench_test.go and scheduler_perf_test.go. Yeah, good catch. Changes look good. Can you rebase the PR?

- Move utilities or constants out so that both of them should be able
to run independently.
- Rename the legacy test so that it can eventually be deleted when the
perf dash changes is done
@k8s-ci-robot k8s-ci-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Mar 27, 2020
@ingvagabund
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 Mar 27, 2020
@alculquicondor
Copy link
Member

/assign

@alculquicondor
Copy link
Member

/approve

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: alculquicondor, chendave

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 Mar 27, 2020
@ingvagabund
Copy link
Contributor

/test pull-kubernetes-e2e-gce

@Huang-Wei
Copy link
Member

/retest

@k8s-ci-robot k8s-ci-robot merged commit 5317a31 into kubernetes:master Mar 27, 2020
@k8s-ci-robot k8s-ci-robot added this to the v1.19 milestone Mar 27, 2020
@chendave chendave deleted the refactor branch April 20, 2020 03:48
@chendave
Copy link
Member Author

/sig scheduling

@k8s-ci-robot k8s-ci-robot added the sig/scheduling Categorizes an issue or PR as relevant to SIG Scheduling. label Jun 11, 2020
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/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. 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/scheduling Categorizes an issue or PR as relevant to SIG Scheduling. sig/testing Categorizes an issue or PR as relevant to SIG Testing. size/S Denotes a PR that changes 10-29 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants