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

Scheduler Policy API Refactoring #83578

Merged
merged 2 commits into from Nov 2, 2019

Conversation

@Huang-Wei
Copy link
Member

Huang-Wei commented Oct 7, 2019

What type of PR is this?

/kind cleanup
/sig scheduling

What this PR does / why we need it:

  • Move Policy API from pkg/scheduler/api to pkg/scheduler/apis/config (unversioned) and staging/src/k8s.io/kube-scheduler/config/v1 (versioned and can be vendored externally by end-users).
  • dual-register Policy as apiGroup "v1" and "kubescheduler.config.k8s.io".
  • Unit test verifying both legacy "v1" group and new "kubescheduler.config.k8s.io" can both serialized properly.
  • Move existing validation and compatibility tests code to pkg/scheduler/apis/config.
  • Eliminate latest.Codec; use scheme.Codecs instead.

Which issue(s) this PR fixes:

Part of #82390.

Special notes for your reviewer:

  • As the legacy Policy API doesn't have XYZList defined, and this PR doesn't add new API fields (just move), so a series of exception rules are added - needs @liggitt 's review
  • The only file left under pkg/scheduler/api is pkg/scheduler/api/well_known_labels.go and variable DefaultPercentageOfNodesToScore. We will raise another PR to move those strings.

Does this PR introduce a user-facing change?:

Scheduler Policy API has a new recommended apiVersion "apiVersion: kubescheduler.config.k8s.io/v1" which is consistent with the scheduler API group "kubescheduler.config.k8s.io". It holds the same API as the old apiVersion "apiVersion: v1".
@Huang-Wei

This comment has been minimized.

Copy link
Member Author

Huang-Wei commented Oct 7, 2019

/assign @ahg-g

/assign @liggitt
for commit 855ea6e

@Huang-Wei Huang-Wei mentioned this pull request Oct 7, 2019
4 of 6 tasks complete
@cblecker cblecker removed their request for review Oct 7, 2019
@liggitt liggitt added this to In progress in API Reviews Oct 7, 2019
@Huang-Wei Huang-Wei force-pushed the Huang-Wei:sched-policy-api-refactor branch 2 times, most recently from da0ae7a to f707a3d Oct 7, 2019
@Huang-Wei

This comment has been minimized.

Copy link
Member Author

Huang-Wei commented Oct 8, 2019

@ahg-g You can hold off reviewing for now. I need to resolve the codec issue in the integration test.

@Huang-Wei Huang-Wei force-pushed the Huang-Wei:sched-policy-api-refactor branch 2 times, most recently from bba6fd6 to 755c49c Oct 8, 2019
@Huang-Wei

This comment has been minimized.

Copy link
Member Author

Huang-Wei commented Oct 8, 2019

/retest

@Huang-Wei

This comment has been minimized.

Copy link
Member Author

Huang-Wei commented Nov 1, 2019

/retest

1 similar comment
@Huang-Wei

This comment has been minimized.

Copy link
Member Author

Huang-Wei commented Nov 1, 2019

/retest

@liggitt

This comment has been minimized.

Copy link
Member

liggitt commented Nov 1, 2019

lgtm, please squash for merge

@liggitt

This comment has been minimized.

Copy link
Member

liggitt commented Nov 1, 2019

/approve

@k8s-ci-robot

This comment has been minimized.

Copy link
Contributor

k8s-ci-robot commented Nov 1, 2019

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: Huang-Wei, liggitt

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

@Huang-Wei Huang-Wei force-pushed the Huang-Wei:sched-policy-api-refactor branch from d56b629 to a34490c Nov 1, 2019
@Huang-Wei

This comment has been minimized.

Copy link
Member Author

Huang-Wei commented Nov 1, 2019

Hmm.. TaintBasedEviction flaked again...

/retest

@liggitt

This comment has been minimized.

Copy link
Member

liggitt commented Nov 1, 2019

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm label Nov 1, 2019
@Huang-Wei

This comment has been minimized.

Copy link
Member Author

Huang-Wei commented Nov 1, 2019

/hold cancel

