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

[CI] [Minimal install] Check python version in minimal install #36887

Merged
merged 7 commits into from
Jun 29, 2023

Conversation

cadedaniel
Copy link
Member

@cadedaniel cadedaniel commented Jun 27, 2023

This PR improves our CI by asserting the expected Python version in our minimal install tests. We use these tests to validate basic Ray functionality for each Python version we support (3.7-3.11). In the past, we saw an issue where the 3.11 tests actually used a different Python version because the conda env we consumed hadn't yet been built for 3.11. Now, the tests will fail if the actual Python version differs from the expected one.

See also #33401

@cadedaniel cadedaniel changed the title [CI] [Minimal install] Check python version in minimal install [WIP] [CI] [Minimal install] Check python version in minimal install Jun 27, 2023
Signed-off-by: Cade Daniel <cade@anyscale.com>
Signed-off-by: Cade Daniel <cade@anyscale.com>
Signed-off-by: Cade Daniel <cade@anyscale.com>
@cadedaniel cadedaniel force-pushed the check-python-version branch from 32e953e to 4211441 Compare June 27, 2023 23:26
@cadedaniel cadedaniel linked an issue Jun 27, 2023 that may be closed by this pull request
Signed-off-by: Cade Daniel <cade@anyscale.com>
Signed-off-by: Cade Daniel <cade@anyscale.com>
Signed-off-by: Cade Daniel <cade@anyscale.com>
@cadedaniel cadedaniel changed the title [WIP] [CI] [Minimal install] Check python version in minimal install [CI] [Minimal install] Check python version in minimal install Jun 28, 2023
@cadedaniel cadedaniel marked this pull request as ready for review June 28, 2023 06:17
BAZEL_EXPORT_OPTIONS="$(./ci/run/bazel_export_options)"
# Ignoring shellcheck is necessary because if ${BAZEL_EXPORT_OPTIONS} is wrapped by the double quotation,
# bazel test cannot recognize the option.
# shellcheck disable=SC2086
bazel test --test_output=streamed --config=ci --test_env=RAY_MINIMAL=1 --test_env=EXPECTED_PYTHON_VERSION=$EXPECTED_PYTHON_VERSION ${BAZEL_EXPORT_OPTIONS} python/ray/tests/test_minimal_install
Copy link
Contributor

Choose a reason for hiding this comment

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

I was thinking of an "easier" approach where we just asserted the python version in shell here like check the python --version output.

What's the motif for running another pytest and assert in there?

Copy link
Member Author

Choose a reason for hiding this comment

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

I'm not sure how bazel works, so wanted to verify that bazel picks up right version. If someone confident in bazel behavior says we can trust it, I can delete the test.

Copy link
Contributor

Choose a reason for hiding this comment

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

I don't have a strong opinion here - I' m ok with the current approach.

@jjyao
Copy link
Collaborator

jjyao commented Jun 28, 2023

Are you saying when we ask conda to install a particular version of python and that version doesn't exist, conda won't fail loudly but silently install another version?

@cadedaniel
Copy link
Member Author

Are you saying when we ask conda to install a particular version of python and that version doesn't exist, conda won't fail loudly but silently install another version?

@rickyyx

We have seen cases where minimal test did not run in the targeted python version (propabbly due to conda not having the python version available yet), and tests were broken unexpectedly as conda released new support python version

#33401

@rickyyx
Copy link
Contributor

rickyyx commented Jun 28, 2023

Are you saying when we ask conda to install a particular version of python and that version doesn't exist, conda won't fail loudly but silently install another version?

Maybe not conda not fail explicitly - but our CI failed silently.

@jjyao
Copy link
Collaborator

jjyao commented Jun 28, 2023

Maybe not conda not fail explicitly - but our CI failed silently.

Should we fix this directly? It seems to me that we still don't know the exact root cause yet?

@cadedaniel
Copy link
Member Author

Maybe not conda not fail explicitly - but our CI failed silently.

Should we fix this directly? It seems to me that we still don't know the exact root cause yet?

I don't think we know what the root cause was. If we have repro steps or logs I can go investigate. This PR is to fail loudly the next time it happens so we can look into it.

@rickyyx
Copy link
Contributor

rickyyx commented Jun 28, 2023

Maybe not conda not fail explicitly - but our CI failed silently.

Should we fix this directly? It seems to me that we still don't know the exact root cause yet?

Yeah - i think the root cause was not really known, all we know now is that it wasn't running the expected python version somehow.

@cadedaniel
Copy link
Member Author

cadedaniel commented Jun 28, 2023

train_minimal_install failed and it looks related. But must be some caching issue, since the codepath should work. I am rerunning the test.

edit: fixed

Signed-off-by: Cade Daniel <cade@anyscale.com>
@cadedaniel
Copy link
Member Author

cc @jjyao ready for merge

@jjyao jjyao merged commit 3e68dd5 into ray-project:master Jun 29, 2023
@jjyao
Copy link
Collaborator

jjyao commented Jun 29, 2023

Yeah - i think the root cause was not really known, all we know now is that it wasn't running the expected python version somehow.

I merged this but can we figure out the root cause as well (not a high priority)

arvind-chandra pushed a commit to lmco/ray that referenced this pull request Aug 31, 2023
…roject#36887)

This PR improves our CI by asserting the expected Python version in our minimal install tests. We use these tests to validate basic Ray functionality for each Python version we support (3.7-3.11). In the past, we saw an issue where the 3.11 tests actually used a different Python version because the conda env we consumed hadn't yet been built for 3.11. Now, the tests will fail if the actual Python version differs from the expected one.

Signed-off-by: Cade Daniel <cade@anyscale.com>
Signed-off-by: e428265 <arvind.chandramouli@lmco.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[core] Make sure minimal tests run in expected python versions
4 participants