Skip to content

Commit

Permalink
Support docker build for 3.11
Browse files Browse the repository at this point in the history
Signed-off-by: can <can@anyscale.com>
  • Loading branch information
can-anyscale committed Jun 14, 2023
1 parent 3d0e46e commit 90b5a8e
Show file tree
Hide file tree
Showing 4 changed files with 49 additions and 9 deletions.
19 changes: 19 additions & 0 deletions .buildkite/pipeline.build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,25 @@
- 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 -T cu111 -T cu112 -T cu113 -T cu116 -T cu118 --build-type BUILDKITE --build-base

- label: ":docker: Build Images: py311 (1/2)"
conditions: ["RAY_CI_PYTHON_DEPENDENCIES_AFFECTED", "RAY_CI_DOCKER_AFFECTED", "RAY_CI_CORE_CPP_AFFECTED"]
instance_size: medium
commands:
- LINUX_WHEELS=1 BUILD_ONE_PYTHON_ONLY=3.11 ./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 -T cpu -T cu101 -T cu102 -T cu110 --build-type BUILDKITE --build-base

- label: ":docker: Build Images: py311 (2/2)"
conditions: ["RAY_CI_PYTHON_DEPENDENCIES_AFFECTED", "RAY_CI_DOCKER_AFFECTED", "RAY_CI_CORE_CPP_AFFECTED"]
instance_size: medium
commands:
- LINUX_WHEELS=1 BUILD_ONE_PYTHON_ONLY=3.11 ./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 -T cu111 -T cu112 -T cu113 -T cu116 -T cu118 --build-type BUILDKITE --build-base

- label: ":java: Java"
conditions: ["RAY_CI_JAVA_AFFECTED"]
instance_size: medium
Expand Down
1 change: 1 addition & 0 deletions ci/build/build-docker-images.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
"py38": "3.8",
"py39": "3.9",
"py310": "3.10",
"py311": "3.11",
}

BASE_IMAGES = {
Expand Down
37 changes: 28 additions & 9 deletions docker/base-deps/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# syntax=docker/dockerfile:1.3-labs
# shellcheck disable=SC2148

# The base-deps Docker image installs main libraries needed to run Ray

# The GPU options are NVIDIA CUDA developer images.
Expand Down Expand Up @@ -33,7 +36,10 @@ ENV HOME=/home/ray
# images for Python 3.7.
# https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-${HOSTTYPE}.sh

RUN sudo apt-get update -y && sudo apt-get upgrade -y \
RUN <<EOF
#!/bin/bash

sudo apt-get update -y && sudo apt-get upgrade -y \
&& sudo apt-get install -y \
git \
libjemalloc-dev \
Expand All @@ -47,18 +53,29 @@ RUN sudo apt-get update -y && sudo apt-get upgrade -y \
rsync \
netbase \
openssh-client \
gnupg; fi) \
&& wget \
--quiet "https://repo.anaconda.com/miniconda/Miniconda3-py37_23.1.0-1-Linux-${HOSTTYPE}.sh" \
-O /tmp/miniconda.sh \
gnupg; fi)

if [ "$PYTHON_VERSION" == "3.11" ]; then
MINICONDA="https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-${HOSTTYPE}.sh"
else
MINICONDA="https://repo.anaconda.com/miniconda/Miniconda3-py37_23.1.0-1-Linux-${HOSTTYPE}.sh"
fi

wget --quiet "$MINICONDA" -O /tmp/miniconda.sh \
&& /bin/bash /tmp/miniconda.sh -b -u -p $HOME/anaconda3 \
&& $HOME/anaconda3/bin/conda init \
&& echo 'export PATH=$HOME/anaconda3/bin:$PATH' >> /home/ray/.bashrc \
&& rm /tmp/miniconda.sh \
&& $HOME/anaconda3/bin/conda install -y \
&& rm /tmp/miniconda.sh

if [ "$PYTHON_VERSION" == "3.11" ]; then
$HOME/anaconda3/bin/conda install -y libgcc-ng python=$PYTHON_VERSION
else
$HOME/anaconda3/bin/conda install -y \
# remove libffi pinning when fixed upstream #33299
libgcc-ng libffi=3.3 python=$PYTHON_VERSION \
&& $HOME/anaconda3/bin/conda clean -y --all \
libgcc-ng libffi=3.3 python=$PYTHON_VERSION
fi

$HOME/anaconda3/bin/conda clean -y --all \
&& $HOME/anaconda3/bin/pip install --no-cache-dir \
flatbuffers \
cython==0.29.32 \
Expand All @@ -85,4 +102,6 @@ RUN sudo apt-get update -y && sudo apt-get upgrade -y \
&& sudo rm -rf /var/lib/apt/lists/* \
&& sudo apt-get clean

EOF

WORKDIR $HOME
1 change: 1 addition & 0 deletions docker/retag-lambda/python_versions.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@ py37
py38
py39
py310
py311

0 comments on commit 90b5a8e

Please sign in to comment.