Skip to content

Commit

Permalink
[Core] [runtime env] Fix get_wheel_filename being out of date (#39965)
Browse files Browse the repository at this point in the history
The get_wheel_filename method was not returning the proper filename of the current wheels.
This pr fixes this issue

Related issue number
Fixes #39842

---------

Signed-off-by: lejara <[email protected]>
Signed-off-by: Archit Kulkarni <[email protected]>
Co-authored-by: Archit Kulkarni <[email protected]>
Co-authored-by: angelinalg <[email protected]>
  • Loading branch information
3 people committed Oct 18, 2023
1 parent d80fd1d commit b60c172
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 24 deletions.
2 changes: 2 additions & 0 deletions doc/source/ray-overview/installation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,8 @@ You can install the nightly Ray wheels via the following links. These daily rele

.. note::

.. If you change the list of wheel links below, remember to update `get_wheel_filename()` in `https://github.com/ray-project/ray/blob/master/python/ray/_private/utils.py`.
Python 3.11 support is experimental.

.. _`Linux Python 3.11 (x86_64) (EXPERIMENTAL)`: https://s3-us-west-2.amazonaws.com/ray-wheels/latest/ray-3.0.0.dev0-cp311-cp311-manylinux2014_x86_64.whl
Expand Down
9 changes: 5 additions & 4 deletions python/ray/_private/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -1216,13 +1216,14 @@ def get_wheel_filename(
assert py_version in ray_constants.RUNTIME_ENV_CONDA_PY_VERSIONS, py_version

py_version_str = "".join(map(str, py_version))
if py_version_str in ["37", "38", "39"]:
darwin_os_string = "macosx_10_15_x86_64"
else:
darwin_os_string = "macosx_10_15_universal2"

architecture = architecture or platform.processor()

if py_version_str in ["311", "310", "39", "38"] and architecture == "arm64":
darwin_os_string = "macosx_11_0_arm64"
else:
darwin_os_string = "macosx_10_15_x86_64"

if architecture == "aarch64":
linux_os_string = "manylinux2014_aarch64"
else:
Expand Down
31 changes: 11 additions & 20 deletions python/ray/tests/test_runtime_env.py
Original file line number Diff line number Diff line change
Expand Up @@ -112,16 +112,15 @@ def test_get_wheel_filename():
"""Test the code that generates the filenames of the `latest` wheels."""
# NOTE: These should not be changed for releases.
ray_version = "3.0.0.dev0"
for sys_platform in ["darwin", "linux", "win32"]:
for py_version in ray_constants.RUNTIME_ENV_CONDA_PY_VERSIONS:
# TODO(https://github.com/ray-project/ray/issues/31362)
if py_version == (3, 11) and sys_platform != "linux":
continue

filename = get_wheel_filename(sys_platform, ray_version, py_version)
prefix = "https://s3-us-west-2.amazonaws.com/ray-wheels/latest/"
url = f"{prefix}{filename}"
assert requests.head(url).status_code == 200, url
for arch in ["x86_64", "aarch64", "arm64"]:
for sys_platform in ["darwin", "linux", "win32"]:
for py_version in ray_constants.RUNTIME_ENV_CONDA_PY_VERSIONS:
filename = get_wheel_filename(
sys_platform, ray_version, py_version, arch
)
prefix = "https://s3-us-west-2.amazonaws.com/ray-wheels/latest/"
url = f"{prefix}{filename}"
assert requests.head(url).status_code == 200, url


def test_get_master_wheel_url():
Expand All @@ -131,13 +130,9 @@ def test_get_master_wheel_url():
# This should be a commit for which wheels have already been built for
# all platforms and python versions at
# `s3:https://ray-wheels/master/<test_commit>/`.
test_commit = "cf23cd6810dbfd7b1ac3016fba02ff4594f24b7f"
test_commit = "0910639b6eba1b77b9a36b9f3350c5aa274578dd"
for sys_platform in ["darwin", "linux", "win32"]:
for py_version in ray_constants.RUNTIME_ENV_CONDA_PY_VERSIONS:
# TODO(https://github.com/ray-project/ray/issues/31362)
if py_version == (3, 11) and sys_platform != "linux":
continue

url = get_master_wheel_url(
test_commit, sys_platform, ray_version, py_version
)
Expand All @@ -149,14 +144,10 @@ def test_get_release_wheel_url():
# This should be a commit for which wheels have already been built for
# all platforms and python versions at
# `s3:https://ray-wheels/releases/2.2.0/<commit>/`.
test_commits = {"2.5.0": "ddf0ccab7aa87be5cf6cf7df9d6e24a3611fb345"}
test_commits = {"2.7.0": "904dbce085bc542b93fbe06d75f3b02a65d3a2b4"}
for sys_platform in ["darwin", "linux", "win32"]:
for py_version in ray_constants.RUNTIME_ENV_CONDA_PY_VERSIONS:
for version, commit in test_commits.items():
# TODO(https://github.com/ray-project/ray/issues/31362)
if py_version == (3, 11) and sys_platform != "linux":
continue

url = get_release_wheel_url(commit, sys_platform, version, py_version)
assert requests.head(url).status_code == 200, url

Expand Down

0 comments on commit b60c172

Please sign in to comment.