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

update pg status with applyStatus #3865

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
update pg status with applyStatus
Signed-off-by: Jay Shane <327411586@qq.com>
  • Loading branch information
jxs1211 committed Dec 24, 2024
commit 71e05adfef649de5154c1d86c528820f2c024d60
4 changes: 2 additions & 2 deletions docs/design/podgroup-statistics.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ resulting in accumulation of memory leak. See in issue #3597: https://github.com

## Alternative
Currently the statistics of podgroups of each state are only used for display by vcctl, there is no need to be persisted in queue's status.
So when users need to use `vcctl queue get -n [name]` or `vcctl list` to display queues and each state of podgroups in queue,
So when users need to use `vcctl queue get -n [name]` or `vcctl queue list` to display queues and each state of podgroups in queue,
vcctl should calculate podgroup statistics in client side and then display them. And we can export these statistics of podgroups in each state as metrics.

## Implementation
Expand All @@ -20,7 +20,7 @@ And `UpdateStatus` should not be used here: https://github.com/volcano-sh/volcan
the `UpdateStatus` interface will verify the resourceVersion in the apiserver, which may cause concurrent update conflicts.
Instead, `ApplyStatus` should be used here to avoid this situation, because we only need to update the status of the queue.
It should be noted that the controller currently does not have patch queue status permissions, so we should add a patch queue/status permission to the clusterrole.
- `vcctl get -n [name]` and `vcctl list` display the statistics of podgroups in each state from queue's status directly,
- `vcctl queue get -n [name]` and `vcctl queue list` display the statistics of podgroups in each state from queue's status directly,
instead we should do one more step, query the podgroups owend in the queue, stat the counts of podgroups in each state at the `vcctl` side, and then display them.
- Those metrics called `queue_pod_group_[state]_count`, which are recorded in proportion/capacity plugins in scheduler,
now will be moved to controller to record. The metrics involved are as follows:
Expand Down
4 changes: 0 additions & 4 deletions pkg/scheduler/framework/session.go
Original file line number Diff line number Diff line change
Expand Up @@ -350,10 +350,6 @@ func jobStatus(ssn *Session, jobInfo *api.JobInfo) scheduling.PodGroupStatus {
}
}

status.Running = int32(len(jobInfo.TaskStatusIndex[api.Running]))
status.Failed = int32(len(jobInfo.TaskStatusIndex[api.Failed]))
status.Succeeded = int32(len(jobInfo.TaskStatusIndex[api.Succeeded]))

return status
}

Expand Down