- add Policy API to pkg/scheduler/apis/config and staging/src/k8s.io/kube-scheduler/config/v1
- dual-register Policy as apiGroup "v1" and "kubescheduler.config.k8s.io
- move/merge pkg/scheduler/api to pkg/scheduler/apis/config/...
- alias schedulerapi to pkg/scheduler/apis/config
- alias legacyapi to pkg/scheduler/api
- eliminate latest.Codec; use scheme.Codecs instead
- unit tests to verify Policy YAML with version "v1" or "kubescheduler.config.k8s.io/v1" can be loaded properly
- update api/api-rules/violation_exceptions.list
@Huang-Wei

This comment has been minimized.

Copy link
Member Author

Huang-Wei commented Nov 1, 2019

/retest

- make generated_files
- update-bazel.sh & update-vendor.sh)
@Huang-Wei Huang-Wei force-pushed the Huang-Wei:sched-policy-api-refactor branch from a34490c to 703a669 Nov 1, 2019
@k8s-ci-robot k8s-ci-robot removed the lgtm label Nov 1, 2019
@Huang-Wei

This comment has been minimized.

Copy link
Member Author

Huang-Wei commented Nov 1, 2019

Needs to rebase and rerun hack/update-vendor.sh, here is the diff applied (amended):

diff --git a/vendor/modules.txt b/vendor/modules.txt
index 9aacfae195..f2f4d20b37 100644
--- a/vendor/modules.txt
+++ b/vendor/modules.txt
@@ -1238,7 +1238,6 @@ k8s.io/apimachinery/pkg/runtime/serializer/protobuf
 k8s.io/apimachinery/pkg/runtime/serializer/recognizer
 k8s.io/apimachinery/pkg/runtime/serializer/streaming
 k8s.io/apimachinery/pkg/runtime/serializer/versioning
-k8s.io/apimachinery/pkg/runtime/serializer/yaml
 k8s.io/apimachinery/pkg/selection
 k8s.io/apimachinery/pkg/types
 k8s.io/apimachinery/pkg/util/cache
@Huang-Wei

This comment has been minimized.

Copy link
Member Author

Huang-Wei commented Nov 1, 2019

/retest

@Huang-Wei

This comment has been minimized.

Copy link
Member Author

Huang-Wei commented Nov 1, 2019

@liggitt Would you mind re-lgtming this? Had to update vendor/modules.txt, explained in #83578 (comment).

@liggitt

This comment has been minimized.

Copy link
Member

liggitt commented Nov 2, 2019

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm label Nov 2, 2019
@k8s-ci-robot k8s-ci-robot merged commit 2da4678 into kubernetes:master Nov 2, 2019
13 of 17 checks passed
13 of 17 checks passed
pull-kubernetes-cross Job triggered.
Details
pull-kubernetes-e2e-gce Job triggered.
Details
pull-kubernetes-kubemark-e2e-gce-big Job triggered.
Details
pull-kubernetes-verify Job triggered.
Details
cla/linuxfoundation Huang-Wei authorized
Details
pull-kubernetes-bazel-build Job succeeded.
Details
pull-kubernetes-bazel-test Job succeeded.
Details
pull-kubernetes-conformance-kind-ipv6 Job succeeded.
Details
pull-kubernetes-dependencies Job succeeded.
Details
pull-kubernetes-e2e-gce-100-performance Job succeeded.
Details
pull-kubernetes-e2e-gce-device-plugin-gpu Job succeeded.
Details
pull-kubernetes-e2e-kind Job succeeded.
Details
pull-kubernetes-integration Job succeeded.
Details
pull-kubernetes-node-e2e Job succeeded.
Details
pull-kubernetes-node-e2e-containerd Job succeeded.
Details
pull-kubernetes-typecheck Job succeeded.
Details
tide In merge pool.
Details
@k8s-ci-robot k8s-ci-robot added this to the v1.17 milestone Nov 2, 2019
@k8s-ci-robot

This comment has been minimized.

Copy link
Contributor

k8s-ci-robot commented Nov 2, 2019

@Huang-Wei: The following test failed, say /retest to rerun them all:

Test name Commit Details Rerun command
pull-kubernetes-e2e-gce 703a669 link /test pull-kubernetes-e2e-gce

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.

@Huang-Wei Huang-Wei deleted the Huang-Wei:sched-policy-api-refactor branch Nov 2, 2019
@liggitt liggitt moved this from Changes requested to API review completed, 1.17 in API Reviews Nov 15, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
API Reviews
API review completed, 1.17
Linked issues

Successfully merging this pull request may close these issues.

None yet

4 participants
You can’t perform that action at this time.