Skip to content

Commit

Permalink
Update docker images (#397)
Browse files Browse the repository at this point in the history
  • Loading branch information
araffin authored Sep 3, 2023
1 parent 7f98df9 commit d6b5c75
Show file tree
Hide file tree
Showing 8 changed files with 37 additions and 53 deletions.
2 changes: 1 addition & 1 deletion .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@ cluster_sbatch.sh
cluster_sbatch_mpi.sh
cluster_torchy.sh
logs/
rl-trained_agents/
.pytype/
htmlcov/
git_rewrite_commit_history.sh
.vscode/
# ignore for docker builds
rl-trained-agents/
.git/
.mypy_cache/
15 changes: 14 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
## Release 2.2.0a1 (WIP)

### Breaking Changes

### New Features

### Bug fixes

### Documentation

### Other
- Updated docker image, removed support for X server


## Release 2.1.0 (2023-08-17)

### Breaking Changes
Expand All @@ -18,7 +32,6 @@
### Other



## Release 2.0.0 (2023-06-22)

**Gymnasium support**
Expand Down
23 changes: 10 additions & 13 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,32 +2,29 @@ ARG PARENT_IMAGE
ARG USE_GPU
FROM $PARENT_IMAGE

USER root

RUN apt-get -y update \
&& apt-get -y install \
ffmpeg \
freeglut3-dev \
swig \
xvfb \
libxrandr2 \
# For building box2d
build-essential \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*

ENV CODE_DIR /root/code
ENV VENV /root/venv
COPY requirements.txt /tmp/
USER $MAMBA_USER

ENV CODE_DIR /home/$MAMBA_USER/code
COPY requirements.txt /tmp/

RUN \
eval "$(micromamba shell hook --shell bash)" && \
micromamba activate && \
mkdir -p ${CODE_DIR}/rl_zoo3 && \
pip uninstall -y stable-baselines3 && \
pip install -r /tmp/requirements.txt && \
pip install highway-env>=1.7.1 && \
rm -rf $HOME/.cache/pip

ENV PATH=$VENV/bin:$PATH

COPY docker/entrypoint.sh /tmp/
RUN chmod +x /tmp/entrypoint.sh
ENTRYPOINT ["/tmp/entrypoint.sh"]
pip cache purge

CMD /bin/bash
30 changes: 0 additions & 30 deletions docker/entrypoint.sh

This file was deleted.

2 changes: 1 addition & 1 deletion rl_zoo3/version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2.1.0
2.2.0a1
2 changes: 1 addition & 1 deletion scripts/build_docker.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
PARENT=stablebaselines/stable-baselines3

TAG=stablebaselines/rl-baselines3-zoo
VERSION=1.5.1a6
VERSION=2.2.0a1

if [[ ${USE_GPU} == "True" ]]; then
PARENT="${PARENT}:${VERSION}"
Expand Down
8 changes: 5 additions & 3 deletions scripts/run_docker_cpu.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ cmd_line="$@"
echo "Executing in the docker (cpu image):"
echo $cmd_line

docker run -it --rm --network host --ipc=host \
--mount src=$(pwd),target=/root/code/rl_zoo3,type=bind stablebaselines/rl-baselines3-zoo-cpu:latest\
bash -c "cd /root/code/rl_zoo3/ && $cmd_line"
# Note: --user=root is needed, as the current user id/group id will be used
# to mount the log directory (and $MAMBAUSER is not root)
docker run -it --user=root --rm --network host --ipc=host \
--mount src=$(pwd),target=/home/mambauser/code/rl_zoo3,type=bind stablebaselines/rl-baselines3-zoo-cpu:latest\
bash -c "cd /home/mambauser/code/rl_zoo3/ && $cmd_line"
8 changes: 5 additions & 3 deletions scripts/run_docker_gpu.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ cmd_line="$@"
echo "Executing in the docker (gpu image):"
echo $cmd_line

docker run -it --runtime=nvidia --rm --network host --ipc=host \
--mount src=$(pwd),target=/root/code/rl_zoo3,type=bind stablebaselines/rl-baselines3-zoo:latest\
bash -c "cd /root/code/rl_zoo3/ && $cmd_line"
# Note: --user=root is needed, as the current user id/group id will be used
# to mount the log directory (and $MAMBAUSER is not root)
docker run -it --user=root --runtime=nvidia --rm --network host --ipc=host \
--mount src=$(pwd),target=/home/mambauser/code/rl_zoo3,type=bind stablebaselines/rl-baselines3-zoo:latest\
bash -c "cd /home/mambauser/code/rl_zoo3/ && $cmd_line"

0 comments on commit d6b5c75

Please sign in to comment.