Skip to content

Conversation

@rockswe
Copy link

@rockswe rockswe commented Dec 1, 2025

/kind cleanup

What this PR does / why we need it:
Reorganizes scheduling plugins under pkg/epp/scheduling/framework/plugins into per-plugin directories (e.g., prefixcachescorer, predictedlatencyscorer, maxscorepicker, etc.), with imports/docs/tests updated accordingly. Picker helpers moved to pickershared, and the existing picker tests were split into per-package files (no new behavior).

Which issue(s) this PR fixes:
Fixes #1889

Does this PR introduce a user-facing change?:

NONE

cc @ahg-g

@k8s-ci-robot k8s-ci-robot added the kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. label Dec 1, 2025
@netlify
Copy link

netlify bot commented Dec 1, 2025

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

Name Link
🔨 Latest commit ff0703c
🔍 Latest deploy log https://app.netlify.com/projects/gateway-api-inference-extension/deploys/692e0fd676d9910008fc1538
😎 Deploy Preview https://deploy-preview-1921--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 Dec 1, 2025
@k8s-ci-robot k8s-ci-robot requested a review from liu-cong December 1, 2025 19:52
@k8s-ci-robot
Copy link
Contributor

Welcome @rockswe!

It looks like this is your first PR to kubernetes-sigs/gateway-api-inference-extension 🎉. Please refer to our pull request process documentation to help your PR have a smooth ride to approval.

You will be prompted by a bot to use commands during the review process. Do not be afraid to follow the prompts! It is okay to experiment. Here is the bot commands documentation.

You can also check if kubernetes-sigs/gateway-api-inference-extension has its own contribution guidelines.

You may want to refer to our testing guide if you run into trouble with your tests not passing.

If you are having difficulty getting your pull request seen, please follow the recommended escalation practices. Also, for tips and tricks in the contribution process you may want to read the Kubernetes contributor cheat sheet. We want to make sure your contribution gets all the attention it needs!

Thank you, and welcome to Kubernetes. 😃

@k8s-ci-robot k8s-ci-robot requested a review from robscott December 1, 2025 19:52
@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 Dec 1, 2025
@k8s-ci-robot
Copy link
Contributor

Hi @rockswe. Thanks for your PR.

I'm waiting for a github.com 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/XL Denotes a PR that changes 500-999 lines, ignoring generated files. label Dec 1, 2025
@ahg-g
Copy link
Contributor

ahg-g commented Dec 1, 2025

/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 Dec 1, 2025
Copy link
Contributor

@ahg-g ahg-g left a comment

Choose a reason for hiding this comment

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

distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
Copy link
Contributor

Choose a reason for hiding this comment

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

I would create a plugins/common and organize "common" packages under it, like picker/picker.go

Co-authored-by: Abdullah Gharaibeh <40361897+ahg-g@users.noreply.github.com>
@ahg-g
Copy link
Contributor

ahg-g commented Dec 1, 2025

What is the deal with https://github.com/kubernetes-sigs/gateway-api-inference-extension/tree/main/pkg/epp/scheduling/framework/plugins/test ? can we move it to https://github.com/kubernetes-sigs/gateway-api-inference-extension/tree/main/pkg/epp/util/testing ?

another option is to move it under scheduling/framework/plugins/common/testing, basically under the new common pkg suggested above

@rockswe
Copy link
Author

rockswe commented Dec 1, 2025

What is the deal with https://github.com/kubernetes-sigs/gateway-api-inference-extension/tree/main/pkg/epp/scheduling/framework/plugins/test ? can we move it to https://github.com/kubernetes-sigs/gateway-api-inference-extension/tree/main/pkg/epp/util/testing ?

another option is to move it under scheduling/framework/plugins/common/testing, basically under the new common pkg suggested above

Ack and thanks for the guidance. I kept the helpers under scheduling/framework/plugins/test during the reorg to avoid touching broader paths, but I’m happy to move them. My preference is pkg/epp/util/testing/scheduling so they’re in the shared testing area but if you’d rather keep them closer to plugins as scheduling/framework/plugins/common/testing, I can do that instead, let me know your pick. I’ll also relocate the picker shared helpers into pkg/epp/scheduling/framework/plugins/common/picker as you suggested.

@ahg-g
Copy link
Contributor

ahg-g commented Dec 1, 2025

What is the deal with https://github.com/kubernetes-sigs/gateway-api-inference-extension/tree/main/pkg/epp/scheduling/framework/plugins/test ? can we move it to https://github.com/kubernetes-sigs/gateway-api-inference-extension/tree/main/pkg/epp/util/testing ?

another option is to move it under scheduling/framework/plugins/common/testing, basically under the new common pkg suggested above

