Skip to content

Conversation

capri-xiyue
Copy link
Contributor

@capri-xiyue capri-xiyue commented Aug 11, 2025

part of #1336

  1. change TargetPortNumber int32 to become TargetPorts []Port, where Port includes only a Number field to start in InferencePool v1.
  2. to avoid break change for now, currently TargetPosts only allows exactly one item

Does this PR introduce a user-facing change?:

Replaces InferencePool targetPortNumber with targetPorts. Only 1 targetPort is supported at this time. Updates Helm values accordingly.

Copy link

netlify bot commented Aug 11, 2025

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

Name Link
🔨 Latest commit c352bae
🔍 Latest deploy log https://app.netlify.com/projects/gateway-api-inference-extension/deploys/689e8e34ade0660008941cf6
😎 Deploy Preview https://deploy-preview-1354--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 project configuration.

@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Aug 11, 2025
@k8s-ci-robot k8s-ci-robot added the needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. label Aug 11, 2025
@k8s-ci-robot
Copy link
Contributor

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 /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

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.

@k8s-ci-robot k8s-ci-robot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Aug 11, 2025
@liu-cong
Copy link
Contributor

/ok-to-test

@k8s-ci-robot k8s-ci-robot added ok-to-test Indicates a non-member PR verified by an org member that is safe to test. and removed needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Aug 11, 2025
@capri-xiyue
Copy link
Contributor Author

/assign @ahg-g

@capri-xiyue
Copy link
Contributor Author

This is ready for early review. I will add additional conversion logic once #1330 gets merged.

/hold until #1330 gets merged

@k8s-ci-robot k8s-ci-robot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Aug 11, 2025
@capri-xiyue
Copy link
Contributor Author

/assign @danehans @nirrozenbaum for InferencePool spec change.

Copy link
Member

@robscott robscott left a comment

Choose a reason for hiding this comment

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

Thanks @capri-xiyue! This LGTM, curious what others like @danehans and @nirrozenbaum think.

Copy link
Member

@robscott robscott left a comment

Choose a reason for hiding this comment

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

Thanks @capri-xiyue!

@capri-xiyue capri-xiyue requested a review from robscott August 12, 2025 00:21
Copy link
Contributor

@nirrozenbaum nirrozenbaum left a comment

Choose a reason for hiding this comment

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

I went over the PR.

the main comment I have is that I think this change is too tightly coupled with a specific way to do DP, while there are potentially multiple ways to do that.

if vLLM decides to shift from multiple ports to something else, we're going to get stuck with an array of size one.
I'm not a big fan of the approach that is suggested in this PR.

if we decide to pursue this path of multiple target ports on the CRD, this PR overall looks good. I left few comments.

@capri-xiyue capri-xiyue force-pushed the capri-xiyue/target-port-change branch from 1d6392f to a8c8088 Compare August 12, 2025 19:59
@k8s-ci-robot k8s-ci-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Aug 13, 2025
@capri-xiyue capri-xiyue force-pushed the capri-xiyue/target-port-change branch from de34d3d to bde16d2 Compare August 13, 2025 17:26
@k8s-ci-robot k8s-ci-robot added needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. and removed needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. labels Aug 13, 2025
@capri-xiyue capri-xiyue force-pushed the capri-xiyue/target-port-change branch from a1e28ad to 575a9e2 Compare August 13, 2025 20:58
@k8s-ci-robot k8s-ci-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Aug 14, 2025
@capri-xiyue capri-xiyue requested a review from danehans August 14, 2025 23:01
dst.Spec.TargetPortNumber = src.Spec.TargetPortNumber
dst.Spec.ExtensionRef = v1Extension
dst.Spec.TargetPorts = []v1.Port{{Number: v1.PortNumber(src.Spec.TargetPortNumber)}}
dst.Spec.ExtensionRef = *v1Extension
Copy link
Contributor

@danehans danehans Aug 14, 2025

Choose a reason for hiding this comment

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

If ExtensionRef continues to be required (xref), convertExtensionRefToV1() should return a value instead of a pointer. With that said, convert should be updated to return a value:

func convert[T any](u *unstructured.Unstructured) (T, error) {
	var res T
	if err := runtime.DefaultUnstructuredConverter.FromUnstructured(u.Object, &res); err != nil {
		var zero T
		return zero, fmt.Errorf("error converting unstructured to T: %v", err)
	}
	return res, nil
}

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Changed ExtensionRef to be optional

Copy link
Contributor

Choose a reason for hiding this comment

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

Copy link
Contributor Author

@capri-xiyue capri-xiyue Aug 15, 2025

Choose a reason for hiding this comment

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

I changed the conversion back to return value instead of pointer, but for the function parameter, I still use pointer as I thought it's a golang convention to pass parameter as a pointer for efficiency. Let me know whether it works for you.

Just curious, as ideally should both src and dst be a pointer for efficiency no matter whether they are required or not See https://github.com/kubernetes/kubernetes/blob/master/pkg/apis/batch/v1/zz_generated.conversion.go

@capri-xiyue capri-xiyue requested a review from danehans August 15, 2025 00:03
@danehans
Copy link
Contributor

/lgtm
/approve

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

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: capri-xiyue, danehans

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 Aug 15, 2025
@k8s-ci-robot k8s-ci-robot merged commit 9976bd0 into kubernetes-sigs:main Aug 15, 2025
10 checks passed
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. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. 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.

8 participants