Skip to content
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

Delta xds #255

Merged
merged 59 commits into from
Sep 26, 2022
Merged

Delta xds #255

merged 59 commits into from
Sep 26, 2022

Conversation

slonka
Copy link
Contributor

@slonka slonka commented May 18, 2021

This PR enables support for delta-xds (also known as incremental xds) in Envoy.

We're trying to optimize CPU usage in services that use '*' in outgoing dependencies. Based on our tests this should decrease Envoy's CPU usage between 50% and 75%.

Will change JCP snapshot to release when it's merged.

@slonka slonka changed the title Delta xds hash bytes Delta xds May 18, 2021
import io.envoyproxy.controlplane.cache.StatusInfo;
import io.envoyproxy.controlplane.cache.Watch;
import io.envoyproxy.controlplane.cache.XdsRequest;
import io.envoyproxy.controlplane.cache.*;
Copy link
Contributor

Choose a reason for hiding this comment

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

wildcard imports, here and in few other files


override fun onV3StreamDeltaRequest(
streamId: Long,
request: io.envoyproxy.envoy.service.discovery.v3.DeltaDiscoveryRequest?
Copy link
Contributor

Choose a reason for hiding this comment

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

Let's make alias for import import io.envoyproxy.envoy.service.discovery.v3.DeltaDiscoveryRequest? as DeltaDiscoveryRequestV3

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I will change all imports to DiscoveryRV2/3.


override fun onV3StreamDeltaRequest(
streamId: Long,
request: io.envoyproxy.envoy.service.discovery.v3.DeltaDiscoveryRequest?
Copy link
Contributor

Choose a reason for hiding this comment

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

We can do also alias import


override fun onV3StreamDeltaRequest(
streamId: Long,
request: io.envoyproxy.envoy.service.discovery.v3.DeltaDiscoveryRequest?
Copy link
Contributor

Choose a reason for hiding this comment

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

here too

@@ -38,6 +38,13 @@ val AdsCustomHealthCheck = EnvoyConfig("envoy/config_ads_custom_health_check.yam
val AdsDynamicForwardProxy = EnvoyConfig("envoy/config_ads_dynamic_forward_proxy.yaml")
val FaultyConfig = EnvoyConfig("envoy/bad_config.yaml")
val Ads = EnvoyConfig("envoy/config_ads.yaml")
val DeltaAds = Ads.copy(
Copy link
Contributor

@lukidzi lukidzi May 19, 2021

Choose a reason for hiding this comment

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

Do we have any tests checking in egress works/propagation changes?

Copy link
Contributor Author

@slonka slonka May 19, 2021

Choose a reason for hiding this comment

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

We can switch to delta-xds for RandomConfigFile or just everywhere since it's going to be the default. WDYT?

EDIT: Also those things are tested in jcp.

@@ -217,8 +217,9 @@ class EnvoySnapshotFactory(
globalSnapshot: GlobalSnapshot,
egressRouteSpecifications: Collection<RouteSpecification>
): List<ClusterLoadAssignment> {
val resources = globalSnapshot.endpoints
Copy link
Contributor

Choose a reason for hiding this comment

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

Why just endpoints are called resources?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Old refactoring, I can call it endpoints.

@@ -59,11 +60,24 @@ class MetricsDiscoveryServerCallbacks(private val meterRegistry: MeterRegistry)
.increment()
}

override fun onV3StreamDeltaRequest(
streamId: Long,
request: io.envoyproxy.envoy.service.discovery.v3.DeltaDiscoveryRequest
Copy link
Contributor

Choose a reason for hiding this comment

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

here too

@Ferdudas97 Ferdudas97 temporarily deployed to ci February 14, 2022 08:20 Inactive
@Ferdudas97 Ferdudas97 force-pushed the delta-xds-hash-bytes branch 2 times, most recently from 822ac21 to 3c91147 Compare February 14, 2022 14:58
@Ferdudas97 Ferdudas97 temporarily deployed to ci February 18, 2022 11:22 Inactive
@Ferdudas97 Ferdudas97 temporarily deployed to ci February 22, 2022 10:04 Inactive
@Ferdudas97 Ferdudas97 temporarily deployed to ci February 23, 2022 14:11 Inactive
@Ferdudas97 Ferdudas97 temporarily deployed to ci February 28, 2022 12:49 Inactive
# Conflicts:
#	envoy-control-core/src/main/kotlin/pl/allegro/tech/servicemesh/envoycontrol/snapshot/SnapshotProperties.kt
@Ferdudas97 Ferdudas97 temporarily deployed to ci March 8, 2022 09:55 Inactive
@slonka
Copy link
Contributor Author

slonka commented Jun 2, 2022

This PR is 1 year old 🎂 🥳

@Automaat
Copy link
Contributor

Automaat commented Jun 3, 2022

This PR is 1 year old 🎂 🥳

Nice @slonka, and congratulations on such a big and long PR since it is still your pull request :) We are unable to merge this PR before we merge the JCP pull request. Which we are unable to merge because JCP community is almost dead, we are unable to publish JCP package, and because of that we cannot test this changes on any of our environments:(

# Conflicts:
#	.github/workflows/changelog.yaml
#	CHANGELOG.md
#	build.gradle
#	docs/changelog_symlink.md
#	docs/configuration.md
#	envoy-control-core/src/main/kotlin/pl/allegro/tech/servicemesh/envoycontrol/groups/NodeMetadataValidator.kt
#	envoy-control-core/src/main/kotlin/pl/allegro/tech/servicemesh/envoycontrol/server/CachedProtoResourcesSerializer.kt
#	envoy-control-core/src/main/kotlin/pl/allegro/tech/servicemesh/envoycontrol/server/callbacks/CompositeDiscoveryServerCallbacks.kt
#	envoy-control-core/src/main/kotlin/pl/allegro/tech/servicemesh/envoycontrol/server/callbacks/LoggingDiscoveryServerCallbacks.kt
#	envoy-control-core/src/main/kotlin/pl/allegro/tech/servicemesh/envoycontrol/server/callbacks/MetricsDiscoveryServerCallbacks.kt
#	envoy-control-core/src/main/kotlin/pl/allegro/tech/servicemesh/envoycontrol/snapshot/GlobalSnapshot.kt
#	envoy-control-core/src/test/java/pl/allegro/tech/servicemesh/envoycontrol/v2/SimpleCacheTest.java
#	envoy-control-core/src/test/java/pl/allegro/tech/servicemesh/envoycontrol/v2/SimpleCacheWithMissingEndpointsTest.java
@Ferdudas97 Ferdudas97 temporarily deployed to ci July 26, 2022 08:41 Inactive
# Conflicts:
#	envoy-control-core/src/test/kotlin/pl/allegro/tech/servicemesh/envoycontrol/EnvoySnapshotFactoryTest.kt
@Ferdudas97 Ferdudas97 merged commit 912799d into master Sep 26, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants