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

kueuectl command to get job + workload #2168

Open
2 of 3 tasks
alculquicondor opened this issue May 8, 2024 · 6 comments · May be fixed by #2238
Open
2 of 3 tasks

kueuectl command to get job + workload #2168

alculquicondor opened this issue May 8, 2024 · 6 comments · May be fixed by #2238
Assignees
Labels
kind/feature Categorizes issue or PR as related to a new feature.

Comments

@alculquicondor
Copy link
Contributor

alculquicondor commented May 8, 2024

What would you like to be added:

A single command that would output the status (and potentially events) of both workload and job objects.

Maybe it should look something like:

kubectl kueue describe <job type> <job name>

Ideally, this should work not just for CRDs supported by Kueue, but also external extensions. This should be possible using the discovery API and searching for a corresponding Workload object for it that has the matching UID label.

Why is this needed:

A common question users ask is "why is my job not running".

While most of this can be answered by looking at the Workload object, we don't want to force users to understand what the difference is between job and workload.

Furthermore, Kueue might have admitted the job and the job could be pending due to scale ups or failing scheduling (kube-scheduler) attempts.

Completion requirements:

This enhancement requires the following artifacts:

  • Design doc
  • API change
  • Docs update

The artifacts should be linked in subsequent comments.

@alculquicondor alculquicondor added the kind/feature Categorizes issue or PR as related to a new feature. label May 8, 2024
@alculquicondor
Copy link
Contributor Author

cc @mwielgus

@trasc
Copy link
Contributor

trasc commented May 15, 2024

@alculquicondor could extending the filter/lookup capabilities of list workload be sufficient for this?

### List Workloads
Lists Workloads that match the provided criteria. Format:
```
kueuectl list workloads
--namespace=ns # uses context's default namespace if not specified
--all-namespaces | -A
--clusterqueue=cq
-–localqueue=lq
-—only-pending
—-only-admitted
--selector=selector
```
Output:
* Namespace (if -A is used)
* Workload name
* CRD type (truncated to 10 chars)
* CRD name
* LocalQueue
* ClusterQueue
* Status
* Position in Queue (if Pending)
* Age

@alculquicondor
Copy link
Contributor Author

It could help, something like:

kubectl list workloads --for job/my-job-name

But it could also help to have a dedicated command that shows you both the job and the workload.

@alculquicondor
Copy link
Contributor Author

Let's start with just --for

/assign @trasc

@trasc
Copy link
Contributor

trasc commented May 16, 2024

/assign @IrvingMg

In my opinion the format for --for can be something like [<type>[.<api-group>]/]<name> so :

  • --for=my-job includes all the workloads with a parent called my-job regardless of type and api-group
  • --for=job/my-job includes all the workloads with a parent called my-job and type job regardless of its api-group
  • --for=job.batch/my-job includes all the workloads with a parent called my-job and type job in api-group batch

The filtering is done on the client side so having the filter relaxed when it comes to owner type should not have any performance penalties.

@alculquicondor
Copy link
Contributor Author

  • --for=my-job includes all the workloads with a parent called my-job regardless of type and api-group
  • --for=job/my-job includes all the workloads with a parent called my-job and type job regardless of its api-group

To avoid confusion if there happen to be 2 jobs with the same name, I hope we can include the full api name for the owning job in the list table.

The fact that multiple jobs matched will be less obvious if using -o=yaml, but I suppose users of this format are more savvy.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/feature Categorizes issue or PR as related to a new feature.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants