From 064d37d380c54d256ee3600c50498ced48df6587 Mon Sep 17 00:00:00 2001 From: Masood Malekghassemi Date: Mon, 8 Feb 2016 12:19:20 -0800 Subject: [PATCH 1/6] Fix GCS URL for Python --- src/python/grpcio/commands.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/python/grpcio/commands.py b/src/python/grpcio/commands.py index 31bd00e94ea..5de631922ad 100644 --- a/src/python/grpcio/commands.py +++ b/src/python/grpcio/commands.py @@ -54,7 +54,7 @@ PYTHON_STEM = os.path.dirname(os.path.abspath(__file__)) BINARIES_REPOSITORY = os.environ.get( 'GRPC_PYTHON_BINARIES_REPOSITORY', - 'https://storage.googleapis.com/grpc-precompiled-binaries/python/') + 'https://storage.googleapis.com/grpc-precompiled-binaries/python') CONF_PY_ADDENDUM = """ extensions.append('sphinx.ext.napoleon') From 45551e0c9952f01b92b886df5f9b91caedb65fe9 Mon Sep 17 00:00:00 2001 From: Craig Tiller Date: Mon, 8 Feb 2016 14:22:40 -0800 Subject: [PATCH 2/6] Fix sanity --- test/cpp/end2end/thread_stress_test.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/cpp/end2end/thread_stress_test.cc b/test/cpp/end2end/thread_stress_test.cc index dd7a8e5ed2c..e246c0b0e2f 100644 --- a/test/cpp/end2end/thread_stress_test.cc +++ b/test/cpp/end2end/thread_stress_test.cc @@ -55,10 +55,10 @@ using grpc::testing::EchoRequest; using grpc::testing::EchoResponse; using std::chrono::system_clock; -const int kNumThreads = 100; // Number of threads +const int kNumThreads = 100; // Number of threads const int kNumAsyncSendThreads = 2; const int kNumAsyncReceiveThreads = 50; -const int kNumRpcs = 1000; // Number of RPCs per thread +const int kNumRpcs = 1000; // Number of RPCs per thread namespace grpc { namespace testing { From 1431e70c7722ab6cf869499a57e6e846b4411dbf Mon Sep 17 00:00:00 2001 From: Jan Tattermusch Date: Mon, 8 Feb 2016 13:02:07 -0800 Subject: [PATCH 3/6] fix python opensuse distribtest --- .../dockerfile/distribtest/python_opensuse_x64/Dockerfile | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/tools/dockerfile/distribtest/python_opensuse_x64/Dockerfile b/tools/dockerfile/distribtest/python_opensuse_x64/Dockerfile index 417d9e0293b..ea5d4c72a14 100644 --- a/tools/dockerfile/distribtest/python_opensuse_x64/Dockerfile +++ b/tools/dockerfile/distribtest/python_opensuse_x64/Dockerfile @@ -31,3 +31,10 @@ FROM opensuse:42.1 RUN zypper --non-interactive install python RUN zypper --non-interactive install python-pip + +# "which" command required by python's run_distrib_test.sh +RUN zypper --non-interactive install which + +# Without this, pip won't be able to connect to +# https://pypi.python.org/simple/ +RUN zypper --non-interactive install ca-certificates-mozilla From ee6a1dcea6c797072a148d6d3dd356c593634d94 Mon Sep 17 00:00:00 2001 From: Craig Tiller Date: Mon, 8 Feb 2016 14:41:45 -0800 Subject: [PATCH 4/6] Fix include hygiene --- include/grpc/impl/codegen/compression_types.h | 2 +- include/grpc/impl/codegen/propagation_bits.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/include/grpc/impl/codegen/compression_types.h b/include/grpc/impl/codegen/compression_types.h index 94a10da21b6..0daccd92f23 100644 --- a/include/grpc/impl/codegen/compression_types.h +++ b/include/grpc/impl/codegen/compression_types.h @@ -34,7 +34,7 @@ #ifndef GRPC_IMPL_CODEGEN_COMPRESSION_TYPES_H #define GRPC_IMPL_CODEGEN_COMPRESSION_TYPES_H -#include +#include #ifdef __cplusplus extern "C" { diff --git a/include/grpc/impl/codegen/propagation_bits.h b/include/grpc/impl/codegen/propagation_bits.h index d0364155997..cdd699710c2 100644 --- a/include/grpc/impl/codegen/propagation_bits.h +++ b/include/grpc/impl/codegen/propagation_bits.h @@ -34,7 +34,7 @@ #ifndef GRPC_IMPL_CODEGEN_H #define GRPC_IMPL_CODEGEN_H -#include +#include #ifdef __cplusplus extern "C" { From 6598ce16dbeca4ed2d9ea554eec154fa4e0d659b Mon Sep 17 00:00:00 2001 From: Masood Malekghassemi Date: Mon, 8 Feb 2016 13:31:21 -0800 Subject: [PATCH 5/6] Move os.environ to module-level --- src/python/grpcio/commands.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/python/grpcio/commands.py b/src/python/grpcio/commands.py index 31bd00e94ea..8901db81c55 100644 --- a/src/python/grpcio/commands.py +++ b/src/python/grpcio/commands.py @@ -56,6 +56,9 @@ BINARIES_REPOSITORY = os.environ.get( 'GRPC_PYTHON_BINARIES_REPOSITORY', 'https://storage.googleapis.com/grpc-precompiled-binaries/python/') +USE_GRPC_CUSTOM_BDIST = bool(int(os.environ.get( + 'GRPC_PYTHON_USE_CUSTOM_BDIST', '1'))) + CONF_PY_ADDENDUM = """ extensions.append('sphinx.ext.napoleon') napoleon_google_docstring = True @@ -135,7 +138,7 @@ class Install(install.install, EggNameMixin): def initialize_options(self): install.install.initialize_options(self) - self.use_grpc_custom_bdist = bool(int(os.environ.get('GRPC_PYTHON_USE_CUSTOM_BDIST', '1'))) + self.use_grpc_custom_bdist = USE_GRPC_CUSTOM_BDIST def finalize_options(self): install.install.finalize_options(self) From 35afe4afaf2090754bdcad34835cee3a07d6e90b Mon Sep 17 00:00:00 2001 From: Masood Malekghassemi Date: Mon, 8 Feb 2016 14:50:18 -0800 Subject: [PATCH 6/6] Fall back to building if GCS cannot be reached --- src/python/grpcio/commands.py | 35 +++++++++++++++++++---------------- 1 file changed, 19 insertions(+), 16 deletions(-) diff --git a/src/python/grpcio/commands.py b/src/python/grpcio/commands.py index 8901db81c55..e6df03fd74b 100644 --- a/src/python/grpcio/commands.py +++ b/src/python/grpcio/commands.py @@ -146,22 +146,25 @@ class Install(install.install, EggNameMixin): def run(self): if self.use_grpc_custom_bdist: try: - egg_path = _get_grpc_custom_bdist_egg(self.egg_name(True), - self.egg_name(False)) - except CommandError as error: - sys.stderr.write( - '\nWARNING: Failed to acquire grpcio prebuilt binary:\n' - '{}.\n\n'.format(error.message)) - raise - try: - self._run_bdist_retrieval_install(egg_path) - except Exception as error: - # if anything else happens (and given how there's no way to really know - # what's happening in setuptools here, I mean *anything*), warn the user - # and fall back to building from source. - sys.stderr.write( - '{}\nWARNING: Failed to install grpcio prebuilt binary.\n\n' - .format(traceback.format_exc())) + try: + egg_path = _get_grpc_custom_bdist_egg(self.egg_name(True), + self.egg_name(False)) + except CommandError as error: + sys.stderr.write( + '\nWARNING: Failed to acquire grpcio prebuilt binary:\n' + '{}.\n\n'.format(error.message)) + raise + try: + self._run_bdist_retrieval_install(egg_path) + except Exception as error: + # if anything else happens (and given how there's no way to really know + # what's happening in setuptools here, I mean *anything*), warn the user + # and fall back to building from source. + sys.stderr.write( + '{}\nWARNING: Failed to install grpcio prebuilt binary.\n\n' + .format(traceback.format_exc())) + raise + except Exception: install.install.run(self) else: install.install.run(self)