Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
43 commits
Select commit Hold shift + click to select a range
e31c37f
Update proxy environment variables doc to match implementation
murgatroid99 Jan 24, 2020
31fa955
Add runner script for xDS integration tests
ericgribkoff Feb 2, 2020
1e75218
wait for backend health first
ericgribkoff Feb 3, 2020
cd76b79
Support compression for both client and server
lidizheng Jan 28, 2020
eb1f21f
Improve readability of unit tests & add one more test case
lidizheng Feb 3, 2020
d190a0e
Make YAPF happy
lidizheng Feb 3, 2020
6a330ed
Add channel_ready helper function
lidizheng Feb 4, 2020
a5503cc
Add unit test for channel ready
lidizheng Feb 4, 2020
f233ad1
a few cmake fixes in BUILDING.md
jtattermusch Feb 4, 2020
09df710
generate bootstrap
ericgribkoff Feb 4, 2020
dc50462
remove bootstrap.json
ericgribkoff Feb 4, 2020
df470c3
fix with clause
ericgribkoff Feb 4, 2020
0bc088f
e2-standard-2
ericgribkoff Feb 4, 2020
0919f93
Improve compression docstring & simplify metadata default value
lidizheng Feb 4, 2020
daeaf8e
Promote the channel_ready & simplify test logic
lidizheng Feb 4, 2020
237e1cd
typo
ericgribkoff Feb 4, 2020
5837127
[Aio] Set debug_error_string to AioRpcError
Feb 5, 2020
cf032b3
xds: Fix crash when moving all localities from a priority to a higher…
markdroth Feb 4, 2020
06ecc87
[bazel] Add fixes for --incompatible_load_proto_rules_from_bzl
Yannic Feb 5, 2020
473a75b
Reduce side effect of a "create" method
lidizheng Feb 5, 2020
5f76067
Add v1.27.1 release of grpc-go to interop matrix
dfawley Feb 5, 2020
5ed0b41
align stuff
jtattermusch Feb 6, 2020
f7cffb6
improve the docs
jtattermusch Feb 6, 2020
1df63bf
Get the debug_error_string in a simpler fashion
Feb 6, 2020
e83426b
Merge pull request #21890 from grpc/jtattermusch-patch-1
jtattermusch Feb 6, 2020
d5e8fdb
Merge pull request #21925 from dfawley/master
dfawley Feb 6, 2020
f739557
Move xds API code into a class, so that common state can be cached.
markdroth Feb 6, 2020
477b2fd
Merge pull request #21909 from markdroth/xds_segfault
markdroth Feb 6, 2020
be85024
Merge pull request #21809 from lidizheng/aio-compression
lidizheng Feb 6, 2020
231d4b2
Merge pull request #21919 from Skyscanner/set-error-description
lidizheng Feb 6, 2020
072c150
Merge pull request #21885 from lidizheng/aio-channel-ready
lidizheng Feb 6, 2020
eeccff4
Merge pull request #21933 from markdroth/xds_logging_prep
markdroth Feb 6, 2020
ecf44b0
Prohibit mixing two styles of API on client side
lidizheng Feb 4, 2020
22cd31b
Remove TODO
lidizheng Feb 5, 2020
15ff162
Improve the documentation about newly added exception classes
lidizheng Feb 6, 2020
2bf8cbb
Modify helloworld example to allow a target string
donnadionne Feb 5, 2020
56aa2c1
Merge pull request #21910 from lidizheng/aio-no-mix
lidizheng Feb 7, 2020
d6ecc32
Merge pull request #21911 from donnadionne/example2
donnadionne Feb 7, 2020
d77a231
Merge pull request #21794 from murgatroid99/env_proxy_doc_update
murgatroid99 Feb 7, 2020
8701b18
Use str instead of Text
lidizheng Feb 7, 2020
14f4a3a
Merge pull request #21951 from lidizheng/aio-str
lidizheng Feb 7, 2020
a2e4a23
Merge pull request #20783 from Yannic/proto_incompat
gnossen Feb 7, 2020
fe6f309
Merge pull request #21869 from ericgribkoff/run_xds_tests
ericgribkoff Feb 9, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 17 additions & 11 deletions BUILDING.md
Original file line number Diff line number Diff line change
Expand Up @@ -161,10 +161,11 @@ Please note that when using Ninja, you will still need Visual C++ (part of Visua
installed to be able to compile the C/C++ sources.
```
> @rem Run from grpc directory after cloning the repo with --recursive or updating submodules.
> md .build
> cd .build
> cd cmake
> md build
> cd build
> call "%VS140COMNTOOLS%..\..\VC\vcvarsall.bat" x64
> cmake .. -GNinja -DCMAKE_BUILD_TYPE=Release
> cmake ..\.. -GNinja -DCMAKE_BUILD_TYPE=Release
> cmake --build .
```

Expand All @@ -183,7 +184,7 @@ ie `gRPC_CARES_PROVIDER`.
### Install after build

Perform the following steps to install gRPC using CMake.
* Set `gRPC_INSTALL` to `ON`
* Set `-DgRPC_INSTALL=ON`
* Build the `install` target

The install destination is controlled by the
Expand All @@ -196,16 +197,21 @@ in "module" mode and install them alongside gRPC in a single step.
If you are using an older version of gRPC, you will need to select "package"
mode (rather than "module" mode) for the dependencies.
This means you will need to have external copies of these libraries available
on your system.
on your system. This [example](test/distrib/cpp/run_distrib_test_cmake.sh) shows
how to install dependencies with cmake before proceeding to installing gRPC itself.

```
$ cmake .. -DgRPC_CARES_PROVIDER=package \
-DgRPC_PROTOBUF_PROVIDER=package \
-DgRPC_SSL_PROVIDER=package \
-DgRPC_ZLIB_PROVIDER=package
# NOTE: all of gRPC's dependencies need to be already installed
$ cmake ../.. -DgRPC_INSTALL=ON \
-DCMAKE_BUILD_TYPE=Release \
-DgRPC_ABSL_PROVIDER=package \
-DgRPC_CARES_PROVIDER=package \
-DgRPC_PROTOBUF_PROVIDER=package \
-DgRPC_SSL_PROVIDER=package \
-DgRPC_ZLIB_PROVIDER=package
$ make
$ make install
```
[Example](test/distrib/cpp/run_distrib_test_cmake.sh)

### Cross-compiling

Expand All @@ -222,7 +228,7 @@ that will be used for this build.
This toolchain file is specified to CMake by setting the `CMAKE_TOOLCHAIN_FILE`
variable.
```
$ cmake .. -DCMAKE_TOOLCHAIN_FILE=path/to/file
$ cmake ../.. -DCMAKE_TOOLCHAIN_FILE=path/to/file
$ make
```

Expand Down
4 changes: 2 additions & 2 deletions bazel/cc_grpc_library.bzl
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
"""Generates and compiles C++ grpc stubs from proto_library rules."""

load("@rules_proto//proto:defs.bzl", "proto_library")
load("//bazel:generate_cc.bzl", "generate_cc")
load("//bazel:protobuf.bzl", "well_known_proto_libs")

Expand Down Expand Up @@ -63,8 +64,7 @@ def cc_grpc_library(
proto_deps += [dep.split(":")[0] + ":" + "_" + dep.split(":")[1] + "_only" for dep in deps if dep.find(":") != -1]
if well_known_protos:
proto_deps += well_known_proto_libs()

native.proto_library(
proto_library(
name = proto_target,
srcs = srcs,
deps = proto_deps,
Expand Down
1 change: 1 addition & 0 deletions bazel/generate_cc.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ This is an internal rule used by cc_grpc_library, and shouldn't be used
directly.
"""

load("@rules_proto//proto:defs.bzl", "ProtoInfo")
load(
"//bazel:protobuf.bzl",
"get_include_directory",
Expand Down
1 change: 1 addition & 0 deletions bazel/generate_objc.bzl
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
load("@rules_proto//proto:defs.bzl", "ProtoInfo")
load(
"//bazel:protobuf.bzl",
"get_include_directory",
Expand Down
2 changes: 2 additions & 0 deletions bazel/protobuf.bzl
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
"""Utility functions for generating protobuf code."""

load("@rules_proto//proto:defs.bzl", "ProtoInfo")

_PROTO_EXTENSION = ".proto"
_VIRTUAL_IMPORTS = "/_virtual_imports/"

Expand Down
1 change: 1 addition & 0 deletions bazel/python_rules.bzl
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
"""Generates and compiles Python gRPC stubs from proto_library rules."""

load("@rules_proto//proto:defs.bzl", "ProtoInfo")
load(
"//bazel:protobuf.bzl",
"declare_out_files",
Expand Down
1 change: 1 addition & 0 deletions bazel/test/python_test_repo/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.

load("@rules_proto//proto:defs.bzl", "proto_library")
load(
"@com_github_grpc_grpc//bazel:python_rules.bzl",
"py2and3_test",
Expand Down
10 changes: 8 additions & 2 deletions doc/environment_variables.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,14 @@ gRPC environment variables
gRPC C core based implementations (those contained in this repository) expose
some configuration as environment variables that can be set.

* http_proxy
The URI of the proxy to use for HTTP CONNECT support.
* grpc_proxy, https_proxy, http_proxy
The URI of the proxy to use for HTTP CONNECT support. These variables are
checked in order, and the first one that has a value is used.

* no_grpc_proxy, no_proxy
A comma separated list of hostnames to connect to without using a proxy even
if a proxy is set. These variables are checked in order, and the first one
that has a value is used.

* GRPC_ABORT_ON_LEAKS
A debugging aid to cause a call to abort() when gRPC objects are leaked past
Expand Down
5 changes: 3 additions & 2 deletions examples/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,11 @@ licenses(["notice"]) # 3-clause BSD

package(default_visibility = ["//visibility:public"])

load("//bazel:grpc_build_system.bzl", "grpc_proto_library")
load("@grpc_python_dependencies//:requirements.bzl", "requirement")
load("@rules_proto//proto:defs.bzl", "proto_library")
load("//bazel:cc_grpc_library.bzl", "cc_grpc_library")
load("//bazel:grpc_build_system.bzl", "grpc_proto_library")
load("//bazel:python_rules.bzl", "py_grpc_library", "py_proto_library")
load("@grpc_python_dependencies//:requirements.bzl", "requirement")

grpc_proto_library(
name = "auth_sample",
Expand Down
6 changes: 5 additions & 1 deletion examples/cpp/helloworld/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -255,6 +255,10 @@ main loop in `HandleRpcs` to query the queue.

For a working example, refer to [greeter_async_server.cc](greeter_async_server.cc).

#### Flags for the client

```sh
./greeter_client --target="a target string used to create a GRPC client channel"
```


The Default value for --target is "localhost:50051".
29 changes: 25 additions & 4 deletions examples/cpp/helloworld/greeter_client.cc
Original file line number Diff line number Diff line change
Expand Up @@ -73,11 +73,32 @@ class GreeterClient {

int main(int argc, char** argv) {
// Instantiate the client. It requires a channel, out of which the actual RPCs
// are created. This channel models a connection to an endpoint (in this case,
// localhost at port 50051). We indicate that the channel isn't authenticated
// (use of InsecureChannelCredentials()).
// are created. This channel models a connection to an endpoint specified by
// the argument "--target=" which is the only expected argument.
// We indicate that the channel isn't authenticated (use of
// InsecureChannelCredentials()).
std::string target_str;
std::string arg_str("--target");
if (argc > 1) {
std::string arg_val = argv[1];
size_t start_pos = arg_val.find(arg_str);
if (start_pos != std::string::npos) {
start_pos += arg_str.size();
if (arg_val[start_pos] == '=') {
target_str = arg_val.substr(start_pos + 1);
} else {
std::cout << "The only correct argument syntax is --target=" << std::endl;
return 0;
}
} else {
std::cout << "The only acceptable argument is --target=" << std::endl;
return 0;
}
} else {
target_str = "localhost:50051";
}
GreeterClient greeter(grpc::CreateChannel(
"localhost:50051", grpc::InsecureChannelCredentials()));
target_str, grpc::InsecureChannelCredentials()));
std::string user("world");
std::string reply = greeter.SayHello(user);
std::cout << "Greeter received: " << reply << std::endl;
Expand Down
1 change: 1 addition & 0 deletions examples/python/cancellation/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
# limitations under the License.

load("@grpc_python_dependencies//:requirements.bzl", "requirement")
load("@rules_proto//proto:defs.bzl", "proto_library")
load("//bazel:python_rules.bzl", "py_grpc_library", "py_proto_library")

package(default_testonly = 1)
Expand Down
1 change: 1 addition & 0 deletions examples/python/multiprocessing/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.

load("@rules_proto//proto:defs.bzl", "proto_library")
load("//bazel:python_rules.bzl", "py_grpc_library", "py_proto_library")

proto_library(
Expand Down
4 changes: 2 additions & 2 deletions src/core/ext/filters/client_channel/lb_policy/xds/cds.cc
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ class CdsLb : public LoadBalancingPolicy {
public:
explicit ClusterWatcher(RefCountedPtr<CdsLb> parent)
: parent_(std::move(parent)) {}
void OnClusterChanged(CdsUpdate cluster_data) override;
void OnClusterChanged(XdsApi::CdsUpdate cluster_data) override;
void OnError(grpc_error* error) override;

private:
Expand Down Expand Up @@ -111,7 +111,7 @@ class CdsLb : public LoadBalancingPolicy {
// CdsLb::ClusterWatcher
//

void CdsLb::ClusterWatcher::OnClusterChanged(CdsUpdate cluster_data) {
void CdsLb::ClusterWatcher::OnClusterChanged(XdsApi::CdsUpdate cluster_data) {
if (GRPC_TRACE_FLAG_ENABLED(grpc_cds_lb_trace)) {
gpr_log(GPR_INFO, "[cdslb %p] received CDS update from xds client",
parent_.get());
Expand Down
18 changes: 10 additions & 8 deletions src/core/ext/filters/client_channel/lb_policy/xds/xds.cc
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ class XdsLb : public LoadBalancingPolicy {

RefCountedPtr<XdsLb> xds_policy_;
PickerList pickers_;
RefCountedPtr<XdsDropConfig> drop_config_;
RefCountedPtr<XdsApi::DropConfig> drop_config_;
};

class FallbackHelper : public ChannelControlHelper {
Expand Down Expand Up @@ -286,7 +286,7 @@ class XdsLb : public LoadBalancingPolicy {
~LocalityMap() { xds_policy_.reset(DEBUG_LOCATION, "LocalityMap"); }

void UpdateLocked(
const XdsPriorityListUpdate::LocalityMap& locality_map_update);
const XdsApi::PriorityListUpdate::LocalityMap& locality_map_update);
void ResetBackoffLocked();
void UpdateXdsPickerLocked();
OrphanablePtr<Locality> ExtractLocalityLocked(
Expand Down Expand Up @@ -316,10 +316,10 @@ class XdsLb : public LoadBalancingPolicy {
static void OnDelayedRemovalTimerLocked(void* arg, grpc_error* error);
static void OnFailoverTimerLocked(void* arg, grpc_error* error);

const XdsPriorityListUpdate& priority_list_update() const {
const XdsApi::PriorityListUpdate& priority_list_update() const {
return xds_policy_->priority_list_update_;
}
const XdsPriorityListUpdate::LocalityMap* locality_map_update() const {
const XdsApi::PriorityListUpdate::LocalityMap* locality_map_update() const {
return xds_policy_->priority_list_update_.Find(priority_);
}

Expand Down Expand Up @@ -431,10 +431,10 @@ class XdsLb : public LoadBalancingPolicy {
// The priority that is being used.
uint32_t current_priority_ = UINT32_MAX;
// The update for priority_list_.
XdsPriorityListUpdate priority_list_update_;
XdsApi::PriorityListUpdate priority_list_update_;

// The config for dropping calls.
RefCountedPtr<XdsDropConfig> drop_config_;
RefCountedPtr<XdsApi::DropConfig> drop_config_;

// The stats for client-side load reporting.
XdsClientStats client_stats_;
Expand Down Expand Up @@ -594,7 +594,7 @@ class XdsLb::EndpointWatcher : public XdsClient::EndpointWatcherInterface {

~EndpointWatcher() { xds_policy_.reset(DEBUG_LOCATION, "EndpointWatcher"); }

void OnEndpointChanged(EdsUpdate update) override {
void OnEndpointChanged(XdsApi::EdsUpdate update) override {
if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_xds_trace)) {
gpr_log(GPR_INFO, "[xdslb %p] Received EDS update from xds client",
xds_policy_.get());
Expand Down Expand Up @@ -1032,6 +1032,8 @@ void XdsLb::UpdatePrioritiesLocked() {
for (uint32_t priority = 0; priority < priorities_.size(); ++priority) {
LocalityMap* locality_map = priorities_[priority].get();
const auto* locality_map_update = priority_list_update_.Find(priority);
// If we have more current priorities than exist in the update, stop here.
if (locality_map_update == nullptr) break;
// Propagate locality_map_update.
// TODO(juanlishen): Find a clean way to skip duplicate update for a
// priority.
Expand Down Expand Up @@ -1154,7 +1156,7 @@ XdsLb::LocalityMap::LocalityMap(RefCountedPtr<XdsLb> xds_policy,
}

void XdsLb::LocalityMap::UpdateLocked(
const XdsPriorityListUpdate::LocalityMap& locality_map_update) {
const XdsApi::PriorityListUpdate::LocalityMap& locality_map_update) {
if (xds_policy_->shutting_down_) return;
if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_xds_trace)) {
gpr_log(GPR_INFO, "[xdslb %p] Start Updating priority %" PRIu32,
Expand Down
Loading