-
Notifications
You must be signed in to change notification settings - Fork 603
move ordering gateway-api resources to provider #6695
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
Conversation
Codecov Report❌ Patch coverage is
❌ Your patch status has failed because the patch coverage (30.91%) is below the target coverage (60.00%). You can increase the patch coverage or adjust the target coverage. Additional details and impacted files@@ Coverage Diff @@
## main #6695 +/- ##
==========================================
- Coverage 71.30% 71.06% -0.24%
==========================================
Files 224 224
Lines 39558 39615 +57
==========================================
- Hits 28207 28154 -53
- Misses 9710 9799 +89
- Partials 1641 1662 +21 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
internal/gatewayapi/testdata/backendtlspolicy-default-ns-targetrefs.out.yaml
Show resolved
Hide resolved
| name: target-httproute-with-attachment-conflict-truncated-ancestors | ||
| name: target-httproute-with-accepted-truncated-ancestors |
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.
didn't follow alphabetical order when createtime is same?
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.
There is no sorting in this layer, it's following test case index order, the sorting has now moved to the provider which is ensuring index order
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.
Maybe I missed something, is there a test to make sure the sort worked as expected?
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 in internal/message/watchutil_test.go
|
/retest |
| // or sort alphabetically by “{namespace}/{name}” if multiple gateways share same timestamp. | ||
| sort.Slice(c[idx].Gateways, func(i, j int) bool { | ||
| if c[idx].Gateways[i].CreationTimestamp.Equal(&(c[idx].Gateways[j].CreationTimestamp)) { | ||
| gatewayKeyI := fmt.Sprintf("%s/%s", c[idx].Gateways[i].Namespace, c[idx].Gateways[i].Name) |
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.
would it be better to compare the namespace/name directly instead of doing a printf here?
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.
can we track this as a follow up, since ive already run the numbers with this code, and it is moving the same logic from gateway-api layer to provider layer
in the future we can run go test -bench tests to track func performance
Xunzhuo
left a comment
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.
Nice improves, looks like CPU cost reduces largely
* sorts a collection of resources on gatewayClass - creationTimestamp then name * moves all per resource sort function to provider layer This ensures all resources will be sorted, and duplicate updates wont result into watchable subscribe calls to runners. It also means per XDS IR is also ordered This allows us to delete `Equal()` functions added for `ProviderResources` and `XDS IR` which called expensive `DeepCopy` and `sort` functions, and rely on the top level * the internal `svcMap` field is removed, because it was affecting caching and equality performance, it can be introduced back in the gateway-api layer as part of Translator context to improve config convergence time once we start accurately tracking it Fixes: envoyproxy#6690 Signed-off-by: Arko Dasgupta <arko@tetrate.io>
Signed-off-by: zirain <zirain2009@gmail.com>
* docs: rm latest from install egctl docs (#6700) * we've removed the latest egctl artifacts Relates to #6551 Signed-off-by: Arko Dasgupta <arko@tetrate.io> Signed-off-by: zirain <zirain2009@gmail.com> * chore: fix globalResources in GNM (#6701) Signed-off-by: zirain <zirain2009@gmail.com> * move ordering gateway-api resources to provider (#6695) Signed-off-by: zirain <zirain2009@gmail.com> * Rate Limiter: Enable rate limit for month and year (#6715) * update go control plane rate limiter version Signed-off-by: Pascal van Leeuwen <pascal@grove.city> * enable rate limit for month and year Signed-off-by: Pascal van Leeuwen <pascal@grove.city> * add attribution Signed-off-by: Pascal van Leeuwen <pascal@grove.city> * fix gen Signed-off-by: Pascal van Leeuwen <pascal@grove.city> * remove helm binaries Signed-off-by: Pascal van Leeuwen <pascal@grove.city> --------- Signed-off-by: Pascal van Leeuwen <pascal@grove.city> Co-authored-by: Rico Pahlisch <pahli88@googlemail.com> Signed-off-by: zirain <zirain2009@gmail.com> * docs: rm alpha alert for gateway namespace mode (#6709) Signed-off-by: Arko Dasgupta <arko@tetrate.io> Signed-off-by: zirain <zirain2009@gmail.com> * allow SNI and Cert SAN mismatch (#6719) Fixes: #6442 Signed-off-by: Arko Dasgupta <arko@tetrate.io> Signed-off-by: zirain <zirain2009@gmail.com> * chore(charts): update metadata for gateway-crds-helm (#6725) * chore(charts): update metadata for gateway-crds-helm Signed-off-by: Maxime Brunet <max@brnt.mx> Signed-off-by: zirain <zirain2009@gmail.com> * chore: Don't render bootstrap local cluster if topologyInjector is disabled (#6718) * Consider topologyInjector when rendering bootstrap Signed-off-by: jukie <10012479+Jukie@users.noreply.github.com> * Add logic to provider Signed-off-by: jukie <10012479+Jukie@users.noreply.github.com> Signed-off-by: zirain <zirain2009@gmail.com> * remove nit log when Backend API is disabled (#6708) * remove nit log when Backend API is disabled Signed-off-by: zirain <zirain2009@gmail.com> * fix: EnvoyProxy image with digest is rejected (#6720) * fix: EnvoyProxy image with digest is rejected Signed-off-by: zirain <zirain2009@gmail.com> * Revert "feat: add listener metadata (#6639)" (#6727) This reverts commit 20cb68b. Signed-off-by: Arko Dasgupta <arko@tetrate.io> Signed-off-by: zirain <zirain2009@gmail.com> * docs: enhance extensibility index page (#6728) make it easier to pick the relevant extension type Signed-off-by: Arko Dasgupta <arko@tetrate.io> Signed-off-by: zirain <zirain2009@gmail.com> * docs: add docs explaining graceful shutdown (#6729) * docs: add docs explaining graceful shutdown fixes: #2686 Signed-off-by: Arko Dasgupta <arko@tetrate.io> Signed-off-by: zirain <zirain2009@gmail.com> * docs: ClusterTrustBundle Support in BackendTLSPolicy (#6714) Signed-off-by: zirain <zirain2009@gmail.com> * chore: bump go 1.24.6 (#6732) Signed-off-by: zirain <zirain2009@gmail.com> * [release-1.5] release-notes for v1.5.0 (#6731) * [release-1.5] release-notes for v1.5.0 Signed-off-by: zirain <zirain2009@gmail.com> * update compatibility matrix Signed-off-by: zirain <zirain2009@gmail.com> --------- Signed-off-by: Arko Dasgupta <arko@tetrate.io> Signed-off-by: zirain <zirain2009@gmail.com> Signed-off-by: Pascal van Leeuwen <pascal@grove.city> Signed-off-by: Maxime Brunet <max@brnt.mx> Signed-off-by: jukie <10012479+Jukie@users.noreply.github.com> Co-authored-by: Arko Dasgupta <arkodg@users.noreply.github.com> Co-authored-by: commoddity <47662958+commoddity@users.noreply.github.com> Co-authored-by: Rico Pahlisch <pahli88@googlemail.com> Co-authored-by: Maxime Brunet <max@brnt.mx> Co-authored-by: Isaac <10012479+jukie@users.noreply.github.com>
* docs: rm latest from install egctl docs (envoyproxy#6700) * we've removed the latest egctl artifacts Relates to envoyproxy#6551 Signed-off-by: Arko Dasgupta <arko@tetrate.io> Signed-off-by: zirain <zirain2009@gmail.com> * chore: fix globalResources in GNM (envoyproxy#6701) Signed-off-by: zirain <zirain2009@gmail.com> * move ordering gateway-api resources to provider (envoyproxy#6695) Signed-off-by: zirain <zirain2009@gmail.com> * Rate Limiter: Enable rate limit for month and year (envoyproxy#6715) * update go control plane rate limiter version Signed-off-by: Pascal van Leeuwen <pascal@grove.city> * enable rate limit for month and year Signed-off-by: Pascal van Leeuwen <pascal@grove.city> * add attribution Signed-off-by: Pascal van Leeuwen <pascal@grove.city> * fix gen Signed-off-by: Pascal van Leeuwen <pascal@grove.city> * remove helm binaries Signed-off-by: Pascal van Leeuwen <pascal@grove.city> --------- Signed-off-by: Pascal van Leeuwen <pascal@grove.city> Co-authored-by: Rico Pahlisch <pahli88@googlemail.com> Signed-off-by: zirain <zirain2009@gmail.com> * docs: rm alpha alert for gateway namespace mode (envoyproxy#6709) Signed-off-by: Arko Dasgupta <arko@tetrate.io> Signed-off-by: zirain <zirain2009@gmail.com> * allow SNI and Cert SAN mismatch (envoyproxy#6719) Fixes: envoyproxy#6442 Signed-off-by: Arko Dasgupta <arko@tetrate.io> Signed-off-by: zirain <zirain2009@gmail.com> * chore(charts): update metadata for gateway-crds-helm (envoyproxy#6725) * chore(charts): update metadata for gateway-crds-helm Signed-off-by: Maxime Brunet <max@brnt.mx> Signed-off-by: zirain <zirain2009@gmail.com> * chore: Don't render bootstrap local cluster if topologyInjector is disabled (envoyproxy#6718) * Consider topologyInjector when rendering bootstrap Signed-off-by: jukie <10012479+Jukie@users.noreply.github.com> * Add logic to provider Signed-off-by: jukie <10012479+Jukie@users.noreply.github.com> Signed-off-by: zirain <zirain2009@gmail.com> * remove nit log when Backend API is disabled (envoyproxy#6708) * remove nit log when Backend API is disabled Signed-off-by: zirain <zirain2009@gmail.com> * fix: EnvoyProxy image with digest is rejected (envoyproxy#6720) * fix: EnvoyProxy image with digest is rejected Signed-off-by: zirain <zirain2009@gmail.com> * Revert "feat: add listener metadata (envoyproxy#6639)" (envoyproxy#6727) This reverts commit 20cb68b. Signed-off-by: Arko Dasgupta <arko@tetrate.io> Signed-off-by: zirain <zirain2009@gmail.com> * docs: enhance extensibility index page (envoyproxy#6728) make it easier to pick the relevant extension type Signed-off-by: Arko Dasgupta <arko@tetrate.io> Signed-off-by: zirain <zirain2009@gmail.com> * docs: add docs explaining graceful shutdown (envoyproxy#6729) * docs: add docs explaining graceful shutdown fixes: envoyproxy#2686 Signed-off-by: Arko Dasgupta <arko@tetrate.io> Signed-off-by: zirain <zirain2009@gmail.com> * docs: ClusterTrustBundle Support in BackendTLSPolicy (envoyproxy#6714) Signed-off-by: zirain <zirain2009@gmail.com> * chore: bump go 1.24.6 (envoyproxy#6732) Signed-off-by: zirain <zirain2009@gmail.com> * [release-1.5] release-notes for v1.5.0 (envoyproxy#6731) * [release-1.5] release-notes for v1.5.0 Signed-off-by: zirain <zirain2009@gmail.com> * update compatibility matrix Signed-off-by: zirain <zirain2009@gmail.com> --------- Signed-off-by: Arko Dasgupta <arko@tetrate.io> Signed-off-by: zirain <zirain2009@gmail.com> Signed-off-by: Pascal van Leeuwen <pascal@grove.city> Signed-off-by: Maxime Brunet <max@brnt.mx> Signed-off-by: jukie <10012479+Jukie@users.noreply.github.com> Co-authored-by: Arko Dasgupta <arkodg@users.noreply.github.com> Co-authored-by: commoddity <47662958+commoddity@users.noreply.github.com> Co-authored-by: Rico Pahlisch <pahli88@googlemail.com> Co-authored-by: Maxime Brunet <max@brnt.mx> Co-authored-by: Isaac <10012479+jukie@users.noreply.github.com> Signed-off-by: zirain <zirain2009@gmail.com>




This ensures all resources will be sorted, and duplicate updates wont result into watchable subscribe calls to runners. It also means per XDS IR is also ordered
This allows us to delete
Equal()functions added forProviderResourcesandXDS IRwhich called expensiveDeepCopyandsortfunctions, and rely on the top levelsvcMapfield is removed, because it was affecting caching and equality performance, it can be introduced back in the gateway-api layer as part of Translator context to improve config convergence time once we start accurately tracking itTested with 2000 HTTPRoutes and a aggressive cache sync period of 1m
Observations
Before
After
Fixes: #6690