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

Prepare Python 3.11 support #31170

Merged
merged 52 commits into from
Jan 7, 2023
Merged
Show file tree
Hide file tree
Changes from 6 commits
Commits
Show all changes
52 commits
Select commit Hold shift + click to select a range
7a18111
python3.11 prep
csko Dec 17, 2022
9255b7a
fix recursion limit
csko Dec 17, 2022
65e77a9
update cicd, buildkite
csko Dec 17, 2022
d5fa276
upgrade cython to 0.29.32
csko Dec 18, 2022
4adad69
pydantic
csko Dec 18, 2022
814581b
update cloudpickle
csko Dec 18, 2022
5ccaa98
condition recursion_depth on <3.11
csko Dec 20, 2022
1f0015c
lint
csko Dec 20, 2022
01dcb87
condition pip packages on py311
csko Dec 20, 2022
1d9daf8
fix wheels
csko Dec 20, 2022
466a835
lint
csko Dec 20, 2022
ddc700c
add 3.11 to wheel scripts
csko Dec 21, 2022
f751360
add numpy version to wheel script
csko Dec 21, 2022
4d33b4f
more specific pydantic versions
csko Dec 21, 2022
9726e0a
use newer pypa images with 311
csko Dec 21, 2022
f33ea25
fix macos build
csko Dec 21, 2022
350a69f
Merge branch 'ray-project:master' into py311
csko Dec 21, 2022
7dc33cd
add 311 to wheel test
csko Dec 21, 2022
fb05c4a
try build without 311
csko Dec 21, 2022
90cb548
Revert "use newer pypa images with 311"
csko Dec 22, 2022
7823dc1
try 2022-02-24-3876535 manylinux2014
csko Dec 22, 2022
722760e
try 2022-01-02-2b36e6e manylinux2014
csko Dec 22, 2022
4d54aa3
try 2021-12-05-142ef77 manylinux2014
csko Dec 22, 2022
c50db92
try 2021-12-19-a4d7f5a manylinux2014
csko Dec 22, 2022
d8005c6
try 2021-12-30-cb9fd5b manylinux2014
csko Dec 23, 2022
fac2e49
Update ci.sh
csko Dec 24, 2022
7013382
use pypa version that supports py3.11
csko Dec 25, 2022
247d3f6
fix typo
csko Dec 25, 2022
8e997a6
try conda-forge
csko Dec 25, 2022
7666831
fix gpu docker images
csko Dec 25, 2022
562ab4f
add back py3.11 to build-wheel-manylinux2014
csko Dec 25, 2022
9763dc6
condition test packages on python3.11
csko Jan 2, 2023
e227548
revert conda-forge
csko Jan 2, 2023
173963f
don't build docker for 3.11
csko Jan 2, 2023
53cf70a
don't build macos and windows wheels
csko Jan 2, 2023
bda9a36
revert cython upgrade in release test
csko Jan 2, 2023
bec10c4
Update documentation
csko Jan 2, 2023
76a3011
Merge branch 'ray-project:master' into py311
csko Jan 2, 2023
8f87f0f
remove purelib reference in commit check
csko Jan 4, 2023
0f2b123
remove mac 3.11 wheels
csko Jan 4, 2023
aa313c7
Merge branch 'master' into py311
csko Jan 4, 2023
d3ea5fd
condition llvmlite on py<3.11
csko Jan 4, 2023
44006df
don't check for 3.11 docker image
csko Jan 4, 2023
c09c347
remove recursion_depth ref
csko Jan 5, 2023
d4c8ee2
remove unused build step
csko Jan 5, 2023
71dfb8a
match __commit__ only on the beginning of the line in wheel check
csko Jan 5, 2023
22538e6
Merge branch 'ray-project:master' into py311
csko Jan 5, 2023
00d7138
remove other commented-out 3.11 references
csko Jan 6, 2023
f22eaab
remove gitpod (merge upstream)
csko Jan 6, 2023
513b97b
Merge branch 'ray-project:master' into py311
csko Jan 6, 2023
241dc32
update docs
csko Jan 6, 2023
d72e1d7
fix table in documentation
csko Jan 7, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 28 additions & 0 deletions .buildkite/pipeline.build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,26 @@
- if [ "${BUILDKITE_PULL_REQUEST}" = "false" ]; then python .buildkite/copy_files.py --destination docker_login; fi
- python ./ci/build/build-docker-images.py --py-versions py310 --device-types cu111 cu112 cu113 cu116 --build-type BUILDKITE --build-base


