-
Notifications
You must be signed in to change notification settings - Fork 182
feat(fc): Initial wiring of the flow control layer #1701
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
feat(fc): Initial wiring of the flow control layer #1701
Conversation
This commit introduces the initial integration of the new Flow Control layer into the Endpoint Picker (EPP). The primary goal is to provide a mechanism for more sophisticated request admission control, queuing, and multitenancy management. This new layer is gated by the ENABLE_EXPERIMENTAL_FLOW_CONTROL_LAYER feature flag. When enabled, the Director delegates admission control decisions to the new flowController component. The legacy saturation-based shedding logic is preserved for when the feature is disabled. Comprehensive unit tests for the admitRequest function have been added to validate the behavior of both the legacy and new flow control paths.
✅ Deploy Preview for gateway-api-inference-extension ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
Hi @LukeAVanDrie. 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. |
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.
Waiting on my test isolation changes in #1627 to land before I add the new FC cases. Will send these out in a separate PR. Right now, I want to unblock others from experimenting with the component. I have of course deployed and benchmarked this to verify the integration is working as expected.
) | ||
|
||
// TODO: this is hardcoded for POC only. This needs to be hooked up to our text-based config story. | ||
var flowControlConfig = flowcontrol.Config{ |
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.
This is admittedly sloppy. I will send out follow PRs to align this with how the rest of our pluggable layers are configured (e.g., the text-based config). For now, I am prioritizing getting the POC checked in with a functional e2e story.
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.
pls create issues to track the followup items
/ok-to-test |
Minor stylistic comments, overall looks good! Pumped to see this integrated! /approve |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: kfswain, LukeAVanDrie 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 |
This commit refactors the admission control logic introduced in the previous commit. - Introduces an AdmissionController interface. - Implements LegacyAdmissionController for existing behavior. - Implements FlowControlAdmissionController for the new flow control path. - Moves flow control request adaptation into FlowControlAdmissionController. - Updates Director to use the AdmissionController interface. - Runner now injects the appropriate controller based on the feature flag. - Splits and refactors tests for better focus and isolation. This improves modularity, testability, and separation of concerns.
82605c7
to
6114ca5
Compare
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, a couple of nits
- Introduce requtil.IsSheddable() for clarity - Move FairnessID defaulting to handler package - Add test for default FairnessID
/lgtm |
/lgtm |
What type of PR is this?
/kind feature
What this PR does / why we need it:
This PR introduces an experimental Flow Control layer to enhance request admission control, providing more sophisticated queuing, fairness, and multi-tenancy capabilities beyond the current saturation-based load shedding.
The key changes include:
Feature Flag: All new flow control functionality is gated behind the
ENABLE_EXPERIMENTAL_FLOW_CONTROL_LAYER
environment variable. When disabled, the existing admission behavior is preserved.Admission Control Refactoring:
AdmissionController
interface has been introduced inpkg/epp/requestcontrol
to abstract admission control logic.LegacyAdmissionController
: Implements the existing saturation-based shedding.FlowControlAdmissionController
: Integrates with the new Flow Control system. This controller includes logic to adapt requests to the Flow Control interface and translate outcomes.Director
now uses theAdmissionController
interface, making the admission strategy pluggable.Component Wiring:
cmd/epp/runner/runner.go
initializes theFlowController
andFlowRegistry
when the feature flag is active.runner
instantiates and injects the appropriateAdmissionController
(eitherLegacy
orFlowControl
) into theDirector
.Configuration:
runner.go
. Follow-up PRs will address dynamic configuration.Testing:
pkg/epp/requestcontrol/admission_test.go
to cover bothLegacyAdmissionController
andFlowControlAdmissionController
behaviors, including edge cases and outcome translations.flowControlRequest
adapter have been included.pkg/epp/requestcontrol/director_test.go
has been refactored to mock theAdmissionController
interface, focusing tests on theDirector
's orchestration logic.test/integration/epp/hermetic_test.go
are updated to use theLegacyAdmissionController
to ensure no change in default behavior.This refactoring improves the design's modularity, testability, and extensibility, allowing for easier development and maintenance of admission control strategies.
Which issue(s) this PR fixes:
Fixes #674
Does this PR introduce a user-facing change?: