[Docker] Fix torch GPU install on Ray Docker images (#15473)

Co-authored-by: Ian Rodney <ian.rodney@gmail.com>
This commit is contained in:
Amog Kamsetty 2021-04-26 16:22:25 -07:00 committed by GitHub
parent a78af85b1c
commit 544dff80fa
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 38 additions and 10 deletions

View file

@ -151,10 +151,10 @@ matrix:
- bash ./java/build-jar-multiplatform.sh linux
cache: false
# Build Py36 & Py38 Docker Images
# Build Py36 Docker Image
- os: linux
env:
- LINUX_WHEELS=1 DOCKER_BUILD_PY36_38=1
- LINUX_WHEELS=1 DOCKER_BUILD_PY36=1
- PYTHONWARNINGS=ignore
language: java
jdk: openjdk8
@ -168,7 +168,27 @@ matrix:
- export PATH="$HOME/miniconda3/bin:$PATH"
- conda install -y python=3.7.6
- python -m pip install docker
- if [[ "$TRAVIS_PULL_REQUEST" != "false" ]]; then python $TRAVIS_BUILD_DIR/ci/travis/build-docker-images.py --py-versions PY36 PY38 --build-type PR --build-base; fi
- if [[ "$TRAVIS_PULL_REQUEST" != "false" ]]; then python $TRAVIS_BUILD_DIR/ci/travis/build-docker-images.py --py-versions PY36 --build-type PR --build-base; fi
cache: false
# Build Py38 Docker Image
- os: linux
env:
- LINUX_WHEELS=1 DOCKER_BUILD_PY38=1
- PYTHONWARNINGS=ignore
language: java
jdk: openjdk8
install:
- . ./ci/travis/ci.sh init RAY_CI_LINUX_WHEELS_AFFECTED
before_script:
- . ./ci/travis/ci.sh build
script:
- wget --quiet "https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh" -O miniconda3.sh
- bash miniconda3.sh -b -p "$HOME/miniconda3"
- export PATH="$HOME/miniconda3/bin:$PATH"
- conda install -y python=3.7.6
- python -m pip install docker
- if [[ "$TRAVIS_PULL_REQUEST" != "false" ]]; then python $TRAVIS_BUILD_DIR/ci/travis/build-docker-images.py --py-versions PY38 --build-type PR --build-base; fi
cache: false
# Build and deploy multi-platform jars.
@ -278,9 +298,18 @@ deploy:
- provider: script
edge: true # This supposedly opts in to deploy v2.
script: export PATH="$HOME/miniconda3/bin:$PATH"; ./ci/keep_alive python $TRAVIS_BUILD_DIR/ci/travis/build-docker-images.py --py-versions PY36 PY38 --build-type MERGE --build-base
script: export PATH="$HOME/miniconda3/bin:$PATH"; ./ci/keep_alive python $TRAVIS_BUILD_DIR/ci/travis/build-docker-images.py --py-versions PY36 --build-type MERGE --build-base
skip_cleanup: true
on:
repo: ray-project/ray
all_branches: true
condition: $LINUX_WHEELS = 1 && $DOCKER_BUILD_PY36_38 = 1
condition: $LINUX_WHEELS = 1 && $DOCKER_BUILD_PY36 = 1
- provider: script
edge: true # This supposedly opts in to deploy v2.
script: export PATH="$HOME/miniconda3/bin:$PATH"; ./ci/keep_alive python $TRAVIS_BUILD_DIR/ci/travis/build-docker-images.py --py-versions PY38 --build-type MERGE --build-base
skip_cleanup: true
on:
repo: ray-project/ray
all_branches: true
condition: $LINUX_WHEELS = 1 && $DOCKER_BUILD_PY38 = 1

View file

@ -14,14 +14,14 @@ 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 install -U pip \
&& $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 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

View file

@ -1,7 +1,6 @@
ipython
tensorflow-gpu>=2.4.0
-f https://download.pytorch.org/whl/torch_stable.html
torch==1.7.1+cu110
torch==1.8.1+cu111
-f https://download.pytorch.org/whl/torch_stable.html
torchvision==0.8.2+cu110
pip; python_version > "3.7"
torchvision==0.9.1+cu111