Skip to content

Commit

Permalink
Set up testing and wheels for Windows on GitHub Actions (ray-project#…
Browse files Browse the repository at this point in the history
…8131)

* Move some Java tests into ci.sh

* Move C++ worker tests into ci.sh

* Define run()

* Prepare to move Python tests into ci.sh

* Fix issues in install-dependencies.sh

* Reload environment for GitHub Actions

* Move wheels to ci.sh and fix related issues

* Don't bypass failures in install-ray.sh anymore

* Make CI a little quieter

* Move linting into ci.sh

* Add vitals test right after build

* Fix os.uname() unavailability on Windows

Co-authored-by: Mehrdad <noreply@github.com>
  • Loading branch information
mehrdadn and web-flow authored Apr 30, 2020
1 parent ae54e0d commit 254b1ec
Show file tree
Hide file tree
Showing 17 changed files with 300 additions and 143 deletions.
12 changes: 12 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,11 @@ jobs:
- name: macos
os: macos-10.15
env:
GITHUB_PULL_REQUEST: ${{ github.event.number }}
PYTHON: 3.6
TRAVIS_BUILD_DIR: ${{ github.workspace }}
TRAVIS_COMMIT: ${{ github.sha }}
#TRAVIS_PULL_REQUEST is defined in the scripts to account for "false"
steps:
- name: Pre-checkout system configuration
# We add -l to process .bashrc, but need -e -o pipefail for consistency with GitHub Actions's default behavior.
Expand All @@ -40,9 +44,17 @@ jobs:
env:
BAZEL_CACHE_CREDENTIAL_B64: ${{ secrets.BAZEL_CACHE_CREDENTIAL_B64 }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
#LINUX_WHEELS: 1
LINT: 1
#MAC_WHEELS: 1
RAY_DEFAULT_BUILD: 1
WINDOWS_WHEELS: 1
run: |
. ./ci/travis/ci.sh init
. ./ci/travis/ci.sh lint
. ./ci/travis/ci.sh build
. ./ci/travis/ci.sh test_python
. ./ci/travis/ci.sh test_wheels
- name: Run Clang Include-What-You-Use
continue-on-error: true
if: runner.os == 'Linux'
Expand Down
65 changes: 5 additions & 60 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ matrix:
install:
- . ./ci/travis/ci.sh build
script:
- . ./ci/travis/ci.sh preload
- ./java/test.sh

- os: linux
Expand All @@ -51,7 +50,6 @@ matrix:
install:
- . ./ci/travis/ci.sh build
script:
- . ./ci/travis/ci.sh preload
# Streaming cpp test.
- if [ $RAY_CI_STREAMING_CPP_AFFECTED == "1" ]; then bazel test --config=ci --test_output=all //streaming:all && bash streaming/src/test/run_streaming_queue_test.sh; fi
- if [ $RAY_CI_STREAMING_PYTHON_AFFECTED == "1" ]; then python -m pytest -v --durations=5 --timeout=300 streaming/python/tests/; fi
Expand All @@ -70,7 +68,6 @@ matrix:
install:
- . ./ci/travis/ci.sh build
script:
- . ./ci/travis/ci.sh preload
- ./ci/suppress_output bash src/ray/test/run_core_worker_tests.sh
- ./ci/suppress_output bash streaming/src/test/run_streaming_queue_test.sh
- ./java/test.sh
Expand All @@ -88,7 +85,6 @@ matrix:
install:
- . ./ci/travis/ci.sh build
script:
- . ./ci/travis/ci.sh preload
- ./ci/keep_alive bazel test --config=ci --test_tag_filters=-jenkins_only python/ray/tests/...

- os: linux
Expand All @@ -100,43 +96,7 @@ matrix:
install:
- . ./ci/travis/ci.sh build
script:
- . ./ci/travis/ci.sh preload
- ./ci/travis/check-git-clang-format-output.sh
# Try generating Sphinx documentation. To do this, we need to install
# Ray first.
- cd doc
# readthedocs has an antiquated build env.
# This is a best effort to reproduce it locally to avoid doc build failures
# and hidden errors.
- pip install -r requirements-rtd.txt
- pip install -r requirements-doc.txt
- pip install yapf==0.23.0
- sphinx-build -q -W -E -T -b html source _build/html
- cd ..
# Run Python linting, ignore dict vs {} (C408), others are defaults
- flake8 --inline-quotes '"' --no-avoid-escape --exclude=python/ray/core/generated/,streaming/python/generated,doc/source/conf.py,python/ray/cloudpickle/,python/ray/thirdparty_files --ignore=C408,E121,E123,E126,E226,E24,E704,W503,W504,W605
- ./ci/travis/format.sh --all
# Make sure that the README is formatted properly.
- cd python
- python setup.py check --restructuredtext --strict --metadata
- cd ..
# Run Bazel linter Buildifier.
- wget -q https://dl.google.com/go/go1.14.2.linux-amd64.tar.gz
- tar -xf go1.14.2.linux-amd64.tar.gz
- mkdir $HOME/go_dir
- export GOROOT=`pwd`/go
- export GOPATH="$HOME/go_dir"
- export PATH="$GOROOT/bin:$GOPATH/bin:$PATH"
- go get github.com/bazelbuild/buildtools/buildifier
- ./ci/travis/bazel-format.sh
# Run TypeScript and HTML linting.
- pushd python/ray/dashboard/client
- source "$HOME/.nvm/nvm.sh"
- nvm use node
- node_modules/.bin/eslint --max-warnings 0 $(find src -name "*.ts" -or -name "*.tsx")
- node_modules/.bin/prettier --check $(find src -name "*.ts" -or -name "*.tsx")
- node_modules/.bin/prettier --check public/index.html
- popd
- . ./ci/travis/ci.sh lint

# Build Linux wheels.
- os: linux
Expand All @@ -149,9 +109,7 @@ matrix:
install:
- . ./ci/travis/ci.sh build
script:
- . ./ci/travis/ci.sh preload
# Explicitly sleep 60 seconds for logs to go through
- ./ci/travis/test-wheels.sh || { cat /tmp/ray/session_latest/logs/* && sleep 60 && false; }
- . ./ci/travis/ci.sh test_wheels
cache: false

# Build MacOS wheels.
Expand All @@ -166,9 +124,7 @@ matrix:
install:
- . ./ci/travis/ci.sh build
script:
- . ./ci/travis/ci.sh preload
# Explicitly sleep 60 seconds for logs to go through
- ./ci/travis/test-wheels.sh || { cat /tmp/ray/session_latest/logs/* && sleep 60 && false; }
- . ./ci/travis/ci.sh test_wheels

# RLlib: Learning tests (from rllib/tuned_examples/regression_tests/*.yaml).
- os: linux
Expand All @@ -185,7 +141,6 @@ matrix:
install:
- . ./ci/travis/ci.sh build
script:
- . ./ci/travis/ci.sh preload
- travis_wait 120 bazel test --config=ci --test_output=streamed --build_tests_only --test_tag_filters=learning_tests rllib/...

# RLlib: Learning tests with tf=1.x (from rllib/tuned_examples/regression_tests/*.yaml).
Expand All @@ -204,7 +159,6 @@ matrix:
install:
- . ./ci/travis/ci.sh build
script:
- . ./ci/travis/ci.sh preload
- travis_wait 120 bazel test --config=ci --test_output=streamed --build_tests_only --test_tag_filters=learning_tests rllib/...

# RLlib: Quick Agent train.py runs (compilation & running, no(!) learning).
Expand All @@ -223,7 +177,6 @@ matrix:
install:
- . ./ci/travis/ci.sh build
script:
- . ./ci/travis/ci.sh preload
- travis_wait 60 bazel test --config=ci --build_tests_only --test_tag_filters=quick_train rllib/...
# Test everything that does not have any of the "main" labels:
# "learning_tests|quick_train|examples|tests_dir".
Expand All @@ -244,7 +197,6 @@ matrix:
install:
- . ./ci/travis/ci.sh build
script:
- . ./ci/travis/ci.sh preload
- ./ci/keep_alive bazel test --config=ci --build_tests_only --test_tag_filters=examples_A,examples_B rllib/...
- ./ci/keep_alive bazel test --config=ci --build_tests_only --test_tag_filters=examples_C rllib/...
- ./ci/keep_alive bazel test --config=ci --build_tests_only --test_tag_filters=examples_E,examples_L,examples_M,examples_N,examples_P rllib/...
Expand All @@ -265,7 +217,6 @@ matrix:
install:
- . ./ci/travis/ci.sh build
script:
- . ./ci/travis/ci.sh preload
- ./ci/keep_alive bazel test --config=ci --build_tests_only --test_tag_filters=tests_dir_A,tests_dir_B,tests_dir_C,tests_dir_D,tests_dir_E,tests_dir_F,tests_dir_G,tests_dir_H,tests_dir_I rllib/...

# RLlib: tests_dir: Everything in rllib/tests/ directory (J-Z).
Expand All @@ -283,7 +234,6 @@ matrix:
install:
- . ./ci/travis/ci.sh build
script:
- . ./ci/travis/ci.sh preload
- ./ci/keep_alive bazel test --config=ci --build_tests_only --test_tag_filters=tests_dir_J,tests_dir_K,tests_dir_L,tests_dir_M,tests_dir_N,tests_dir_O,tests_dir_P,tests_dir_Q,tests_dir_R,tests_dir_S,tests_dir_T,tests_dir_U,tests_dir_V,tests_dir_W,tests_dir_X,tests_dir_Y,tests_dir_Z rllib/...

# Cpp worker test
Expand All @@ -296,11 +246,9 @@ matrix:
install:
- . ./ci/travis/ci.sh build
script:
- . ./ci/travis/ci.sh preload
- bazel test --config=ci //cpp:all --build_tests_only --test_output=streamed
- . ./ci/travis/ci.sh test_cpp

script:
- . ./ci/travis/ci.sh preload
# raylet integration tests
- ./ci/suppress_output bash src/ray/test/run_core_worker_tests.sh
- ./ci/suppress_output bash src/ray/test/run_object_manager_tests.sh
Expand All @@ -312,10 +260,7 @@ script:
- if [ $RAY_CI_SERVE_AFFECTED == "1" ]; then ./ci/keep_alive bazel test --config=ci --test_tag_filters=-jenkins_only python/ray/serve/...; fi

# ray operator tests
- cd ./deploy/ray-operator/
- CC=gcc ../../ci/suppress_output go build
- CC=gcc ../../ci/suppress_output go test ./...
- cd ../..
- (cd deploy/ray-operator && export CC=gcc && suppress_output go build && suppress_output go test ./...)

# random python tests TODO(ekl): these should be moved to bazel
- if [ $RAY_CI_PYTHON_AFFECTED == "1" ]; then python -m pytest -v --durations=5 --timeout=300 python/ray/experimental/test/async_test.py; fi
Expand Down
2 changes: 1 addition & 1 deletion BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -1530,7 +1530,7 @@ genrule(
tmpdir="redis.tmp" &&
path=$(location @com_github_antirez_redis//:file) &&
cp -p -L -R -- "$${path%/*}" "$${tmpdir}" &&
make -s -C "$${tmpdir}" -j"$$(getconf _NPROCESSORS_ONLN || echo 1)" &&
make -s -C "$${tmpdir}" -j"$$(getconf _NPROCESSORS_ONLN || echo 1)" V=0 &&
mv "$${tmpdir}"/src/redis-server $(location redis-server) &&
chmod +x $(location redis-server) &&
mv "$${tmpdir}"/src/redis-cli $(location redis-cli) &&
Expand Down
2 changes: 1 addition & 1 deletion build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ pushd $WORK_DIR
git clone https://github.com/suquark/pickle5-backport
pushd pickle5-backport
git checkout 8ffe41ceba9d5e2ce8a98190f6b3d2f3325e5a72
CC=gcc "$PYTHON_EXECUTABLE" setup.py bdist_wheel
CC=gcc "$PYTHON_EXECUTABLE" setup.py --quiet bdist_wheel
unzip -o dist/*.whl -d "$ROOT_DIR/python/ray/pickle5_files"
popd
popd
Expand Down
Loading

0 comments on commit 254b1ec

Please sign in to comment.