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

Refactor: split out flavor assigment logic #454

Merged
merged 1 commit into from
Dec 1, 2022

Conversation

alculquicondor
Copy link
Contributor

@alculquicondor alculquicondor commented Nov 30, 2022

What type of PR is this?

/kind cleanup

What this PR does / why we need it:

Split the logic for flavor assignment into its own package.
This decoupling can lead to better unit testing and more maintainable extensions in each of the packages.

I also added an "assignment mode" into the flavor assignment, which opens the possibility to assign flavors that require preemption.

Which issue(s) this PR fixes:

Preparation for #83

Special notes for your reviewer:

The integration tests didn't require any changes :D

@k8s-ci-robot k8s-ci-robot added kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. labels Nov 30, 2022
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: alculquicondor

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 approved Indicates a PR has been approved by an approver from all required OWNERS files. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. labels Nov 30, 2022
@alculquicondor
Copy link
Contributor Author

/assign @ahg-g

@kerthcet
Copy link
Contributor

kerthcet commented Dec 1, 2022

/cc

// ClusterQueuePreempt means that there is not enough min quota in the
// ClusterQueue, so we need to preempt other workloads in the ClusterQueue
// with lower priority.
ClusterQueuePreempt
Copy link
Contributor

Choose a reason for hiding this comment

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

lets add those later in the PR that uses them.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Just left CohortFit for now.

"sigs.k8s.io/kueue/pkg/workload"
)

func TestAssignFlavors(t *testing.T) {
Copy link
Contributor

Choose a reason for hiding this comment

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

are the tests in this file mostly a copy?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yes, they were moved from scheduler_test.go

Change-Id: I3cd13127c2fc92be836becffcd8a7e69d2c3a819
@ahg-g
Copy link
Contributor

ahg-g commented Dec 1, 2022

/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 1, 2022
@k8s-ci-robot k8s-ci-robot merged commit 08dc185 into kubernetes-sigs:main Dec 1, 2022
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. 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. 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.

4 participants