Merge pull request #23105 from markdroth/xds_uri_scheme

Support xDS via both "xds" and "xds-experimental" URI schemes.
pull/23116/head
Mark D. Roth 5 years ago committed by GitHub
commit c566b0f7af
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      examples/python/xds/README.md
  2. 16
      src/core/ext/filters/client_channel/resolver/xds/xds_resolver.cc
  3. 3
      test/cpp/end2end/xds_end2end_test.cc
  4. 2
      tools/internal_ci/linux/grpc_xds_bazel_python_test_in_docker.sh
  5. 2
      tools/internal_ci/linux/grpc_xds_bazel_test_in_docker.sh
  6. 2
      tools/internal_ci/linux/grpc_xds_csharp_test_in_docker.sh
  7. 2
      tools/internal_ci/linux/grpc_xds_php_test_in_docker.sh
  8. 2
      tools/internal_ci/linux/grpc_xds_ruby_test_in_docker.sh

@ -57,7 +57,7 @@ export GRPC_XDS_BOOTSTRAP=/etc/xds-bootstrap.json
Finally, run your client:
```
python client.py xds-experimental:///my-backend
python client.py xds:///my-backend
```
Alternatively, `grpcurl` can be used to test your server. If you don't have it,

@ -144,6 +144,8 @@ void XdsResolver::StartLocked() {
class XdsResolverFactory : public ResolverFactory {
public:
explicit XdsResolverFactory(const char* scheme) : scheme_(scheme) {}
bool IsValidUri(const grpc_uri* uri) const override {
if (GPR_UNLIKELY(0 != strcmp(uri->authority, ""))) {
gpr_log(GPR_ERROR, "URI authority not supported");
@ -157,16 +159,26 @@ class XdsResolverFactory : public ResolverFactory {
return MakeOrphanable<XdsResolver>(std::move(args));
}
const char* scheme() const override { return "xds-experimental"; }
const char* scheme() const override { return scheme_; }
private:
const char* scheme_;
};
constexpr char kXdsScheme[] = "xds";
constexpr char kXdsExperimentalScheme[] = "xds-experimental";
} // namespace
} // namespace grpc_core
void grpc_resolver_xds_init() {
grpc_core::ResolverRegistry::Builder::RegisterResolverFactory(
absl::make_unique<grpc_core::XdsResolverFactory>());
absl::make_unique<grpc_core::XdsResolverFactory>(grpc_core::kXdsScheme));
// TODO(roth): Remov this in the 1.31 release.
grpc_core::ResolverRegistry::Builder::RegisterResolverFactory(
absl::make_unique<grpc_core::XdsResolverFactory>(
grpc_core::kXdsExperimentalScheme));
}
void grpc_resolver_xds_shutdown() {}

@ -1204,8 +1204,7 @@ class XdsEnd2endTest : public ::testing::TestWithParam<TestType> {
if (!expected_targets.empty()) {
args.SetString(GRPC_ARG_FAKE_SECURITY_EXPECTED_TARGETS, expected_targets);
}
grpc::string scheme =
GetParam().use_xds_resolver() ? "xds-experimental" : "fake";
grpc::string scheme = GetParam().use_xds_resolver() ? "xds" : "fake";
std::ostringstream uri;
uri << scheme << ":///" << kApplicationTargetName_;
// TODO(dgq): templatize tests to run everything using both secure and

@ -56,4 +56,4 @@ GRPC_VERBOSITY=debug GRPC_TRACE=xds_client,xds_resolver,cds_lb,eds_lb,priority_l
--path_to_server_binary=/java_server/grpc-java/interop-testing/build/install/grpc-interop-testing/bin/xds-test-server \
--gcp_suffix=$(date '+%s') \
--verbose \
--client_cmd='bazel run //src/python/grpcio_tests/tests_py3_only/interop:xds_interop_client -- --server=xds-experimental:///{server_uri} --stats_port={stats_port} --qps={qps} --verbose'
--client_cmd='bazel run //src/python/grpcio_tests/tests_py3_only/interop:xds_interop_client -- --server=xds:///{server_uri} --stats_port={stats_port} --qps={qps} --verbose'

@ -56,4 +56,4 @@ GRPC_VERBOSITY=debug GRPC_TRACE=xds_client,xds_resolver,cds_lb,eds_lb,priority_l
--path_to_server_binary=/java_server/grpc-java/interop-testing/build/install/grpc-interop-testing/bin/xds-test-server \
--gcp_suffix=$(date '+%s') \
--verbose \
--client_cmd='bazel-bin/test/cpp/interop/xds_interop_client --server=xds-experimental:///{server_uri} --stats_port={stats_port} --qps={qps} {fail_on_failed_rpc}'
--client_cmd='bazel-bin/test/cpp/interop/xds_interop_client --server=xds:///{server_uri} --stats_port={stats_port} --qps={qps} {fail_on_failed_rpc}'

@ -56,4 +56,4 @@ GRPC_VERBOSITY=debug GRPC_TRACE=xds_client,xds_resolver,cds_lb,eds_lb,priority_l
--path_to_server_binary=/java_server/grpc-java/interop-testing/build/install/grpc-interop-testing/bin/xds-test-server \
--gcp_suffix=$(date '+%s') \
--verbose \
--client_cmd='dotnet exec src/csharp/Grpc.IntegrationTesting.XdsClient/bin/Release/netcoreapp2.1/Grpc.IntegrationTesting.XdsClient.dll -- --server=xds-experimental:///{server_uri} --stats_port={stats_port} --qps={qps}'
--client_cmd='dotnet exec src/csharp/Grpc.IntegrationTesting.XdsClient/bin/Release/netcoreapp2.1/Grpc.IntegrationTesting.XdsClient.dll -- --server=xds:///{server_uri} --stats_port={stats_port} --qps={qps}'

@ -70,4 +70,4 @@ GRPC_VERBOSITY=debug GRPC_TRACE=xds_client,xds_resolver,cds_lb,eds_lb,priority_l
--gcp_suffix=$(date '+%s') \
--only_stable_gcp_apis \
--verbose \
--client_cmd='php -d extension=grpc.so -d extension=pthreads.so src/php/tests/interop/xds_client.php --server=xds-experimental:///{server_uri} --stats_port={stats_port} --qps={qps}'
--client_cmd='php -d extension=grpc.so -d extension=pthreads.so src/php/tests/interop/xds_client.php --server=xds:///{server_uri} --stats_port={stats_port} --qps={qps}'

@ -57,4 +57,4 @@ GRPC_VERBOSITY=debug GRPC_TRACE=xds_client,xds_resolver,cds_lb,eds_lb,priority_l
--gcp_suffix=$(date '+%s') \
--only_stable_gcp_apis \
--verbose \
--client_cmd='ruby src/ruby/pb/test/xds_client.rb --server=xds-experimental:///{server_uri} --stats_port={stats_port} --qps={qps}'
--client_cmd='ruby src/ruby/pb/test/xds_client.rb --server=xds:///{server_uri} --stats_port={stats_port} --qps={qps}'

Loading…
Cancel
Save