<commit_before>language: generic
# Use Ubuntu 18.04
dist: bionic

git:
  clone: false  # Clone manually to work around Travis issues like https://github.com/travis-ci/travis-ci/issues/6337
  depth: false  # Shallow clones can prevent diff against base branch
  quiet: true

branches:
  except:
    - /dependabot.*/

before_install:
  - unset -f cd  # Travis defines this on Mac for RVM, but it breaks the Mac build
  - |
    git clone -q -n "https://github.com/${TRAVIS_REPO_SLUG}.git" "${TRAVIS_REPO_SLUG}"
    cd -- "${TRAVIS_REPO_SLUG}"
    to_fetch=("${TRAVIS_COMMIT}")
    if [ false != "${TRAVIS_PULL_REQUEST-}" ]; then to_fetch+=("+refs/pull/${TRAVIS_PULL_REQUEST}/merge:"); fi
    git fetch -q -- origin "${to_fetch[@]}"
    git checkout -qf "${TRAVIS_COMMIT}" --
    python -u ci/remote-watch.py --skip_repo=ray-project/ray &

matrix:
  include:
    - os: linux
      env:
        - PYTHON=3.6 SMALL_AND_LARGE_TESTS=1
        - PYTHONWARNINGS=ignore
        - RAY_DEFAULT_BUILD=1
        - RAY_CYTHON_EXAMPLES=1
        - RAY_USE_RANDOM_PORTS=1
      install:
        - . ./ci/travis/ci.sh init RAY_CI_SERVE_AFFECTED,RAY_CI_TUNE_AFFECTED,RAY_CI_PYTHON_AFFECTED,RAY_CI_DASHBOARD_AFFECTED
      before_script:
        - . ./ci/travis/ci.sh build

    - os: linux
      env:
        - PYTHON=3.6 MEDIUM_TESTS_A_TO_J=1
        - PYTHONWARNINGS=ignore
        - RAY_DEFAULT_BUILD=1
        - RAY_CYTHON_EXAMPLES=1
        - RAY_USE_RANDOM_PORTS=1
      install:
        - . ./ci/travis/ci.sh init RAY_CI_SERVE_AFFECTED,RAY_CI_TUNE_AFFECTED,RAY_CI_PYTHON_AFFECTED,RAY_CI_DASHBOARD_AFFECTED
      before_script:
        - . ./ci/travis/ci.sh build
      script:
        # bazel python tests for medium size tests. Used for parallelization.
        - if [ $RAY_CI_PYTHON_AFFECTED == "1" ]; then ./ci/keep_alive bazel test --config=ci $(./scripts/bazel_export_options) --test_tag_filters=-kubernetes,-jenkins_only,medium_size_python_tests_a_to_j python/ray/tests/...; fi
        - if [ $RAY_CI_PYTHON_AFFECTED == "1" ]; then ./ci/keep_alive bazel test --config=ci $(./scripts/bazel_export_options) --test_tag_filters=-kubernetes,-jenkins_only,client_tests --test_env=RAY_CLIENT_MODE=1 python/ray/tests/...; fi

    - os: linux
      env:
        - PYTHON=3.6 MEDIUM_TESTS_K_TO_Z=1
        - PYTHONWARNINGS=ignore
        - RAY_DEFAULT_BUILD=1
        - RAY_CYTHON_EXAMPLES=1
        - RAY_USE_RANDOM_PORTS=1
      install:
        - . ./ci/travis/ci.sh init RAY_CI_SERVE_AFFECTED,RAY_CI_TUNE_AFFECTED,RAY_CI_PYTHON_AFFECTED,RAY_CI_DASHBOARD_AFFECTED
      before_script:
        - . ./ci/travis/ci.sh build
      script:
        # bazel python tests for medium size tests. Used for parallelization.
        - if [ $RAY_CI_PYTHON_AFFECTED == "1" ]; then ./ci/keep_alive bazel test --config=ci $(./scripts/bazel_export_options) --test_tag_filters=-kubernetes,-jenkins_only,medium_size_python_tests_k_to_z python/ray/tests/...; fi

    - os: linux
      env:
        - PYTHON=3.6 BAZEL_CONFIG="asan"
        - PYTHONWARNINGS=ignore
        - RAY_DEFAULT_BUILD=1
      install:
        - . ./ci/travis/ci.sh init
      before_script:
        - . ./ci/travis/ci.sh build
      script:
        # Run all C++ unit tests with ASAN enabled. ASAN adds too much overhead to run Python tests.
        # NOTE: core_worker_test is out-of-date and should already covered by
        # Python tests.
        - bazel test --config=ci $(./scripts/bazel_export_options) --build_tests_only -- //:all -core_worker_test

    - os: osx
      osx_image: xcode7
      env:
        - PYTHON=3.6 SMALL_AND_LARGE_TESTS=1
        - PYTHONWARNINGS=ignore
        - RAY_DEFAULT_BUILD=1
        - RAY_CYTHON_EXAMPLES=1
        - RAY_USE_RANDOM_PORTS=1
      install:
        - . ./ci/travis/ci.sh init RAY_CI_SERVE_AFFECTED,RAY_CI_TUNE_AFFECTED,RAY_CI_PYTHON_AFFECTED,RAY_CI_DASHBOARD_AFFECTED
      before_script:
        - . ./ci/travis/ci.sh build

    - os: osx
      osx_image: xcode7
      env:
        - PYTHON=3.6 MEDIUM_TESTS_A_TO_J=1
        - PYTHONWARNINGS=ignore
        - RAY_DEFAULT_BUILD=1
        - RAY_CYTHON_EXAMPLES=1
        - RAY_USE_RANDOM_PORTS=1
      install:
        - . ./ci/travis/ci.sh init RAY_CI_SERVE_AFFECTED,RAY_CI_TUNE_AFFECTED,RAY_CI_PYTHON_AFFECTED,RAY_CI_DASHBOARD_AFFECTED
      before_script:
        - . ./ci/travis/ci.sh build
      script:
        # bazel python tests for medium size tests. Used for parallelization.
        - if [ $RAY_CI_PYTHON_AFFECTED == "1" ]; then ./ci/keep_alive bazel test --config=ci $(./scripts/bazel_export_options) --test_tag_filters=-kubernetes,-jenkins_only,medium_size_python_tests_a_to_j python/ray/tests/...; fi

    - os: osx
      osx_image: xcode7
      env:
        - PYTHON=3.6 MEDIUM_TESTS_K_TO_Z=1
        - PYTHONWARNINGS=ignore
        - RAY_DEFAULT_BUILD=1
        - RAY_CYTHON_EXAMPLES=1
        - RAY_USE_RANDOM_PORTS=1
      install:
        - . ./ci/travis/ci.sh init RAY_CI_SERVE_AFFECTED,RAY_CI_TUNE_AFFECTED,RAY_CI_PYTHON_AFFECTED,RAY_CI_DASHBOARD_AFFECTED
      before_script:
        - . ./ci/travis/ci.sh build
      script:
        # bazel python tests for medium size tests. Used for parallelization.
        - if [ $RAY_CI_PYTHON_AFFECTED == "1" ]; then ./ci/keep_alive bazel test --config=ci $(./scripts/bazel_export_options) --test_tag_filters=-kubernetes,-jenkins_only,medium_size_python_tests_k_to_z python/ray/tests/...; fi

    - os: linux
      env:
        - JAVA_TESTS=1
        - PYTHON=3.6 PYTHONWARNINGS=ignore
        - RAY_INSTALL_JAVA=1
      language: java
      jdk: openjdk8
      install:
        - . ./ci/travis/ci.sh init RAY_CI_JAVA_AFFECTED
      before_script:
        - . ./ci/travis/ci.sh build
      script:
        - ./java/test.sh

    - os: linux
      env:
        - STREAMING_TESTS=1
        - RAY_INSTALL_JAVA=1
        - PYTHON=3.6 PYTHONWARNINGS=ignore
        - RAY_USE_RANDOM_PORTS=1
        - RAY_ENABLE_NEW_SCHEDULER=0
      language: java
      jdk: openjdk8
      install:
        - . ./ci/travis/ci.sh init RAY_CI_STREAMING_PYTHON_AFFECTED,RAY_CI_STREAMING_JAVA_AFFECTED
      before_script:
        - . ./ci/travis/ci.sh build
      script:
        # Streaming cpp test.
        - if [ $RAY_CI_STREAMING_CPP_AFFECTED == "1" ]; then bazel test --config=ci $(./scripts/bazel_export_options) --test_output=all //streaming:all && bash streaming/src/test/run_streaming_queue_test.sh; fi
        # BROKEN
        # - if [ $RAY_CI_STREAMING_PYTHON_AFFECTED == "1" ]; then python -m pytest -v --durations=5 --timeout=300 streaming/python/tests/; fi
        # - if [ $RAY_CI_STREAMING_JAVA_AFFECTED == "1" ]; then ./streaming/java/test.sh; fi

    - os: linux
      env:
        - LINT=1
        - PYTHONWARNINGS=ignore
      install:
        - . ./ci/travis/ci.sh init
      before_script:
        - . ./ci/travis/ci.sh lint
        - . ./ci/travis/ci.sh build
      script:
        - sleep 30  # we still need this block to exist, otherwise it will fall back to the global one

    # Build MacOS wheels and MacOS jars
    - os: osx
      osx_image: xcode7
      env:
        - MAC_WHEELS=1 MAC_JARS=1
        - PYTHONWARNINGS=ignore
        - RAY_INSTALL_JAVA=1
      install:
        - . ./ci/travis/ci.sh init RAY_CI_MACOS_WHEELS_AFFECTED,RAY_CI_JAVA_AFFECTED,RAY_CI_STREAMING_JAVA_AFFECTED
      before_script:
        - ./ci/keep_alive brew tap adoptopenjdk/openjdk
        - ./ci/keep_alive brew install --cask adoptopenjdk8
        - export JAVA_HOME=/Library/Java/JavaVirtualMachines/adoptopenjdk-8.jdk/Contents/Home
        - java -version
        - ./ci/keep_alive bash ./ci/travis/ci.sh build
      script:
        - . ./ci/travis/ci.sh test_wheels
        - bash ./java/build-jar-multiplatform.sh darwin

    # Build Linux wheels and jars.
    - os: linux
      env:
        # - PYTHON=3.6
        - LINUX_WHEELS=1 LINUX_JARS=1
        - DOCKER_BUILD_PY37=1
        - PYTHONWARNINGS=ignore
        - RAY_INSTALL_JAVA=1
      language: java
      jdk: openjdk8
      install:
        - . ./ci/travis/ci.sh init RAY_CI_LINUX_WHEELS_AFFECTED,RAY_CI_JAVA_AFFECTED,RAY_CI_STREAMING_JAVA_AFFECTED
      before_script:
        - . ./ci/travis/ci.sh build
      script:
        - . ./ci/travis/ci.sh test_wheels
        - export PATH="$HOME/miniconda3/bin:$PATH"
        - python -m pip install docker
        - if [[ "$TRAVIS_PULL_REQUEST" != "false" ]]; then python $TRAVIS_BUILD_DIR/ci/travis/build-docker-images.py --py-versions PY37 --build-type PR --build-base; fi
        - bash ./java/build-jar-multiplatform.sh linux
      cache: false


    # Build Py36 & Py38 Docker Images
    - os: linux
      env:
        - LINUX_WHEELS=1
        - DOCKER_BUILD_PY36_38=1
        - PYTHONWARNINGS=ignore
      language: java
      jdk: openjdk8
      install:
        - . ./ci/travis/ci.sh init RAY_CI_LINUX_WHEELS_AFFECTED
      before_script:
        - . ./ci/travis/ci.sh build
      script:
        - wget --quiet "https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh" -O miniconda3.sh
        - bash miniconda3.sh -b -p "$HOME/miniconda3"
        - export PATH="$HOME/miniconda3/bin:$PATH"
        - conda install -y python=3.7.6
        - python -m pip install docker
        - if [[ "$TRAVIS_PULL_REQUEST" != "false" ]]; then python $TRAVIS_BUILD_DIR/ci/travis/build-docker-images.py --py-versions PY36 PY38 --build-type PR --build-base; fi
      cache: false

    # Build and deploy multi-platform jars.
    - os: linux
      env:
        - MULTIPLATFORM_JARS=1
        - PYTHONWARNINGS=ignore
        - RAY_INSTALL_JAVA=1
        - secure: "<KEY>
        - secure: "<KEY>
      language: java
      jdk: openjdk8
      install:
        - . ./ci/travis/ci.sh init RAY_CI_JAVA_AFFECTED,RAY_CI_STREAMING_JAVA_AFFECTED
      script:
        - bash ./java/build-jar-multiplatform.sh multiplatform
        - bash ./java/build-jar-multiplatform.sh deploy
      cache: false

    # RLlib: Learning tests (from rllib/tuned_examples/*.yaml).
    - os: linux
      env:
        - RLLIB_TESTING=1 RLLIB_REGRESSION_TESTS=1
        - TF_VERSION=2.1.0
        - TFP_VERSION=0.8
        - TORCH_VERSION=1.6
        - PYTHON=3.6
        - PYTHONWARNINGS=ignore
      install:
        - . ./ci/travis/ci.sh init RAY_CI_RLLIB_AFFECTED
      before_script:
        - . ./ci/travis/ci.sh build
      script:
        - ./ci/keep_alive bazel test --config=ci $(./scripts/bazel_export_options) --build_tests_only --test_tag_filters=learning_tests_tf rllib/...

    # RLlib: Learning tests with tf=1.x (from rllib/tuned_examples/*.yaml).
    # Requested by Edi (MS): Test all learning capabilities with tf1.x
    - os: linux
      env:
        - RLLIB_TESTING=1 RLLIB_REGRESSION_TESTS_TF1X=1
        - TF_VERSION=1.14.0
        - TFP_VERSION=0.7
        - TORCH_VERSION=1.6
        - PYTHON=3.6
        - PYTHONWARNINGS=ignore
      install:
        - . ./ci/travis/ci.sh init RAY_CI_RLLIB_FULL_AFFECTED
      before_script:
        - . ./ci/travis/ci.sh build
      script:
        - ./ci/keep_alive bazel test --config=ci $(./scripts/bazel_export_options) --build_tests_only --test_tag_filters=learning_tests_tf rllib/...

    # RLlib: Learning tests with torch (from rllib/tuned_examples/*.yaml).
    - os: linux
      env:
        - RLLIB_TESTING=1 RLLIB_REGRESSION_TESTS_TORCH=1
        - TF_VERSION=2.1.0
        - TFP_VERSION=0.8
        - TORCH_VERSION=1.6
        - PYTHON=3.6
        - PYTHONWARNINGS=ignore
      install:
        - . ./ci/travis/ci.sh init RAY_CI_RLLIB_AFFECTED
      before_script:
        - . ./ci/travis/ci.sh build
      script:
        - ./ci/keep_alive bazel test --config=ci $(./scripts/bazel_export_options) --build_tests_only --test_tag_filters=learning_tests_torch rllib/...

    # RLlib: Quick Agent train.py runs (compilation & running, no(!) learning).
    # Agent single tests (compilation, loss-funcs, etc..).
    - os: linux
      env:
        - RLLIB_TESTING=1 RLLIB_QUICK_TRAIN_AND_MISC_TESTS=1
        # TODO (sven): Remove this after fixing rllib tests num_cpus.
        - RAY_USE_MULTIPROCESSING_CPU_COUNT=1
        - PYTHON=3.6
        - TF_VERSION=2.1.0
        - TFP_VERSION=0.8
        - TORCH_VERSION=1.6
        - PYTHONWARNINGS=ignore
      install:
        - . ./ci/travis/ci.sh init RAY_CI_RLLIB_FULL_AFFECTED
      before_script:
        - . ./ci/travis/ci.sh build
      script:
        - ./ci/keep_alive bazel test --config=ci $(./scripts/bazel_export_options) --build_tests_only --test_tag_filters=quick_train --test_env=RAY_USE_MULTIPROCESSING_CPU_COUNT=1 rllib/...
        # Test everything that does not have any of the "main" labels:
        # "learning_tests|quick_train|examples|tests_dir".
        - ./ci/keep_alive bazel test --config=ci $(./scripts/bazel_export_options) --build_tests_only --test_tag_filters=-learning_tests_tf,-learning_tests_torch,-quick_train,-examples,-tests_dir --test_env=RAY_USE_MULTIPROCESSING_CPU_COUNT=1 rllib/...

    # RLlib: Everything in rllib/examples/ directory.
    - os: linux
      env:
        - RLLIB_TESTING=1 RLLIB_EXAMPLE_DIR_TESTS=1
        # TODO (sven): Remove this after fixing rllib tests num_cpus.
        - RAY_USE_MULTIPROCESSING_CPU_COUNT=1
        - PYTHON=3.6
        - TF_VERSION=2.1.0
        - TFP_VERSION=0.8
        - TORCH_VERSION=1.6
        - PYTHONWARNINGS=ignore
      install:
        - . ./ci/travis/ci.sh init RAY_CI_RLLIB_FULL_AFFECTED
      before_script:
        - . ./ci/travis/ci.sh build
      script:
        - ./ci/keep_alive bazel test --config=ci $(./scripts/bazel_export_options) --build_tests_only --test_tag_filters=examples_A,examples_B --test_env=RAY_USE_MULTIPROCESSING_CPU_COUNT=1 rllib/...
        - ./ci/keep_alive bazel test --config=ci $(./scripts/bazel_export_options) --build_tests_only --test_tag_filters=examples_C,examples_D --test_env=RAY_USE_MULTIPROCESSING_CPU_COUNT=1 rllib/...
        - ./ci/keep_alive bazel test --config=ci $(./scripts/bazel_export_options) --build_tests_only --test_tag_filters=examples_E,examples_F,examples_G,examples_H,examples_I,examples_J,examples_K,examples_L,examples_M,examples_N,examples_O,examples_P --test_env=RAY_USE_MULTIPROCESSING_CPU_COUNT=1  rllib/...
        - ./ci/keep_alive bazel test --config=ci $(./scripts/bazel_export_options) --build_tests_only --test_tag_filters=examples_Q,examples_R,examples_S,examples_T,examples_U,examples_V,examples_W,examples_X,examples_Y,examples_Z --test_env=RAY_USE_MULTIPROCESSING_CPU_COUNT=1 rllib/...

    # RLlib: tests_dir: Everything in rllib/tests/ directory (A-L).
    - os: linux
      env:
        - RLLIB_TESTING=1 RLLIB_TESTS_DIR_TESTS_A_TO_L=1
        # TODO (sven): Remove this after fixing rllib tests num_cpus.
        - RAY_USE_MULTIPROCESSING_CPU_COUNT=1
        - PYTHON=3.6
        - TF_VERSION=2.1.0
        - TFP_VERSION=0.8
        - TORCH_VERSION=1.6
        - PYTHONWARNINGS=ignore
      install:
        - . ./ci/travis/ci.sh init RAY_CI_RLLIB_FULL_AFFECTED
      before_script:
        - . ./ci/travis/ci.sh build
      script:
        - ./ci/keep_alive bazel test --config=ci $(./scripts/bazel_export_options) --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,tests_dir_J,tests_dir_K,tests_dir_L --test_env=RAY_USE_MULTIPROCESSING_CPU_COUNT=1 rllib/...

    # RLlib: tests_dir: Everything in rllib/tests/ directory (M-Z).
    - os: linux
      env:
        - RLLIB_TESTING=1 RLLIB_TESTS_DIR_TESTS_M_TO_Z=1
        # TODO (sven): Remove this after fixing rllib tests num_cpus.
        - RAY_USE_MULTIPROCESSING_CPU_COUNT=1
        - PYTHON=3.6
        - TF_VERSION=2.1.0
        - TFP_VERSION=0.8
        - TORCH_VERSION=1.6
        - PYTHONWARNINGS=ignore
      install:
        - . ./ci/travis/ci.sh init RAY_CI_RLLIB_FULL_AFFECTED
      before_script:
        - . ./ci/travis/ci.sh build
      script:
        - ./ci/keep_alive bazel test --config=ci $(./scripts/bazel_export_options) --build_tests_only --test_tag_filters=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 --test_env=RAY_USE_MULTIPROCESSING_CPU_COUNT=1 rllib/...


    # Tune: Tests and examples.
    - os: linux
      env:
        - TUNE_TESTING=1
        - PYTHON=3.6
        - PYTHONWARNINGS=ignore
      install:
        - . ./ci/travis/ci.sh init RAY_CI_TUNE_AFFECTED
      before_script:
        - . ./ci/travis/ci.sh build
      script:
        - ./ci/keep_alive bazel test --config=ci $(./scripts/bazel_export_options) --test_tag_filters=-jenkins_only,-example python/ray/tune/...
        - ./ci/keep_alive bazel test --config=ci $(./scripts/bazel_export_options) --build_tests_only --test_tag_filters=example,-tf,-pytorch,-py37,-flaky python/ray/tune/...
        - ./ci/keep_alive bazel test --config=ci $(./scripts/bazel_export_options) --build_tests_only --test_tag_filters=tf,-pytorch,-py37,-flaky python/ray/tune/...
        - ./ci/keep_alive bazel test --config=ci $(./scripts/bazel_export_options) --build_tests_only --test_tag_filters=-tf,pytorch,-py37,-flaky python/ray/tune/...
        - ./ci/keep_alive bazel test --config=ci $(./scripts/bazel_export_options) --build_tests_only --test_tag_filters=-py37,flaky python/ray/tune/...

    # SGD: Tests and examples.
    - os: linux
      env:
        - SGD_TESTING=1
        - PYTHON=3.6
        - PYTHONWARNINGS=ignore
      install:
        - . ./ci/travis/ci.sh init RAY_CI_SGD_AFFECTED
      before_script:
        - . ./ci/travis/ci.sh build
      script:
        # No such tests at the moment:
        # - ./ci/keep_alive bazel test --config=ci $(./scripts/bazel_export_options) --build_tests_only --test_tag_filters=-tf,-pytorch,-py37 python/ray/util/sgd/...
        - ./ci/keep_alive bazel test --config=ci $(./scripts/bazel_export_options) --build_tests_only --test_tag_filters=tf,-pytorch,-py37 python/ray/util/sgd/...
        - ./ci/keep_alive bazel test --config=ci $(./scripts/bazel_export_options) --build_tests_only --test_tag_filters=-tf,pytorch,-py37 python/ray/util/sgd/...

    # Docs: Tests and examples.
    - os: linux
      env:
        - DOC_TESTING=1
        - PYTHON=3.6
        - PYTHONWARNINGS=ignore
      install:
        - . ./ci/travis/ci.sh init RAY_CI_PYTHON_AFFECTED,RAY_CI_TUNE_AFFECTED,RAY_CI_DOC_AFFECTED
      before_script:
        - . ./ci/travis/ci.sh build
      script:
        - ./ci/keep_alive bazel test --config=ci $(./scripts/bazel_export_options) --build_tests_only --test_tag_filters=-tf,-pytorch,-py37 doc/...
        - ./ci/keep_alive bazel test --config=ci $(./scripts/bazel_export_options) --build_tests_only --test_tag_filters=tf,-pytorch,-py37 doc/...
        - ./ci/keep_alive bazel test --config=ci $(./scripts/bazel_export_options) --build_tests_only --test_tag_filters=-tf,pytorch,-py37 doc/...

    # Tune/SGD: Python >= 3.7 tests and examples.
    - os: linux
      env:
        - PYTHON=3.7 TUNE_TESTING=1
        - INSTALL_HOROVOD=1
        - PYTHONWARNINGS=ignore
      install:
        - . ./ci/travis/ci.sh init RAY_CI_TUNE_AFFECTED,RAY_CI_SGD_AFFECTED
      before_script:
        - . ./ci/travis/ci.sh build
      script:
        - ./ci/keep_alive bazel test --config=ci $(./scripts/bazel_export_options) --build_tests_only --test_tag_filters=py37 python/ray/tune/...
        - ./ci/keep_alive bazel test --config=ci $(./scripts/bazel_export_options) --build_tests_only python/ray/util/xgboost/...
        - ./ci/keep_alive bazel test --config=ci $(./scripts/bazel_export_options) --build_tests_only python/ray/util/lightning_accelerators/...
        # There are no python 3.7 tests for RaySGD at the moment
        # - ./ci/keep_alive bazel test --config=ci --build_tests_only --test_tag_filters=py37 python/ray/util/sgd/...
        # - ./ci/keep_alive bazel test --config=ci --build_tests_only --test_tag_filters=py37 doc/...

    # Cpp worker test
    - os: linux
      env:
        - TESTSUITE=cpp_worker
        - PYTHON=3.6
        - PYTHONWARNINGS=ignore
      install:
        - . ./ci/travis/ci.sh init
      before_script:
        - . ./ci/travis/ci.sh build
      script:
        - . ./ci/travis/ci.sh test_cpp
