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

Refactor: Define PodMetricsClient interface and hide implementation details of vllm metrics processing #26

Merged
merged 1 commit into from
Oct 22, 2024

Conversation

liu-cong
Copy link
Contributor

No description provided.

@k8s-ci-robot k8s-ci-robot requested review from ahg-g and kfswain October 22, 2024 00:07
@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Oct 22, 2024
@@ -130,3 +130,37 @@ func (p *Provider) refreshPodsOnce() error {
p.podMetrics.Range(mergeFn)
return nil
}

func (p *Provider) refreshMetricsOnce() error {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is moved from metrics.go, no new code

Copy link
Collaborator

Choose a reason for hiding this comment

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

The name of this file is slightly confusing. It reads as if it's intended to be a factory class, but then we have metrics related funcs, while there is a metrics.go file.

What is this file intended to do?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yeah probably the name is too broad. It intends to "provide info of the backend", thus "provider", and metrics is part of the "info".

}

// FetchMetrics fetches metrics from a given pod.
func (p *PodMetricsClientImpl) FetchMetrics(pod backend.Pod, existing *backend.PodMetrics) (*backend.PodMetrics, error) {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is moved from pod_client.go, no new code

@@ -75,7 +73,7 @@ func main() {

s := grpc.NewServer()

pp := backend.NewProvider(&backend.PodMetricsClientImpl{}, &backend.FakePodLister{Pods: pods})
pp := backend.NewProvider(&vllm.PodMetricsClientImpl{}, &backend.FakePodLister{Pods: pods})
Copy link
Contributor

Choose a reason for hiding this comment

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

why did we move it to a vllm package? shouldn't this be agnostic the model server?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Model servers don't always share the same metric names, so I expect we will need some "adapter code" for each model server.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We will likely share some helper functions across model servers, but until we integrate with the next model server, I put metrics scraping code in vllm.

@ahg-g
Copy link
Contributor

ahg-g commented Oct 22, 2024

/lgtm
/approve

just so we move forward

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

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: ahg-g, liu-cong

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 Oct 22, 2024
@k8s-ci-robot k8s-ci-robot merged commit 18bc3a2 into kubernetes-sigs:main Oct 22, 2024
2 checks passed
@liu-cong liu-cong deleted the metrics branch October 28, 2024 18:51
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. lgtm "Looks good to me", indicates that a PR is ready to be merged. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants