mirror of
https://github.com/wassname/ray.git
synced 2026-07-08 06:11:10 +08:00
[docker] Make python version configurable on docker image (#10783)
This commit is contained in:
+9
-2
@@ -8,6 +8,7 @@ set -x
|
||||
GPU=""
|
||||
BASE_IMAGE="ubuntu:focal"
|
||||
WHEEL_URL="https://s3-us-west-2.amazonaws.com/ray-wheels/latest/ray-1.1.0.dev0-cp37-cp37m-manylinux1_x86_64.whl"
|
||||
PYTHON_VERSION=""
|
||||
|
||||
while [[ $# -gt 0 ]]
|
||||
do
|
||||
@@ -37,8 +38,14 @@ case $key in
|
||||
echo "not implemented, just hardcode me :'("
|
||||
exit 1
|
||||
;;
|
||||
--python-version)
|
||||
# Python version to install. e.g. 3.7.7.
|
||||
# Changing python versions may require a different wheel.
|
||||
shift
|
||||
PYTHON_VERSION=$1
|
||||
;;
|
||||
*)
|
||||
echo "Usage: build-docker.sh [ --no-cache-build ] [ --shas-only ] [ --build-development-image ] [ --build-examples ] [ --wheel-to-use ]"
|
||||
echo "Usage: build-docker.sh [ --no-cache-build ] [ --shas-only ] [ --build-development-image ] [ --build-examples ] [ --wheel-to-use ] [ --python-version ]"
|
||||
exit 1
|
||||
esac
|
||||
shift
|
||||
@@ -55,7 +62,7 @@ do
|
||||
IMAGE_SHA=$(docker build $NO_CACHE --build-arg GPU="$GPU" --build-arg BASE_IMAGE="$BASE_IMAGE" --build-arg WHEEL_PATH="$(basename "$WHEEL")" -q -t rayproject/$IMAGE:latest docker/$IMAGE)
|
||||
echo "rayproject/$IMAGE:latest SHA:$IMAGE_SHA"
|
||||
else
|
||||
docker build $NO_CACHE --build-arg GPU="$GPU" --build-arg BASE_IMAGE="$BASE_IMAGE" --build-arg WHEEL_PATH="$(basename "$WHEEL")" -t rayproject/$IMAGE:latest docker/$IMAGE
|
||||
docker build $NO_CACHE --build-arg GPU="$GPU" --build-arg BASE_IMAGE="$BASE_IMAGE" --build-arg WHEEL_PATH="$(basename "$WHEEL")" --build-arg PYTHON_VERSION="$PYTHON_VERSION" -t rayproject/$IMAGE:latest docker/$IMAGE
|
||||
fi
|
||||
rm "docker/$IMAGE/$(basename "$WHEEL")"
|
||||
done
|
||||
|
||||
@@ -9,6 +9,7 @@ ENV TZ=America/Los_Angeles
|
||||
# TODO(ilr) $HOME seems to point to result in "" instead of "/root"
|
||||
ENV PATH "/root/anaconda3/bin:$PATH"
|
||||
ARG DEBIAN_FRONTEND=noninteractive
|
||||
ARG PYTHON_VERSION=3.7.7
|
||||
RUN apt-get update -y && apt-get upgrade -y \
|
||||
&& apt-get install -y \
|
||||
git \
|
||||
@@ -28,7 +29,7 @@ RUN apt-get update -y && apt-get upgrade -y \
|
||||
&& echo 'export PATH=$HOME/anaconda3/bin:$PATH' > /etc/profile.d/conda.sh \
|
||||
&& rm /tmp/miniconda.sh \
|
||||
&& $HOME/anaconda3/bin/conda install -y \
|
||||
libgcc python=3.7.7 \
|
||||
libgcc python=$PYTHON_VERSION \
|
||||
&& $HOME/anaconda3/bin/conda clean -y --all \
|
||||
&& $HOME/anaconda3/bin/pip install --no-cache-dir \
|
||||
flatbuffers \
|
||||
|
||||
Reference in New Issue
Block a user