- label: ":docker: Build Images: py311 (1/2)"
csko marked this conversation as resolved.
Show resolved Hide resolved
conditions: ["RAY_CI_LINUX_WHEELS_AFFECTED"]
instance_size: medium
commands:
- LINUX_WHEELS=1 ./ci/ci.sh build
- pip install -q docker aws_requests_auth boto3
- ./ci/env/env_info.sh
- if [ "${BUILDKITE_PULL_REQUEST}" = "false" ]; then python .buildkite/copy_files.py --destination docker_login; fi
- python ./ci/build/build-docker-images.py --py-versions py311 --device-types cpu cu101 cu102 cu110 --build-type BUILDKITE --build-base

- label: ":docker: Build Images: py311 (2/2)"
conditions: ["RAY_CI_LINUX_WHEELS_AFFECTED"]
instance_size: medium
commands:
- LINUX_WHEELS=1 ./ci/ci.sh build
- pip install -q docker aws_requests_auth boto3
- if [ "${BUILDKITE_PULL_REQUEST}" = "false" ]; then python .buildkite/copy_files.py --destination docker_login; fi
- python ./ci/build/build-docker-images.py --py-versions py311 --device-types cu111 cu112 cu113 cu116 --build-type BUILDKITE --build-base

- label: ":java: Java"
conditions: ["RAY_CI_JAVA_AFFECTED"]
instance_size: medium
Expand Down Expand Up @@ -338,6 +358,14 @@
- ./ci/ci.sh test_minimal 3.10
- ./ci/ci.sh test_latest_core_dependencies 3.10

- label: ":python: Minimal install 3.11"
conditions: ["RAY_CI_PYTHON_AFFECTED"]
instance_size: medium
commands:
- cleanup() { if [ "${BUILDKITE_PULL_REQUEST}" = "false" ]; then ./ci/build/upload_build_info.sh; fi }; trap cleanup EXIT
- ./ci/ci.sh test_minimal 3.11
- ./ci/ci.sh test_latest_core_dependencies 3.11

- label: ":python: Default install"
conditions: ["RAY_CI_PYTHON_AFFECTED"]
instance_size: small
Expand Down
2 changes: 1 addition & 1 deletion .gitpod/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ RUN set -x; apt update \
&& mv bazel.gpg /etc/apt/trusted.gpg.d/ \
&& echo "deb [arch=amd64] https://storage.googleapis.com/bazel-apt stable jdk1.8" | tee /etc/apt/sources.list.d/bazel.list \
&& apt update && apt install bazel-3.7.2 -y \
&& pip3 install cython==0.29.26 pytest pandas tree tabulate pexpect sklearn joblib black==21.12b0 flake8==3.9.1 mypy==0.782 flake8-quotes flake8-bugbear==21.9.2 setproctitle==1.1.10 psutil yq \
&& pip3 install cython==0.29.32 pytest pandas tree tabulate pexpect sklearn joblib black==21.12b0 flake8==3.9.1 mypy==0.782 flake8-quotes flake8-bugbear==21.9.2 setproctitle==1.1.10 psutil yq \
&& python3 -c 'print("startup --output_base=/workspace/ray/.bazel-cache\nstartup --host_jvm_args=-Xmx1800m\nbuild --jobs=6")' > /etc/bazel.bazelrc

