diff --git a/doc/source/installation.rst b/doc/source/installation.rst index 7473918da..dc80e3579 100644 --- a/doc/source/installation.rst +++ b/doc/source/installation.rst @@ -22,7 +22,17 @@ You can install the latest stable version of Ray as follows. Latest Snapshots (Nightlies) ---------------------------- -Here are links to the latest wheels (which are built for each commit on the +You can install the latest Ray wheels via the following command: + +.. code-block:: bash + + pip install -U ray + ray install-nightly + + +.. note:: ``ray install-nightly`` may not capture updated library dependencies. After running ``ray install-nightly``, consider running ``pip install ray[]`` *without upgrading (via -U)* to update dependencies. + +Alternatively, here are the links to the latest wheels (which are built for each commit on the master branch). To install these wheels, use the following ``pip`` command and wheels instead of the ones above: diff --git a/python/ray/nightly-wheels.yaml b/python/ray/nightly-wheels.yaml new file mode 100644 index 000000000..3bc9d1a06 --- /dev/null +++ b/python/ray/nightly-wheels.yaml @@ -0,0 +1,14 @@ +linux: + "3.8": https://s3-us-west-2.amazonaws.com/ray-wheels/latest/ray-0.9.0.dev0-cp38-cp38-manylinux1_x86_64.whl + "3.7": https://s3-us-west-2.amazonaws.com/ray-wheels/latest/ray-0.9.0.dev0-cp37-cp37m-manylinux1_x86_64.whl + "3.6": https://s3-us-west-2.amazonaws.com/ray-wheels/latest/ray-0.9.0.dev0-cp36-cp36m-manylinux1_x86_64.whl + +darwin: + "3.8": https://s3-us-west-2.amazonaws.com/ray-wheels/latest/ray-0.9.0.dev0-cp38-cp38-macosx_10_13_x86_64.whl + "3.7": https://s3-us-west-2.amazonaws.com/ray-wheels/latest/ray-0.9.0.dev0-cp37-cp37m-macosx_10_13_intel.whl + "3.6": https://s3-us-west-2.amazonaws.com/ray-wheels/latest/ray-0.9.0.dev0-cp36-cp36m-macosx_10_13_intel.whl + +win32: + "3.8": https://s3-us-west-2.amazonaws.com/ray-wheels/latest/ray-0.9.0.dev0-cp38-cp38-win_amd64.whl + "3.7": https://s3-us-west-2.amazonaws.com/ray-wheels/latest/ray-0.9.0.dev0-cp37-cp37m-win_amd64.whl + "3.6": https://s3-us-west-2.amazonaws.com/ray-wheels/latest/ray-0.9.0.dev0-cp36-cp36m-win_amd64.whl diff --git a/python/ray/scripts/scripts.py b/python/ray/scripts/scripts.py index ad86a4bf4..082fbc360 100644 --- a/python/ray/scripts/scripts.py +++ b/python/ray/scripts/scripts.py @@ -9,6 +9,7 @@ import sys import time import urllib import urllib.parse +import yaml import ray import psutil @@ -1487,6 +1488,60 @@ def globalgc(address): print("Triggered gc.collect() on all workers.") +@cli.command() +@click.option("-v", "--verbose", is_flag=True) +@click.option( + "--dryrun", + is_flag=True, + help="Identifies the wheel but does not execute the installation.") +def install_nightly(verbose, dryrun): + """Install the latest wheels for Ray. + + This uses the same python environment as the one that Ray is currently + installed in. Make sure that there is no Ray processes on this + machine (ray stop) when running this command. + """ + raydir = os.path.abspath(os.path.dirname(ray.__file__)) + all_wheels_path = os.path.join(raydir, "nightly-wheels.yaml") + + wheels = None + if os.path.exists(all_wheels_path): + with open(all_wheels_path) as f: + wheels = yaml.safe_load(f) + + if not wheels: + raise click.ClickException( + f"Wheels not found in '{all_wheels_path}'! " + "Please visit https://docs.ray.io/en/master/installation.html to " + "obtain the latest wheels.") + + platform = sys.platform + py_version = "{0}.{1}".format(*sys.version_info[:2]) + + matching_wheel = None + for target_platform, wheel_map in wheels.items(): + if verbose: + print(f"Evaluating os={target_platform}, python={list(wheel_map)}") + if platform.startswith(target_platform): + if py_version in wheel_map: + matching_wheel = wheel_map[py_version] + break + if verbose: + print("Not matched.") + + if matching_wheel is None: + raise click.ClickException( + "Unable to identify a matching platform. " + "Please visit https://docs.ray.io/en/master/installation.html to " + "obtain the latest wheels.") + if dryrun: + print(f"Found wheel: {matching_wheel}") + else: + cmd = [sys.executable, "-m", "pip", "install", "-U", matching_wheel] + print(f"Running: {' '.join(cmd)}.") + subprocess.check_call(cmd) + + def add_command_alias(command, name, hidden): new_command = copy.deepcopy(command) new_command.hidden = hidden @@ -1518,6 +1573,7 @@ cli.add_command(globalgc) cli.add_command(timeline) cli.add_command(project_cli) cli.add_command(session_cli) +cli.add_command(install_nightly) try: from ray.serve.scripts import serve_cli diff --git a/python/setup.py b/python/setup.py index 64623177b..f1a8172f6 100644 --- a/python/setup.py +++ b/python/setup.py @@ -68,7 +68,7 @@ generated_python_directories = [ "ray/streaming/generated", ] -optional_ray_files = [] +optional_ray_files = ["ray/nightly-wheels.yaml"] ray_autoscaler_files = [ "ray/autoscaler/aws/example-full.yaml",