Skip to content

Commit

Permalink
[CI] Buildkite PR Environment for Simple Tests (ray-project#13130)
Browse files Browse the repository at this point in the history
  • Loading branch information
simon-mo authored Jan 18, 2021
1 parent 3a07101 commit 1e2adb3
Show file tree
Hide file tree
Showing 6 changed files with 54 additions and 11 deletions.
11 changes: 6 additions & 5 deletions .bazelrc
Original file line number Diff line number Diff line change
Expand Up @@ -101,16 +101,17 @@ aquery:ci --color=no
aquery:ci --noshow_progress
build:ci --color=yes
build:ci --curses=no
build:ci --disk_cache=~/ray-bazel-cache
build:ci --keep_going
build:ci --remote_cache="https://storage.googleapis.com/ray-bazel-cache"
build:ci --progress_report_interval=100
build:ci --show_progress_rate_limit=15
build:ci --show_task_finish
build:ci --ui_actions_shown=1024
build:ci-travis --show_timestamps # Travis doesn't have an option to show timestamps, but GitHub Actions does
# GitHub Actions has low disk space, so prefer hardlinks there.
build:ci-github --experimental_repository_cache_hardlinks
build:ci --show_timestamps
build:ci-travis --disk_cache=~/ray-bazel-cache
build:ci-travis --remote_cache="https://storage.googleapis.com/ray-bazel-cache"
build:ci-github --experimental_repository_cache_hardlinks # GitHub Actions has low disk space, so prefer hardlinks there.
build:ci-github --disk_cache=~/ray-bazel-cache
build:ci-github --remote_cache="https://storage.googleapis.com/ray-bazel-cache"
test:ci --flaky_test_attempts=3
test:ci --nocache_test_results
test:ci --spawn_strategy=local
Expand Down
28 changes: 28 additions & 0 deletions .buildkite/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
FROM ubuntu:focal

ARG REMOTE_CACHE_URL
ARG BUILDKITE_PULL_REQUEST

ENV DEBIAN_FRONTEND=noninteractive
ENV TZ=America/Los_Angeles
ENV BUILDKITE=true
ENV CI=true

RUN apt-get update -qq
RUN apt-get install -y -qq \
curl python-is-python3 git build-essential \
sudo unzip apt-utils dialog tzdata wget
RUN locale -a

# Setup Bazel caches
RUN (echo "build --remote_cache=${REMOTE_CACHE_URL}" >> /root/.bazelrc); \
(if [ ${BUILDKITE_PULL_REQUEST} != "false" ]; then (echo "build --remote_upload_local_results=false" >> /root/.bazelrc); fi); \
cat /root/.bazelrc

RUN mkdir /ray
WORKDIR /ray

# Below should be re-run each time
COPY . .
RUN ./ci/travis/ci.sh init
RUN ./ci/travis/ci.sh build
3 changes: 3 additions & 0 deletions .buildkite/pipeline.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
- label: "Ray Core Tests (:buildkite: Experimental)"
commands:
- bazel test --config=ci $(./scripts/bazel_export_options) --build_tests_only -- //:all -rllib/...
9 changes: 6 additions & 3 deletions ci/travis/ci.sh
Original file line number Diff line number Diff line change
Expand Up @@ -215,9 +215,12 @@ build_dashboard_front_end() {
else
(
cd ray/new_dashboard/client
set +x # suppress set -x since it'll get very noisy here
. "${HOME}/.nvm/nvm.sh"
nvm use --silent node

if [ -z "${BUILDKITE-}" ]; then
set +x # suppress set -x since it'll get very noisy here
. "${HOME}/.nvm/nvm.sh"
nvm use --silent node
fi
install_npm_project
npm run -s build
)
Expand Down
4 changes: 3 additions & 1 deletion ci/travis/install-bazel.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/usr/bin/env bash
set -x
set -x
set -euo pipefail

ROOT_DIR=$(cd "$(dirname "${BASH_SOURCE:-$0}")"; pwd)
Expand Down Expand Up @@ -115,6 +115,8 @@ if [ "${CI-}" = true ]; then
cat <<EOF >> ~/.bazelrc
build --google_credentials="${translated_path}"
EOF
elif [ -n "${BUILDKITE-}" ]; then
echo "Using buildkite secret store to communicate with cache address"
else
echo "Using remote build cache in read-only mode." 1>&2
cat <<EOF >> ~/.bazelrc
Expand Down
10 changes: 8 additions & 2 deletions ci/travis/install-dependencies.sh
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,10 @@ install_nvm() {
"nvm() { \"\${NVM_HOME}/nvm.exe\" \"\$@\"; }" \
> "${NVM_HOME}/nvm.sh"
fi
elif [ -n "${BUILDKITE-}" ]; then
# https://github.com/nodesource/distributions/blob/master/README.md#installation-instructions
curl -sL https://deb.nodesource.com/setup_14.x | sudo -E bash -
sudo apt-get install -y nodejs
else
test -f "${NVM_HOME}/nvm.sh" # double-check NVM is already available on other platforms
fi
Expand Down Expand Up @@ -227,7 +231,9 @@ install_node() {
}

install_toolchains() {
"${ROOT_DIR}"/install-toolchains.sh
if [ -z "${BUILDKITE-}" ]; then
"${ROOT_DIR}"/install-toolchains.sh
fi
}

install_dependencies() {
Expand All @@ -250,7 +256,7 @@ install_dependencies() {

if [ -n "${PYTHON-}" ]; then
# Remove this entire section once RLlib and Serve dependencies are fixed.
if [ "${DOC_TESTING-}" != 1 ] && [ "${SGD_TESTING-}" != 1 ] && [ "${TUNE_TESTING-}" != 1 ]; then
if [ -z "${BUILDKITE-}" ] && [ "${DOC_TESTING-}" != 1 ] && [ "${SGD_TESTING-}" != 1 ] && [ "${TUNE_TESTING-}" != 1 ]; then
# PyTorch is installed first since we are using a "-f" directive to find the wheels.
# We want to install the CPU version only.
local torch_url="https://download.pytorch.org/whl/torch_stable.html"
Expand Down

0 comments on commit 1e2adb3

Please sign in to comment.