Skip to content

Commit

Permalink
Fix pip and Bazel interaction messing up CI (ray-project#9506)
Browse files Browse the repository at this point in the history
Co-authored-by: Mehrdad <[email protected]>
  • Loading branch information
mehrdadn and web-flow authored Jul 16, 2020
1 parent 60a838f commit aa33aba
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 7 deletions.
18 changes: 12 additions & 6 deletions ci/travis/ci.sh
Original file line number Diff line number Diff line change
Expand Up @@ -233,21 +233,27 @@ install_go() {
fi
}

bazel_ensure_buildable_on_windows() {
_bazel_build_before_install() {
local target
if [ "${OSTYPE}" = msys ]; then
# This performs as full of a build as possible, to ensure the repository always remains buildable on Windows.
# On Windows, we perform as full of a build as possible, to ensure the repository always remains buildable on Windows.
# (Pip install will not perform a full build.)
# NOTE: Do not add build flags here. Use .bazelrc and --config instead.
bazel build -k "//:*"
target="//:*"
else
# Just build Python on other platforms.
# This because pip install captures & suppresses the build output, which causes a timeout on CI.
target="//:ray_pkg"
fi
# NOTE: Do not add build flags here. Use .bazelrc and --config instead.
bazel build -k "${target}"
}

install_ray() {
# TODO(mehrdadn): This function should be unified with the one in python/build-wheel-windows.sh.
(
cd "${WORKSPACE_DIR}"/python
build_dashboard_front_end
pip install -v -v -e .
keep_alive pip install -v -e .
)
}

Expand Down Expand Up @@ -431,7 +437,7 @@ init() {
}

build() {
bazel_ensure_buildable_on_windows
_bazel_build_before_install

if ! need_wheels; then
install_ray
Expand Down
2 changes: 1 addition & 1 deletion python/build-wheel-windows.sh
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ install_ray() {
pip install wheel

cd "${WORKSPACE_DIR}"/python
pip install -v -e .
"${WORKSPACE_DIR}"/ci/keep_alive pip install -v -e .
)
}

Expand Down

0 comments on commit aa33aba

Please sign in to comment.