RUN update-alternatives --install /usr/local/bin/python python /usr/bin/python3 30 \
Expand Down
4 changes: 2 additions & 2 deletions bazel/ray_deps_setup.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -194,8 +194,8 @@ def ray_deps_setup():
auto_http_archive(
name = "cython",
build_file = True,
url = "https://github.com/cython/cython/archive/3028e8c7ac296bc848d996e397c3354b3dbbd431.tar.gz",
sha256 = "31ea23c2231ddee8572a2a5effd54952e16a1b44e9a4cb3eb645418f8accf20d",
url = "https://github.com/cython/cython/archive/c48361d0a0969206e227ec016f654c9d941c2b69.tar.gz",
sha256 = "37c466fea398da9785bc37fe16f1455d2645d21a72e402103991d9e2fa1c6ff3",
)

auto_http_archive(
Expand Down
3 changes: 2 additions & 1 deletion ci/build/build-docker-images.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
"py38": "3.8",
"py39": "3.9",
"py310": "3.10",
"py311": "3.11",
}

BASE_IMAGES = {
Expand Down Expand Up @@ -619,7 +620,7 @@ def push_readmes(merge_build: bool):
default="py37",
nargs="*",
help="Which python versions to build. "
"Must be in (py36, py37, py38, py39, py310)",
"Must be in (py36, py37, py38, py39, py310, py311)",
)
parser.add_argument(
"--device-types",
Expand Down
7 changes: 4 additions & 3 deletions ci/build/test-wheels.sh
Original file line number Diff line number Diff line change
Expand Up @@ -87,20 +87,21 @@ if [[ "$platform" == "linux" ]]; then

# Check that the other wheels are present.
NUMBER_OF_WHEELS="$(find "$ROOT_DIR"/../../.whl/ -mindepth 1 -maxdepth 1 -name "*.whl" | wc -l)"
if [[ "$NUMBER_OF_WHEELS" != "5" ]]; then
if [[ "$NUMBER_OF_WHEELS" != "6" ]]; then
csko marked this conversation as resolved.
Show resolved Hide resolved
echo "Wrong number of wheels found."
ls -l "$ROOT_DIR/../.whl/"
exit 2
fi

elif [[ "$platform" == "macosx" ]]; then
MACPYTHON_PY_PREFIX=/Library/Frameworks/Python.framework/Versions
PY_WHEEL_VERSIONS=("36" "37" "38" "39" "310")
PY_WHEEL_VERSIONS=("36" "37" "38" "39" "310", "311")
PY_MMS=("3.6"
"3.7"
"3.8"
"3.9"
"3.10")
"3.10"
"3.11")