script:
  # cc bazel tests (w/o RLlib)
  # NOTE: core_worker_test is out-of-date and should already covered by Python
  # tests.
  - ./ci/suppress_output bazel test --config=ci $(./scripts/bazel_export_options) --build_tests_only -- //:all -rllib/... -core_worker_test

  # ray serve tests
  - if [ $RAY_CI_SERVE_AFFECTED == "1" ]; then ./ci/keep_alive bazel test --config=ci $(./scripts/bazel_export_options) --test_tag_filters=-jenkins_only python/ray/serve/...; fi

  # ray new dashboard tests
  - if [ "$RAY_CI_DASHBOARD_AFFECTED" == "1" ]; then ./ci/keep_alive bazel test python/ray/new_dashboard/...; fi

  # bazel python tests. This should be run last to keep its logs at the end of travis logs.
  - if [ $RAY_CI_PYTHON_AFFECTED == "1" ]; then ./ci/keep_alive bazel test --test_env=CONDA_EXE --test_env=CONDA_PYTHON_EXE --test_env=CONDA_SHLVL --test_env=CONDA_PREFIX --test_env=CONDA_DEFAULT_ENV --test_env=CONDA_PROMPT_MODIFIER --config=ci $(./scripts/bazel_export_options) --test_tag_filters=-kubernetes,-jenkins_only,-medium_size_python_tests_a_to_j,-medium_size_python_tests_k_to_z python/ray/tests/...; fi
  # NO MORE TESTS BELOW, keep them above.

