[CI] Buildkite PR Environment for Simple Tests (#13130)

This commit is contained in:
Simon Mo
2021-01-18 00:44:24 -08:00
committed by GitHub
parent 3a0710130c
commit 1e2adb335e
6 changed files with 54 additions and 11 deletions
+6 -5
View File
@@ -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
+28
View File
@@ -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
View File
@@ -0,0 +1,3 @@
- label: "Ray Core Tests (:buildkite: Experimental)"
commands:
- bazel test --config=ci $(./scripts/bazel_export_options) --build_tests_only -- //:all -rllib/...
+6 -3
View File
@@ -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
)
+3 -1
View File
@@ -1,5 +1,5 @@
#!/usr/bin/env bash
set -x
set -x
set -euo pipefail
ROOT_DIR=$(cd "$(dirname "${BASH_SOURCE:-$0}")"; pwd)
@@ -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
+8 -2
View File
@@ -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
@@ -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() {
@@ -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"