[docker] Build Python3.6 & Python3.8 Docker Images (#13548)

This commit is contained in:
Ian Rodney
2021-01-28 15:24:50 -08:00
committed by GitHub
parent 0c906a8b93
commit 813a7ab0e2
6 changed files with 173 additions and 89 deletions
+6 -2
View File
@@ -30,6 +30,8 @@ RUN sudo apt-get update -y && sudo apt-get upgrade -y \
git \
wget \
cmake \
g++ \
zlib1g-dev \
$(if [ "$AUTOSCALER" = "autoscaler" ]; then echo \
tmux \
screen \
@@ -52,12 +54,14 @@ RUN sudo apt-get update -y && sudo apt-get upgrade -y \
numpy==1.15.4 \
psutil \
blist \
atari-py \
# blist is needed for numpy (which is re-installed when ray is installed)
# atari-py is built from source for Python 3.8 (requires g++ & zlib1g-dev)
# To avoid the following error on Jenkins:
# AttributeError: 'numpy.ufunc' object has no attribute '__module__'
&& $HOME/anaconda3/bin/pip uninstall -y dask \
# We install cmake temporarily to get psutil
&& sudo apt-get autoremove -y cmake \
# We install cmake temporarily to get psutil, blist & atari-py
&& sudo apt-get autoremove -y cmake g++ zlib1g-dev \
# Either install kubectl or remove wget
&& (if [ "$AUTOSCALER" = "autoscaler" ]; \
then wget -O - -q https://packages.cloud.google.com/apt/doc/apt-key.gpg | sudo apt-key add - \
+6 -4
View File
@@ -1,12 +1,13 @@
ARG GPU
FROM rayproject/ray:nightly"$GPU"
ARG PYTHON_MINOR_VERSION=7
# We have to uninstall wrapt this way for Tensorflow compatibility
COPY requirements.txt ./
COPY requirements_ml_docker.txt ./
COPY requirements_rllib.txt ./
# Docker image uses Python 3.7
COPY linux-py3.7-requirements_tune.txt ./requirements_tune.txt
COPY linux-py3."$PYTHON_MINOR_VERSION"-requirements_tune.txt ./requirements_tune.txt
RUN sudo apt-get update \
&& sudo apt-get install -y gcc \
@@ -14,12 +15,13 @@ RUN sudo apt-get update \
libgtk2.0-dev \
zlib1g-dev \
libgl1-mesa-dev \
&& $HOME/anaconda3/bin/pip --no-cache-dir install -U -r requirements_ml_docker.txt \
&& $HOME/anaconda3/bin/pip --use-deprecated=legacy-resolver --no-cache-dir install -r requirements.txt \
&& $HOME/anaconda3/bin/pip --no-cache-dir install -r requirements_rllib.txt \
&& $HOME/anaconda3/bin/pip --no-cache-dir install -r requirements_tune.txt \
&& $HOME/anaconda3/bin/pip --no-cache-dir install -U -r requirements_ml_docker.txt \
# Remove dataclasses & typing because they are included in Py3.7
&& $HOME/anaconda3/bin/pip uninstall dataclasses typing -y \
# Remove dataclasses & typing because they are included in Python > 3.6
&& if [ $(python -c 'import sys; print(sys.version_info.minor)') != "6" ]; then \
$HOME/anaconda3/bin/pip uninstall dataclasses typing -y; fi \
&& sudo rm requirements.txt && sudo rm requirements_ml_docker.txt \
&& sudo rm requirements_tune.txt && sudo rm requirements_rllib.txt \
&& sudo apt-get clean