Rename PodInfo struct to EndpointMetadata to better reflect its purpose#1866
Rename PodInfo struct to EndpointMetadata to better reflect its purpose#1866k8s-ci-robot merged 10 commits intokubernetes-sigs:mainfrom
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.
This one still returns a backend.Pod :(
This seems to just be an indirection/alias of datalayer.PodInfo.
Do we know if this is needed?
There was a problem hiding this comment.
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
| @@ -480,7 +480,7 @@ func makePodListFunc(ds datastore.Datastore) func() []types.NamespacedName { | |||
| names := make([]types.NamespacedName, 0, len(pods)) | |||
|
|
|||
| for _, p := range pods { | |||
There was a problem hiding this comment.
I presume a future PR will remove all references to Pod?
For example for _, p := range pods of the function name/type (makePodListFunc)
|
|
||
| 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.
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.
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.
| 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.
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.
| logger := log.FromContext(ctx).WithValues("pod", ep.GetMetadata().NamespacedName) | |
| logger := log.FromContext(ctx).WithValues("metadata", ep.GetMetadata().NamespacedName) |
|
/lgtm |
1b86ae1 to
335982f
Compare
|
/lgtm |
af24cde to
ef6aed2
Compare
|
/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 DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
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>
Signed-off-by: Shmuel Kallner <kallner@il.ibm.com>
ef6aed2 to
6fad61d
Compare
Signed-off-by: Shmuel Kallner <kallner@il.ibm.com>
|
/lgtm |
…se (kubernetes-sigs/gateway-api-inference-extension#1866) * Renamed PodInfo EndpointMetadata Signed-off-by: Shmuel Kallner <kallner@il.ibm.com> * Non test code updates due to PodInfo rename Signed-off-by: Shmuel Kallner <kallner@il.ibm.com> * Test updates due to PodInfo rename Signed-off-by: Shmuel Kallner <kallner@il.ibm.com> * Updated new code with new struct names Signed-off-by: Shmuel Kallner <kallner@il.ibm.com> * Changed PodInfo to EndpointMetadata in comments and test function names Signed-off-by: Shmuel Kallner <kallner@il.ibm.com> * Updates from review comments Signed-off-by: Shmuel Kallner <kallner@il.ibm.com> * Updated code from rebase Signed-off-by: Shmuel Kallner <kallner@il.ibm.com> * Make messages and variable names somewhat more consistent Signed-off-by: Shmuel Kallner <kallner@il.ibm.com> * Rebase correction that was missed Signed-off-by: Shmuel Kallner <kallner@il.ibm.com> * Rebase corrections due to other changes Signed-off-by: Shmuel Kallner <kallner@il.ibm.com> --------- Signed-off-by: Shmuel Kallner <kallner@il.ibm.com>
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.