Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[runtime env] Support python 3.10 for runtime_env conda #30970

Merged
merged 6 commits into from
Dec 19, 2022

Conversation

architkulkarni
Copy link
Contributor

Signed-off-by: Archit Kulkarni architkulkarni@users.noreply.github.com

Why are these changes needed?

conda environments are isolated, so when runtime_env sets up a conda environment it must download the Ray wheel into the conda environment. It must download the wheel that matches the current Python and Ray version running, otherwise there will be incompatibility issues between the workers that use this runtime_env and the other workers and Ray processes.

This PR updates the wheel name format logic to support Python 3.10.

Related issue number

Closes #30929

Checks

  • I've signed off every commit(by using the -s flag, i.e., git commit -s) in this PR.
  • I've run scripts/format.sh to lint the changes in this PR.
  • I've included any doc changes needed for https://docs.ray.io/en/master/.
  • I've made sure the tests are passing. Note that there might be a few flaky tests, see the recent failures at https://flakey-tests.ray.io/
  • Testing Strategy
    • Unit tests
    • Release tests
    • This PR is not tested :(

Signed-off-by: Archit Kulkarni <architkulkarni@users.noreply.github.com>
Signed-off-by: Archit Kulkarni <architkulkarni@users.noreply.github.com>
@architkulkarni
Copy link
Contributor Author

@scv119 If there is a "release process" for new Python versions, could this PR be linked there and added as a step?

We could make this more futureproof by removing the assert py_version in ["36", "37", "38", "39", ...], but it would just delay the eventual breakage whenever the wheel name format changes, and we'd still need to manually update the tests.

Copy link
Contributor

@edoakes edoakes left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@architkulkarni is there a way we can fail very loudly when Ray runs a new python version but it isn't supported in this enum? At a minimum we can add a small CI test (just check current py version vs. this map)

@edoakes
Copy link
Contributor

edoakes commented Dec 8, 2022

Or maybe the existing test is good enough... just checking we catch this as early as possible

Signed-off-by: Archit Kulkarni <architkulkarni@users.noreply.github.com>
@architkulkarni
Copy link
Contributor Author

@edoakes Good point, the existing tests will just pass even if a new version is added.

I added a constant SUPPORTED_PY_VERSIONS and a unit test to check the current py version against it to make sure the constant stays updated.

Unfortunately, there's still no way to auto-update the test_get_*_wheel CI tests because of a chicken and egg situation. The test needs wheels to be uploaded to AWS in the standard location, but the wheels get uploaded there only after the PR is merged. It's probably not too bad to have a manual process here because new python versions only come once a year.

elif py_version_str in ["38", "39"]:
darwin_os_string = "macosx_10_15_x86_64"
else:
darwin_os_string = "macosx_10_15_universal2"
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

New OS string just dropped.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lol

Signed-off-by: Archit Kulkarni <architkulkarni@users.noreply.github.com>
@architkulkarni
Copy link
Contributor Author

test_huggingface was broken on master, unrelated
rllbi test_memory_leak was flaky on master, unrelated

@architkulkarni architkulkarni added the tests-ok The tagger certifies test failures are unrelated and assumes personal liability. label Dec 10, 2022
@architkulkarni
Copy link
Contributor Author

@scv119 @edoakes Any other comments on this PR?

Copy link
Contributor

@rkooo567 rkooo567 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

minor comments

@@ -1304,7 +1308,7 @@ def get_release_wheel_url(
ray_commit: str = ray.__commit__,
sys_platform: str = sys.platform,
ray_version: str = ray.__version__,
py_version: str = f"{sys.version_info.major}{sys.version_info.minor}",
py_version: Tuple[int, int] = sys.version_info[:2],
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why do we fix this? The previous code seems to be easier to understand

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No strong reason, I just think it's better not to convert it to a string until the very end of the data flow, when we actually generate the wheel name.

But I agree that sys.version_info[:2] is harder to understand. I'll change it to (sys.version_info.major, sys.version_info.minor)

# 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 ["36", "37", "38", "39"]:
if sys_platform == "win32" and py_version == "36":
for py_version in [(3, 6), (3, 7), (3, 8), (3, 9), (3, 10)]:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use the same constant?

@rkooo567 rkooo567 added the @author-action-required The PR author is responsible for the next step. Remove tag to send back to the reviewer. label Dec 16, 2022
Signed-off-by: Archit Kulkarni <architkulkarni@users.noreply.github.com>
Signed-off-by: Archit Kulkarni <architkulkarni@users.noreply.github.com>
@rkooo567 rkooo567 merged commit 98fef77 into ray-project:master Dec 19, 2022
architkulkarni added a commit that referenced this pull request Dec 20, 2022
This PR updates the release tests wheel_urls to make it compatible with the internal API change in PR #30970. Previously the release test was breaking with

  File "/home/ray/anaconda3/lib/python3.7/site-packages/ray/_private/utils.py", line 1266, in get_wheel_filename
    assert py_version in ray_constants.RUNTIME_ENV_CONDA_PY_VERSIONS, py_version
AssertionError: 36
AmeerHajAli pushed a commit that referenced this pull request Jan 12, 2023
Signed-off-by: Archit Kulkarni <architkulkarni@users.noreply.github.com>

conda environments are isolated, so when runtime_env sets up a conda environment it must download the Ray wheel into the conda environment. It must download the wheel that matches the current Python and Ray version running, otherwise there will be incompatibility issues between the workers that use this runtime_env and the other workers and Ray processes.

This PR updates the wheel name format logic to support Python 3.10.
AmeerHajAli pushed a commit that referenced this pull request Jan 12, 2023
This PR updates the release tests wheel_urls to make it compatible with the internal API change in PR #30970. Previously the release test was breaking with

  File "/home/ray/anaconda3/lib/python3.7/site-packages/ray/_private/utils.py", line 1266, in get_wheel_filename
    assert py_version in ray_constants.RUNTIME_ENV_CONDA_PY_VERSIONS, py_version
AssertionError: 36
tamohannes pushed a commit to ju2ez/ray that referenced this pull request Jan 25, 2023
…30970)

Signed-off-by: Archit Kulkarni <architkulkarni@users.noreply.github.com>

conda environments are isolated, so when runtime_env sets up a conda environment it must download the Ray wheel into the conda environment. It must download the wheel that matches the current Python and Ray version running, otherwise there will be incompatibility issues between the workers that use this runtime_env and the other workers and Ray processes.

This PR updates the wheel name format logic to support Python 3.10.


Signed-off-by: tmynn <hovhannes.tamoyan@gmail.com>
tamohannes pushed a commit to ju2ez/ray that referenced this pull request Jan 25, 2023
This PR updates the release tests wheel_urls to make it compatible with the internal API change in PR ray-project#30970. Previously the release test was breaking with

  File "/home/ray/anaconda3/lib/python3.7/site-packages/ray/_private/utils.py", line 1266, in get_wheel_filename
    assert py_version in ray_constants.RUNTIME_ENV_CONDA_PY_VERSIONS, py_version
AssertionError: 36

Signed-off-by: tmynn <hovhannes.tamoyan@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
@author-action-required The PR author is responsible for the next step. Remove tag to send back to the reviewer. tests-ok The tagger certifies test failures are unrelated and assumes personal liability.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[runtime env] conda does not work with Python 3.10
4 participants