aboutsummaryrefslogtreecommitdiffhomepage
path: root/scripts
diff options
context:
space:
mode:
authorGravatar Alpha Lam <alpha.lam.ts@gmail.com>2016-05-15 19:13:52 +0000
committerGravatar Kristina Chodorow <kchodorow@google.com>2016-05-16 15:17:02 +0000
commita1a79cb0a1880e825618c6440219680f27faa0b7 (patch)
treeaecf14deeb67de64710884785b495379d6379817 /scripts
parentdb89a643180895c0b9ca27911adf1ff692212d1c (diff)
Prototype for remote execution using gRPC and Netty transport
This change implements a remote worker that executes work (build or test). Bazel will be a client of the remote worker. The communication uses gRPC and Netty as transport. A single remote worker has little advantage over running locally. Additional infrastructure is needed to run workers on multiple machines and distributing the work among them. This change provides the basic building blocks for a distributed build farm. (Mainly reformatting changes compared to https://bazel-review.googlesource.com/3110, some BUILD file changes.) -- Change-Id: If7d285444ef42a6823b59443af17b61b04b9ce6a Reviewed-on: https://bazel-review.googlesource.com/#/c/3110/ MOS_MIGRATED_REVID=122376861
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/bootstrap/compile.sh13
1 files changed, 12 insertions, 1 deletions
diff --git a/scripts/bootstrap/compile.sh b/scripts/bootstrap/compile.sh
index cba3ae3e0a..3862bdec4e 100755
--- a/scripts/bootstrap/compile.sh
+++ b/scripts/bootstrap/compile.sh
@@ -41,11 +41,13 @@ linux)
JAVA_HOME="${JAVA_HOME:-$(readlink -f $(which javac) | sed 's_/bin/javac__')}"
if [ "${MACHINE_IS_64BIT}" = 'yes' ]; then
PROTOC=${PROTOC:-third_party/protobuf/protoc-linux-x86_64.exe}
+ GRPC_JAVA_PLUGIN=${GRPC_JAVA_PLUGIN:-third_party/grpc/protoc-gen-grpc-java-0.13.2-linux-x86_64.exe}
else
if [ "${MACHINE_IS_ARM}" = 'yes' ]; then
PROTOC=${PROTOC:-third_party/protobuf/protoc-linux-arm32.exe}
else
PROTOC=${PROTOC:-third_party/protobuf/protoc-linux-x86_32.exe}
+ GRPC_JAVA_PLUGIN=${GRPC_JAVA_PLUGIN:-third_party/grpc/protoc-gen-grpc-java-0.13.2-linux-x86_32.exe}
fi
fi
;;
@@ -57,6 +59,7 @@ freebsd)
# We choose the 32-bit version for maximum compatiblity since 64-bit
# linux binaries are only supported in FreeBSD-11.
PROTOC=${PROTOC:-third_party/protobuf/protoc-linux-x86_32.exe}
+ GRPC_JAVA_PLUGIN=${GRPC_JAVA_PLUGIN:-third_party/grpc/protoc-gen-grpc-java-0.13.2-linux-x86_32.exe}
;;
darwin)
@@ -66,6 +69,7 @@ darwin)
fi
if [ "${MACHINE_IS_64BIT}" = 'yes' ]; then
PROTOC=${PROTOC:-third_party/protobuf/protoc-osx-x86_64.exe}
+ GRPC_JAVA_PLUGIN=${GRPC_JAVA_PLUGIN:-third_party/grpc/protoc-gen-grpc-java-0.13.2-osx-x86_64.exe}
else
PROTOC=${PROTOC:-third_party/protobuf/protoc-osx-x86_32.exe}
fi
@@ -80,14 +84,19 @@ msys*|mingw*)
# We do not use the JNI library on Windows.
if [ "${MACHINE_IS_64BIT}" = 'yes' ]; then
PROTOC=${PROTOC:-third_party/protobuf/protoc-windows-x86_64.exe}
+ GRPC_JAVA_PLUGIN=${GRPC_JAVA_PLUGIN:-third_party/grpc/protoc-gen-grpc-java-0.13.2-windows-x86_64.exe}
else
PROTOC=${PROTOC:-third_party/protobuf/protoc-windows-x86_32.exe}
+ GRPC_JAVA_PLUGIN=${GRPC_JAVA_PLUGIN:-third_party/grpc/protoc-gen-grpc-java-0.13.2-windows-x86_32.exe}
fi
esac
[[ -x "${PROTOC-}" ]] \
|| fail "Protobuf compiler not found in ${PROTOC-}"
+[[ -x "${GRPC_JAVA_PLUGIN-}" ]] \
+ || fail "gRPC Java plugin not found in ${GRPC_JAVA_PLUGIN-}"
+
# Check that javac -version returns a upper version than $JAVA_VERSION.
get_java_version
[ ${JAVA_VERSION#*.} -le ${JAVAC_VERSION#*.} ] || \
@@ -168,7 +177,9 @@ function create_deploy_jar() {
if [ -z "${BAZEL_SKIP_JAVA_COMPILATION}" ]; then
log "Compiling Java stubs for protocol buffers..."
for f in $PROTO_FILES ; do
- run "${PROTOC}" -Isrc/main/protobuf/ --java_out=${OUTPUT_DIR}/src "$f"
+ run "${PROTOC}" -Isrc/main/protobuf/ --java_out=${OUTPUT_DIR}/src \
+ --plugin=protoc-gen-grpc="${GRPC_JAVA_PLUGIN-}" \
+ --grpc_out=${OUTPUT_DIR}/src "$f"
done
java_compilation "Bazel Java" "$DIRS" "$EXCLUDE_FILES" "$LIBRARY_JARS" "${OUTPUT_DIR}"