Merge github.com:grpc/grpc into cq-drop

pull/11317/head
Craig Tiller 8 years ago
commit 10d4b14843
  1. 8
      include/grpc++/grpc++.h
  2. 5
      src/python/grpcio_reflection/grpc_reflection/v1alpha/reflection.py
  3. 12
      test/cpp/microbenchmarks/bm_fullstack_trickle.cc
  4. 14
      tools/distrib/pylint_code.sh
  5. 3
      tools/dockerfile/test/cxx_alpine_x64/Dockerfile
  6. 3
      tools/dockerfile/test/python_alpine_x64/Dockerfile
  7. 4
      tools/internal_ci/linux/grpc_build_artifacts.sh
  8. 39
      tools/internal_ci/linux/grpc_sanity.cfg
  9. 2
      tools/internal_ci/linux/grpc_sanity.sh
  10. 2
      tools/profiling/microbenchmarks/bm_json.py
  11. 7
      tools/run_tests/python_utils/jobset.py

@ -34,18 +34,18 @@
/// \mainpage gRPC C++ API /// \mainpage gRPC C++ API
/// ///
/// The gRPC C++ API mainly consists of the following classes: /// The gRPC C++ API mainly consists of the following classes:
// /// <br>
/// - grpc::Channel, which represents the connection to an endpoint. See [the /// - grpc::Channel, which represents the connection to an endpoint. See [the
/// gRPC Concepts page](http://www.grpc.io/docs/guides/concepts.html) for more /// gRPC Concepts page](http://www.grpc.io/docs/guides/concepts.html) for more
/// details. Channels are created by the factory function grpc::CreateChannel. /// details. Channels are created by the factory function grpc::CreateChannel.
// ///
/// - grpc::CompletionQueue, the producer-consumer queue used for all /// - grpc::CompletionQueue, the producer-consumer queue used for all
/// asynchronous communication with the gRPC runtime. /// asynchronous communication with the gRPC runtime.
// ///
/// - grpc::ClientContext and grpc::ServerContext, where optional configuration /// - grpc::ClientContext and grpc::ServerContext, where optional configuration
/// for an RPC can be set, such as setting custom metadata to be conveyed to the /// for an RPC can be set, such as setting custom metadata to be conveyed to the
/// peer, compression settings, authentication, etc. /// peer, compression settings, authentication, etc.
// ///
/// - grpc::Server, representing a gRPC server, created by grpc::ServerBuilder. /// - grpc::Server, representing a gRPC server, created by grpc::ServerBuilder.
/// ///
/// Streaming calls are handled with the streaming classes in /// Streaming calls are handled with the streaming classes in

@ -28,8 +28,6 @@
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
"""Reference implementation for reflection in gRPC Python.""" """Reference implementation for reflection in gRPC Python."""
import threading
import grpc import grpc
from google.protobuf import descriptor_pb2 from google.protobuf import descriptor_pb2
from google.protobuf import descriptor_pool from google.protobuf import descriptor_pool
@ -120,6 +118,7 @@ class ReflectionServicer(reflection_pb2_grpc.ServerReflectionServicer):
])) ]))
def ServerReflectionInfo(self, request_iterator, context): def ServerReflectionInfo(self, request_iterator, context):
# pylint: disable=unused-argument
for request in request_iterator: for request in request_iterator:
if request.HasField('file_by_filename'): if request.HasField('file_by_filename'):
yield self._file_by_filename(request.file_by_filename) yield self._file_by_filename(request.file_by_filename)
@ -152,4 +151,4 @@ def enable_server_reflection(service_names, server, pool=None):
pool: DescriptorPool object to use (descriptor_pool.Default() if None). pool: DescriptorPool object to use (descriptor_pool.Default() if None).
""" """
reflection_pb2_grpc.add_ServerReflectionServicer_to_server( reflection_pb2_grpc.add_ServerReflectionServicer_to_server(
ReflectionServicer(service_names, pool), server) ReflectionServicer(service_names, pool=pool), server)

@ -419,18 +419,18 @@ static void BM_PumpUnbalancedUnary_Trickle(benchmark::State& state) {
} }
static void UnaryTrickleArgs(benchmark::internal::Benchmark* b) { static void UnaryTrickleArgs(benchmark::internal::Benchmark* b) {
// A selection of interesting numbers
const int cli_1024k = 1024 * 1024; const int cli_1024k = 1024 * 1024;
const int cli_32M = 32 * 1024 * 1024; const int cli_32M = 32 * 1024 * 1024;
const int svr_256k = 256 * 1024; const int svr_256k = 256 * 1024;
const int svr_4M = 4 * 1024 * 1024; const int svr_4M = 4 * 1024 * 1024;
const int svr_64M = 64 * 1024 * 1024; const int svr_64M = 64 * 1024 * 1024;
for (int bw = 64; bw <= 128 * 1024 * 1024; bw *= 16) { for (int bw = 64; bw <= 128 * 1024 * 1024; bw *= 16) {
b->Args({bw, cli_1024k, svr_256k}); for (auto svr : {svr_256k, svr_4M, svr_64M}) {
b->Args({bw, cli_1024k, svr_4M}); for (auto cli : {cli_1024k, cli_32M}) {
b->Args({bw, cli_1024k, svr_64M}); b->Args({cli, svr, bw});
b->Args({bw, cli_32M, svr_256k}); }
b->Args({bw, cli_32M, svr_4M}); }
b->Args({bw, cli_32M, svr_64M});
} }
} }
BENCHMARK(BM_PumpUnbalancedUnary_Trickle)->Apply(UnaryTrickleArgs); BENCHMARK(BM_PumpUnbalancedUnary_Trickle)->Apply(UnaryTrickleArgs);

