Skip to content

Commit

Permalink
simplify bazel install script (ray-project#38145)
Browse files Browse the repository at this point in the history
- remove the copying of bazeliskrc file. bazelisk always respects the
bazeliskrc file in the workspace.
- upload bazel cache by default. buildkite runners on PR's do not have
the permission to upload.

Signed-off-by: Lonnie Liu <[email protected]>
Signed-off-by: harborn <[email protected]>
  • Loading branch information
aslonnie authored and harborn committed Aug 17, 2023
1 parent e639eb1 commit fcaa0ca
Showing 1 changed file with 4 additions and 9 deletions.
13 changes: 4 additions & 9 deletions ci/env/install-bazel.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
#!/usr/bin/env bash
set -x
set -euo pipefail
ROOT_DIR=$(cd "$(dirname "$0")/$(dirname "$(test -L "$0" && readlink "$0" || echo "/")")"; pwd)

set -exuo pipefail

arg1="${1-}"

Expand Down Expand Up @@ -112,10 +111,6 @@ if [[ "${TRAVIS-}" == true ]]; then
echo "build --jobs=50" >> ~/.bazelrc
fi

if [[ "${BUILDKITE-}" == "true" ]]; then
cp "${ROOT_DIR}"/../../.bazeliskrc ~/.bazeliskrc
fi

if [[ "${GITHUB_ACTIONS-}" == "true" ]]; then
echo "build --config=ci-github" >> ~/.bazelrc
echo "build --jobs="$(($(nproc)+2)) >> ~/.bazelrc
Expand All @@ -137,9 +132,9 @@ if [[ "${CI-}" == "true" ]]; then
echo "Using local disk cache on mac"
echo "build --disk_cache=/tmp/bazel-cache" >> ~/.bazelrc
echo "build --repository_cache=/tmp/bazel-repo-cache" >> ~/.bazelrc
else
elif [[ "${BUILDKITE_BAZEL_CACHE_URL:-}" != "" ]]; then
echo "build --remote_cache=${BUILDKITE_BAZEL_CACHE_URL}" >> ~/.bazelrc
if [[ "${BUILDKITE_PULL_REQUEST}" != "false" ]]; then
if [[ "${BUILDKITE_PULL_REQUEST:-false}" != "false" ]]; then
echo "build --remote_upload_local_results=false" >> ~/.bazelrc
fi
fi
Expand Down

0 comments on commit fcaa0ca

Please sign in to comment.