From 96d579a4fed690f918a98a919da7f4237f789add Mon Sep 17 00:00:00 2001 From: Akash Patel <17132214+acxz@users.noreply.github.com> Date: Fri, 26 Aug 2022 14:01:12 -0400 Subject: [PATCH] Add support for Python 3.10 (#21221) Signed-off-by: acxz <17132214+acxz@users.noreply.github.com> --- .buildkite/pipeline.yml | 18 ++++++++++++++++-- ci/build/build-docker-images.py | 7 ++++--- ci/build/test-wheels.sh | 7 ++++--- ci/env/install-minimal.sh | 2 ++ doc/source/ray-overview/installation.rst | 2 +- docker/fix-docker-latest.sh | 2 +- docker/retag-lambda/python_versions.txt | 2 +- 7 files changed, 29 insertions(+), 11 deletions(-) diff --git a/.buildkite/pipeline.yml b/.buildkite/pipeline.yml index 939957055..8ab326e65 100644 --- a/.buildkite/pipeline.yml +++ b/.buildkite/pipeline.yml @@ -147,14 +147,22 @@ - if [ "${BUILDKITE_PULL_REQUEST}" = "false" ]; then python .buildkite/copy_files.py --destination docker_login; fi - python ./ci/build/build-docker-images.py --py-versions py39 --device-types cu111 cu112 cu113 cu116 --build-type BUILDKITE --build-base -- label: ":docker: Build Images: py310" +- label: ":docker: Build Images: py310 (1/2)" conditions: ["RAY_CI_LINUX_WHEELS_AFFECTED"] 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 py310 --device-types cpu --build-type BUILDKITE --build-base + - python ./ci/build/build-docker-images.py --py-versions py310 --device-types cpu cu101 cu102 --build-type BUILDKITE --build-base + +- label: ":docker: Build Images: py310 (2/2)" + conditions: ["RAY_CI_LINUX_WHEELS_AFFECTED"] + 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 py310 --device-types cu110 cu111 cu112 --build-type BUILDKITE --build-base - label: ":book: Lint" commands: @@ -316,6 +324,12 @@ - cleanup() { if [ "${BUILDKITE_PULL_REQUEST}" = "false" ]; then ./ci/build/upload_build_info.sh; fi }; trap cleanup EXIT - ./ci/ci.sh test_minimal 3.9 +- label: ":python: Minimal install 3.10" + conditions: ["RAY_CI_PYTHON_AFFECTED"] + commands: + - cleanup() { if [ "${BUILDKITE_PULL_REQUEST}" = "false" ]; then ./ci/build/upload_build_info.sh; fi }; trap cleanup EXIT + - ./ci/ci.sh test_minimal 3.10 + - label: ":python: Default install" conditions: ["RAY_CI_PYTHON_AFFECTED"] commands: diff --git a/ci/build/build-docker-images.py b/ci/build/build-docker-images.py index bd5f1739c..131f018f0 100644 --- a/ci/build/build-docker-images.py +++ b/ci/build/build-docker-images.py @@ -192,7 +192,7 @@ def _build_docker_image( ) # TODO(https://github.com/ray-project/ray/issues/16599): - # remove below after supporting ray-ml images with Python 3.9+ + # remove below after supporting ray-ml images with Python 3.9/3.10 if image_name == "ray-ml" and py_version in {"py39", "py310"}: print(f"{image_name} image is currently unsupported with " "Python 3.9/3.10") return @@ -453,7 +453,7 @@ def push_and_tag_images( continue # TODO(https://github.com/ray-project/ray/issues/16599): - # remove below after supporting ray-ml images with Python 3.9 + # remove below after supporting ray-ml images with Python 3.9/3.10 if image_name in ["ray-ml"] and ( PY_MATRIX[py_name].startswith("3.9") or PY_MATRIX[py_name].startswith("3.10") @@ -607,7 +607,8 @@ if __name__ == "__main__": choices=list(PY_MATRIX.keys()), default="py37", nargs="*", - help="Which python versions to build. " "Must be in (py36, py37, py38, py39)", + help="Which python versions to build. " + "Must be in (py36, py37, py38, py39, py310)", ) parser.add_argument( "--device-types", diff --git a/ci/build/test-wheels.sh b/ci/build/test-wheels.sh index 60543427e..7f884b5ff 100755 --- a/ci/build/test-wheels.sh +++ b/ci/build/test-wheels.sh @@ -87,7 +87,7 @@ 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" != "4" ]]; then + if [[ "$NUMBER_OF_WHEELS" != "5" ]]; then echo "Wrong number of wheels found." ls -l "$ROOT_DIR/../.whl/" exit 2 @@ -95,11 +95,12 @@ if [[ "$platform" == "linux" ]]; then elif [[ "$platform" == "macosx" ]]; then MACPYTHON_PY_PREFIX=/Library/Frameworks/Python.framework/Versions - PY_WHEEL_VERSIONS=("36" "37" "38" "39") + PY_WHEEL_VERSIONS=("36" "37" "38" "39" "310") PY_MMS=("3.6" "3.7" "3.8" - "3.9") + "3.9" + "3.10") for ((i=0; i<${#PY_MMS[@]}; ++i)); do PY_MM="${PY_MMS[i]}" diff --git a/ci/env/install-minimal.sh b/ci/env/install-minimal.sh index 493bd841c..40db33a56 100755 --- a/ci/env/install-minimal.sh +++ b/ci/env/install-minimal.sh @@ -12,6 +12,8 @@ else PYTHON_VERSION=${PYTHON-3.8} elif [ "$1" = "3.9" ]; then PYTHON_VERSION=${PYTHON-3.9} + elif [ "$1" = "3.10" ]; then + PYTHON_VERSION=${PYTHON-3.10} else echo "Unsupported Python version." exit 1 diff --git a/doc/source/ray-overview/installation.rst b/doc/source/ray-overview/installation.rst index 8c5bc154c..e76ff9fbd 100644 --- a/doc/source/ray-overview/installation.rst +++ b/doc/source/ray-overview/installation.rst @@ -58,7 +58,7 @@ You can install the nightly Ray wheels via the following links. These daily rele .. note:: - Python 3.10 support is currently experimental. + Python 3.9/3.10 support is currently experimental. .. note:: diff --git a/docker/fix-docker-latest.sh b/docker/fix-docker-latest.sh index 27a3cfa0a..fb3f7ee29 100755 --- a/docker/fix-docker-latest.sh +++ b/docker/fix-docker-latest.sh @@ -36,4 +36,4 @@ lambda invoke --function-name DockerTagLatest \ --cli-read-timeout 600 \ --payload "{\"source_tag\" : \"$IMAGE\", \"destination_tag\" : \"latest\"}" /dev/stdout -echo -e "Please check logs before rerunning!!!!\n\nAt the time of writing, Autoscaler Images are not built & Ray-ML Images are not built for Py39\nSo retagging errors for those images are expected!" +echo -e "Please check logs before rerunning!!!!\n\nAt the time of writing, Autoscaler Images are not built & Ray-ML Images are not built for Py39/Py310\nSo retagging errors for those images are expected!" diff --git a/docker/retag-lambda/python_versions.txt b/docker/retag-lambda/python_versions.txt index 655fefd55..a6a71708d 100644 --- a/docker/retag-lambda/python_versions.txt +++ b/docker/retag-lambda/python_versions.txt @@ -2,4 +2,4 @@ py36 py37 py38 py39 -py310 \ No newline at end of file +py310