Ack and thanks for the guidance. I kept the helpers under scheduling/framework/plugins/test during the reorg to avoid touching broader paths, but I’m happy to move them. My preference is pkg/epp/util/testing/scheduling so they’re in the shared testing area but if you’d rather keep them closer to plugins as scheduling/framework/plugins/common/testing, I can do that instead, let me know your pick. I’ll also relocate the picker shared helpers into pkg/epp/scheduling/framework/plugins/common/picker as you suggested.

Thanks, make sense, lets do that in a follow up PR then.

@rockswe
Copy link
Author

rockswe commented Dec 1, 2025

What is the deal with https://github.com/kubernetes-sigs/gateway-api-inference-extension/tree/main/pkg/epp/scheduling/framework/plugins/test ? can we move it to https://github.com/kubernetes-sigs/gateway-api-inference-extension/tree/main/pkg/epp/util/testing ?

another option is to move it under scheduling/framework/plugins/common/testing, basically under the new common pkg suggested above

Ack and thanks for the guidance. I kept the helpers under scheduling/framework/plugins/test during the reorg to avoid touching broader paths, but I’m happy to move them. My preference is pkg/epp/util/testing/scheduling so they’re in the shared testing area but if you’d rather keep them closer to plugins as scheduling/framework/plugins/common/testing, I can do that instead, let me know your pick. I’ll also relocate the picker shared helpers into pkg/epp/scheduling/framework/plugins/common/picker as you suggested.

Thanks, make sense, lets do that in a follow up PR then.

What is the deal with https://github.com/kubernetes-sigs/gateway-api-inference-extension/tree/main/pkg/epp/scheduling/framework/plugins/test ? can we move it to https://github.com/kubernetes-sigs/gateway-api-inference-extension/tree/main/pkg/epp/util/testing ?

another option is to move it under scheduling/framework/plugins/common/testing, basically under the new common pkg suggested above

Ack and thanks for the guidance. I kept the helpers under scheduling/framework/plugins/test during the reorg to avoid touching broader paths, but I’m happy to move them. My preference is pkg/epp/util/testing/scheduling so they’re in the shared testing area but if you’d rather keep them closer to plugins as scheduling/framework/plugins/common/testing, I can do that instead, let me know your pick. I’ll also relocate the picker shared helpers into pkg/epp/scheduling/framework/plugins/common/picker as you suggested.

Thanks, make sense, lets do that in a follow up PR then.

got it, will leave this PR as is and move the scheduling test helpers and picker common helpers to the suggested locations in a follow up PR.

@ahg-g
Copy link
Contributor

ahg-g commented Dec 1, 2025

Here is how the plugins will look like under the new organization:

image

Note that both pickershared and test will be removed in a followup PR.

@kfswain @nirrozenbaum can someone pls review and lgtm so we have at least two looking at this PR.

/approve
/hold

@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 Dec 1, 2025
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: ahg-g, rockswe

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 Dec 1, 2025
@kfswain
Copy link
Collaborator

kfswain commented Dec 1, 2025

Looks good! I notice that we are essentially fully flattening the plugins directory. (for example, predictedlatency has a profile handler, and a scorer.

If we want to do it flat, could we come up with some naming conventions to make it a little easier to read? ex: featurename_extensionpoint. So that would make it predictedlatency_profilehandler & predictedlatency_scorer.

Alternatively we can just make the directories the feature names, and put all the plugin points within the dir. I do kinda like the flat structure for quick glance value. It may get too wide in the future, but we shall see.

TL;DR: lets converge on a convention (author's choice) to make it a tad easier to read/navigate then happy to stamp, thanks!

@ahg-g
Copy link
Contributor

ahg-g commented Dec 1, 2025

Alternatively we can just make the directories the feature names, and put all the plugin points within the dir. I do kinda like the flat structure for quick glance value. It may get too wide in the future, but we shall see.

Thanks for the catch, I missed it! My strong preference is to organize by feature, so everything for predicated latency should be under one directory, I am fine with naming it predictedlatency but if the feature at its core is a scorer and the picker extension is an implementation detail, then naming the directory predictedlatencyscorer makes more sense to me.

@ahg-g
Copy link
Contributor

ahg-g commented Dec 4, 2025

@rockswe we discussed the naming format in today's community meeting and converged on the format

predictedlatency.Plugin; basically the package name is the feature name only without any suffixes, and the internal struct is always named Plugin.

#1889 (comment)

@k8s-ci-robot k8s-ci-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Dec 6, 2025
@k8s-ci-robot
Copy link
Contributor

PR needs rebase.

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.

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. do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Reorganize the plugins directory to group by plugin name rather than extension

4 participants