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 Factory Package to Scheduler #83573

Merged
merged 1 commit into from
Oct 13, 2019

Conversation

ahmad-diaa
Copy link
Contributor

What type of PR is this?
/kind cleanup

/sig scheduling

What this PR does / why we need it:
This PR moves the factory package to scheduler. This simplifies the process of getting rid of factory.Config

Which issue(s) this PR fixes:
Part of #72547

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/L Denotes a PR that changes 100-499 lines, ignoring generated files. sig/scheduling Categorizes an issue or PR as relevant to SIG Scheduling. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. needs-priority Indicates a PR lacks a `priority/foo` label and requires one. labels Oct 7, 2019
@ahmad-diaa
Copy link
Contributor Author

/cc @alculquicondor

@k8s-ci-robot k8s-ci-robot added area/test sig/testing Categorizes an issue or PR as relevant to SIG Testing. labels Oct 7, 2019
// Copy returns a snapshot of current registered predicates and priorities.
func Copy() *Snapshot {
// CopyRegisteredPredicatesAndPriorities returns a snapshot of current registered predicates and priorities.
func CopyRegisteredPredicatesAndPriorities() *Snapshot {
Copy link
Member

Choose a reason for hiding this comment

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

RegisteredPredicatesAndPrioritiesSnapshot

@@ -61,32 +61,32 @@ func defaultPredicates() sets.String {
// when this function is called, and should be called in tests which may modify the value
// of a feature gate temporarily.
func ApplyFeatureGates() (restore func()) {
snapshot := factory.Copy()
snapshot := scheduler.CopyRegisteredPredicatesAndPriorities()
Copy link
Member

Choose a reason for hiding this comment

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

Could be in this PR or a follow up:

scheduler.PredicatesAndPrioritiesSnapshot, which returns the restore function already. I don't see any need to export Snapshot.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Could be in a follow up PR as it's part of the next step

Unexport all functions and types that are only used from pkg/scheduler. There seem to be some unused functions already. So we can remove them here.

Copy link
Member

Choose a reason for hiding this comment

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

sg

@@ -338,7 +337,7 @@ func initPolicyFromConfigMap(client clientset.Interface, policyRef *kubeschedule
}

// NewFromConfig returns a new scheduler using the provided Config.
func NewFromConfig(config *factory.Config) *Scheduler {
func NewFromConfig(config *Config) *Scheduler {
Copy link
Member

Choose a reason for hiding this comment

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

can this be unexported already?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

the only blocker now is the call in cluster-autoscaler.

Copy link
Member

Choose a reason for hiding this comment

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

Since they are locked to an old version, and we already have an alternative for when they decide to upgrade, I would say this is not a blocker.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Okay, could be addressed in a separate PR. WDYT?

Copy link
Member

Choose a reason for hiding this comment

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

sg

@alculquicondor
Copy link
Member

There seem to be legitimate failing tests

@ahmad-diaa
Copy link
Contributor Author

@alculquicondor Is there any action that should be taken regarding the following in test/test_owners.csv?
https://github.com/kubernetes/kubernetes/blob/master/test/test_owners.csv#L761

@alculquicondor
Copy link
Member

You can squash now

@alculquicondor
Copy link
Member

Aldo Culquicondor Is there any action that should be taken regarding the following in test/test_owners.csv?
https://github.com/kubernetes/kubernetes/blob/master/test/test_owners.csv#L761

I'm not sure. You can ask the OWNERS of the folder. @draveness ?

@ahmad-diaa ahmad-diaa force-pushed the remove-factory-package branch from 2937973 to ab0ebdf Compare October 7, 2019 22:29
@ahmad-diaa
Copy link
Contributor Author

/retest

@ahg-g
Copy link
Member

ahg-g commented Oct 8, 2019

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

@ahmad-diaa ahmad-diaa force-pushed the remove-factory-package branch 3 times, most recently from 3939f0c to 0c181ef Compare October 12, 2019 00:37
@ahmad-diaa
Copy link
Contributor Author

@ahg-g could we merge this soon? It needs a rebase whenever a PR is merged because of moving the factory package which is usually touched in other PRs.

@ahg-g
Copy link
Member

ahg-g commented Oct 12, 2019

@ahg-g could we merge this soon? It needs a rebase whenever a PR is merged because of moving the factory package which is usually touched in other PRs.

sure, I thought you were waiting for an answer to this: #83573 (comment)

@ahg-g
Copy link
Member

ahg-g commented Oct 12, 2019

/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 Oct 12, 2019
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: ahg-g, ahmad-diaa

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 Oct 12, 2019
@ahmad-diaa
Copy link
Contributor Author

sure, I thought you were waiting for an answer to this: #83573 (comment)

I don't know, I think this could be addressed later anyway. WDYT?
Is there someone specific that we could ping about it?

@ahmad-diaa
Copy link
Contributor Author

/retest

@ahmad-diaa
Copy link
Contributor Author

/test pull-kubernetes-e2e-gce

@fejta-bot
Copy link

/retest
This bot automatically retries jobs that failed/flaked on approved PRs (send feedback to fejta).

Review the full test history for this PR.

Silence the bot with an /lgtm cancel or /hold comment for consistent failures.

6 similar comments
@fejta-bot
Copy link

/retest
This bot automatically retries jobs that failed/flaked on approved PRs (send feedback to fejta).

Review the full test history for this PR.

Silence the bot with an /lgtm cancel or /hold comment for consistent failures.

@fejta-bot
Copy link

/retest
This bot automatically retries jobs that failed/flaked on approved PRs (send feedback to fejta).

Review the full test history for this PR.

Silence the bot with an /lgtm cancel or /hold comment for consistent failures.

@fejta-bot
Copy link

/retest
This bot automatically retries jobs that failed/flaked on approved PRs (send feedback to fejta).

Review the full test history for this PR.

Silence the bot with an /lgtm cancel or /hold comment for consistent failures.

@fejta-bot
Copy link

/retest
This bot automatically retries jobs that failed/flaked on approved PRs (send feedback to fejta).

Review the full test history for this PR.

Silence the bot with an /lgtm cancel or /hold comment for consistent failures.

@fejta-bot
Copy link

/retest
This bot automatically retries jobs that failed/flaked on approved PRs (send feedback to fejta).

Review the full test history for this PR.

Silence the bot with an /lgtm cancel or /hold comment for consistent failures.

@fejta-bot
Copy link

/retest
This bot automatically retries jobs that failed/flaked on approved PRs (send feedback to fejta).

Review the full test history for this PR.

Silence the bot with an /lgtm cancel or /hold comment for consistent failures.

@ahmad-diaa ahmad-diaa force-pushed the remove-factory-package branch from 0c181ef to 4448a1c Compare October 12, 2019 21:04
@k8s-ci-robot k8s-ci-robot removed the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Oct 12, 2019
@ahg-g
Copy link
Member

ahg-g commented Oct 13, 2019

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Oct 13, 2019
@fejta-bot
Copy link

/retest
This bot automatically retries jobs that failed/flaked on approved PRs (send feedback to fejta).

Review the full test history for this PR.

Silence the bot with an /lgtm cancel or /hold comment for consistent failures.

@k8s-ci-robot k8s-ci-robot merged commit ceceaca into kubernetes:master Oct 13, 2019
@k8s-ci-robot k8s-ci-robot added this to the v1.17 milestone Oct 13, 2019
ohsewon pushed a commit to ohsewon/kubernetes that referenced this pull request Oct 16, 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. 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/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants