Skip to content

Commit

Permalink
Move RLLib GPU release test dependencies to ml docker (ray-project#18208
Browse files Browse the repository at this point in the history
)
  • Loading branch information
krfricke authored Sep 3, 2021
1 parent 336e799 commit fb38d06
Show file tree
Hide file tree
Showing 9 changed files with 39 additions and 24 deletions.
2 changes: 1 addition & 1 deletion .buildkite/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ ENV BUILDKITE_BAZEL_CACHE_URL=${REMOTE_CACHE_URL}
RUN apt-get update -qq
RUN apt-get install -y -qq \
curl python-is-python3 git build-essential \
sudo unzip apt-utils dialog tzdata wget rsync \
sudo unzip unrar apt-utils dialog tzdata wget rsync \
language-pack-en tmux cmake gdb vim htop \
libgtk2.0-dev zlib1g-dev libgl1-mesa-dev maven \
openjdk-8-jre openjdk-8-jdk clang-format-7
Expand Down
2 changes: 1 addition & 1 deletion .buildkite/Dockerfile.gpu
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ ENV BUILDKITE_BAZEL_CACHE_URL=${REMOTE_CACHE_URL}
RUN apt-get update -qq
RUN apt-get install -y -qq \
curl git build-essential \
sudo unzip apt-utils dialog tzdata wget rsync \
sudo unzip unrar apt-utils dialog tzdata wget rsync \
language-pack-en tmux cmake gdb vim htop \
libgtk2.0-dev zlib1g-dev libgl1-mesa-dev maven \
openjdk-8-jre openjdk-8-jdk clang-format-7
Expand Down
3 changes: 3 additions & 0 deletions ci/travis/build-docker-images.py
Original file line number Diff line number Diff line change
Expand Up @@ -258,6 +258,9 @@ def build_ray_ml():
f"{_get_root_dir()}/python/**/requirements*.txt", recursive=True)
for fl in requirement_files:
shutil.copy(fl, os.path.join(root_dir, "docker/ray-ml/"))
# Install atari roms script
shutil.copy(f"{_get_root_dir()}/rllib/utils/install_atari_roms.sh",
os.path.join(root_dir, "docker/ray-ml/"))
ray_ml_images = _build_cpu_gpu_images("ray-ml")
for img in ray_ml_images:
tag = img.split(":")[-1]
Expand Down
7 changes: 7 additions & 0 deletions ci/travis/install-dependencies.sh
Original file line number Diff line number Diff line change
Expand Up @@ -349,6 +349,13 @@ install_dependencies() {
pip install -r "${WORKSPACE_DIR}"/python/requirements/rllib/requirements_rllib.txt
# install the following packages for testing on travis only
pip install 'recsim>=0.2.4'

# Install Atari ROMs. Previously these have been shipped with atari_py
if [[ "${OSTYPE}" = linux* ]]; then
bash "${WORKSPACE_DIR}"/rllib/utils/install_atari_roms.sh
else
echo "Not installing Atari roms on ${OSTYPE}"
fi
fi

# Additional Tune/SGD/Doc test dependencies.
Expand Down
6 changes: 6 additions & 0 deletions docker/ray-ml/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,16 @@ COPY requirements.txt ./
COPY requirements_ml_docker.txt ./
COPY requirements_rllib.txt ./
COPY requirements_tune.txt ./requirements_tune.txt
COPY install_atari_roms.sh ./install_atari_roms.sh

RUN sudo apt-get update \
&& sudo apt-get install -y gcc \
cmake \
libgtk2.0-dev \
zlib1g-dev \
libgl1-mesa-dev \
unzip \
unrar \
&& $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 \
Expand All @@ -25,3 +28,6 @@ RUN sudo apt-get update \
&& sudo rm requirements.txt && sudo rm requirements_ml_docker.txt \
&& sudo rm requirements_tune.txt && sudo rm requirements_rllib.txt \
&& sudo apt-get clean

# Install Atari ROMs. Previously these have been shipped with atari_py \
RUN ./install_atari_roms.sh
2 changes: 1 addition & 1 deletion python/requirements/rllib/requirements_rllib.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ torchvision==0.9.1+cpu;sys_platform!="darwin"
# Environment adapters.
# ---------------------
# Atari
atari_py==0.2.6
atari_py==0.2.9
gym[atari]==0.18.3
# Kaggle envs.
kaggle_environments==1.7.11
Expand Down
2 changes: 1 addition & 1 deletion python/requirements_ml_docker.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
ipython
# In TF >v2, GPU support is included in the base package.
tensorflow==2.5
tensorflow==2.4.3
-f https://download.pytorch.org/whl/torch_stable.html
torch==1.8.1+cu111
-f https://download.pytorch.org/whl/torch_stable.html
Expand Down
23 changes: 3 additions & 20 deletions release/rllib_tests/app_config.yaml
Original file line number Diff line number Diff line change
@@ -1,31 +1,14 @@
base_image: "anyscale/ray-ml:pinned-nightly-py37-gpu"
env_vars: {}
debian_packages:
- libglib2.0-0
- unrar
- curl
- unzip
- gcc
- python3-dev
debian_packages: []

python:
pip_packages:
# Atari support.
- gym[atari]
- atari_py
# PyBullet support.
- pybullet
- pybullet_envs
# Pin this to 2.4.3 so it'll work with CUDA=11.0.
- tensorflow==2.4.3
# These dependencies should be handled by requirements_rllib.txt and requirements_ml_docker.txt
pip_packages: []
conda_packages: []

post_build_cmds:
- pip uninstall -y numpy ray || true
- sudo rm -rf /home/ray/anaconda3/lib/python3.7/site-packages/numpy
- pip3 install numpy==1.19.5 || true
- pip3 install -U {{ env["RAY_WHEELS"] | default("ray") }}
# Install Atari ROMs.
- wget http://www.atarimania.com/roms/Roms.rar
- unrar x Roms.rar
- python -m atari_py.import_roms .
16 changes: 16 additions & 0 deletions rllib/utils/install_atari_roms.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#!/bin/bash
set -e
echo "Downloading Atari roms and importing into gym"
ROMDIR=$(mktemp -d)
pushd "$ROMDIR"
wget -q http://www.atarimania.com/roms/Roms.rar
unrar x "Roms.rar" > /dev/null
# Importing from zipfiles with atari_py only works in Python >= 3.7
# so we unzip manually here
mkdir -p ./unzipped
unzip "ROMS.zip" -d ./unzipped
unzip "HC ROMS.zip" -d ./unzipped
python -m atari_py.import_roms ./unzipped
popd
echo rm -rf "$ROMDIR"
echo "Successfully installed Atari roms"

0 comments on commit fb38d06

Please sign in to comment.