-
Notifications
You must be signed in to change notification settings - Fork 105
feat(conformance): Add HTTPRouteMultipleGatewaysDifferentPools test #838
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: main
Are you sure you want to change the base?
feat(conformance): Add HTTPRouteMultipleGatewaysDifferentPools test #838
Conversation
✅ Deploy Preview for gateway-api-inference-extension ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
Hi @SinaChavoshi. 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. |
/cc |
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.
/lgtm
/lgtm |
/ok-to-test |
https://github.com/kubernetes-sigs/gateway-api-inference-extension/pull/838/files#r2150419700 needs to be resolved before merging. /hold |
Implementation-specific resources should not be in conformance tests (#838 (comment)). /hold |
sorry was waiting for #982 to merge, this makes the code much simpler as all tests now share the EPP and inferencePool definitions from manifests.yaml |
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 @SinaChavoshi! This mostly LGTM
// TODO - Remove this once the upstream timeout has been changed. | ||
modifiedConfig := gatewayconfig.DefaultTimeoutConfig() | ||
modifiedConfig.HTTPRouteMustHaveCondition = 300 * time.Second |
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.
We should override this via flag when running tests, but should not have a hardcoded override like this.
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 I actually did similar thing in https://github.com/kubernetes-sigs/gateway-api-inference-extension/pull/961/files#diff-a3410329c9007a0eb0b2c451387bbf6bf97821df458a0fdf6eb669f9565f0956 . I feel for the inference-gateway conformance tests we need to have a separate setting of timeout. And I feel here DefaultInferenceExtensionTimeoutConfig
is a good place to put it in.
Flag is good but I assume we don't want to change the timeout a lot. So maybe hard code here is fine?
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.
Yeah, I like that idea of having a separate set of defaults for this project. Just want to override something like this where we're hardcoding a value in a way that would make it impossible to override via flag.
|
||
const ( | ||
eppSelectionHeader = "test-epp-endpoint-selection" | ||
backendPort = 3000 |
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.
It seems like we should make IP:Port
the input here instead of hardcoding port in this function.
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.
We don't need to provide the port at all. EPP will use the port configured in inferencePool.
|
||
primaryGwAddr := k8sutils.GetGatewayEndpoint(t, s.Client, s.TimeoutConfig, primaryGatewayNN) | ||
primarySelector := labels.SelectorFromSet(labels.Set{backendAppLabelKey: primaryBackendLabel}) | ||
primaryPod := k8sutils.GetPod(t, s.Client, appBackendNamespace, primarySelector, s.TimeoutConfig.RequestTimeout) |
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.
Does this mean that each InferencePool needs to have exactly 1 Pod running? I thought that in other tests we were able to just check the prefix of a Pod name or something similar?
- group: inference.networking.x-k8s.io | ||
kind: InferencePool | ||
name: primary-inference-pool | ||
port: 80 |
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.
nit: this is not needed any more based on #918
- group: inference.networking.x-k8s.io | ||
kind: InferencePool | ||
name: secondary-inference-pool | ||
port: 80 |
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.
Same here, we can remove it
// TODO - Remove this once the upstream timeout has been changed. | ||
modifiedConfig := gatewayconfig.DefaultTimeoutConfig() | ||
modifiedConfig.HTTPRouteMustHaveCondition = 300 * time.Second |
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 I actually did similar thing in https://github.com/kubernetes-sigs/gateway-api-inference-extension/pull/961/files#diff-a3410329c9007a0eb0b2c451387bbf6bf97821df458a0fdf6eb669f9565f0956 . I feel for the inference-gateway conformance tests we need to have a separate setting of timeout. And I feel here DefaultInferenceExtensionTimeoutConfig
is a good place to put it in.
Flag is good but I assume we don't want to change the timeout a lot. So maybe hard code here is fine?
|
||
const ( | ||
eppSelectionHeader = "test-epp-endpoint-selection" | ||
backendPort = 3000 |
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.
We don't need to provide the port at all. EPP will use the port configured in inferencePool.
Path: path, | ||
Host: hostname, | ||
Headers: map[string]string{ | ||
eppSelectionHeader: fmt.Sprintf("%s:%d", targetPod.Status.PodIP, backendPort), |
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.
only podIP is needed here.
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. |
This PR introduces a new conformance test, HTTPRouteMultipleGatewaysDifferentPools, which validates a scenario where two distinct HTTPRoute resources, parented by different Gateway resources, successfully reference and route traffic to separate InferencePool backends.
local run results: ( Ran on commit be03841 )