vitess-gh/travis
Michael Berlin 622df68d43 bootstrap: Install protobuf gRPC Python plugin via PyPi and do not compile it from a Git checkout.
Tested:
- I've rebuilt bootstrap docker images locally and all tests passed on them.
- I ran `bootstrap.sh` and `make proto` manually on my Linux workstation and my MacOS laptop.

History of changes for references:
- https://github.com/vitessio/vitess/pull/3220 - I got rid of compiling gRPC from source. Because of that, the gRPC Python plugin was no longer installed and "make proto" stopped working.
- https://github.com/vitessio/vitess/pull/3461 - This PR reverted my changes and changed back to compile gRPC from source again. However, that would not have been necessary in the first place. The "grpcio-tools" package has the protobuf compiler and the protobuf gRPC Python plugin. See: https://grpc.io/docs/quickstart/python.html#install-grpc-tools
- https://github.com/vitessio/vitess/pull/3516 - This PR removed the gRPC compilation, but still compiled the protobuf gRPC Python plugin.

Note: As part of the now removed Python plugin compilation, we also had a compiled "protoc" binary. Since we will no longer have this binary, we're using the recommended procedure from the "grpcio-tools" package instead. See: https://grpc.io/docs/quickstart/python.html#generate-grpc-code They provide a Python wrapper script around a shared library of the "protoc" compiler, but not a binary anymore. Therefore, we have to call "python -m grpc_tools.protoc" to invoke the protobuf compiler.

Other changes:
- This protobuf compiler knows the Python plugin by default and does not require the --plugin flag for generating the Python services.
- In contrast, --plugin is now required to pass the gRPC Go plugin.
- The Python plugin changed its flag from --grpc_out to --grpc_python_out.
- The Python plugin emits different files since gRPC 1.7.0. I'll regenerate the files in a separate commit. See: https://github.com/grpc/grpc/releases/tag/v1.7.0
- Removed unlinking and linking back of Homebrew "protobuf" package. It looks to me like an existing package should not interfere with our virtualenv environment.
- Removed cleanup call where we deleted the obsolete $VTROOT/dist/protobuf directory. If users still have that directory on disk, they can delete it manually themselves. Existing directories should not interfere with the new approach.

Signed-off-by: Michael Berlin <mberlin@google.com>
2018-04-08 16:46:14 -07:00
..
check_make_proto.sh license: BSD->Apache v2.0 2017-05-06 00:38:56 -07:00
log_gomaxprocs.go license: BSD->Apache v2.0 2017-05-06 00:38:56 -07:00