From 7db3d171f04930998c457bac2b58fc091060db4d Mon Sep 17 00:00:00 2001 From: simon-mo Date: Tue, 29 Dec 2020 13:54:40 -0800 Subject: [PATCH 1/8] Buildkite PR Build wip Use apt-get node Fix Add timing Run test in docker Fit pipeline.yml for terraform Fix Multiple tests Prettier diff --- .bazelrc | 11 ++++++----- .buildkite/Dockerfile | 23 +++++++++++++++++++++++ .buildkite/pipeline.yml | 7 +++++++ ci/travis/ci.sh | 9 ++++++--- ci/travis/install-bazel.sh | 4 +++- ci/travis/install-dependencies.sh | 20 ++++++++++++++------ 6 files changed, 59 insertions(+), 15 deletions(-) create mode 100644 .buildkite/Dockerfile create mode 100644 .buildkite/pipeline.yml diff --git a/.bazelrc b/.bazelrc index 67bbf92d1e8c..2baaa0fa2af5 100644 --- a/.bazelrc +++ b/.bazelrc @@ -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 diff --git a/.buildkite/Dockerfile b/.buildkite/Dockerfile new file mode 100644 index 000000000000..80c374019065 --- /dev/null +++ b/.buildkite/Dockerfile @@ -0,0 +1,23 @@ +FROM ubuntu:focal + +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 + +RUN mkdir /bazel-cache; \ + (echo "build --remote_cache=https://ray-bazel-remote.g1jl7rtfvrm4o.us-west-2.cs.amazonlightsail.com" >> /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 diff --git a/.buildkite/pipeline.yml b/.buildkite/pipeline.yml new file mode 100644 index 000000000000..d577aa9c8150 --- /dev/null +++ b/.buildkite/pipeline.yml @@ -0,0 +1,7 @@ +# TODO: doc +- label: "Ray Core Tests" + commands: + - bash src/ray/test/run_object_manager_tests.sh + - bazel test --config=ci $(./scripts/bazel_export_options) --build_tests_only -- //:all -rllib/... +- label: "Ray Dashboard Tests" + command: bazel test --config=ci $(./scripts/bazel_export_options) --build_tests_only python/ray/new_dashboard/... \ No newline at end of file diff --git a/ci/travis/ci.sh b/ci/travis/ci.sh index 3638b3af36e5..3c623bcff133 100755 --- a/ci/travis/ci.sh +++ b/ci/travis/ci.sh @@ -208,9 +208,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 ) diff --git a/ci/travis/install-bazel.sh b/ci/travis/install-bazel.sh index 2ba58b1ff0e2..1f125de66218 100755 --- a/ci/travis/install-bazel.sh +++ b/ci/travis/install-bazel.sh @@ -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 <> ~/.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 <> ~/.bazelrc diff --git a/ci/travis/install-dependencies.sh b/ci/travis/install-dependencies.sh index 7bc73e967051..dcc98285264f 100755 --- a/ci/travis/install-dependencies.sh +++ b/ci/travis/install-dependencies.sh @@ -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() { @@ -251,11 +257,13 @@ install_dependencies() { if [ -n "${PYTHON-}" ]; 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" - case "${OSTYPE}" in - darwin*) pip install torch torchvision;; - *) pip install torch==1.7.0+cpu torchvision==0.8.1+cpu -f "${torch_url}";; - esac + if [ -z "${BUILDKITE-}" ]; then + local torch_url="https://download.pytorch.org/whl/torch_stable.html" + case "${OSTYPE}" in + darwin*) pip install torch torchvision;; + *) pip install torch==1.7.0+cpu torchvision==0.8.1+cpu -f "${torch_url}";; + esac + fi # Try n times; we often encounter OpenSSL.SSL.WantReadError (or others) # that break the entire CI job: Simply retry installation in this case From 8f3fbc3a6e23db294839506a665fb8793d3c01bc Mon Sep 17 00:00:00 2001 From: simon-mo Date: Wed, 30 Dec 2020 18:35:59 -0800 Subject: [PATCH 2/8] Use Conda Python --- .buildkite/pipeline.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.buildkite/pipeline.yml b/.buildkite/pipeline.yml index d577aa9c8150..9e585c19e9c7 100644 --- a/.buildkite/pipeline.yml +++ b/.buildkite/pipeline.yml @@ -4,4 +4,4 @@ - bash src/ray/test/run_object_manager_tests.sh - bazel test --config=ci $(./scripts/bazel_export_options) --build_tests_only -- //:all -rllib/... - label: "Ray Dashboard Tests" - command: bazel test --config=ci $(./scripts/bazel_export_options) --build_tests_only python/ray/new_dashboard/... \ No newline at end of file + command: conda activate base; bazel test --config=ci $(./scripts/bazel_export_options) --build_tests_only python/ray/new_dashboard/... \ No newline at end of file From a0ea94416147041d78d94429ec591ade8a3a8de7 Mon Sep 17 00:00:00 2001 From: simon-mo Date: Thu, 31 Dec 2020 10:15:03 -0800 Subject: [PATCH 3/8] Don't use conda --- .buildkite/pipeline.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.buildkite/pipeline.yml b/.buildkite/pipeline.yml index 9e585c19e9c7..d577aa9c8150 100644 --- a/.buildkite/pipeline.yml +++ b/.buildkite/pipeline.yml @@ -4,4 +4,4 @@ - bash src/ray/test/run_object_manager_tests.sh - bazel test --config=ci $(./scripts/bazel_export_options) --build_tests_only -- //:all -rllib/... - label: "Ray Dashboard Tests" - command: conda activate base; bazel test --config=ci $(./scripts/bazel_export_options) --build_tests_only python/ray/new_dashboard/... \ No newline at end of file + command: bazel test --config=ci $(./scripts/bazel_export_options) --build_tests_only python/ray/new_dashboard/... \ No newline at end of file From 07fa5ab1d6d76bacf72bd0ebf8debdc6202924f3 Mon Sep 17 00:00:00 2001 From: simon-mo Date: Thu, 31 Dec 2020 10:36:21 -0800 Subject: [PATCH 4/8] fix From 4ac328de57c01ee589ef4bbecaabf9efc5cc4fe1 Mon Sep 17 00:00:00 2001 From: simon-mo Date: Thu, 31 Dec 2020 10:49:07 -0800 Subject: [PATCH 5/8] Add back conda --- .buildkite/pipeline.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.buildkite/pipeline.yml b/.buildkite/pipeline.yml index d577aa9c8150..9e585c19e9c7 100644 --- a/.buildkite/pipeline.yml +++ b/.buildkite/pipeline.yml @@ -4,4 +4,4 @@ - bash src/ray/test/run_object_manager_tests.sh - bazel test --config=ci $(./scripts/bazel_export_options) --build_tests_only -- //:all -rllib/... - label: "Ray Dashboard Tests" - command: bazel test --config=ci $(./scripts/bazel_export_options) --build_tests_only python/ray/new_dashboard/... \ No newline at end of file + command: conda activate base; bazel test --config=ci $(./scripts/bazel_export_options) --build_tests_only python/ray/new_dashboard/... \ No newline at end of file From eabf2e7b646a4b81e3d982fc6531e7383025b624 Mon Sep 17 00:00:00 2001 From: Simon Mo Date: Sun, 3 Jan 2021 20:45:35 -0800 Subject: [PATCH 6/8] Update Dockerfile --- .buildkite/Dockerfile | 1 + 1 file changed, 1 insertion(+) diff --git a/.buildkite/Dockerfile b/.buildkite/Dockerfile index 80c374019065..ca4ba1eacb92 100644 --- a/.buildkite/Dockerfile +++ b/.buildkite/Dockerfile @@ -21,3 +21,4 @@ WORKDIR /ray COPY . . RUN ./ci/travis/ci.sh init RUN ./ci/travis/ci.sh build + From 708c5900e4b6a72fe05dac3a507d9dd60365e08d Mon Sep 17 00:00:00 2001 From: simon-mo Date: Tue, 5 Jan 2021 16:07:37 -0800 Subject: [PATCH 7/8] Update pipeline --- .buildkite/pipeline.yml | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/.buildkite/pipeline.yml b/.buildkite/pipeline.yml index 9e585c19e9c7..52f294982208 100644 --- a/.buildkite/pipeline.yml +++ b/.buildkite/pipeline.yml @@ -1,7 +1,4 @@ # TODO: doc -- label: "Ray Core Tests" +- label: "Ray Core Tests (:buildkite: Experimental)" commands: - - bash src/ray/test/run_object_manager_tests.sh - bazel test --config=ci $(./scripts/bazel_export_options) --build_tests_only -- //:all -rllib/... -- label: "Ray Dashboard Tests" - command: conda activate base; bazel test --config=ci $(./scripts/bazel_export_options) --build_tests_only python/ray/new_dashboard/... \ No newline at end of file From d15bbac0ec82d8de291760a8cbab6f1c2c8becda Mon Sep 17 00:00:00 2001 From: simon-mo Date: Tue, 5 Jan 2021 16:19:45 -0800 Subject: [PATCH 8/8] Lint --- .buildkite/Dockerfile | 1 - .buildkite/pipeline.yml | 1 - 2 files changed, 2 deletions(-) diff --git a/.buildkite/Dockerfile b/.buildkite/Dockerfile index ca4ba1eacb92..80c374019065 100644 --- a/.buildkite/Dockerfile +++ b/.buildkite/Dockerfile @@ -21,4 +21,3 @@ WORKDIR /ray COPY . . RUN ./ci/travis/ci.sh init RUN ./ci/travis/ci.sh build - diff --git a/.buildkite/pipeline.yml b/.buildkite/pipeline.yml index 52f294982208..0fc4508d9869 100644 --- a/.buildkite/pipeline.yml +++ b/.buildkite/pipeline.yml @@ -1,4 +1,3 @@ -# TODO: doc - label: "Ray Core Tests (:buildkite: Experimental)" commands: - bazel test --config=ci $(./scripts/bazel_export_options) --build_tests_only -- //:all -rllib/...