for ((i=0; i<${#PY_MMS[@]}; ++i)); do
PY_MM="${PY_MMS[i]}"
Expand Down
2 changes: 2 additions & 0 deletions ci/env/install-minimal.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ else
PYTHON_VERSION="3.9"
elif [ "$1" = "3.10" ]; then
PYTHON_VERSION="3.10"
elif [ "$1" = "3.11" ]; then
PYTHON_VERSION="3.11"
else
echo "Unsupported Python version."
exit 1
Expand Down
2 changes: 1 addition & 1 deletion docker/base-deps/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ RUN sudo apt-get update -y && sudo apt-get upgrade -y \
&& $HOME/anaconda3/bin/conda clean -y --all \
&& $HOME/anaconda3/bin/pip install --no-cache-dir \
flatbuffers \
cython==0.29.26 \
cython==0.29.32 \
# Necessary for Dataset to work properly.
numpy\>=1.20 \
psutil \
Expand Down
2 changes: 1 addition & 1 deletion docker/ray-worker-container/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ RUN apt-get update -y && sudo apt-get upgrade -y \
&& $HOME/anaconda3/bin/conda clean -y --all \
&& $HOME/anaconda3/bin/pip install --no-cache-dir \
flatbuffers \
cython==0.29.26 \
cython==0.29.32 \
numpy==1.15.4 \
psutil \
# To avoid the following error on Jenkins:
Expand Down
1 change: 1 addition & 0 deletions docker/retag-lambda/python_versions.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@ py37
py38
py39
py310
py311
csko marked this conversation as resolved.
Show resolved Hide resolved
2 changes: 1 addition & 1 deletion python/build-wheel-macos-arm64.sh
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ for ((i=0; i<${#PY_VERSIONS[@]}; ++i)); do
# Setuptools on CentOS is too old to install arrow 0.9.0, therefore we upgrade.
# TODO: Unpin after https://github.com/pypa/setuptools/issues/2849 is fixed.
$PIP_CMD install --upgrade setuptools==58.4
$PIP_CMD install -q cython==0.29.26
$PIP_CMD install -q cython==0.29.32
# Install wheel to avoid the error "invalid command 'bdist_wheel'".
$PIP_CMD install -q wheel
# Set the commit SHA in __init__.py.
Expand Down
2 changes: 1 addition & 1 deletion python/build-wheel-macos.sh
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ for ((i=0; i<${#PY_VERSIONS[@]}; ++i)); do
$PIP_CMD install -q setuptools_scm==3.1.0
# Fix the numpy version because this will be the oldest numpy version we can
# support.
$PIP_CMD install -q numpy=="$NUMPY_VERSION" cython==0.29.26
$PIP_CMD install -q numpy=="$NUMPY_VERSION" cython==0.29.32
# Install wheel to avoid the error "invalid command 'bdist_wheel'".
$PIP_CMD install -q wheel
# Set the commit SHA in __init__.py.
Expand Down
2 changes: 1 addition & 1 deletion python/build-wheel-manylinux2014.sh
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ for ((i=0; i<${#PYTHONS[@]}; ++i)); do
pushd python
# Fix the numpy version because this will be the oldest numpy version we can
# support.
/opt/python/"${PYTHON}"/bin/pip install -q numpy=="${NUMPY_VERSION}" cython==0.29.26
/opt/python/"${PYTHON}"/bin/pip install -q numpy=="${NUMPY_VERSION}" cython==0.29.32
# Set the commit SHA in __init__.py.
if [ -n "$TRAVIS_COMMIT" ]; then
sed -i.bak "s/{{RAY_COMMIT_SHA}}/$TRAVIS_COMMIT/g" ray/__init__.py && rm ray/__init__.py.bak
Expand Down
3 changes: 2 additions & 1 deletion python/ray/_raylet.pxd
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,8 @@ cdef extern from "Python.h":

# You can find the cpython definition in Include/cpython/pystate.h#L59
ctypedef struct CPyThreadState "PyThreadState":
int recursion_depth
int recursion_limit
int recursion_remaining

# From Include/ceveal.h#67
int Py_GetRecursionLimit()
Expand Down
2 changes: 1 addition & 1 deletion python/ray/_raylet.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,7 @@ cdef increase_recursion_limit():
"""Double the recusion limit if current depth is close to the limit"""
cdef:
CPyThreadState * s = <CPyThreadState *> PyThreadState_Get()
int current_depth = s.recursion_depth
int current_depth = s.recursion_limit - s.recursion_remaining
int current_limit = Py_GetRecursionLimit()
int new_limit = current_limit * 2

Expand Down
2 changes: 1 addition & 1 deletion python/ray/autoscaler/aws/development-example.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ setup_commands:
- git clone https://github.com/ray-project/ray || true
- ray/ci/env/install-bazel.sh
- cd ray/python/ray/dashboard/client; npm ci; npm run build
- pip install boto3==1.4.8 cython==0.29.26 aiohttp grpcio psutil setproctitle
- pip install boto3==1.4.8 cython==0.29.32 aiohttp grpcio psutil setproctitle
- cd ray/python; pip install -e . --verbose

# Command to start ray on the head node. You don't need to change this.
Expand Down
Loading