mirror of
https://github.com/wassname/ray.git
synced 2026-06-27 19:16:19 +08:00
Find bazel even if it isn't in the PATH. (#4729)
This commit is contained in:
committed by
Philipp Moritz
parent
23ae73135e
commit
af463e8bb1
+2
-2
@@ -34,7 +34,7 @@ fi
|
||||
|
||||
# Build the current Ray source
|
||||
git rev-parse HEAD > ./docker/deploy/git-rev
|
||||
git archive -o ./docker/deploy/ray.tar $(git rev-parse HEAD)
|
||||
git archive -o ./docker/deploy/ray.tar "$(git rev-parse HEAD)"
|
||||
if [ $OUTPUT_SHA ]; then
|
||||
IMAGE_SHA=$(docker build --no-cache -q -t ray-project/deploy docker/deploy)
|
||||
else
|
||||
@@ -52,5 +52,5 @@ if [ ! $SKIP_EXAMPLES ]; then
|
||||
fi
|
||||
|
||||
if [ $OUTPUT_SHA ]; then
|
||||
echo $IMAGE_SHA | sed 's/sha256://'
|
||||
echo "$IMAGE_SHA" | sed 's/sha256://'
|
||||
fi
|
||||
|
||||
@@ -38,7 +38,7 @@ PYTHON_EXECUTABLE=""
|
||||
BUILD_DIR=""
|
||||
|
||||
# Parse options
|
||||
while [[ $# > 0 ]]; do
|
||||
while [[ $# -gt 0 ]]; do
|
||||
key="$1"
|
||||
case $key in
|
||||
-h|--help)
|
||||
@@ -76,18 +76,23 @@ while [[ $# > 0 ]]; do
|
||||
done
|
||||
|
||||
if [[ -z "$PYTHON_EXECUTABLE" ]]; then
|
||||
PYTHON_EXECUTABLE=`which python`
|
||||
PYTHON_EXECUTABLE=$(which python)
|
||||
fi
|
||||
echo "Using Python executable $PYTHON_EXECUTABLE."
|
||||
|
||||
# Find the bazel executable. The script ci/travis/install-bazel.sh doesn't
|
||||
# always put the bazel executable on the PATH.
|
||||
BAZEL_EXECUTABLE=$(PATH="$PATH:$HOME/.bazel/bin" which bazel)
|
||||
echo "Using Bazel executable $BAZEL_EXECUTABLE."
|
||||
|
||||
RAY_BUILD_PYTHON=$RAY_BUILD_PYTHON \
|
||||
RAY_BUILD_JAVA=$RAY_BUILD_JAVA \
|
||||
bash $ROOT_DIR/setup_thirdparty.sh $PYTHON_EXECUTABLE
|
||||
bash "$ROOT_DIR/setup_thirdparty.sh" "$PYTHON_EXECUTABLE"
|
||||
|
||||
# Now we build everything.
|
||||
BUILD_DIR="$ROOT_DIR/build/"
|
||||
if [ ! -d "${BUILD_DIR}" ]; then
|
||||
mkdir -p ${BUILD_DIR}
|
||||
mkdir -p "${BUILD_DIR}"
|
||||
fi
|
||||
|
||||
pushd "$BUILD_DIR"
|
||||
@@ -96,16 +101,16 @@ pushd "$BUILD_DIR"
|
||||
# generated from https://github.com/ray-project/arrow-build from
|
||||
# the commit listed in the command.
|
||||
$PYTHON_EXECUTABLE -m pip install \
|
||||
--target=$ROOT_DIR/python/ray/pyarrow_files pyarrow==0.12.0.RAY \
|
||||
--target="$ROOT_DIR/python/ray/pyarrow_files" pyarrow==0.12.0.RAY \
|
||||
--find-links https://s3-us-west-2.amazonaws.com/arrow-wheels/ca1fa51f0901f5a4298f0e4faea00f24e5dd7bb7/index.html
|
||||
export PYTHON_BIN_PATH="$PYTHON_EXECUTABLE"
|
||||
|
||||
if [ "$RAY_BUILD_JAVA" == "YES" ]; then
|
||||
bazel build //java:all --verbose_failures
|
||||
$BAZEL_EXECUTABLE build //java:all --verbose_failures
|
||||
fi
|
||||
|
||||
if [ "$RAY_BUILD_PYTHON" == "YES" ]; then
|
||||
bazel build //:ray_pkg --verbose_failures
|
||||
$BAZEL_EXECUTABLE build //:ray_pkg --verbose_failures
|
||||
fi
|
||||
|
||||
popd
|
||||
|
||||
+2
-3
@@ -7,7 +7,7 @@ set -e
|
||||
ROOT_DIR=$(cd "$(dirname "${BASH_SOURCE:-$0}")"; pwd)
|
||||
|
||||
if [[ -z "$1" ]]; then
|
||||
PYTHON_EXECUTABLE=`which python`
|
||||
PYTHON_EXECUTABLE=$(which python)
|
||||
else
|
||||
PYTHON_EXECUTABLE=$1
|
||||
fi
|
||||
@@ -15,5 +15,4 @@ echo "Using Python executable $PYTHON_EXECUTABLE."
|
||||
|
||||
RAY_BUILD_PYTHON=$RAY_BUILD_PYTHON \
|
||||
RAY_BUILD_JAVA=$RAY_BUILD_JAVA \
|
||||
$ROOT_DIR/thirdparty/scripts/setup.sh $PYTHON_EXECUTABLE
|
||||
|
||||
"$ROOT_DIR/thirdparty/scripts/setup.sh" "$PYTHON_EXECUTABLE"
|
||||
|
||||
Reference in New Issue
Block a user