Skip to content

Validate dependencies for all producer/consumer plugins in datalayer#2246

Merged
k8s-ci-robot merged 5 commits intokubernetes-sigs:mainfrom
rahulgurnani:datalayer-rework
Feb 9, 2026
Merged

Validate dependencies for all producer/consumer plugins in datalayer#2246
k8s-ci-robot merged 5 commits intokubernetes-sigs:mainfrom
rahulgurnani:datalayer-rework

Conversation

@rahulgurnani
Copy link
Copy Markdown
Contributor

@rahulgurnani rahulgurnani commented Feb 2, 2026

What type of PR is this?

/kind cleanup

What this PR does / why we need it:

Presently only prepare data plugins are validated for dependency check for cyclic dependencies. In this change, the check is extended to all producer/consumer plugins.

Which issue(s) this PR fixes:

Fixes #1988

Does this PR introduce a user-facing change?:

No

@k8s-ci-robot
Copy link
Copy Markdown
Contributor

Skipping CI for Draft Pull Request.
If you want CI signal for your change, please convert it to an actual PR.
You can still manually trigger a test run with /test all

@k8s-ci-robot k8s-ci-robot added do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. labels Feb 2, 2026
@netlify
Copy link
Copy Markdown

netlify bot commented Feb 2, 2026

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

Name Link
🔨 Latest commit b41f0bf
🔍 Latest deploy log https://app.netlify.com/projects/gateway-api-inference-extension/deploys/698a5ab3c8aa1800086b029f
😎 Deploy Preview https://deploy-preview-2246--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 size/M Denotes a PR that changes 30-99 lines, ignoring generated files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. labels Feb 2, 2026
@rahulgurnani
Copy link
Copy Markdown
Contributor Author

/assign @kfswain

@k8s-ci-robot k8s-ci-robot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Feb 3, 2026
@rahulgurnani rahulgurnani marked this pull request as ready for review February 3, 2026 10:47
@k8s-ci-robot k8s-ci-robot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Feb 3, 2026
@k8s-ci-robot k8s-ci-robot requested a review from elevran February 3, 2026 10:47
@ahg-g
Copy link
Copy Markdown
Contributor

ahg-g commented Feb 6, 2026

anything blocking this?

for producedKey, producedData := range plugins[i].Produces() {
if producer.Produces() != nil && consumer.Consumes() != nil {
for producedKey, producedData := range producer.Produces() {
// If plugin j consumes the produced key, then j depends on i. We can break after the first match.
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

lets update these comments to the new var names

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Thanks for the catch. The new variable names are quite intutive. I think we don't need some of these comments now. Removed them.

for producedKey, producedData := range producer.Produces() {
// If plugin j consumes the produced key, then j depends on i. We can break after the first match.
if consumedData, ok := plugins[j].Consumes()[producedKey]; ok {
if consumedData, ok := consumer.Consumes()[producedKey]; ok {
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

We should also check that plugins arent attempting to consume data from a layer they dont have access to. example: Flow Control plugins currently can't rely on Request Specific data

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I think, that's something we should do in a separate change. AFAIK, we presently don't have the information about which layer the plugin is from here etc. It may require significant redesign and refactor. Added a TODO for it now. Thanks!

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

SG, spun up a an issue, added it to the milestone & assigned to you. Thanks!

}

// orderPrepareDataPlugins reorders the prepareDataPlugins in the Config based on the given sorted plugin names.
func (c *Config) orderPrepareDataPlugins(sortedPluginNames []string) {
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Is this consumed in a way that parallelizes preparedata steps until it hits a plugin that has a dependency?

If not, we should add that, I think.

Copy link
Copy Markdown
Contributor Author

@rahulgurnani rahulgurnani Feb 9, 2026

Choose a reason for hiding this comment

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

no.. I had added the code to parallelize it earlier but based on Nir's suggestion, I kept the plugin execution sequential for now for simplicity. I did check the performance differences and prepare data step execution latency in parallel vs sequential had hardly any difference. I think we can stick with sequential execution in the correct order (topologically sorted order) for now.

Reference:
#1878 (comment)

@kfswain
Copy link
Copy Markdown
Collaborator

kfswain commented Feb 9, 2026

/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 Feb 9, 2026
@k8s-ci-robot
Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: kfswain, rahulgurnani

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details 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 Feb 9, 2026
@k8s-ci-robot k8s-ci-robot merged commit 74aa889 into kubernetes-sigs:main Feb 9, 2026
11 checks passed
RyanRosario pushed a commit to RyanRosario/gateway-api-inference-extension that referenced this pull request Mar 9, 2026
…ubernetes-sigs#2246)

* Validate all producer consumer plugins

* Rename methods, cleanup

* More cleanup

* Remove stale comments

* Add TODO for pool-level/request level validations
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. kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. lgtm "Looks good to me", indicates that a PR is ready to be merged. 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.

Extend data layer dependency graph validation to all plugins

4 participants