@ -31,18 +31,22 @@
set -ex set -ex
# change to root directory # change to root directory
cd $(dirname $0)/../.. cd "$(dirname "$0")/../.."
DIRS=src/python/grpcio/grpc DIRS=(
'src/python/grpcio/grpc'
'src/python/grpcio_reflection/grpc_reflection'
'src/python/grpcio_health_checking/grpc_health'
)
VIRTUALENV=python_pylint_venv VIRTUALENV=python_pylint_venv
virtualenv $VIRTUALENV virtualenv $VIRTUALENV
PYTHON=`realpath $VIRTUALENV/bin/python` PYTHON=$(realpath $VIRTUALENV/bin/python)
$PYTHON -m pip install pylint==1.6.5 $PYTHON -m pip install pylint==1.6.5
for dir in $DIRS; do for dir in "${DIRS[@]}"; do
$PYTHON -m pylint --rcfile=.pylintrc -rn $dir || exit $? $PYTHON -m pylint --rcfile=.pylintrc -rn "$dir" || exit $?
done done
exit 0 exit 0

@ -55,6 +55,9 @@ RUN pip install pip --upgrade
RUN pip install virtualenv RUN pip install virtualenv
RUN pip install futures==2.2.0 enum34==1.0.4 protobuf==3.2.0 six==1.10.0 RUN pip install futures==2.2.0 enum34==1.0.4 protobuf==3.2.0 six==1.10.0
# Google Cloud platform API libraries
RUN pip install --upgrade google-api-python-client
# Prepare ccache # Prepare ccache
RUN ln -s /usr/bin/ccache /usr/local/bin/gcc RUN ln -s /usr/bin/ccache /usr/local/bin/gcc
RUN ln -s /usr/bin/ccache /usr/local/bin/g++ RUN ln -s /usr/bin/ccache /usr/local/bin/g++

@ -55,6 +55,9 @@ RUN pip install pip --upgrade
RUN pip install virtualenv RUN pip install virtualenv
RUN pip install futures==2.2.0 enum34==1.0.4 protobuf==3.2.0 six==1.10.0 RUN pip install futures==2.2.0 enum34==1.0.4 protobuf==3.2.0 six==1.10.0
# Google Cloud platform API libraries
RUN pip install --upgrade google-api-python-client
# Prepare ccache # Prepare ccache
RUN ln -s /usr/bin/ccache /usr/local/bin/gcc RUN ln -s /usr/bin/ccache /usr/local/bin/gcc
RUN ln -s /usr/bin/ccache /usr/local/bin/g++ RUN ln -s /usr/bin/ccache /usr/local/bin/g++

@ -35,4 +35,8 @@ cd $(dirname $0)/../../..
source tools/internal_ci/helper_scripts/prepare_build_linux_rc source tools/internal_ci/helper_scripts/prepare_build_linux_rc
# TODO(jtattermusch): install ruby on the internal_ci worker
gpg --keyserver hkp://keys.gnupg.net --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3
curl -sSL https://get.rvm.io | bash -s stable --ruby
tools/run_tests/task_runner.py -f artifact linux tools/run_tests/task_runner.py -f artifact linux

@ -0,0 +1,39 @@
# Copyright 2017, Google Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# * Redistributions in binary form must reproduce the above
# copyright notice, this list of conditions and the following disclaimer
# in the documentation and/or other materials provided with the
# distribution.
# * Neither the name of Google Inc. nor the names of its
# contributors may be used to endorse or promote products derived from
# this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
# Config file for the internal CI (in protobuf text format)
# Location of the continuous shell script in repository.
build_file: "grpc/tools/internal_ci/linux/grpc_sanity.sh"
timeout_mins: 20
action {
define_artifacts {
regex: "**/*sponge_log.xml"
}
}

@ -35,4 +35,4 @@ cd $(dirname $0)/../../..
source tools/internal_ci/helper_scripts/prepare_build_linux_rc source tools/internal_ci/helper_scripts/prepare_build_linux_rc
tools/run_tests/run_tests.py -l sanity -c opt -t -x sponge_log.xml --use_docker --report_suite_name sanity_linux_opt tools/run_tests/run_tests_matrix.py -f basictests linux sanity opt --inner_jobs 16 -j 1 --internal_ci

@ -56,7 +56,7 @@ _BM_SPECS = {
}, },
'BM_PumpUnbalancedUnary_Trickle': { 'BM_PumpUnbalancedUnary_Trickle': {
'tpl': [], 'tpl': [],
'dyn': ['request_size', 'bandwidth_kilobits'], 'dyn': ['cli_req_size', 'svr_req_size', 'bandwidth_kilobits'],
}, },
'BM_ErrorStringOnNewError': { 'BM_ErrorStringOnNewError': {
'tpl': ['fixture'], 'tpl': ['fixture'],

@ -276,8 +276,13 @@ class Job(object):
env = sanitized_environment(env) env = sanitized_environment(env)
self._start = time.time() self._start = time.time()
cmdline = self._spec.cmdline cmdline = self._spec.cmdline
if measure_cpu_costs: # The Unix time command is finicky when used with MSBuild, so we don't use it
# with jobs that run MSBuild.
global measure_cpu_costs
if measure_cpu_costs and not 'vsprojects\\build' in cmdline[0]:
cmdline = ['time', '-p'] + cmdline cmdline = ['time', '-p'] + cmdline
else:
measure_cpu_costs = False
try_start = lambda: subprocess.Popen(args=cmdline, try_start = lambda: subprocess.Popen(args=cmdline,
stderr=subprocess.STDOUT, stderr=subprocess.STDOUT,
stdout=self._tempfile, stdout=self._tempfile,

Loading…
Cancel
Save