1+ FROM nvidia/cudagl:11.0-devel-ubuntu20.04
2+ ARG DEBIAN_FRONTEND=noninteractive
3+
4+ ARG PYTHON_VERSION=3.8
5+
6+ ARG branch
7+
8+ # Install ubuntu libaries
9+ RUN apt-get update && \
10+ apt-get install -y --no-install-recommends build-essential cmake pkg-config \
11+ libfreetype6-dev git nano wget curl vim ca-certificates unzip libjpeg-dev \
12+ libpng-dev libosmesa6-dev software-properties-common xvfb gpg-agent
13+
14+ # Install miniconda
15+ RUN curl -o ~/miniconda.sh -O https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh && \
16+ chmod +x ~/miniconda.sh && \
17+ ~/miniconda.sh -b -p /opt/conda && \
18+ rm ~/miniconda.sh && \
19+ /opt/conda/bin/conda update -n base -c defaults conda && \
20+ /opt/conda/bin/conda install -y python=$PYTHON_VERSION setuptools patchelf && \
21+ /opt/conda/bin/conda clean -ya
22+ ENV PATH /opt/conda/bin:$PATH
23+
24+
25+ # Env vars for the nvidia-container-runtime.
26+ ENV PATH /usr/local/cuda/bin/:$PATH
27+ ENV LD_LIBRARY_PATH /usr/local/cuda/lib:/usr/local/cuda/lib64
28+ ENV NVIDIA_VISIBLE_DEVICES all
29+ ENV NVIDIA_DRIVER_CAPABILITIES compute,utility
30+ LABEL com.nvidia.volumes.needed="nvidia_driver"
31+
32+ # Install weebots
33+ RUN wget -qO- https://cyberbotics.com/Cyberbotics.asc | apt-key add -
34+ RUN apt-add-repository 'deb https://cyberbotics.com/debian/ binary-amd64/' && \
35+ apt-get update && apt-get install -y webots
36+
37+ # Save enviroment libraries
38+ ENV WEBOTS_HOME /usr/local/webots
39+ ENV LD_LIBRARY_PATH $WEBOTS_HOME/lib/controller:$LD_LIBRARY_PATH
40+
41+
42+ ADD requirements.txt .
43+ # Install python dependencies
44+ RUN pip install -r requirements.txt
45+
46+ RUN if [ $branch = "dev" ]; then pip install -i https://test.pypi.org/simple/ deepbots ; else pip install deepbots ; fi
47+
48+ RUN pip install 'ray[tune]' 'ray[rllib]'
49+
50+ # Fix the error of the custome enviroment on Ray
51+ ADD preprocessors.py .
52+ RUN cp -r preprocessors.py opt/conda/lib/python3.8/site-packages/ray/rllib/models/
53+ RUN rm preprocessors.py
54+
55+
56+ WORKDIR /workspace
57+ RUN chmod -R a+w /workspace
0 commit comments