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

KEP 168: Visibility for cluster queue #1069

Merged
merged 26 commits into from
Sep 8, 2023
Merged

Conversation

stuton
Copy link
Contributor

@stuton stuton commented Aug 18, 2023

What type of PR is this?

/kind feature

What this PR does / why we need it:

First iteration: support visibility for ClusterQueues

Which issue(s) this PR fixes:

Part of #168

Special notes for your reviewer:

Does this PR introduce a user-facing change?

Expose cluster queue information about pending workloads

@k8s-ci-robot k8s-ci-robot added do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. kind/feature Categorizes issue or PR as related to a new feature. do-not-merge/release-note-label-needed Indicates that a PR should not merge because it's missing one of the release note labels. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. labels Aug 18, 2023
@k8s-ci-robot k8s-ci-robot requested review from ahg-g and trasc August 18, 2023 14:40
@k8s-ci-robot k8s-ci-robot added the needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. label Aug 18, 2023
@k8s-ci-robot
Copy link
Contributor

Hi @stuton. Thanks for your PR.

I'm waiting for a kubernetes-sigs member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

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.

@netlify
Copy link

netlify bot commented Aug 18, 2023

Deploy Preview for kubernetes-sigs-kueue canceled.

Name Link
🔨 Latest commit 3b1f7c1
🔍 Latest deploy log https://app.netlify.com/sites/kubernetes-sigs-kueue/deploys/64f9f96ab1bb420007599076

@k8s-ci-robot k8s-ci-robot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Aug 18, 2023
@stuton
Copy link
Contributor Author

stuton commented Aug 18, 2023

/assign

@alculquicondor
Copy link
Contributor

/ok-to-test

@k8s-ci-robot k8s-ci-robot added ok-to-test Indicates a non-member PR verified by an org member that is safe to test. and removed needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Aug 21, 2023
@stuton stuton force-pushed the kep-168 branch 3 times, most recently from 84205b9 to cd06b83 Compare August 22, 2023 08:53
@k8s-ci-robot k8s-ci-robot added needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. and removed size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Aug 24, 2023
@k8s-ci-robot k8s-ci-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Aug 24, 2023
@mimowo
Copy link
Contributor

mimowo commented Aug 28, 2023

/assign

Copy link
Contributor

@mimowo mimowo left a comment

Choose a reason for hiding this comment

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

LGTM, minor naming nits

@mimowo
Copy link
Contributor

mimowo commented Sep 7, 2023

/lgtm
@alculquicondor over to you
@stuton it would be nice if you could squash the commits. I will renew lgtm.

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Sep 7, 2023
Copy link
Contributor

@alculquicondor alculquicondor left a comment

Choose a reason for hiding this comment

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

Some recommendations that can be done as follow ups or now

/hold
/approve

}
}

var DefaultOptions = ClusterQueueReconcilerOptions{}
Copy link
Contributor

Choose a reason for hiding this comment

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

Does it need to be exported?

Copy link
Contributor

@mimowo mimowo Sep 8, 2023

Choose a reason for hiding this comment

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

It does not need to be exported. But there is a collision with another defaultOptions in the package. We can rename it to defaultCqOptions. Ticketed: #1100

return cq.Status.PendingWorkloadsStatus
}

func (r *ClusterQueueReconciler) Start(ctx context.Context) error {
Copy link
Contributor

Choose a reason for hiding this comment

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

what calls this function? Is it internally called within SetupWithManager?

It feels a bit like an overload to make the Reconciler also be the one that calls the reconciler? If possible, I would split it into its own struct.

Copy link
Contributor

@mimowo mimowo Sep 8, 2023

Choose a reason for hiding this comment

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

I have traced this a little. The clusterqueue_controller.Start is called from here: https://github.com/kubernetes-sigs/controller-runtime/blob/2a553d6f910dfc4b0796142ba1e059639a21c54a/pkg/manager/runnable_group.go#L223C17-L223C22.

So, the Start is registered in the runnable Other group here, and Started here: https://github.com/kubernetes-sigs/controller-runtime/blob/2a553d6f910dfc4b0796142ba1e059639a21c54a/pkg/manager/internal.go#L417.

The start we call from within Kueue:

if err := mgr.Start(ctx); err != nil {
.

So calling SetupWithManager does not call directly the Start, but registers the runnable.

I see, seems possible. There could be something like ClusterQueueSnapshotManager.

Copy link
Contributor

Choose a reason for hiding this comment

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

Ticketed: #1099

}
for _, e := range c.inadmissibleWorkloads {
elements = append(elements, e)
}
Copy link
Contributor

Choose a reason for hiding this comment

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

could we release the lock at this point?

Copy link
Contributor

@mimowo mimowo Sep 8, 2023

Choose a reason for hiding this comment

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

Yes, the sorting can be done outside the lock.

Copy link
Contributor

Choose a reason for hiding this comment

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

Ticketed as: #1098

@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 Sep 7, 2023
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

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

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 Sep 7, 2023
@mimowo
Copy link
Contributor

mimowo commented Sep 8, 2023

Some recommendations that can be done as follow ups or now

/hold /approve

All are good points, but I think it will be better to do follow ups as @stuton is taking a week off, so waiting with the PR would risk solving merge conflicts.

@mimowo
Copy link
Contributor

mimowo commented Sep 8, 2023

xref: #1098

@mimowo
Copy link
Contributor

mimowo commented Sep 8, 2023

/hold cancel
As suggested the remaining recommendations can be fixed as follow ups (#1069 (review)).

@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 Sep 8, 2023
@mimowo
Copy link
Contributor

mimowo commented Sep 8, 2023

/test pull-kueue-verify-main

@k8s-ci-robot k8s-ci-robot merged commit 61ab18f into kubernetes-sigs:main Sep 8, 2023
@k8s-ci-robot k8s-ci-robot added this to the v0.5 milestone Sep 8, 2023
@tenzen-y
Copy link
Member

tenzen-y commented Sep 8, 2023

@stuton @mimowo Thank you for this great work. As I can see KEP, this feature is enabled only when featureGatete, QueueVisibility is enabled. However, I can not see the implementation of the featureGate in this PR. Is this intended?

@mimowo
Copy link
Contributor

mimowo commented Sep 8, 2023

@stuton @mimowo Thank you for this great work. As I can see KEP, this feature is enabled only when featureGatete, QueueVisibility is enabled. However, I can not see the implementation of the featureGate in this PR. Is this intended?

@tenzen-y it's an omission. Would you like to create an issue to follow up?

@tenzen-y
Copy link
Member

tenzen-y commented Sep 8, 2023

@stuton @mimowo Thank you for this great work. As I can see KEP, this feature is enabled only when featureGatete, QueueVisibility is enabled. However, I can not see the implementation of the featureGate in this PR. Is this intended?

@tenzen-y it's an omission. Would you like to create an issue to follow up?

Yes, I prefer to disable this feature as a default since this feature seems to be a bit aggressive. Any thought? > @alculquicondor

@alculquicondor
Copy link
Contributor

Sure thing, let's put it under a feature gate.

@tenzen-y
Copy link
Member

tenzen-y commented Sep 8, 2023

Created: #1102

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/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. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. release-note Denotes a PR that will be considered when it comes time to generate release notes. 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.

5 participants