From 96f2f8ff10e9c0f69bf8fb033c76edd6fbb95b6d Mon Sep 17 00:00:00 2001 From: Robert Nishihara Date: Fri, 27 Dec 2019 20:47:49 -0800 Subject: [PATCH] Stop testing Python 2.7 and building Python 2.7 wheels. (#6601) --- .travis.yml | 7 ----- .../run_application_stress_tests.sh | 3 +-- ci/travis/install-cython-examples.sh | 9 +------ ci/travis/install-dependencies.sh | 20 +------------- ci/travis/install-ray.sh | 8 +----- ci/travis/test-wheels.sh | 27 +++---------------- doc/source/installation.rst | 5 +--- python/build-wheel-macos.sh | 10 +++---- python/build-wheel-manylinux1.sh | 10 +------ 9 files changed, 12 insertions(+), 87 deletions(-) diff --git a/.travis.yml b/.travis.yml index a5ed2405f..345427e36 100644 --- a/.travis.yml +++ b/.travis.yml @@ -4,16 +4,9 @@ dist: xenial matrix: include: - - os: linux - env: BAZEL_PYTHON_VERSION=PY2 PYTHON=2.7 PYTHONWARNINGS=ignore - - os: linux env: BAZEL_PYTHON_VERSION=PY3 PYTHON=3.5 PYTHONWARNINGS=ignore - - os: osx - osx_image: xcode7 - env: BAZEL_PYTHON_VERSION=PY2 PYTHON=2.7 PYTHONWARNINGS=ignore - - os: osx osx_image: xcode7 env: BAZEL_PYTHON_VERSION=PY3 PYTHON=3.5 PYTHONWARNINGS=ignore diff --git a/ci/stress_tests/run_application_stress_tests.sh b/ci/stress_tests/run_application_stress_tests.sh index a1ae63bbb..5e0224218 100755 --- a/ci/stress_tests/run_application_stress_tests.sh +++ b/ci/stress_tests/run_application_stress_tests.sh @@ -7,8 +7,7 @@ # should be the latest commit on the branch "releases/". # This script runs all of the application tests. -# Currently includes an IMPALA stress test and a SGD stress test. -# on both Python 2.7 and 3.6. +# Currently includes an IMPALA stress test and a SGD stress test on Python 3.6. # All tests use a separate cluster, and each cluster # will be destroyed upon test completion (or failure). diff --git a/ci/travis/install-cython-examples.sh b/ci/travis/install-cython-examples.sh index 7f394d5bb..30886ec5e 100755 --- a/ci/travis/install-cython-examples.sh +++ b/ci/travis/install-cython-examples.sh @@ -9,14 +9,7 @@ echo "PYTHON is $PYTHON" cython_examples="$ROOT_DIR/../../doc/examples/cython" -if [[ "$PYTHON" == "2.7" ]]; then - - pushd $cython_examples - pip install --progress-bar=off scipy - python setup.py install --user - popd - -elif [[ "$PYTHON" == "3.5" ]]; then +if [[ "$PYTHON" == "3.5" ]]; then export PATH="$HOME/miniconda/bin:$PATH" pushd $cython_examples diff --git a/ci/travis/install-dependencies.sh b/ci/travis/install-dependencies.sh index 4657b42aa..e22a6fabe 100755 --- a/ci/travis/install-dependencies.sh +++ b/ci/travis/install-dependencies.sh @@ -17,17 +17,7 @@ else exit 1 fi -if [[ "$PYTHON" == "2.7" ]] && [[ "$platform" == "linux" ]]; then - sudo apt-get update - sudo apt-get install -y build-essential curl python-dev python-numpy python-pip unzip tmux gdb - # Install miniconda. - wget -q https://repo.continuum.io/miniconda/Miniconda2-4.5.4-Linux-x86_64.sh -O miniconda.sh -nv - bash miniconda.sh -b -p $HOME/miniconda - export PATH="$HOME/miniconda/bin:$PATH" - pip install -q scipy tensorflow cython==0.29.0 gym opencv-python-headless pyyaml pandas==0.24.2 requests \ - feather-format lxml openpyxl xlrd py-spy setproctitle faulthandler pytest-timeout mock networkx \ - tabulate psutil kubernetes grpcio pytest-sugar pytest-rerunfailures -elif [[ "$PYTHON" == "3.5" ]] && [[ "$platform" == "linux" ]]; then +if [[ "$PYTHON" == "3.5" ]] && [[ "$platform" == "linux" ]]; then sudo apt-get update sudo apt-get install -y python-dev python-numpy build-essential curl unzip tmux gdb # Install miniconda. @@ -38,14 +28,6 @@ elif [[ "$PYTHON" == "3.5" ]] && [[ "$platform" == "linux" ]]; then feather-format lxml openpyxl xlrd py-spy setproctitle pytest-timeout networkx tabulate psutil aiohttp \ uvicorn dataclasses pygments werkzeug kubernetes flask grpcio pytest-sugar pytest-rerunfailures pytest-asyncio \ blist -elif [[ "$PYTHON" == "2.7" ]] && [[ "$platform" == "macosx" ]]; then - # Install miniconda. - wget -q https://repo.continuum.io/miniconda/Miniconda2-4.5.4-MacOSX-x86_64.sh -O miniconda.sh -nv - bash miniconda.sh -b -p $HOME/miniconda - export PATH="$HOME/miniconda/bin:$PATH" - pip install -q cython==0.29.0 tensorflow gym opencv-python-headless pyyaml pandas==0.24.2 requests \ - feather-format lxml openpyxl xlrd py-spy setproctitle faulthandler pytest-timeout mock networkx \ - tabulate psutil kubernetes grpcio pytest-sugar pytest-rerunfailures elif [[ "$PYTHON" == "3.5" ]] && [[ "$platform" == "macosx" ]]; then # Install miniconda. wget -q https://repo.continuum.io/miniconda/Miniconda3-4.5.4-MacOSX-x86_64.sh -O miniconda.sh -nv diff --git a/ci/travis/install-ray.sh b/ci/travis/install-ray.sh index c510b5d29..34233cfa5 100755 --- a/ci/travis/install-ray.sh +++ b/ci/travis/install-ray.sh @@ -16,13 +16,7 @@ if [[ "$TRAVIS" == "true" ]]; then echo "build --jobs=50" >> $HOME/.bazelrc fi -if [[ "$PYTHON" == "2.7" ]]; then - - pushd "$ROOT_DIR/../../python" - python setup.py install --user - popd - -elif [[ "$PYTHON" == "3.5" ]]; then +if [[ "$PYTHON" == "3.5" ]]; then export PATH="$HOME/miniconda/bin:$PATH" pushd "$ROOT_DIR/../../python" diff --git a/ci/travis/test-wheels.sh b/ci/travis/test-wheels.sh index 1e22e6e7a..3314f221a 100755 --- a/ci/travis/test-wheels.sh +++ b/ci/travis/test-wheels.sh @@ -25,25 +25,6 @@ TEST_SCRIPT="$TRAVIS_BUILD_DIR/python/ray/tests/test_microbenchmarks.py" UI_TEST_SCRIPT="$TRAVIS_BUILD_DIR/python/ray/tests/test_webui.py" if [[ "$platform" == "linux" ]]; then - # First test Python 2.7. - - # Install miniconda. - wget --quiet https://repo.continuum.io/miniconda/Miniconda2-4.5.4-Linux-x86_64.sh -O miniconda2.sh - bash miniconda2.sh -b -p "$HOME/miniconda2" - - PYTHON_EXE=$HOME/miniconda2/bin/python - PIP_CMD=$HOME/miniconda2/bin/pip - - # Find the right wheel by grepping for the Python version. - PYTHON_WHEEL=$(find "$ROOT_DIR/../../.whl" -type f -maxdepth 1 -print | grep -m1 '27') - - # Install the wheel. - $PIP_CMD install -q "$PYTHON_WHEEL" - - # Run a simple test script to make sure that the wheel works. - INSTALLED_RAY_DIRECTORY=$(dirname "$($PYTHON_EXE -u -c "import ray; print(ray.__file__)" | tail -n1)") - $PYTHON_EXE "$TEST_SCRIPT" - # Now test Python 3.6. # Install miniconda. @@ -69,7 +50,7 @@ if [[ "$platform" == "linux" ]]; then # Check that the other wheels are present. NUMBER_OF_WHEELS=$(ls -1q "$ROOT_DIR"/../../.whl/*.whl | wc -l) - if [[ "$NUMBER_OF_WHEELS" != "4" ]]; then + if [[ "$NUMBER_OF_WHEELS" != "3" ]]; then echo "Wrong number of wheels found." ls -l "$ROOT_DIR/../.whl/" exit 2 @@ -77,13 +58,11 @@ if [[ "$platform" == "linux" ]]; then elif [[ "$platform" == "macosx" ]]; then MACPYTHON_PY_PREFIX=/Library/Frameworks/Python.framework/Versions - PY_MMS=("2.7" - "3.5" + PY_MMS=("3.5" "3.6" "3.7") # This array is just used to find the right wheel. - PY_WHEEL_VERSIONS=("27" - "35" + PY_WHEEL_VERSIONS=("35" "36" "37") diff --git a/doc/source/installation.rst b/doc/source/installation.rst index c58975f68..dafb3a651 100644 --- a/doc/source/installation.rst +++ b/doc/source/installation.rst @@ -1,7 +1,7 @@ Installing Ray ============== -Ray supports Python 2 and Python 3 as well as MacOS and Linux. Windows support +Ray currently supports MacOS and Linux. Windows support is planned for the future. Latest stable version @@ -30,18 +30,15 @@ master branch). To install these wheels, run the following command: `Linux Python 3.7`_ `MacOS Python 3.7`_ `Linux Python 3.6`_ `MacOS Python 3.6`_ `Linux Python 3.5`_ `MacOS Python 3.5`_ -`Linux Python 2.7`_ `MacOS Python 2.7`_ =================== =================== .. _`Linux Python 3.7`: https://s3-us-west-2.amazonaws.com/ray-wheels/latest/ray-0.9.0.dev0-cp37-cp37m-manylinux1_x86_64.whl .. _`Linux Python 3.6`: https://s3-us-west-2.amazonaws.com/ray-wheels/latest/ray-0.9.0.dev0-cp36-cp36m-manylinux1_x86_64.whl .. _`Linux Python 3.5`: https://s3-us-west-2.amazonaws.com/ray-wheels/latest/ray-0.9.0.dev0-cp35-cp35m-manylinux1_x86_64.whl -.. _`Linux Python 2.7`: https://s3-us-west-2.amazonaws.com/ray-wheels/latest/ray-0.9.0.dev0-cp27-cp27mu-manylinux1_x86_64.whl .. _`MacOS Python 3.7`: https://s3-us-west-2.amazonaws.com/ray-wheels/latest/ray-0.9.0.dev0-cp37-cp37m-macosx_10_6_intel.whl .. _`MacOS Python 3.6`: https://s3-us-west-2.amazonaws.com/ray-wheels/latest/ray-0.9.0.dev0-cp36-cp36m-macosx_10_6_intel.whl .. _`MacOS Python 3.5`: https://s3-us-west-2.amazonaws.com/ray-wheels/latest/ray-0.9.0.dev0-cp35-cp35m-macosx_10_6_intel.whl -.. _`MacOS Python 2.7`: https://s3-us-west-2.amazonaws.com/ray-wheels/latest/ray-0.9.0.dev0-cp27-cp27m-macosx_10_6_intel.whl Installing Ray with Anaconda ---------------------------- diff --git a/python/build-wheel-macos.sh b/python/build-wheel-macos.sh index 9f8a7a6dd..74e9ca79c 100755 --- a/python/build-wheel-macos.sh +++ b/python/build-wheel-macos.sh @@ -13,23 +13,19 @@ MACPYTHON_URL=https://www.python.org/ftp/python MACPYTHON_PY_PREFIX=/Library/Frameworks/Python.framework/Versions DOWNLOAD_DIR=python_downloads -PY_VERSIONS=("2.7.13" - "3.5.3" +PY_VERSIONS=("3.5.3" "3.6.1" "3.7.0") -PY_INSTS=("python-2.7.13-macosx10.6.pkg" - "python-3.5.3-macosx10.6.pkg" +PY_INSTS=("python-3.5.3-macosx10.6.pkg" "python-3.6.1-macosx10.6.pkg" "python-3.7.0-macosx10.6.pkg") -PY_MMS=("2.7" - "3.5" +PY_MMS=("3.5" "3.6" "3.7") # The minimum supported numpy version is 1.14, see # https://issues.apache.org/jira/browse/ARROW-3141 NUMPY_VERSIONS=("1.14.5" - "1.14.5" "1.14.5" "1.14.5") diff --git a/python/build-wheel-manylinux1.sh b/python/build-wheel-manylinux1.sh index d7325e15e..04aecf135 100755 --- a/python/build-wheel-manylinux1.sh +++ b/python/build-wheel-manylinux1.sh @@ -11,15 +11,13 @@ echo 10 EOF chmod +x /usr/bin/nproc -PYTHONS=("cp27-cp27mu" - "cp35-cp35m" +PYTHONS=("cp35-cp35m" "cp36-cp36m" "cp37-cp37m") # The minimum supported numpy version is 1.14, see # https://issues.apache.org/jira/browse/ARROW-3141 NUMPY_VERSIONS=("1.14.5" - "1.14.5" "1.14.5" "1.14.5") @@ -29,12 +27,6 @@ sudo apt-get install unzip # Put bazel into the PATH export PATH=$PATH:/root/bin -# Remove this old Python 2.4.3 executable, and make the "python2" command find -# a newer version of Python. We need this for autogenerating some files for the -# UI. -rm -f /usr/bin/python2 -ln -s /opt/python/cp27-cp27m/bin/python2 /usr/bin/python2 - # Install and use the latest version of Node.js in order to build the dashboard. curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.34.0/install.sh | bash source $HOME/.nvm/nvm.sh