after_script:
  - if [ "${TRAVIS_PULL_REQUEST}" = "false" ]; then ./ci/travis/upload_build_info.sh; fi

deploy:
  - provider: s3
    edge: true # This supposedly opts in to deploy v2.
    access_key_id: AKIAU6DMUCJUFL3EX3SM
    secret_access_key:
      <KEY>
    bucket: ray-wheels
    acl: public_read
    region: us-west-2
    local_dir: .whl
    upload-dir: "$TRAVIS_BRANCH/$TRAVIS_COMMIT"
    skip_cleanup: true
    on:
      repo: ray-project/ray
      all_branches: true
      condition: ($LINUX_WHEELS = 1 && $DOCKER_BUILD_PY37=1) || $MAC_WHEELS = 1

  - provider: s3
    edge: true # This supposedly opts in to deploy v2.
    access_key_id: AKIAU6DMUCJUFL3EX3SM
    secret_access_key:
      secure: <KEY>
    bucket: ray-wheels
    acl: public_read
    region: us-west-2
    local_dir: .whl
    upload-dir: latest
    skip_cleanup: true
    on:
      branch: master
      repo: ray-project/ray
      condition: ($LINUX_WHEELS = 1 && $DOCKER_BUILD_PY37=1) || $MAC_WHEELS = 1

  - provider: script
    edge: true # This supposedly opts in to deploy v2.
    script: export PATH="$HOME/miniconda3/bin:$PATH"; ./ci/keep_alive python $TRAVIS_BUILD_DIR/ci/travis/build-docker-images.py --py-versions PY37 --build-type MERGE --build-base
    skip_cleanup: true
    on:
      repo: ray-project/ray
      all_branches: true
      condition: $LINUX_WHEELS = 1 && $DOCKER_BUILD_PY37 = 1

  # Upload jars so that we can debug locally for every commit
  - provider: s3
    edge: true # This supposedly opts in to deploy v2.
    access_key_id: AKIAU6DMUCJUFL3EX3SM
    secret_access_key:
      secure: <KEY>
    bucket: ray-wheels
    acl: public_read
    region: us-west-2
    local_dir: .jar
    upload-dir: "jars/$TRAVIS_BRANCH/$TRAVIS_COMMIT"
    skip_cleanup: true
    on:
      repo: ray-project/ray
      all_branches: true
      condition: $MULTIPLATFORM_JARS = 1 || $MAC_JARS = 1 || $LINUX_JARS = 1

  - provider: s3
    edge: true # This supposedly opts in to deploy v2.
    access_key_id: AKIAU6DMUCJUFL3EX3SM
    secret_access_key:
      secure: <KEY>
    bucket: ray-wheels
    acl: public_read
    region: us-west-2
    local_dir: .jar
    upload-dir: "jars/latest"
    skip_cleanup: true
    on:
      repo: ray-project/ray
      branch: master
      condition: $MULTIPLATFORM_JARS = 1 || $MAC_JARS = 1 || $LINUX_JARS = 1

  - provider: script
    edge: true # This supposedly opts in to deploy v2.
    script: export PATH="$HOME/miniconda3/bin:$PATH"; ./ci/keep_alive python $TRAVIS_BUILD_DIR/ci/travis/build-docker-images.py --py-versions PY36 PY38 --build-type MERGE --build-base
    skip_cleanup: true
    on:
      repo: ray-project/ray
      all_branches: true
      condition: $LINUX_WHEELS = 1 && $DOCKER_BUILD_PY36_38 = 1
