-
Notifications
You must be signed in to change notification settings - Fork 115
feat: move x-k8s to apix and add v1 InferencePool to api/v1 #1116
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: release-1.0
Are you sure you want to change the base?
feat: move x-k8s to apix and add v1 InferencePool to api/v1 #1116
Conversation
Hi @capri-xiyue. Thanks for your PR. I'm waiting for a kubernetes-sigs member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
✅ Deploy Preview for gateway-api-inference-extension ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
/assign @robscott |
It's ready for review. I added DO-NOT-MERGE because this PR should be merged in v1 branch |
Change the base to be |
/hold Adding this label until we have confirmation that we can merge this PR without sig-net approval (or getting sig-net approval) |
/ok-to-test |
/retest |
/retest |
/retest |
Currently I added the annotation |
/assign @zetxqx |
@capri-xiyue: GitHub didn't allow me to assign the following users: zetxqx. Note that only kubernetes-sigs members with read permissions, repo collaborators and people who have commented on this issue/PR can be assigned. Additionally, issues/PRs can only have 10 assignees at the same time. In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
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.
looks good to me! just one comment
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: capri-xiyue, zetxqx The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
I followed https://github.com/kubernetes-sigs/gateway-api pattern to have |
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.
Thanks @capri-xiyue!
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.
These should be updated to use aliases pointing to the v1 types. See https://github.com/kubernetes-sigs/gateway-api/blob/093f6538409c071e906856bd1ce4072204fb3f08/apis/v1beta1/gateway_types.go#L48-L55 for an example.
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 existing make generate
can't work with such alias usage, it will throw non-local type error. I guess it is because gateway-api use https://github.com/kubernetes-sigs/gateway-api/blob/main/hack/update-clientset.sh while this repo uses kube-codegen
natively. I'm wondering should we move to gateway-api self-written codegen to support alias or we are fine with native kube-codegen
with non-alias
- change from kube-codegen to self-written codegen like gateway api to support alias usage like type EndpointPickerConfig = v1.EndpointPickerConfig
- pros: avoid type duplication
- cons: need to maintain self-written codegen
- keep existing kube-codegen usage but need to duplicate the InferencePool types in alpha and v1
- pros: use kube-codegen and can get the latest code-gen feature without self-development
- con: duplicate the v1 and alpha type for now
cc @kfswain
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'm not familiar with GW API's custom code gen tool so I'm not quite sure what tradeoffs we would be making. Generally speaking, we do use a pretty slimmed down version of kubebuilders codegen tooling.
And to share more context: we might have need to define a controller for the evolution multi-tenant APIs. So IGW and GW-API differ in that regard where GW API is primarily a shared API surface w/ conformance spec. IGW has the EPP and potentially an additional controller, so we might have different code gen needs.
I understand that isn't a clear decision, just sharing additional context to help with decision making. Ultimately, I think you @capri-xiyue and @robscott would know the tradeoffs between the two tools best. I can help more if needed, but would need a tl;dr for what each choice entails.
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.
@kfswain
Here are the trade-off I think(also commented above)
-
change from kube-codegen to self-written codegen like gateway api to support alias usage like type EndpointPickerConfig = v1.EndpointPickerConfig
- pros: avoid type duplication, can use alias like
type EndpointPickerConfig = v1.EndpointPickerConfig
- cons: need to maintain self-written codegen
- pros: avoid type duplication, can use alias like
-
keep existing kube-codegen usage but need to duplicate the InferencePool types in alpha and v1
- pros: use kube-codegen and can get the latest code-gen feature without self-development
- con: duplicate the v1 and alpha type for now
Do you need additional info? For me, I think if gateway-api-inference-extension and gate-way-api may have different code gen needs, I prefer to keep using the existing slimmed down version of kubebuilders codegen tooling with which we can easily get the kubebuilder codegen latest feature easily without self development, the only cons is that we duplicate the CRD golang type in different versions, I think it is fine as I've seen such pattern commonly used in other k8s extension OSS repo, see events/v1 and events/v1beta1
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.
Discussed offline, @capri-xiyue and I agree that keeping the existing kubebuilder codegen tool is a better path forward, at the cost of duplicating the InferencePool spec into 2 different places.
Thanks @capri-xiyue!
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.
@robscott suggested that we won't need deepcopy code like api/v1alpha2/zz_generated.deepcopy.go
, therefore we can still use alias like type EndpointPickerConfig = v1.EndpointPickerConfig
. As without deepcopy code api/v1alpha2/zz_generated.deepcopy.go
, we won't hit the limitation of k8s codegen. I tried it, but still no luck as our repo uses the deepcopy code, see https://prow.k8s.io/view/gs/kubernetes-ci-logs/pr-logs/pull/kubernetes-sigs_gateway-api-inference-extension/1116/pull-gateway-api-inference-extension-test-e2e-main/1943761093448962048. Will continue the discussion with Rob.
At the same time I have filed an issue in kubernetes/code-generator#187 to get the confirmation from the code-generator side to see whether they have such support or not. I'm wondering for GA, can we tolerate the non-alias now and see later we can achieve using k8s-codegen natively and at the same time using alias? I searched the existing usage of k8s code generator. I have not found the usage of such alias. See https://github.com/kubernetes/api/blob/master/events/v1/types.go, https://github.com/kubernetes/api/blob/master/events/v1beta1/types.go. I guess the code-gen probably doesn't have such alias support right now.
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.
Spent a few hours working together with Rob to see whether we can use existing kube codegen in this repo and at the same time with GW api types definition like type InferencePool v1.InferencePool
. However, it will eventually lose alpha InferencePool CRD. Rob suggested v1.0 exclusively includes v1 InferencePool with no alpha version of InferencePool type or CRD, release channels come in to play later
and will raise it in next OSS meeting.
For now, I will duplicate the alpha golang types for InferencePool to unblock @zetxqx GA efforts.
Co-authored-by: Rob Scott <rob.scott87@gmail.com>
Co-authored-by: Rob Scott <rob.scott87@gmail.com>
Currently it failed to pass the test because of #1116 (comment). |
Revert it back to make it work. |
inference.networking.x-k8s.io
resources from/api
to/apix
inference.networking.x-k8s.io
resources in/api