Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 13 additions & 11 deletions docker/Commands → Docker/Commands
Original file line number Diff line number Diff line change
@@ -1,29 +1,31 @@
# Build a docker image with all dependencies for Linux running the command below from the repo root folder.
# Dependency: Docker, Nvidia-Docker, Nvidia cuda-enabled GPU. If you do not have Nvidia GPU you might use also the Dockerfile_Windows for building image on Linux.
docker build . -t vtprl_image -f docker/Dockerfile
# Build a docker image with all dependencies for Linux running the command below from the repo root folder
# Dependency: Docker, Nvidia-Docker, Nvidia cuda-enabled GPU. if you do not have Nvidia GPU you might use also the Dockerfile_Windows for building image on Linux)
docker build . -t cmlr_image -f Docker/Dockerfile

# Build a docker image with all dependencies for Windows running the command below from the repo root folder on Windows.
# Dependencies: Docker for Windows with Linux containers enabled. Only difference from Dockerfile is the root image it starts from as Docker Windows does not support GPU acceleration from inside Docker.
docker build . -t vtprl_image -f docker/Dockerfile_Windows
# Dependencies: Docker for Windows with Linux containers enabled. Only difference from Dockerfile is the root image it starts from as Docker Windows does not support GPU acceleration from inside Docker
docker build . -t cmlr_image -f Docker/Dockerfile_Windows

# These commands are useful to run before starting the container in case you want to start the simulator from a shell inside the container (not possible for Windows, works on linux).
# Starting the simulator on a fake display of X server on the AI4DI server from the shell:
DISPLAY=:3 ./ManipulatorEnvironment_Linux.x86_64

export DISPLAY=":0"
# These commands are useful to run before starting the container in case you want to start the simulator from a shell inside the container (not possible for Windows, works on AI4DI servers, you can set it on your local machines or on VM from LRZ CC after installing X server) - it allows local connections to your X server
export DISPLAY=":3"
xhost + local:

# After building create a container with the built image running the command below from the repo root folder. Same for Windows, but remove the --gpus parameter as it is not supported on Windows.
# After building create a container with the built image running the command below from the repo root folder. Same for Windows, but remove the --gpus parameter as it is not supported on Windows
docker run --rm -it \
--name vtprl_container \
--name cmlr_container \
--gpus all \
-e DISPLAY \
-v $(pwd):/home/[repo_name]:rw \
-v $(pwd)/external/stable-baselines3:/home/repos/stable-baselines3:ro \
--privileged \
--net="host" \
vtprl_image:latest \
cmlr_image:latest \
bash

# On local machines you can start the simulator outside of docker as well, cd to the repository root folder inside the docker container and run python3 agant/main.py to connect to the simulator and start training.

# If there are errors see "Troubleshooting" section.
# If there are errors see "Troubleshooting" section

21 changes: 15 additions & 6 deletions docker/Dockerfile → Docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# syntax=docker/dockerfile:1
FROM nvidia/cudagl:10.0-devel-ubuntu18.04
FROM nvidia/cudagl:11.0-devel-ubuntu18.04

ENV DEBIAN_FRONTEND=noninteractive

Expand All @@ -9,7 +9,7 @@ ADD https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2004/x86_64
RUN dpkg -i cuda-keyring_1.0-1_all.deb
RUN rm /etc/apt/sources.list.d/cuda.list
RUN rm /etc/apt/sources.list.d/nvidia-ml.list
RUN apt-get update && apt-get install -y ffmpeg libsm6 libxext6 python3.7 python3.7-dev python3-pip && \
RUN apt-get update && apt-get install -y htop nano graphviz ffmpeg libsm6 libxext6 python3.7 python3.7-dev python3-pip && \
rm /usr/bin/python3 && ln -s /usr/bin/python3.7 /usr/bin/python3 && \
python3 -m pip install --upgrade pip

Expand All @@ -23,20 +23,29 @@ RUN apt-get install -y build-essential cmake pkg-config git && \
cd pybind11 && mkdir build && cd build && cmake .. && make -j4 && make install && \
cd /home/repos && git clone https://github.com/dartsim/dart.git && cd dart && git checkout tags/v6.11.1

# Install viewer dependencies
RUN apt-get install -y libxcb-icccm4 && apt-get install -y libxcb-image0 && \
apt-get install -y libxcb-keysyms1 && apt-get install -y libxcb-render-util0 && \
apt-get install -y libxcb-xkb-dev && apt-get install -y libxkbcommon-x11-0 && \
apt-get install -y libxcb-xinerama0

RUN python3 -m pip install --upgrade pip

# Install DartPy from source with new bindings
COPY resources/dart_additional_files /home/repos/dart
COPY Dart_Additional_Files /home/repos/dart
RUN cd /home/repos/dart && mkdir build && cd build && \
cmake .. -DCMAKE_INSTALL_PREFIX=/usr/ -DCMAKE_BUILD_TYPE=Release -DDART_BUILD_DARTPY=ON && \
make -j4 dartpy && make install-dartpy

# Install Requirements
ADD docker/requirements.txt /home/requirements.txt
RUN python3 -m pip install -r /home/requirements.txt
ADD Docker/requirements.txt /home/requirements.txt
RUN python3 -m pip install -r /home/requirements.txt --log /home/requirements_logs.txt

# Install Stable-Baselines-3
COPY external/stable-baselines3 /home/repos/stable-baselines3
#RUN cd /home/repos/stable-baselines3 && python3 -m pip install -e .
RUN cd /usr/local/lib/python3.7/dist-packages/ && python3 /home/repos/stable-baselines3/setup.py develop

RUN cd /usr/local/lib/python3.7/dist-packages/ && python3 /home/repos/stable-baselines3/setup.py develop
ENV PYTHONPATH='/home/repos/stable-baselines3'
ENV WANDB_API_KEY=INSERT_KEY_HERE

Expand Down
13 changes: 10 additions & 3 deletions docker/Dockerfile_Windows → Docker/Dockerfile_Windows
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,20 @@ RUN apt-get install -y build-essential cmake pkg-config git && \
cd /home/repos && git clone https://github.com/dartsim/dart.git && cd dart && git checkout tags/v6.11.1

# Install DartPy from source with new bindings
COPY resources/dart_additional_files /home/repos/dart
COPY Dart_Additional_Files /home/repos/dart
RUN cd /home/repos/dart && mkdir build && cd build && \
cmake .. -DCMAKE_INSTALL_PREFIX=/usr/ -DCMAKE_BUILD_TYPE=Release -DDART_BUILD_DARTPY=ON && \
make -j4 dartpy && make install-dartpy

# Install viewer dependencies
RUN apt-get install -y libxcb-icccm4 && apt-get install -y libxcb-image0 && \
apt-get install -y libxcb-keysyms1 && apt-get install -y libxcb-render-util0 && \
apt-get install -y libxcb-xkb-dev && apt-get install -y libxkbcommon-x11-0 && \
apt-get install -y libxcb-xinerama0

# Install Requirements
ADD docker/requirements.txt /home/requirements.txt
RUN python3 -m pip install -r /home/requirements.txt
ADD Docker/requirements.txt /home/requirements.txt
RUN python3 -m pip install -r /home/requirements.txt --log /home/requirements_logs.txt

# Install Stable-Baselines-3
COPY external/stable-baselines3 /home/repos/stable-baselines3
Expand All @@ -33,3 +39,4 @@ ENV PYTHONPATH='/home/repos/stable-baselines3'
ENV WANDB_API_KEY=INSERT_KEY_HERE

WORKDIR /home

File renamed without changes.
31 changes: 31 additions & 0 deletions Docker/requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
--extra-index-url https://download.pytorch.org/whl/cu116
tqdm==4.65.0
zmq==0.0.0
protobuf==3.20.1
roslibpy==1.5.0

Pillow==8.0.1
numpy==1.21.6
matplotlib==3.5.3
opencv-python-headless==4.7.0.72
scipy==1.7.3
seaborn==0.12.2
pandas==1.1.5

tensorboard==1.15.0
tensorflow-estimator==1.15.1
tensorflow-gpu==1.15.0

torch==1.12.0+cu116
torchvision==0.13.0+cu116
pytorch-lightning==0.8.1

optuna==3.1.1
wandb==0.12.11

Box2D==2.3.10
gym==0.17.3

PySide2==5.15.2.1

ruckig==0.9.2
Loading