<commit_msg>fix install jdk8 on mac (#14725)<commit_after>language: generic
# Use Ubuntu 18.04
dist: bionic

git:
  clone: false  # Clone manually to work around Travis issues like https://github.com/travis-ci/travis-ci/issues/6337
  depth: false  # Shallow clones can prevent diff against base branch
  quiet: true

branches:
  except:
    - /dependabot.*/

before_install:
  - unset -f cd  # Travis defines this on Mac for RVM, but it breaks the Mac build
  - |
    git clone -q -n "https://github.com/${TRAVIS_REPO_SLUG}.git" "${TRAVIS_REPO_SLUG}"
    cd -- "${TRAVIS_REPO_SLUG}"
    to_fetch=("${TRAVIS_COMMIT}")
    if [ false != "${TRAVIS_PULL_REQUEST-}" ]; then to_fetch+=("+refs/pull/${TRAVIS_PULL_REQUEST}/merge:"); fi
    git fetch -q -- origin "${to_fetch[@]}"
    git checkout -qf "${TRAVIS_COMMIT}" --
    python -u ci/remote-watch.py --skip_repo=ray-project/ray &

matrix:
  include:
    - os: linux
      env:
        - PYTHON=3.6 SMALL_AND_LARGE_TESTS=1
        - PYTHONWARNINGS=ignore
        - RAY_DEFAULT_BUILD=1
        - RAY_CYTHON_EXAMPLES=1
        - RAY_USE_RANDOM_PORTS=1
      install:
        - . ./ci/travis/ci.sh init RAY_CI_SERVE_AFFECTED,RAY_CI_TUNE_AFFECTED,RAY_CI_PYTHON_AFFECTED,RAY_CI_DASHBOARD_AFFECTED
      before_script:
        - . ./ci/travis/ci.sh build

    - os: linux
      env:
        - PYTHON=3.6 MEDIUM_TESTS_A_TO_J=1
        - PYTHONWARNINGS=ignore
        - RAY_DEFAULT_BUILD=1
        - RAY_CYTHON_EXAMPLES=1
        - RAY_USE_RANDOM_PORTS=1
      install:
        - . ./ci/travis/ci.sh init RAY_CI_SERVE_AFFECTED,RAY_CI_TUNE_AFFECTED,RAY_CI_PYTHON_AFFECTED,RAY_CI_DASHBOARD_AFFECTED
      before_script:
        - . ./ci/travis/ci.sh build
      script:
        # bazel python tests for medium size tests. Used for parallelization.
        - if [ $RAY_CI_PYTHON_AFFECTED == "1" ]; then ./ci/keep_alive bazel test --config=ci $(./scripts/bazel_export_options) --test_tag_filters=-kubernetes,-jenkins_only,medium_size_python_tests_a_to_j python/ray/tests/...; fi
        - if [ $RAY_CI_PYTHON_AFFECTED == "1" ]; then ./ci/keep_alive bazel test --config=ci $(./scripts/bazel_export_options) --test_tag_filters=-kubernetes,-jenkins_only,client_tests --test_env=RAY_CLIENT_MODE=1 python/ray/tests/...; fi

    - os: linux
      env:
        - PYTHON=3.6 MEDIUM_TESTS_K_TO_Z=1
        - PYTHONWARNINGS=ignore
        - RAY_DEFAULT_BUILD=1
        - RAY_CYTHON_EXAMPLES=1
        - RAY_USE_RANDOM_PORTS=1
      install:
        - . ./ci/travis/ci.sh init RAY_CI_SERVE_AFFECTED,RAY_CI_TUNE_AFFECTED,RAY_CI_PYTHON_AFFECTED,RAY_CI_DASHBOARD_AFFECTED
      before_script:
        - . ./ci/travis/ci.sh build
      script:
        # bazel python tests for medium size tests. Used for parallelization.
        - if [ $RAY_CI_PYTHON_AFFECTED == "1" ]; then ./ci/keep_alive bazel test --config=ci $(./scripts/bazel_export_options) --test_tag_filters=-kubernetes,-jenkins_only,medium_size_python_tests_k_to_z python/ray/tests/...; fi

    - os: linux
      env:
        - PYTHON=3.6 BAZEL_CONFIG="asan"
        - PYTHONWARNINGS=ignore
        - RAY_DEFAULT_BUILD=1
      install:
        - . ./ci/travis/ci.sh init
      before_script:
        - . ./ci/travis/ci.sh build
      script:
        # Run all C++ unit tests with ASAN enabled. ASAN adds too much overhead to run Python tests.
        # NOTE: core_worker_test is out-of-date and should already covered by
        # Python tests.
        - bazel test --config=ci $(./scripts/bazel_export_options) --build_tests_only -- //:all -core_worker_test

    - os: osx
      osx_image: xcode7
      env:
        - PYTHON=3.6 SMALL_AND_LARGE_TESTS=1
        - PYTHONWARNINGS=ignore
        - RAY_DEFAULT_BUILD=1
        - RAY_CYTHON_EXAMPLES=1
        - RAY_USE_RANDOM_PORTS=1
      install:
        - . ./ci/travis/ci.sh init RAY_CI_SERVE_AFFECTED,RAY_CI_TUNE_AFFECTED,RAY_CI_PYTHON_AFFECTED,RAY_CI_DASHBOARD_AFFECTED
      before_script:
        - . ./ci/travis/ci.sh build

    - os: osx
      osx_image: xcode7
      env:
        - PYTHON=3.6 MEDIUM_TESTS_A_TO_J=1
        - PYTHONWARNINGS=ignore
        - RAY_DEFAULT_BUILD=1
        - RAY_CYTHON_EXAMPLES=1
        - RAY_USE_RANDOM_PORTS=1
      install:
        - . ./ci/travis/ci.sh init RAY_CI_SERVE_AFFECTED,RAY_CI_TUNE_AFFECTED,RAY_CI_PYTHON_AFFECTED,RAY_CI_DASHBOARD_AFFECTED
      before_script:
        - . ./ci/travis/ci.sh build
      script:
        # bazel python tests for medium size tests. Used for parallelization.
        - if [ $RAY_CI_PYTHON_AFFECTED == "1" ]; then ./ci/keep_alive bazel test --config=ci $(./scripts/bazel_export_options) --test_tag_filters=-kubernetes,-jenkins_only,medium_size_python_tests_a_to_j python/ray/tests/...; fi

    - os: osx
      osx_image: xcode7
      env:
        - PYTHON=3.6 MEDIUM_TESTS_K_TO_Z=1
        - PYTHONWARNINGS=ignore
        - RAY_DEFAULT_BUILD=1
        - RAY_CYTHON_EXAMPLES=1
        - RAY_USE_RANDOM_PORTS=1
      install:
        - . ./ci/travis/ci.sh init RAY_CI_SERVE_AFFECTED,RAY_CI_TUNE_AFFECTED,RAY_CI_PYTHON_AFFECTED,RAY_CI_DASHBOARD_AFFECTED
      before_script:
        - . ./ci/travis/ci.sh build
      script:
        # bazel python tests for medium size tests. Used for parallelization.
        - if [ $RAY_CI_PYTHON_AFFECTED == "1" ]; then ./ci/keep_alive bazel test --config=ci $(./scripts/bazel_export_options) --test_tag_filters=-kubernetes,-jenkins_only,medium_size_python_tests_k_to_z python/ray/tests/...; fi

    - os: linux
      env:
        - JAVA_TESTS=1
        - PYTHON=3.6 PYTHONWARNINGS=ignore
        - RAY_INSTALL_JAVA=1
      language: java
      jdk: openjdk8
      install:
        - . ./ci/travis/ci.sh init RAY_CI_JAVA_AFFECTED
      before_script:
        - . ./ci/travis/ci.sh build
      script:
        - ./java/test.sh

    - os: linux
      env:
        - STREAMING_TESTS=1
        - RAY_INSTALL_JAVA=1
        - PYTHON=3.6 PYTHONWARNINGS=ignore
        - RAY_USE_RANDOM_PORTS=1
        - RAY_ENABLE_NEW_SCHEDULER=0
      language: java
      jdk: openjdk8
      install:
        - . ./ci/travis/ci.sh init RAY_CI_STREAMING_PYTHON_AFFECTED,RAY_CI_STREAMING_JAVA_AFFECTED
      before_script:
        - . ./ci/travis/ci.sh build
      script:
        # Streaming cpp test.
        - if [ $RAY_CI_STREAMING_CPP_AFFECTED == "1" ]; then bazel test --config=ci $(./scripts/bazel_export_options) --test_output=all //streaming:all && bash streaming/src/test/run_streaming_queue_test.sh; fi
        # BROKEN
        # - if [ $RAY_CI_STREAMING_PYTHON_AFFECTED == "1" ]; then python -m pytest -v --durations=5 --timeout=300 streaming/python/tests/; fi
        # - if [ $RAY_CI_STREAMING_JAVA_AFFECTED == "1" ]; then ./streaming/java/test.sh; fi

    - os: linux
      env:
        - LINT=1
        - PYTHONWARNINGS=ignore
      install:
        - . ./ci/travis/ci.sh init
      before_script:
        - . ./ci/travis/ci.sh lint
        - . ./ci/travis/ci.sh build
      script:
        - sleep 30  # we still need this block to exist, otherwise it will fall back to the global one

    # Build MacOS wheels and MacOS jars
    - os: osx
      osx_image: xcode7
      env:
        - MAC_WHEELS=1 MAC_JARS=1
        - PYTHONWARNINGS=ignore
        - RAY_INSTALL_JAVA=1
      install:
        - . ./ci/travis/ci.sh init RAY_CI_MACOS_WHEELS_AFFECTED,RAY_CI_JAVA_AFFECTED,RAY_CI_STREAMING_JAVA_AFFECTED
      before_script:
        - ./ci/keep_alive brew remove --force java & brew uninstall --force java & rm -rf /usr/local/Homebrew/Library/Taps/homebrew/homebrew-cask
        - ./ci/keep_alive brew install --cask adoptopenjdk/openjdk/adoptopenjdk8
        - export JAVA_HOME=/Library/Java/JavaVirtualMachines/adoptopenjdk-8.jdk/Contents/Home
        - java -version
        - ./ci/keep_alive bash ./ci/travis/ci.sh build
      script:
        - . ./ci/travis/ci.sh test_wheels
        - bash ./java/build-jar-multiplatform.sh darwin

    # Build Linux wheels and jars.
    - os: linux
      env:
        # - PYTHON=3.6
        - LINUX_WHEELS=1 LINUX_JARS=1
        - DOCKER_BUILD_PY37=1
        - PYTHONWARNINGS=ignore
        - RAY_INSTALL_JAVA=1
      language: java
      jdk: openjdk8
      install:
        - . ./ci/travis/ci.sh init RAY_CI_LINUX_WHEELS_AFFECTED,RAY_CI_JAVA_AFFECTED,RAY_CI_STREAMING_JAVA_AFFECTED
      before_script:
        - . ./ci/travis/ci.sh build
      script:
        - . ./ci/travis/ci.sh test_wheels
        - export PATH="$HOME/miniconda3/bin:$PATH"
        - python -m pip install docker
        - if [[ "$TRAVIS_PULL_REQUEST" != "false" ]]; then python $TRAVIS_BUILD_DIR/ci/travis/build-docker-images.py --py-versions PY37 --build-type PR --build-base; fi
        - bash ./java/build-jar-multiplatform.sh linux
      cache: false


    # Build Py36 & Py38 Docker Images
    - os: linux
      env:
        - LINUX_WHEELS=1
        - DOCKER_BUILD_PY36_38=1
        - PYTHONWARNINGS=ignore
      language: java
      jdk: openjdk8
      install:
        - . ./ci/travis/ci.sh init RAY_CI_LINUX_WHEELS_AFFECTED
      before_script:
        - . ./ci/travis/ci.sh build
      script:
        - wget --quiet "https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh" -O miniconda3.sh
        - bash miniconda3.sh -b -p "$HOME/miniconda3"
        - export PATH="$HOME/miniconda3/bin:$PATH"
        - conda install -y python=3.7.6
        - python -m pip install docker
        - if [[ "$TRAVIS_PULL_REQUEST" != "false" ]]; then python $TRAVIS_BUILD_DIR/ci/travis/build-docker-images.py --py-versions PY36 PY38 --build-type PR --build-base; fi
      cache: false

    # Build and deploy multi-platform jars.
    - os: linux
      env:
        - MULTIPLATFORM_JARS=1
        - PYTHONWARNINGS=ignore
        - RAY_INSTALL_JAVA=1
        - secure: "<KEY>
        - secure: "<KEY>HIDlzlcOMAxNNRMuT6+GATEvtsK8llh0qEzKShbOST54DDp1jST4w="
      language: java
      jdk: openjdk8
      install:
        - . ./ci/travis/ci.sh init RAY_CI_JAVA_AFFECTED,RAY_CI_STREAMING_JAVA_AFFECTED
      script:
        - bash ./java/build-jar-multiplatform.sh multiplatform
        - bash ./java/build-jar-multiplatform.sh deploy
      cache: false

    # RLlib: Learning tests (from rllib/tuned_examples/*.yaml).
    - os: linux
      env:
        - RLLIB_TESTING=1 RLLIB_REGRESSION_TESTS=1
        - TF_VERSION=2.1.0
        - TFP_VERSION=0.8
        - TORCH_VERSION=1.6
        - PYTHON=3.6
        - PYTHONWARNINGS=ignore
      install:
        - . ./ci/travis/ci.sh init RAY_CI_RLLIB_AFFECTED
      before_script:
        - . ./ci/travis/ci.sh build
      script:
        - ./ci/keep_alive bazel test --config=ci $(./scripts/bazel_export_options) --build_tests_only --test_tag_filters=learning_tests_tf rllib/...

    # RLlib: Learning tests with tf=1.x (from rllib/tuned_examples/*.yaml).
    # Requested by Edi (MS): Test all learning capabilities with tf1.x
    - os: linux
      env:
        - RLLIB_TESTING=1 RLLIB_REGRESSION_TESTS_TF1X=1
        - TF_VERSION=1.14.0
        - TFP_VERSION=0.7
        - TORCH_VERSION=1.6
        - PYTHON=3.6
        - PYTHONWARNINGS=ignore
      install:
        - . ./ci/travis/ci.sh init RAY_CI_RLLIB_FULL_AFFECTED
      before_script:
        - . ./ci/travis/ci.sh build
      script:
        - ./ci/keep_alive bazel test --config=ci $(./scripts/bazel_export_options) --build_tests_only --test_tag_filters=learning_tests_tf rllib/...

    # RLlib: Learning tests with torch (from rllib/tuned_examples/*.yaml).
    - os: linux
      env:
        - RLLIB_TESTING=1 RLLIB_REGRESSION_TESTS_TORCH=1
        - TF_VERSION=2.1.0
        - TFP_VERSION=0.8
        - TORCH_VERSION=1.6
        - PYTHON=3.6
        - PYTHONWARNINGS=ignore
      install:
        - . ./ci/travis/ci.sh init RAY_CI_RLLIB_AFFECTED
      before_script:
        - . ./ci/travis/ci.sh build
      script:
        - ./ci/keep_alive bazel test --config=ci $(./scripts/bazel_export_options) --build_tests_only --test_tag_filters=learning_tests_torch rllib/...

    # RLlib: Quick Agent train.py runs (compilation & running, no(!) learning).
    # Agent single tests (compilation, loss-funcs, etc..).
    - os: linux
      env:
        - RLLIB_TESTING=1 RLLIB_QUICK_TRAIN_AND_MISC_TESTS=1
        # TODO (sven): Remove this after fixing rllib tests num_cpus.
        - RAY_USE_MULTIPROCESSING_CPU_COUNT=1
        - PYTHON=3.6
        - TF_VERSION=2.1.0
        - TFP_VERSION=0.8
        - TORCH_VERSION=1.6
        - PYTHONWARNINGS=ignore
      install:
        - . ./ci/travis/ci.sh init RAY_CI_RLLIB_FULL_AFFECTED
      before_script:
        - . ./ci/travis/ci.sh build
      script:
        - ./ci/keep_alive bazel test --config=ci $(./scripts/bazel_export_options) --build_tests_only --test_tag_filters=quick_train --test_env=RAY_USE_MULTIPROCESSING_CPU_COUNT=1 rllib/...
        # Test everything that does not have any of the "main" labels:
        # "learning_tests|quick_train|examples|tests_dir".
        - ./ci/keep_alive bazel test --config=ci $(./scripts/bazel_export_options) --build_tests_only --test_tag_filters=-learning_tests_tf,-learning_tests_torch,-quick_train,-examples,-tests_dir --test_env=RAY_USE_MULTIPROCESSING_CPU_COUNT=1 rllib/...

    # RLlib: Everything in rllib/examples/ directory.
    - os: linux
      env:
        - RLLIB_TESTING=1 RLLIB_EXAMPLE_DIR_TESTS=1
        # TODO (sven): Remove this after fixing rllib tests num_cpus.
        - RAY_USE_MULTIPROCESSING_CPU_COUNT=1
        - PYTHON=3.6
        - TF_VERSION=2.1.0
        - TFP_VERSION=0.8
        - TORCH_VERSION=1.6
        - PYTHONWARNINGS=ignore
      install:
        - . ./ci/travis/ci.sh init RAY_CI_RLLIB_FULL_AFFECTED
      before_script:
        - . ./ci/travis/ci.sh build
      script:
        - ./ci/keep_alive bazel test --config=ci $(./scripts/bazel_export_options) --build_tests_only --test_tag_filters=examples_A,examples_B --test_env=RAY_USE_MULTIPROCESSING_CPU_COUNT=1 rllib/...
        - ./ci/keep_alive bazel test --config=ci $(./scripts/bazel_export_options) --build_tests_only --test_tag_filters=examples_C,examples_D --test_env=RAY_USE_MULTIPROCESSING_CPU_COUNT=1 rllib/...
        - ./ci/keep_alive bazel test --config=ci $(./scripts/bazel_export_options) --build_tests_only --test_tag_filters=examples_E,examples_F,examples_G,examples_H,examples_I,examples_J,examples_K,examples_L,examples_M,examples_N,examples_O,examples_P --test_env=RAY_USE_MULTIPROCESSING_CPU_COUNT=1  rllib/...
        - ./ci/keep_alive bazel test --config=ci $(./scripts/bazel_export_options) --build_tests_only --test_tag_filters=examples_Q,examples_R,examples_S,examples_T,examples_U,examples_V,examples_W,examples_X,examples_Y,examples_Z --test_env=RAY_USE_MULTIPROCESSING_CPU_COUNT=1 rllib/...

    # RLlib: tests_dir: Everything in rllib/tests/ directory (A-L).
    - os: linux
      env:
        - RLLIB_TESTING=1 RLLIB_TESTS_DIR_TESTS_A_TO_L=1
        # TODO (sven): Remove this after fixing rllib tests num_cpus.
        - RAY_USE_MULTIPROCESSING_CPU_COUNT=1
        - PYTHON=3.6
        - TF_VERSION=2.1.0
        - TFP_VERSION=0.8
        - TORCH_VERSION=1.6
        - PYTHONWARNINGS=ignore
      install:
        - . ./ci/travis/ci.sh init RAY_CI_RLLIB_FULL_AFFECTED
      before_script:
        - . ./ci/travis/ci.sh build
      script:
        - ./ci/keep_alive bazel test --config=ci $(./scripts/bazel_export_options) --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,tests_dir_J,tests_dir_K,tests_dir_L --test_env=RAY_USE_MULTIPROCESSING_CPU_COUNT=1 rllib/...

    # RLlib: tests_dir: Everything in rllib/tests/ directory (M-Z).
    - os: linux
      env:
        - RLLIB_TESTING=1 RLLIB_TESTS_DIR_TESTS_M_TO_Z=1
        # TODO (sven): Remove this after fixing rllib tests num_cpus.
        - RAY_USE_MULTIPROCESSING_CPU_COUNT=1
        - PYTHON=3.6
        - TF_VERSION=2.1.0
        - TFP_VERSION=0.8
        - TORCH_VERSION=1.6
        - PYTHONWARNINGS=ignore
      install:
        - . ./ci/travis/ci.sh init RAY_CI_RLLIB_FULL_AFFECTED
      before_script:
        - . ./ci/travis/ci.sh build
      script:
        - ./ci/keep_alive bazel test --config=ci $(./scripts/bazel_export_options) --build_tests_only --test_tag_filters=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 --test_env=RAY_USE_MULTIPROCESSING_CPU_COUNT=1 rllib/...


    # Tune: Tests and examples.
    - os: linux
      env:
        - TUNE_TESTING=1
        - PYTHON=3.6
        - PYTHONWARNINGS=ignore
      install:
        - . ./ci/travis/ci.sh init RAY_CI_TUNE_AFFECTED
      before_script:
        - . ./ci/travis/ci.sh build
      script:
        - ./ci/keep_alive bazel test --config=ci $(./scripts/bazel_export_options) --test_tag_filters=-jenkins_only,-example python/ray/tune/...
        - ./ci/keep_alive bazel test --config=ci $(./scripts/bazel_export_options) --build_tests_only --test_tag_filters=example,-tf,-pytorch,-py37,-flaky python/ray/tune/...
        - ./ci/keep_alive bazel test --config=ci $(./scripts/bazel_export_options) --build_tests_only --test_tag_filters=tf,-pytorch,-py37,-flaky python/ray/tune/...
        - ./ci/keep_alive bazel test --config=ci $(./scripts/bazel_export_options) --build_tests_only --test_tag_filters=-tf,pytorch,-py37,-flaky python/ray/tune/...
        - ./ci/keep_alive bazel test --config=ci $(./scripts/bazel_export_options) --build_tests_only --test_tag_filters=-py37,flaky python/ray/tune/...

    # SGD: Tests and examples.
    - os: linux
      env:
        - SGD_TESTING=1
        - PYTHON=3.6
        - PYTHONWARNINGS=ignore
      install:
        - . ./ci/travis/ci.sh init RAY_CI_SGD_AFFECTED
      before_script:
        - . ./ci/travis/ci.sh build
      script:
        # No such tests at the moment:
        # - ./ci/keep_alive bazel test --config=ci $(./scripts/bazel_export_options) --build_tests_only --test_tag_filters=-tf,-pytorch,-py37 python/ray/util/sgd/...
        - ./ci/keep_alive bazel test --config=ci $(./scripts/bazel_export_options) --build_tests_only --test_tag_filters=tf,-pytorch,-py37 python/ray/util/sgd/...
        - ./ci/keep_alive bazel test --config=ci $(./scripts/bazel_export_options) --build_tests_only --test_tag_filters=-tf,pytorch,-py37 python/ray/util/sgd/...

    # Docs: Tests and examples.
    - os: linux
      env:
        - DOC_TESTING=1
        - PYTHON=3.6
        - PYTHONWARNINGS=ignore
      install:
        - . ./ci/travis/ci.sh init RAY_CI_PYTHON_AFFECTED,RAY_CI_TUNE_AFFECTED,RAY_CI_DOC_AFFECTED
      before_script:
        - . ./ci/travis/ci.sh build
      script:
        - ./ci/keep_alive bazel test --config=ci $(./scripts/bazel_export_options) --build_tests_only --test_tag_filters=-tf,-pytorch,-py37 doc/...
        - ./ci/keep_alive bazel test --config=ci $(./scripts/bazel_export_options) --build_tests_only --test_tag_filters=tf,-pytorch,-py37 doc/...
        - ./ci/keep_alive bazel test --config=ci $(./scripts/bazel_export_options) --build_tests_only --test_tag_filters=-tf,pytorch,-py37 doc/...

    # Tune/SGD: Python >= 3.7 tests and examples.
    - os: linux
      env:
        - PYTHON=3.7 TUNE_TESTING=1
        - INSTALL_HOROVOD=1
        - PYTHONWARNINGS=ignore
      install:
        - . ./ci/travis/ci.sh init RAY_CI_TUNE_AFFECTED,RAY_CI_SGD_AFFECTED
      before_script:
        - . ./ci/travis/ci.sh build
      script:
        - ./ci/keep_alive bazel test --config=ci $(./scripts/bazel_export_options) --build_tests_only --test_tag_filters=py37 python/ray/tune/...
        - ./ci/keep_alive bazel test --config=ci $(./scripts/bazel_export_options) --build_tests_only python/ray/util/xgboost/...
        - ./ci/keep_alive bazel test --config=ci $(./scripts/bazel_export_options) --build_tests_only python/ray/util/lightning_accelerators/...
        # There are no python 3.7 tests for RaySGD at the moment
        # - ./ci/keep_alive bazel test --config=ci --build_tests_only --test_tag_filters=py37 python/ray/util/sgd/...
        # - ./ci/keep_alive bazel test --config=ci --build_tests_only --test_tag_filters=py37 doc/...

    # Cpp worker test
    - os: linux
      env:
        - TESTSUITE=cpp_worker
        - PYTHON=3.6
        - PYTHONWARNINGS=ignore
      install:
        - . ./ci/travis/ci.sh init
      before_script:
        - . ./ci/travis/ci.sh build
      script:
        - . ./ci/travis/ci.sh test_cpp
script:
  # cc bazel tests (w/o RLlib)
  # NOTE: core_worker_test is out-of-date and should already covered by Python
  # tests.
  - ./ci/suppress_output bazel test --config=ci $(./scripts/bazel_export_options) --build_tests_only -- //:all -rllib/... -core_worker_test

  # ray serve tests
  - if [ $RAY_CI_SERVE_AFFECTED == "1" ]; then ./ci/keep_alive bazel test --config=ci $(./scripts/bazel_export_options) --test_tag_filters=-jenkins_only python/ray/serve/...; fi

  # ray new dashboard tests
  - if [ "$RAY_CI_DASHBOARD_AFFECTED" == "1" ]; then ./ci/keep_alive bazel test python/ray/new_dashboard/...; fi

  # bazel python tests. This should be run last to keep its logs at the end of travis logs.
  - if [ $RAY_CI_PYTHON_AFFECTED == "1" ]; then ./ci/keep_alive bazel test --test_env=CONDA_EXE --test_env=CONDA_PYTHON_EXE --test_env=CONDA_SHLVL --test_env=CONDA_PREFIX --test_env=CONDA_DEFAULT_ENV --test_env=CONDA_PROMPT_MODIFIER --config=ci $(./scripts/bazel_export_options) --test_tag_filters=-kubernetes,-jenkins_only,-medium_size_python_tests_a_to_j,-medium_size_python_tests_k_to_z python/ray/tests/...; fi
  # NO MORE TESTS BELOW, keep them above.

after_script:
  - if [ "${TRAVIS_PULL_REQUEST}" = "false" ]; then ./ci/travis/upload_build_info.sh; fi

deploy:
  - provider: s3
    edge: true # This supposedly opts in to deploy v2.
    access_key_id: AKIAU6DMUCJUFL3EX3SM
    secret_access_key:
      <KEY>
    bucket: ray-wheels
    acl: public_read
    region: us-west-2
    local_dir: .whl
    upload-dir: "$TRAVIS_BRANCH/$TRAVIS_COMMIT"
    skip_cleanup: true
    on:
      repo: ray-project/ray
      all_branches: true
      condition: ($LINUX_WHEELS = 1 && $DOCKER_BUILD_PY37=1) || $MAC_WHEELS = 1

  - provider: s3
    edge: true # This supposedly opts in to deploy v2.
    access_key_id: AKIAU6DMUCJUFL3EX3SM
    secret_access_key:
      secure: <KEY>
    bucket: ray-wheels
    acl: public_read
    region: us-west-2
    local_dir: .whl
    upload-dir: latest
    skip_cleanup: true
    on:
      branch: master
      repo: ray-project/ray
      condition: ($LINUX_WHEELS = 1 && $DOCKER_BUILD_PY37=1) || $MAC_WHEELS = 1

  - provider: script
    edge: true # This supposedly opts in to deploy v2.
    script: export PATH="$HOME/miniconda3/bin:$PATH"; ./ci/keep_alive python $TRAVIS_BUILD_DIR/ci/travis/build-docker-images.py --py-versions PY37 --build-type MERGE --build-base
    skip_cleanup: true
    on:
      repo: ray-project/ray
      all_branches: true
      condition: $LINUX_WHEELS = 1 && $DOCKER_BUILD_PY37 = 1

  # Upload jars so that we can debug locally for every commit
  - provider: s3
    edge: true # This supposedly opts in to deploy v2.
    access_key_id: AKIAU6DMUCJUFL3EX3SM
    secret_access_key:
      secure: <KEY>
    bucket: ray-wheels
    acl: public_read
    region: us-west-2
    local_dir: .jar
    upload-dir: "jars/$TRAVIS_BRANCH/$TRAVIS_COMMIT"
    skip_cleanup: true
    on:
      repo: ray-project/ray
      all_branches: true
      condition: $MULTIPLATFORM_JARS = 1 || $MAC_JARS = 1 || $LINUX_JARS = 1

  - provider: s3
    edge: true # This supposedly opts in to deploy v2.
    access_key_id: AKIAU6DMUCJUFL3EX3SM
    secret_access_key:
      <KEY>
    bucket: ray-wheels
    acl: public_read
    region: us-west-2
    local_dir: .jar
    upload-dir: "jars/latest"
    skip_cleanup: true
    on:
      repo: ray-project/ray
      branch: master
      condition: $MULTIPLATFORM_JARS = 1 || $MAC_JARS = 1 || $LINUX_JARS = 1

  - provider: script
    edge: true # This supposedly opts in to deploy v2.
    script: export PATH="$HOME/miniconda3/bin:$PATH"; ./ci/keep_alive python $TRAVIS_BUILD_DIR/ci/travis/build-docker-images.py --py-versions PY36 PY38 --build-type MERGE --build-base
    skip_cleanup: true
    on:
      repo: ray-project/ray
      all_branches: true
      condition: $LINUX_WHEELS = 1 && $DOCKER_BUILD_PY36_38 = 1

{'fraction_non_alphanumeric': 0.11643849759441657, 'fraction_numerical': 0.01377273947428194, 'mean_word_length': 2.462996067214873, 'pattern_counts': {'":': 0, '<': 15, '<?xml version=': 0, '>': 17, 'https://': 6, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4455722', 'n_tokens_mistral': 18910, 'n_tokens_neox': 18514, 'n_words': 3098}