-
Notifications
You must be signed in to change notification settings - Fork 206
Rename PodInfo struct to EndpointMetadata to better reflect its purpose #1866
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
base: main
Are you sure you want to change the base?
Conversation
✅ Deploy Preview for gateway-api-inference-extension ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
facd8e6 to
0ec1d80
Compare
0ec1d80 to
474bc16
Compare
| } | ||
|
|
||
| func (pm *podMetrics) GetPod() *backend.Pod { | ||
| func (pm *podMetrics) GetMetadata() *backend.Pod { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This one still returns a backend.Pod :(
This seems to just be an indirection/alias of datalayer.PodInfo.
| type Pod = datalayer.PodInfo |
Do we know if this is needed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have updated the code you mentioned.
The indirection/alias of backend.Pod to datalayer.EndpointMetadata (was PodInfo) is still used in many places in the code.
This PR removes some of those "indirect references". I though to take care of this in multiple PRs to keep the size down.
I can if you want, make all of the changes in one Pr.
37ce4da to
e4f723b
Compare
79b282b to
cc1c41e
Compare
| pods := ds.PodList(func(_ backendmetrics.PodMetrics) bool { return true }) | ||
| names := make([]types.NamespacedName, 0, len(pods)) | ||
|
|
||
| for _, p := range pods { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I presume a future PR will remove all references to Pod?
For example for _, p := range pods of the function name/type (makePodListFunc)
pkg/epp/backend/metrics/fake.go
Outdated
|
|
||
| func (fpm *FakePodMetrics) String() string { | ||
| return fmt.Sprintf("Pod: %v; Metrics: %v", fpm.GetPod(), fpm.GetMetrics()) | ||
| return fmt.Sprintf("Pod: %v; Metrics: %v", fpm.GetMetadata(), fpm.GetMetrics()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if you're changing this line anyway consider changing the text as well.
| return fmt.Sprintf("Pod: %v; Metrics: %v", fpm.GetMetadata(), fpm.GetMetrics()) | |
| return fmt.Sprintf("Metadata: %v; Metrics: %v", fpm.GetMetadata(), fpm.GetMetrics()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The same applies in other lines in all files where you've already replaced the GetPod() and contain pod
|
|
||
| func (pm *podMetrics) stopRefreshLoop() { | ||
| pm.logger.V(logutil.DEFAULT).Info("Stopping refresher", "pod", pm.GetPod()) | ||
| pm.logger.V(logutil.DEFAULT).Info("Stopping refresher", "pod", pm.GetMetadata()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| pm.logger.V(logutil.DEFAULT).Info("Stopping refresher", "pod", pm.GetMetadata()) | |
| pm.logger.V(logutil.DEFAULT).Info("Stopping refresher", "endpoint", pm.GetMetadata()) |
| // pooled memory or other management chores in the implementation. | ||
| type EndpointFactory interface { | ||
| NewEndpoint(parent context.Context, inpod *PodInfo, poolinfo PoolInfo) Endpoint | ||
| NewEndpoint(parent context.Context, inEnpointMetadata *EndpointMetadata, poolinfo PoolInfo) Endpoint |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: prefer shorter variables if possible (e.g., meta or inmd in this case)?
| } | ||
|
|
||
| logger := log.FromContext(ctx).WithValues("pod", ep.GetPod().NamespacedName) | ||
| logger := log.FromContext(ctx).WithValues("pod", ep.GetMetadata().NamespacedName) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| logger := log.FromContext(ctx).WithValues("pod", ep.GetMetadata().NamespacedName) | |
| logger := log.FromContext(ctx).WithValues("metadata", ep.GetMetadata().NamespacedName) |
|
/lgtm |
1b86ae1 to
335982f
Compare
|
/lgtm |
Signed-off-by: Shmuel Kallner <kallner@il.ibm.com>
Signed-off-by: Shmuel Kallner <kallner@il.ibm.com>
Signed-off-by: Shmuel Kallner <kallner@il.ibm.com>
Signed-off-by: Shmuel Kallner <kallner@il.ibm.com>
Signed-off-by: Shmuel Kallner <kallner@il.ibm.com>
Signed-off-by: Shmuel Kallner <kallner@il.ibm.com>
Signed-off-by: Shmuel Kallner <kallner@il.ibm.com>
Signed-off-by: Shmuel Kallner <kallner@il.ibm.com>
af24cde to
ef6aed2
Compare
|
New changes are detected. LGTM label has been removed. |
|
/approve |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: kfswain, shmuelk 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 |
What type of PR is this?
/kind cleanup
What this PR does / why we need it:
Gateway Inference Extension (GIE) PR #1663 added support for vLLM's Data Parallel feature. This feature enables running more than one exposed vLLM HTTP endpoint in a pod/container.
Previously the GIE assumed that there was only one vLLM endpoint per pod. Thus it tracked per pod information and called it PodInfo.
To simplify things PR #1663 simply treated each of the vLLM endpoints, described in a GIE InferencePool, as another pod with an appropriate PodInfo struct.
It was pointed out during the review of PR #1663 by @kfswain that we need to rename some of the structs due to the changes. Details can be found here
This PR is the first of several that will refactor/rename various structs/APIs to better reflect their usage.
In particular this PR:
Future PRs will do more of this refactoring/renaming and will improve variable names in the code as well.