# Dockerfile — exact environment for the StBR / SPOT reproduction (hopper-medium-v2) # Mirrors StBR's conda_env.yml (pinned repo commit c47ebe2bf1c4bc801a225c8b86ae00917e7e706a): # python=3.8.5, pytorch>=2.1.0 (pytorch-cuda=12.1), gym==0.18.3, mujoco-py, # numpy<1.24.0, pyyaml==5.4.1, coolname==1.1.0, termcolor==1.1.0, # tensorboard==2.7.0, protobuf==3.17.3 # + MuJoCo 2.1.0 at /root/.mujoco/mujoco210 (StBR README step 1) # + d4rl pinned at the exact commit linked in the StBR README: # 4aff6f8c46f62f9a57f79caa9287efefa45b6688 # NOTE (disclosed): SPOT's own conda_env.yml pins torch 1.10.0 + cudatoolkit 10.x, # which cannot run on any current GPU (T4/L4/A10G). SPOT (plain PyTorch) is therefore # run under this StBR-derived environment; its training hyperparameters are untouched. # Pin notes (see README "Deviations" in the dataset repo): # - gym 0.18.3 caps Pillow<=8.2.0; imageio>=2.10.5 floors pillow>=8.3.2 -> imageio # is pinned to 2.9.0 (last release without a pillow pin; also what the authors' # `anaconda` metapackage shipped on py3.8.5). Two failed builds are archived in # logs/failed/ (imageio 2.31.1 and 2.19.3). # - imageio-ffmpeg provides the MP4 backend for Step-3 rendering; gymnasium+mujoco # (modern API) are used ONLY by Step-3 rendering, never by the training stack. FROM ubuntu:22.04 ENV DEBIAN_FRONTEND=noninteractive # apt-get update FIRST (fixes the earlier failure: stale lists -> 404) RUN apt-get update && apt-get install -y --no-install-recommends \ git curl wget bzip2 ca-certificates build-essential pkg-config \ libgl1-mesa-dev libosmesa6-dev libglew-dev libglfw3 libglfw3-dev patchelf libegl1 \ && rm -rf /var/lib/apt/lists/* # MuJoCo 2.1.0 (StBR README step 1) RUN mkdir -p /root/.mujoco && \ wget -q https://mujoco.org/download/mujoco210-linux-x86_64.tar.gz -O /tmp/mujoco210.tar.gz && \ tar -zxf /tmp/mujoco210.tar.gz -C /root/.mujoco/ ENV LD_LIBRARY_PATH=/root/.mujoco/mujoco210/bin:/usr/lib/nvidia:/usr/lib/x86_64-linux-gnu ENV MUJOCO_PY_MUJOCO_PATH=/root/.mujoco/mujoco210 ENV D4RL_SUPPRESS_IMPORT_ERROR=1 # Miniconda with `defaults` channel (still hosts python=3.8.5 as in conda_env.yml) RUN wget -q https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh -O /tmp/miniconda.sh && \ bash /tmp/miniconda.sh -b -p /opt/conda ENV PATH=/opt/conda/bin:/opt/conda/envs/stbr/bin:$PATH # newer conda requires accepting Anaconda's ToS for the defaults channel RUN /opt/conda/bin/conda tos accept --override-channels \ --channel https://repo.anaconda.com/pkgs/main --channel https://repo.anaconda.com/pkgs/r || true RUN conda create -y -n stbr python=3.8.5 RUN /opt/conda/envs/stbr/bin/pip install --upgrade pip==24.0 setuptools==59.5.0 wheel==0.37.1 # pytorch>=2.1.0 + CUDA 12.1 (StBR conda_env.yml), via official cu121 wheels RUN /opt/conda/envs/stbr/bin/pip install torch==2.4.1 --index-url https://download.pytorch.org/whl/cu121 RUN /opt/conda/envs/stbr/bin/pip install numpy==1.23.5 gym==0.18.3 "cython<3" mujoco-py==2.1.2.14 \ pyyaml==5.4.1 coolname==1.1.0 termcolor==1.1.0 tensorboard==2.7.0 protobuf==3.17.3 \ tqdm==4.61.2 imageio==2.9.0 h5py==3.8.0 click cloudpickle==1.6.0 pyglet==1.5.0 \ scipy matplotlib==3.7.5 # modern gymnasium + mujoco (ONLY used by the Step-3 MP4 rendering, offscreen CPU; # separate packages, not touched by the authors' training stack) RUN /opt/conda/envs/stbr/bin/pip install gymnasium==0.29.1 mujoco==2.3.7 imageio-ffmpeg # d4rl pinned at the commit linked in the StBR README (--no-deps: skips pybullet / # dm_control / mjrl, which only concern non-MuJoCo domains; d4rl guards them via try/except) RUN /opt/conda/envs/stbr/bin/pip install --no-deps \ "git+https://github.com/rail-berkeley/d4rl.git@4aff6f8c46f62f9a57f79caa9287efefa45b6688" # precompile mujoco-py at build time (catches build issues early) RUN /opt/conda/envs/stbr/bin/python -c "import mujoco_py; print('mujoco-py OK', mujoco_py.__version__)" CMD ["/bin/bash"]