kueue icon indicating copy to clipboard operation
kueue copied to clipboard

Report the position of a Workload in a queue via the visibility API

Open alculquicondor opened this issue 1 year ago • 18 comments
trafficstars

What would you like to be added:

Provide a visibility endpoint that returns the position of a workload in a LocalQueue or ClusterQueue.

This is a continuation of https://github.com/kubernetes-sigs/kueue/issues/168

Why is this needed:

To improve visibility to end users so they can estimate how long they will have to wait for their workloads to run

Completion requirements:

This enhancement requires the following artifacts:

  • [x] Design doc
  • [x] API change
  • [x] Docs update

The artifacts should be linked in subsequent comments.

alculquicondor avatar Jan 26 '24 17:01 alculquicondor

The Kubernetes project currently lacks enough contributors to adequately respond to all issues.

This bot triages un-triaged issues according to the following rules:

  • After 90d of inactivity, lifecycle/stale is applied
  • After 30d of inactivity since lifecycle/stale was applied, lifecycle/rotten is applied
  • After 30d of inactivity since lifecycle/rotten was applied, the issue is closed

You can:

  • Mark this issue as fresh with /remove-lifecycle stale
  • Close this issue with /close
  • Offer to help out with Issue Triage

Please send feedback to sig-contributor-experience at kubernetes/community.

/lifecycle stale

k8s-triage-robot avatar Apr 25 '24 18:04 k8s-triage-robot

/remove-lifecycle stale

alculquicondor avatar Apr 25 '24 18:04 alculquicondor

/assign

highpon avatar Jul 03 '24 15:07 highpon

Note that this issue requires a design (in the keps/ folder) prior to implementation.

alculquicondor avatar Jul 03 '24 15:07 alculquicondor

@alculquicondor Thanks for letting me know! I have no experience writing KEP ... I would be glad to know if you have any resources to help me!

highpon avatar Jul 03 '24 17:07 highpon

The best starting point would be to read the existing KEP for the visibility API. https://github.com/kubernetes-sigs/kueue/tree/main/keps/168-2-pending-workloads-visibility

alculquicondor avatar Jul 03 '24 18:07 alculquicondor

@alculquicondor I have a question. Is what you want to accomplish with this issue to estimate the number of minutes until the pending workload is executed?

highpon avatar Jul 06 '24 05:07 highpon

@alculquicondor I have a question. Is what you want to accomplish with this issue to estimate the number of minutes until the pending workload is executed?

From my understanding, the answer is no. I would like to assume the goal of this enhancement is to provide the ability to specify workload name query parameters something like /apis/visibility.kueue.x-k8s.io/v1alpha1/namespaces/default/localqueues/user-queue/pendingworkloads?workload=myworkload.

tenzen-y avatar Jul 08 '24 16:07 tenzen-y

yeah, we only want to know what is the current position of the workload in the queue. We don't have the means to estimate the wait time at the moment (Kueue doesn't have long term memory).

However, this feature is a step towards that.

alculquicondor avatar Jul 08 '24 19:07 alculquicondor

If this has not been worked on, I can help with making this feature possible. @alculquicondor @tenzen-y

alaypatel07 avatar Aug 26 '24 21:08 alaypatel07

@alaypatel07 I have been too busy with work lately to work on this issue. If you are able to get to it, I would be very grateful for your help in resolving this issue!

highpon avatar Aug 27 '24 00:08 highpon

@alaypatel07 If you want to work on this issue, feel free to assign yourself with /assign.

tenzen-y avatar Aug 27 '24 01:08 tenzen-y

yes I can help with this issue, thanks folks.

/assign

alaypatel07 avatar Aug 27 '24 01:08 alaypatel07

/unassign @highpon

tenzen-y avatar Aug 27 '24 01:08 tenzen-y

@tenzen-y @alculquicondor I have been playing around the visibility API and I can create the kep for implementing

/apis/visibility.kueue.x-k8s.io/v1alpha1/namespaces/default/localqueues/user-queue/pendingworkloads?workload=myworkload

Since workload is a namespaced resource, I wonder if this feature should only apply on localqueues?

The issue with fetching the workload from cluster queue is two fold:

  1. in order to correctly resolve the workload name in cluster queue, the URI will require additional arg workloadNamespace, something like this:
kubectl get --raw "/apis/visibility.kueue.x-k8s.io/v1alpha1/clusterqueues/cluster-queue/pendingworkloads?workloadName=myworkload&workloadNamespace=default"
  1. The information on where the workload is in global queue is already available from localqueue response in positionInClusterQueue field so not sure why the same information will be needed from globalqueue URL.

Any thoughts on this will be helpful, TIA

