feat: add priority to backendRef#673
Conversation
eb2aa3b to
102c94b
Compare
76f2dbe to
79f2fcd
Compare
mathetake
left a comment
There was a problem hiding this comment.
maybe you might want to update the provider_fallback e2e ?
|
i am glad that the core change is much smaller than i thought! I think the rest is documentation + e2e tests |
515f83b to
02c5208
Compare
I don't think we will be able to add this until the previous priority retry predicate PR makes it into Envoy Gateway. |
|
hmm i was under the impression that this could be used instead of fallback: true option in the e2e test. not sure what i am missing |
ah, yes that will work. The part that can't be tested yet is retrying across priorities in a dynamic way. |
|
cool, could you go ahead and make the change like the below; diff --git a/examples/provider_fallback/base.yaml b/examples/provider_fallback/base.yaml
index b695ae4..ea3c5bc 100644
--- a/examples/provider_fallback/base.yaml
+++ b/examples/provider_fallback/base.yaml
@@ -41,8 +41,11 @@ spec:
name: x-ai-eg-model
value: us.meta.llama3-2-1b-instruct-v1:0
backendRefs:
- - name: provider-fallback-always-failing-upstream # This is the primary backend and trying to speak TLS, which always fails.
+ - name: provider-fallback-always-failing-upstream
+ # This is the primary backend and trying to speak TLS, which always fails.
+ priority: 0
- name: provider-fallback-aws
+ priority: 1
---
apiVersion: aigateway.envoyproxy.io/v1alpha1
kind: AIServiceBackend
@@ -80,8 +83,6 @@ metadata:
name: provider-fallback-aws
namespace: default
spec:
- # Indicate that this backend is a fallback backend, meaning that it will only be used if the primary backend fails.
- fallback: true
endpoints:
- fqdn:
hostname: bedrock-runtime.us-east-1.amazonaws.comi believe this should work and then we are good to go (i think we can make this part of v0.2) |
extension server. Signed-off-by: Curtis Maddalozzo <cmaddalozzo@bloomberg.net>
Signed-off-by: Curtis Maddalozzo <cmaddalozzo@bloomberg.net>
Signed-off-by: Curtis Maddalozzo <cmaddalozzo@bloomberg.net>
Signed-off-by: Curtis Maddalozzo <cmaddalozzo@bloomberg.net>
Signed-off-by: Curtis Maddalozzo <cmaddalozzo@bloomberg.net>
Signed-off-by: Curtis Maddalozzo <cmaddalozzo@bloomberg.net>
Signed-off-by: Dan Sun <dsun20@bloomberg.net>
a2ed196 to
9e2d702
Compare
@mathetake I updated, going to update my doc with the same change. |
| - name: provider-fallback-always-failing-upstream # This is the primary backend and trying to speak TLS, which always fails. | ||
| priority: 0 | ||
| - name: provider-fallback-aws | ||
| priority: 1 |
There was a problem hiding this comment.
Can you also delete the fallback: true below as it's overridden by this
There was a problem hiding this comment.
Yes I deleted the fallback flag below
**Commit Message** Add priority field to AIGatewayRouteRuleBackendRef. This will set priority on the underlying LocalityLB endpoint in Envoy. **Related Issues/PRs (if applicable)** N/A **Special notes for reviewers (if applicable)** In order to get the Envoy Gateway to reconcile the underlying `HTTPRoute` when the priorities in the `AIGatewayRoute` spec change we need to add an annotation. This annotation just store the priorities for each rule. This ensure we only trigger reconciliation when the priorities actually change. --------- Signed-off-by: Curtis Maddalozzo <cmaddalozzo@bloomberg.net> Signed-off-by: Dan Sun <dsun20@bloomberg.net> Co-authored-by: Dan Sun <dsun20@bloomberg.net>
Commit Message
Add priority field to AIGatewayRouteRuleBackendRef. This will set priority on the underlying LocalityLB endpoint in Envoy.
Related Issues/PRs (if applicable)
N/A
Special notes for reviewers (if applicable)
In order to get the Envoy Gateway to reconcile the underlying
HTTPRoutewhen the priorities in theAIGatewayRoutespec change we need to add an annotation. This annotation just store the priorities for each rule. This ensure we only trigger reconciliation when the priorities actually change.