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

router: scoped rds (2d): integrate SRDS API into HttpConnectionManager #7068

Merged
merged 44 commits into from
Jun 4, 2019

Conversation

AndresGuedez
Copy link
Contributor

Integrate the Scoped Route Discovery Service (SRDS) API into the HttpConnectionManager.

NOTES:

Risk Level: Low (API is not yet fully implemented and should not be enabled)
Testing: Integration tests added.
Docs Changes: N/A

This commit introduces:
- Support for scoped routing configuration parsing.
- Inline and dynamic config providers using the ConfigProvider framework.
- Unit and integration testing scaffolding.

This is the second step in the PR chain for envoyproxy#4704.

Signed-off-by: Andres Guedez <aguedez@google.com>
Signed-off-by: Andres Guedez <aguedez@google.com>
Signed-off-by: Andres Guedez <aguedez@google.com>
…-dynamic

Signed-off-by: Andres Guedez <aguedez@google.com>
Signed-off-by: Andres Guedez <aguedez@google.com>
Signed-off-by: Andres Guedez <aguedez@google.com>
Signed-off-by: Andres Guedez <aguedez@google.com>
Signed-off-by: Andres Guedez <aguedez@google.com>
Signed-off-by: Andres Guedez <aguedez@google.com>
Signed-off-by: Andres Guedez <aguedez@google.com>
Signed-off-by: Andres Guedez <aguedez@google.com>
Signed-off-by: Andres Guedez <aguedez@google.com>
Signed-off-by: Andres Guedez <aguedez@google.com>
Signed-off-by: Andres Guedez <aguedez@google.com>
- Top level SRDS resource is now called a 'ScopedRouteConfiguration'.
- SRDS now operates like CDS where the full set of resources received
via the DS builds the complete configuration state.
- Modified the ConfigProvider framework to support delta APIs such as SRDS
and CDS
- Scoped RDS unit test mostly passing, integration tests have not yet
been migrated to new API

Signed-off-by: Andres Guedez <aguedez@google.com>
Also, cleanup.

Signed-off-by: Andres Guedez <aguedez@google.com>
- Readability cleanup in various places.
- Improve integration tests.
- Add 'name' field to ScopedRoutes proto.

Signed-off-by: Andres Guedez <aguedez@google.com>
Signed-off-by: Andres Guedez <aguedez@google.com>
…-dynamic

Signed-off-by: Andres Guedez <aguedez@google.com>
Signed-off-by: Andres Guedez <aguedez@google.com>
Signed-off-by: Andres Guedez <aguedez@google.com>
Signed-off-by: Andres Guedez <aguedez@google.com>
Signed-off-by: Andres Guedez <aguedez@google.com>
…-dynamic

Signed-off-by: Andres Guedez <aguedez@google.com>
- Refactor the framework to create a cleaner, more cohesive set of abstractions based on the
ConfigProvider::ApiType of the DS API.
- Rename base classes for consistency and clarity.

Signed-off-by: Andres Guedez <aguedez@google.com>
Signed-off-by: Andres Guedez <aguedez@google.com>
Signed-off-by: Andres Guedez <aguedez@google.com>
Signed-off-by: Andres Guedez <aguedez@google.com>
…scoped-rds-integration

Signed-off-by: Andres Guedez <aguedez@google.com>
Signed-off-by: Andres Guedez <aguedez@google.com>
…ation

Signed-off-by: Andres Guedez <aguedez@google.com>
Signed-off-by: Andres Guedez <aguedez@google.com>
Signed-off-by: Andres Guedez <aguedez@google.com>
Signed-off-by: Andres Guedez <aguedez@google.com>
…ation

Signed-off-by: Andres Guedez <aguedez@google.com>
…ation

Signed-off-by: Andres Guedez <aguedez@google.com>
@htuch
Copy link
Member

htuch commented May 28, 2019

Please merge master to pick up #7090

…ation

Signed-off-by: Andres Guedez <aguedez@google.com>
@htuch htuch added the waiting label May 28, 2019
Signed-off-by: Andres Guedez <aguedez@google.com>
@AndresGuedez
Copy link
Contributor Author

/retest

@repokitteh-read-only
Copy link

🔨 rebuilding ci/circleci: tsan (failed build)

🐱

Caused by: a #7068 (comment) was created by @AndresGuedez.

see: more, trace.

@AndresGuedez
Copy link
Contributor Author

Is there any way to retest just the envoy-macos CI run? It appears to have flaked but /retest did not kick off a rerun.

@htuch
Copy link
Member

htuch commented May 30, 2019

/azp run
@AndresGuedez ^^ like so

@azure-pipelines
Copy link

Command 'run @AndresGuedez' is not supported by Azure Pipelines.

Supported commands
  • help:
    • Get descriptions, examples and documentation about supported commands
    • Example: help "command_name"
  • list:
    • List all pipelines for this repository using a comment.
    • Example: "list"
  • run:
    • Run all pipelines or a specific pipeline for this repository using a comment. Use this command by itself to trigger all related pipelines, or specify a pipeline to run.
    • Example: "run" or "run pipeline_name"
  • where:
    • Report back the Azure DevOps orgs that are related to this repository and org
    • Example: "where"

See additional documentation.

@htuch
Copy link
Member

htuch commented May 30, 2019

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 2 pipeline(s).

Copy link
Member

@htuch htuch left a comment

Choose a reason for hiding this comment

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

Generally looks good, a few comments on some of the proto munging.

config.scoped_routes().scope_key_builder()));

case envoy::config::filter::network::http_connection_manager::v2::ScopedRoutes::
CONFIG_SPECIFIER_NOT_SET:
Copy link
Member

Choose a reason for hiding this comment

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

Should we have a proto constraint to ensure this never happens?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We do have one, see http_connection_manager.proto.

I've removed handling of the condition to allow it to fall through to the default: to avoid ambiguity.

Protobuf::Message* clone = scoped_route_config.New();
clone->MergeFrom(scoped_route_config);
return std::unique_ptr<const Protobuf::Message>(clone);
});
Copy link
Member

Choose a reason for hiding this comment

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

Should there just be some util to convert a RepeatedPtrField to these const vectors in source/common/protobuf? Seems generic enough

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've added the utility function.

Signed-off-by: Andres Guedez <aguedez@google.com>
Signed-off-by: Andres Guedez <aguedez@google.com>
Copy link
Member

@htuch htuch left a comment

Choose a reason for hiding this comment

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

LGTM modulo comments.
/wait

config.scoped_routes().rds_config_source(),
config.scoped_routes().scope_key_builder()));
}

Copy link
Member

Choose a reason for hiding this comment

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

Nit: superfluous blank line.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done.

)EOF";
envoy::config::filter::network::http_connection_manager::v2::ScopedRoutes::ScopeKeyBuilder
scope_key_builder;
MessageUtil::loadFromYaml(scope_key_builder_config_yaml, scope_key_builder);
Copy link
Member

Choose a reason for hiding this comment

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

Can you merge master to pick up changes? This will need to change to TestUtil::loadFromYaml..

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done.

…ation

Signed-off-by: Andres Guedez <aguedez@google.com>
Signed-off-by: Andres Guedez <aguedez@google.com>
Copy link
Member

@htuch htuch left a comment

Choose a reason for hiding this comment

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

Thanks!

@htuch htuch merged commit 1fdaf8e into envoyproxy:master Jun 4, 2019
@AndresGuedez
Copy link
Contributor Author

Thanks for the reviews throughout this whole PR chain!

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.

2 participants