alaypatel07 avatar Aug 27 '24 02:08 alaypatel07

I don't think you should be piggy-backing on the existing URLs. We should have a new URL just for workloads, something like this:

/apis/visibility.kueue.x-k8s.io/v1alpha1/namespaces/<ns>/workloads/<name>

The next question is whether it should present any information if it's not pending, and what it should present.

alculquicondor avatar Aug 27 '24 15:08 alculquicondor

@alculquicondor out of curiosity why would having a new URL be preferable?

IIUC, visibility API w.r.t. workload only provides information about a workload on the queue and extending the existing URL will give users a way to filter the 1 WL out of all the pending ones May be in the future have an additional arg of label selector as query to filter from pending workloads URL.

Are there any use case that I'm missing which will be achieved better with a separate URL?

alaypatel07 avatar Aug 27 '24 16:08 alaypatel07

Think of it the other way: I want a way to know all the queueing information for a particular workload.

Then the endpoint gives me in which queue it's queued and what its position.

alculquicondor avatar Aug 27 '24 17:08 alculquicondor

The Kubernetes project currently lacks enough contributors to adequately respond to all issues.

This bot triages un-triaged issues according to the following rules:

  • After 90d of inactivity, lifecycle/stale is applied
  • After 30d of inactivity since lifecycle/stale was applied, lifecycle/rotten is applied
  • After 30d of inactivity since lifecycle/rotten was applied, the issue is closed

You can:

  • Mark this issue as fresh with /remove-lifecycle stale
  • Close this issue with /close
  • Offer to help out with Issue Triage

Please send feedback to sig-contributor-experience at kubernetes/community.

/lifecycle stale

k8s-triage-robot avatar Nov 25 '24 17:11 k8s-triage-robot

/remove-lifecycle stale

tenzen-y avatar Nov 26 '24 03:11 tenzen-y

The Kubernetes project currently lacks enough contributors to adequately respond to all issues.

This bot triages un-triaged issues according to the following rules:

  • After 90d of inactivity, lifecycle/stale is applied
  • After 30d of inactivity since lifecycle/stale was applied, lifecycle/rotten is applied
  • After 30d of inactivity since lifecycle/rotten was applied, the issue is closed

You can:

  • Mark this issue as fresh with /remove-lifecycle stale
  • Close this issue with /close
  • Offer to help out with Issue Triage

Please send feedback to sig-contributor-experience at kubernetes/community.

/lifecycle stale

k8s-triage-robot avatar Feb 24 '25 03:02 k8s-triage-robot

The Kubernetes project currently lacks enough active contributors to adequately respond to all issues.

This bot triages un-triaged issues according to the following rules:

  • After 90d of inactivity, lifecycle/stale is applied
  • After 30d of inactivity since lifecycle/stale was applied, lifecycle/rotten is applied
  • After 30d of inactivity since lifecycle/rotten was applied, the issue is closed

You can:

  • Mark this issue as fresh with /remove-lifecycle rotten
  • Close this issue with /close
  • Offer to help out with Issue Triage

Please send feedback to sig-contributor-experience at kubernetes/community.

/lifecycle rotten

k8s-triage-robot avatar Mar 26 '25 03:03 k8s-triage-robot

The Kubernetes project currently lacks enough active contributors to adequately respond to all issues and PRs.

This bot triages issues according to the following rules:

  • After 90d of inactivity, lifecycle/stale is applied
  • After 30d of inactivity since lifecycle/stale was applied, lifecycle/rotten is applied
  • After 30d of inactivity since lifecycle/rotten was applied, the issue is closed

You can:

  • Reopen this issue with /reopen
  • Mark this issue as fresh with /remove-lifecycle rotten
  • Offer to help out with Issue Triage

Please send feedback to sig-contributor-experience at kubernetes/community.

/close not-planned

k8s-triage-robot avatar Apr 25 '25 03:04 k8s-triage-robot

@k8s-triage-robot: Closing this issue, marking it as "Not Planned".

In response to this:

The Kubernetes project currently lacks enough active contributors to adequately respond to all issues and PRs.

This bot triages issues according to the following rules:

  • After 90d of inactivity, lifecycle/stale is applied
  • After 30d of inactivity since lifecycle/stale was applied, lifecycle/rotten is applied
  • After 30d of inactivity since lifecycle/rotten was applied, the issue is closed

You can:

  • Reopen this issue with /reopen
  • Mark this issue as fresh with /remove-lifecycle rotten
  • Offer to help out with Issue Triage

Please send feedback to sig-contributor-experience at kubernetes/community.

/close not-planned

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-sigs/prow repository.

k8s-ci-robot avatar Apr 25 '25 03:04 k8s-ci-robot