Avoid redundant bazel build (#4458)

This commit is contained in:
Hao Chen 2019-03-23 10:44:11 +08:00 committed by GitHub
parent 01747b11a1
commit 7a38f9be1c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 8 additions and 3 deletions

View file

@ -1,2 +1,4 @@
# build config
build --compilation_mode=opt
build --action_env=PATH
build --action_env=PYTHON_BIN_PATH

View file

@ -121,14 +121,15 @@ else
$PYTHON_EXECUTABLE -m pip install \
--target=$ROOT_DIR/python/ray/pyarrow_files pyarrow==0.12.0.RAY \
--find-links https://s3-us-west-2.amazonaws.com/arrow-wheels/9357dc130789ee42f8181d8724bee1d5d1509060/index.html
export PYTHON_BIN_PATH="$PYTHON_EXECUTABLE"
if [ "$RAY_BUILD_JAVA" == "YES" ]; then
bazel run //java:bazel_deps -- generate -r $ROOT_DIR -s java/third_party/workspace.bzl -d java/dependencies.yaml
bazel build //java:all --verbose_failures --action_env=PATH
bazel build //java:all --verbose_failures
fi
if [ "$RAY_BUILD_PYTHON" == "YES" ]; then
bazel build //:ray_pkg --verbose_failures --action_env=PYTHON_BIN_PATH=$PYTHON_EXECUTABLE
bazel build //:ray_pkg --verbose_failures
fi
fi

View file

@ -9,7 +9,9 @@ ROOT_DIR=$(cd "$(dirname "${BASH_SOURCE:-$0}")"; pwd)
pushd $ROOT_DIR/..
echo "Linting Java code with checkstyle."
bazel test //java:all --test_tag_filters="checkstyle" --action_env=PATH
# NOTE(hchen): The `test_tag_filters` option causes bazel to ignore caches.
# Thus, we add the `build_tests_only` option to avoid re-building everything.
bazel test //java:all --test_tag_filters="checkstyle" --build_tests_only
echo "Running tests under cluster mode."
# TODO(hchen): Ideally, we should use the following bazel command to run Java tests. However, if there're skipped tests,