yunikorn-core icon indicating copy to clipboard operation
yunikorn-core copied to clipboard

[YUNIKORN-2461] Add new RESTful API to get queue applications filtered by state

Open targetoee opened this issue 9 months ago • 4 comments

What is this PR for?

In YUNIKORN-2235, an API to retrieve applications by state in partition was added. However, there is currently no API serving the same purpose at the queue level. This PR add a new RESTful API that allows filtering applications by state at queue level, which unifies API behavior.

What type of PR is it?

  • [ ] - Bug Fix
  • [x] - Improvement
  • [ ] - Feature
  • [ ] - Documentation
  • [ ] - Hot Fix
  • [ ] - Refactoring

Todos

N/A

What is the Jira issue?

YUNIKORN-2461

How should this be tested?

It has been checked locally by make test.

Screenshots (if appropriate)

N/A

Questions:

N/A

targetoee avatar Apr 27 '24 08:04 targetoee

Codecov Report

Attention: Patch coverage is 66.66667% with 14 lines in your changes are missing coverage. Please review.

Project coverage is 76.97%. Comparing base (cf838f9) to head (507da8b). Report is 6 commits behind head on master.

Files Patch % Lines
pkg/webservice/handlers.go 66.66% 9 Missing and 5 partials :warning:
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #861      +/-   ##
==========================================
- Coverage   77.00%   76.97%   -0.03%     
==========================================
  Files          97       97              
  Lines       12002    12040      +38     
==========================================
+ Hits         9242     9268      +26     
- Misses       2422     2430       +8     
- Partials      338      342       +4     

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

codecov-commenter avatar Apr 27 '24 18:04 codecov-commenter

I have another thought. Since we only have 'active' applications in queue, how about extend the existing 'queue applications' api?

Extend

  • http://localhost:9889/ws/v1/partition/default/queue/root.default/applications

to

  • http://localhost:9889/ws/v1/partition/default/queue/root.default/applications?running.

Keep using query parameter to filter out 'new', 'accepted', 'running', 'completing', 'failing', 'resuming'.

chenyulin0719 avatar May 16 '24 08:05 chenyulin0719

@targetoee could you rebase this patch to master?

pbacsko avatar Jun 20 '24 15:06 pbacsko

@targetoee could you rebase this PR?

pbacsko avatar Jun 25 '24 13:06 pbacsko

After contacting @targetoee and obtaining his consent, I will proceed to complete this issue.

I also agree with @chenyulin0719's suggestion. I believe the API path /partition/{partitionName}/queue/{queueName}/applications/{state}?status={status} might be a more suitable approach. This structure maintains better consistency with the non-queue version: /partition/{partitionName}/applications/{state}?status={status}

I'd appreciate hearing everyone's thoughts on this proposal. @pbacsko, WDYT?

blueBlue0102 avatar Aug 08 '24 02:08 blueBlue0102

@blueBlue0102 Thanks for taking over this Jira. As we discussed, In YUNIKORN-2235, we have below new APIs.

  • http://localhost:9889/ws/v1/partition/default/applications/completed
  • http://localhost:9889/ws/v1/partition/default/applications/rejected
  • http://localhost:9889/ws/v1/partition/default/applications/active
  • http://localhost:9889/ws/v1/partition/default/applications/active?status=running

This Jira (YUNIKORN-2461) should be implemented in the consistent way:

  • http://localhost:9889/ws/v1/partition/default/queue/root.default/applications/{state}?status={status}

(My previous comment could be ignored)

Please proceed and update the original description in this Jira. Thanks.

chenyulin0719 avatar Aug 08 '24 06:08 chenyulin0719

close this PR as duplicate to #938

chia7712 avatar Aug 10 '24 18:08 chia7712