From 15a4392156728b76b5c07dd232ca6557190c3bc5 Mon Sep 17 00:00:00 2001 From: Robert Nishihara Date: Mon, 12 Mar 2018 00:52:00 -0700 Subject: [PATCH] Add instructions for pip installing the latest wheel. (#1672) --- README.rst | 56 +++++---- doc/source/index.rst | 3 +- doc/source/install-on-macosx.rst | 76 ------------ doc/source/install-on-ubuntu.rst | 84 ------------- doc/source/installation.rst | 127 ++++++++++++++++++++ doc/source/using-ray-on-a-cluster.rst | 5 +- doc/source/using-ray-on-a-large-cluster.rst | 5 +- 7 files changed, 159 insertions(+), 197 deletions(-) delete mode 100644 doc/source/install-on-macosx.rst delete mode 100644 doc/source/install-on-ubuntu.rst create mode 100644 doc/source/installation.rst diff --git a/README.rst b/README.rst index a9300e841..e6604756b 100644 --- a/README.rst +++ b/README.rst @@ -11,6 +11,30 @@ Ray Ray is a flexible, high-performance distributed execution framework. + +Ray is easy to install: ``pip install ray`` + +Example Use +----------- + ++------------------------------------------------+----------------------------------------------------+ +| **Basic Python** | **Distributed with Ray** | ++------------------------------------------------+----------------------------------------------------+ +|.. code-block:: python |.. code-block:: python | +| | | +| # Execute f serially. | # Execute f in parallel. | +| | | +| | @ray.remote | +| def f(): | def f(): | +| time.sleep(1) | time.sleep(1) | +| return 1 | return 1 | +| | | +| | | +| | ray.init() | +| results = [f() for i in range(4)] | results = ray.get([f.remote() for i in range(4)]) | ++------------------------------------------------+----------------------------------------------------+ + + Ray comes with libraries that accelerate deep learning and reinforcement learning development: - `Ray Tune`_: Hyperparameter Optimization Framework @@ -19,40 +43,14 @@ Ray comes with libraries that accelerate deep learning and reinforcement learnin .. _`Ray Tune`: http://ray.readthedocs.io/en/latest/tune.html .. _`Ray RLlib`: http://ray.readthedocs.io/en/latest/rllib.html - Installation ------------ -- Ray can be installed on Linux and Mac with ``pip install ray``. -- To build Ray from source, see the instructions for `Ubuntu`_ and `Mac`_. +Ray can be installed on Linux and Mac with ``pip install ray``. -.. _`Ubuntu`: http://ray.readthedocs.io/en/latest/install-on-ubuntu.html -.. _`Mac`: http://ray.readthedocs.io/en/latest/install-on-macosx.html - - -Example Program ---------------- - -+------------------------------------------------+----------------------------------------------+ -| **Basic Python** | **Distributed with Ray** | -+------------------------------------------------+----------------------------------------------+ -|.. code:: python |.. code-block:: python | -| | | -| import time | import time | -| | import ray | -| | | -| | ray.init() | -| | | -| | @ray.remote | -| def f(): | def f(): | -| time.sleep(1) | time.sleep(1) | -| return 1 | return 1 | -| | | -| # Execute f serially. | # Execute f in parallel. | -| results = [f() for i in range(4)] | object_ids = [f.remote() for i in range(4)] | -| | results = ray.get(object_ids) | -+------------------------------------------------+----------------------------------------------+ +To build Ray from source or to install the nightly versions, see the `installation documentation`_. +.. _`installation documentation`: http://ray.readthedocs.io/en/latest/installation.html More Information ---------------- diff --git a/doc/source/index.rst b/doc/source/index.rst index ec5f30037..99c1e522b 100644 --- a/doc/source/index.rst +++ b/doc/source/index.rst @@ -51,8 +51,7 @@ Ray comes with libraries that accelerate deep learning and reinforcement learnin :maxdepth: 1 :caption: Installation - install-on-ubuntu.rst - install-on-macosx.rst + installation.rst install-on-docker.rst installation-troubleshooting.rst diff --git a/doc/source/install-on-macosx.rst b/doc/source/install-on-macosx.rst deleted file mode 100644 index 5289fc5fb..000000000 --- a/doc/source/install-on-macosx.rst +++ /dev/null @@ -1,76 +0,0 @@ -Installation on Mac OS X -======================== - -Ray should work with Python 2 and Python 3. We have tested Ray on OS X 10.11 and -10.12. - -You can install Ray as follows. - -.. code-block:: bash - - pip install ray - -Building Ray from source ------------------------- - -If you want to use the latest version of Ray, you can build it from source. - -Dependencies -~~~~~~~~~~~~ - -To build Ray, first install the following dependencies. We recommend using -`Anaconda`_. - -.. _`Anaconda`: https://www.continuum.io/downloads - -.. code-block:: bash - - brew update - brew install cmake pkg-config automake autoconf libtool openssl bison wget - - pip install cython - -If you are using Anaconda, you may also need to run the following. - -.. code-block:: bash - - conda install libgcc - - -Install Ray -~~~~~~~~~~~ - -Ray can be built from the repository as follows. - -.. code-block:: bash - - git clone https://github.com/ray-project/ray.git - cd ray/python - pip install -e . --verbose # Add --user if you see a permission denied error. - -Alternatively, Ray can be built from the repository without cloning using pip. - -.. code-block:: bash - - pip install git+https://github.com/ray-project/ray.git#subdirectory=python - -Test if the installation succeeded -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -To test if the installation was successful, try running some tests. This assumes -that you've cloned the git repository. - -.. code-block:: bash - - python test/runtest.py - -Cleaning the source tree -~~~~~~~~~~~~~~~~~~~~~~~~ - -The source tree can be cleaned by running - -.. code-block:: bash - - git clean -f -f -x -d - -in the ``ray/`` directory. diff --git a/doc/source/install-on-ubuntu.rst b/doc/source/install-on-ubuntu.rst deleted file mode 100644 index 218434cdf..000000000 --- a/doc/source/install-on-ubuntu.rst +++ /dev/null @@ -1,84 +0,0 @@ -Installation on Ubuntu -====================== - -Ray should work with Python 2 and Python 3. We have tested Ray on Ubuntu 14.04 -and Ubuntu 16.04. - -You can install Ray as follows. - -.. code-block:: bash - - pip install ray - -Building Ray from source ------------------------- - -If you want to use the latest version of Ray, you can build it from source. - -Dependencies -~~~~~~~~~~~~ - -To build Ray, first install the following dependencies. We recommend using -`Anaconda`_. - -.. _`Anaconda`: https://www.continuum.io/downloads - -.. code-block:: bash - - sudo apt-get update - sudo apt-get install -y cmake pkg-config build-essential autoconf curl libtool unzip flex bison python # we install python here because python2 is required to build the webui - - # If you are not using Anaconda, you need the following. - sudo apt-get install python-dev # For Python 2. - sudo apt-get install python3-dev # For Python 3. - - # If you are on Ubuntu 14.04, you need the following. - pip install cmake - - pip install cython - - -If you are using Anaconda, you may also need to run the following. - -.. code-block:: bash - - conda install libgcc - - -Install Ray -~~~~~~~~~~~ - -Ray can be built from the repository as follows. - -.. code-block:: bash - - git clone https://github.com/ray-project/ray.git - cd ray/python - pip install -e . --verbose # Add --user if you see a permission denied error. - -Alternatively, Ray can be built from the repository without cloning using pip. - -.. code-block:: bash - - pip install git+https://github.com/ray-project/ray.git#subdirectory=python - -Test if the installation succeeded -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -To test if the installation was successful, try running some tests. This assumes -that you've cloned the git repository. - -.. code-block:: bash - - python test/runtest.py - -Cleaning the source tree -~~~~~~~~~~~~~~~~~~~~~~~~ - -The source tree can be cleaned by running - -.. code-block:: bash - - git clean -f -f -x -d - -in the ``ray/`` directory. diff --git a/doc/source/installation.rst b/doc/source/installation.rst new file mode 100644 index 000000000..b0dc5322d --- /dev/null +++ b/doc/source/installation.rst @@ -0,0 +1,127 @@ +Installing Ray +============== + +Ray should work with Python 2 and Python 3. We have tested Ray on Ubuntu 14.04, Ubuntu 16.04, OS X 10.11 and 10.12. + +You can install Ray as follows. + +.. code-block:: bash + + pip install ray + +Trying the latest version of Ray +-------------------------------- + +Here are links to the latest wheels (which are built off of master). These versions will have newer +features but may be subject to more bugs. To install these wheels, run the following command: + +.. code-block:: bash + + pip install -U [link to wheel] + + +=================== =================== + Linux MacOS +=================== =================== +`Linux Python 3.6`_ `MacOS Python 3.6`_ +`Linux Python 3.5`_ `MacOS Python 3.5`_ +`Linux Python 3.4`_ `MacOS Python 3.4`_ +`Linux Python 3.3`_ +`Linux Python 2.7`_ `MacOS Python 2.7`_ +=================== =================== + + +.. _`Linux Python 3.6`: https://s3-us-west-2.amazonaws.com/ray-wheels/latest/ray-0.3.1-cp36-cp36m-manylinux1_x86_64.whl +.. _`Linux Python 3.5`: https://s3-us-west-2.amazonaws.com/ray-wheels/latest/ray-0.3.1-cp35-cp35m-manylinux1_x86_64.whl +.. _`Linux Python 3.4`: https://s3-us-west-2.amazonaws.com/ray-wheels/latest/ray-0.3.1-cp34-cp34m-manylinux1_x86_64.whl +.. _`Linux Python 3.3`: https://s3-us-west-2.amazonaws.com/ray-wheels/latest/ray-0.3.1-cp33-cp33m-manylinux1_x86_64.whl +.. _`Linux Python 2.7`: https://s3-us-west-2.amazonaws.com/ray-wheels/latest/ray-0.3.1-cp27-cp27mu-manylinux1_x86_64.whl +.. _`MacOS Python 3.6`: https://s3-us-west-2.amazonaws.com/ray-wheels/latest/ray-0.3.1-cp36-cp36m-macosx_10_6_intel.whl +.. _`MacOS Python 3.5`: https://s3-us-west-2.amazonaws.com/ray-wheels/latest/ray-0.3.1-cp35-cp35m-macosx_10_6_intel.whl +.. _`MacOS Python 3.4`: https://s3-us-west-2.amazonaws.com/ray-wheels/latest/ray-0.3.1-cp34-cp34m-macosx_10_6_intel.whl +.. _`MacOS Python 2.7`: https://s3-us-west-2.amazonaws.com/ray-wheels/latest/ray-0.3.1-cp27-cp27m-macosx_10_6_intel.whl + + +Building Ray from source +------------------------ + +If you want to use the latest version of Ray, you can build it from source. Below, we have instructions for installing dependencies and building from source for both Linux and MacOS. + +Dependencies +~~~~~~~~~~~~ + +To build Ray, first install the following dependencies. We recommend using +`Anaconda`_. + +.. _`Anaconda`: https://www.continuum.io/downloads + +For Ubuntu, run the following commands: + +.. code-block:: bash + + sudo apt-get update + sudo apt-get install -y cmake pkg-config build-essential autoconf curl libtool unzip flex bison python # we install python here because python2 is required to build the webui + + # If you are not using Anaconda, you need the following. + sudo apt-get install python-dev # For Python 2. + sudo apt-get install python3-dev # For Python 3. + + # If you are on Ubuntu 14.04, you need the following. + pip install cmake + + pip install cython + +For MacOS, run the following commands: + +.. code-block:: bash + + brew update + brew install cmake pkg-config automake autoconf libtool openssl bison wget + + pip install cython + + +If you are using Anaconda, you may also need to run the following. + +.. code-block:: bash + + conda install libgcc + + +Install Ray +~~~~~~~~~~~ + +Ray can be built from the repository as follows. + +.. code-block:: bash + + git clone https://github.com/ray-project/ray.git + cd ray/python + pip install -e . --verbose # Add --user if you see a permission denied error. + +Alternatively, Ray can be built from the repository without cloning using pip. + +.. code-block:: bash + + pip install git+https://github.com/ray-project/ray.git#subdirectory=python + +Test if the installation succeeded +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +To test if the installation was successful, try running some tests. This assumes +that you've cloned the git repository. + +.. code-block:: bash + + python test/runtest.py + +Cleaning the source tree +~~~~~~~~~~~~~~~~~~~~~~~~ + +The source tree can be cleaned by running + +.. code-block:: bash + + git clean -f -f -x -d + +in the ``ray/`` directory. diff --git a/doc/source/using-ray-on-a-cluster.rst b/doc/source/using-ray-on-a-cluster.rst index 7135f0c2f..e06f5ccef 100644 --- a/doc/source/using-ray-on-a-cluster.rst +++ b/doc/source/using-ray-on-a-cluster.rst @@ -15,10 +15,9 @@ Deploying Ray on a Cluster This section assumes that you have a cluster running and that the nodes in the cluster can communicate with each other. It also assumes that Ray is installed -on each machine. To install Ray, follow the instructions for -`installation on Ubuntu`_. +on each machine. To install Ray, follow the `installation instructions`_. -.. _`installation on Ubuntu`: http://ray.readthedocs.io/en/latest/install-on-ubuntu.html +.. _`installation instructions`: http://ray.readthedocs.io/en/latest/installation.html Starting Ray on each machine ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ diff --git a/doc/source/using-ray-on-a-large-cluster.rst b/doc/source/using-ray-on-a-large-cluster.rst index 1b6127ab0..805e08c67 100644 --- a/doc/source/using-ray-on-a-large-cluster.rst +++ b/doc/source/using-ray-on-a-large-cluster.rst @@ -12,8 +12,7 @@ commands and scripts on many machines simultaneously. Booting up a cluster on EC2 --------------------------- -* Create an EC2 instance running Ray following instructions for - `installation on Ubuntu`_. +* Create an EC2 instance running Ray following the `installation instructions`_. * Add any packages that you may need for running your application. * Install the pssh package: ``sudo apt-get install pssh``. @@ -23,7 +22,7 @@ Booting up a cluster on EC2 * Configure the instance security groups so that they machines can all communicate with one another. -.. _`installation on Ubuntu`: http://ray.readthedocs.io/en/latest/install-on-ubuntu.html +.. _`installation instructions`: http://ray.readthedocs.io/en/latest/installation.html .. _`Create an AMI`: http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/creating-an-ami-ebs.html Deploying Ray on a Cluster