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

Adding printer columns to inference model #574

Merged
merged 1 commit into from
Mar 27, 2025

Conversation

kfswain
Copy link
Collaborator

@kfswain kfswain commented Mar 25, 2025

Fixes: #504

@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Mar 25, 2025
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: kfswain

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 approved Indicates a PR has been approved by an approver from all required OWNERS files. size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Mar 25, 2025
Copy link

netlify bot commented Mar 25, 2025

Deploy Preview for gateway-api-inference-extension ready!

Name Link
🔨 Latest commit 6a394df
🔍 Latest deploy log https://app.netlify.com/sites/gateway-api-inference-extension/deploys/67e43c387275ea000843ec93
😎 Deploy Preview https://deploy-preview-574--gateway-api-inference-extension.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@@ -25,6 +25,10 @@ import (
// +kubebuilder:object:root=true
// +kubebuilder:subresource:status
// +kubebuilder:storageversion
// +kubebuilder:printcolumn:name="Model Name", type=string,JSONPath=`.spec.modelName`
// +kubebuilder:printcolumn:name="Inference Pool", type=string,JSONPath=`.spec.poolRef.name`
Copy link
Contributor

Choose a reason for hiding this comment

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

Criticality is operationally important

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I looked into adding it, but it's optional, so I thought that might be odd to have some empty entries.

For posterity/context: We specifically made this field optional so it could be nullable, should we ever make a replacement field we could retroactively one-of them.

That being said, we can still add it, as I agree, it is important.

@smarterclayton
Copy link
Contributor

Also inference model please (the referent)

@kfswain
Copy link
Collaborator Author

kfswain commented Mar 25, 2025

Also inference model please (the referent)

targetModels is an array, which is also optional. So just to talk this out (which is kinda why I omitted), what behavior do we want? Is a count sufficient and then the user describes the model they want to look into further?

That could be useful as:
0 implies that modelName==referentName
1 implies modelName is just an indirection
>1 implies there is a transition state or traffic split of some sort ongoing

LMKWYT

@kfswain
Copy link
Collaborator Author

kfswain commented Mar 25, 2025

Screenshot 2025-03-25 at 1 19 11 PM

I get the above output using:

// +kubebuilder:printcolumn:name="Model Name",type=string,JSONPath=`.spec.modelName`
// +kubebuilder:printcolumn:name="Target Models",type=string,JSONPath=`.spec.targetModels[*].name`
// +kubebuilder:printcolumn:name="Inference Pool",type=string,JSONPath=`.spec.poolRef.name`
// +kubebuilder:printcolumn:name="Criticality",type=string,JSONPath=`.spec.criticality`
// +kubebuilder:printcolumn:name="Age",type=date,JSONPath=`.metadata.creationTimestamp`

Its worth noting that criticality is specified on all models, the entry will just be blank if unspecified.

I think criticality is fine as is, target model(s) I think is very misleading, as it only prints the first entry

@k8s-ci-robot k8s-ci-robot added needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Mar 26, 2025
@k8s-ci-robot k8s-ci-robot added size/S Denotes a PR that changes 10-29 lines, ignoring generated files. and removed needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Mar 26, 2025
@ahg-g
Copy link
Contributor

ahg-g commented Mar 27, 2025

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Mar 27, 2025
@k8s-ci-robot k8s-ci-robot merged commit d1d11f8 into kubernetes-sigs:main Mar 27, 2025
8 checks passed
@kfswain kfswain deleted the printer-cols branch March 27, 2025 19:45
@smarterclayton
Copy link
Contributor

The target model thing seems like a bug, I designed custom printers to support arrays, but something may have changed since then.

@smarterclayton
Copy link
Contributor

You might need to use “range” in the target model column.

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/S Denotes a PR that changes 10-29 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

InferenceModel needs custom printer columns
4 participants