forked from kzl/decision-transformer
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
124 lines (100 loc) · 4.06 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
# We need the CUDA base dockerfile to enable GPU rendering
# on hosts with GPUs.
FROM nvidia/cuda:12.4.1-devel-ubuntu22.04
RUN apt-get update -q \
&& DEBIAN_FRONTEND=noninteractive apt-get install -y \
curl \
git \
libgl1-mesa-dev \
libgl1-mesa-glx \
libglew-dev \
libosmesa6-dev \
software-properties-common \
net-tools \
wget \
xpra \
xserver-xorg-dev \
python-is-python3 \
python3-pip \
python3-venv \
patchelf \
cmake \
unzip \
tensorrt \
# build-essential \
# libtbb-dev \
sudo \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*
# vim \
# virtualenv \
# RUN DEBIAN_FRONTEND=noninteractive add-apt-repository --yes ppa:deadsnakes/ppa && apt-get update
# RUN DEBIAN_FRONTEND=noninteractive apt-get install --yes python3.6-dev python3.6 python3-pip
# RUN virtualenv --python=python3.6 env
# RUN rm /usr/bin/python
# RUN ln -s /env/bin/python3.6 /usr/bin/python
# RUN ln -s /env/bin/pip3.6 /usr/bin/pip
# RUN ln -s /env/bin/pytest /usr/bin/pytest
# RUN curl -o /usr/local/bin/patchelf https://s3-us-west-2.amazonaws.com/openai-sci-artifacts/manual-builds/patchelf_0.9_amd64.elf \
# && chmod +x /usr/local/bin/patchelf
ENV LANG C.UTF-8
RUN mkdir -p /opt/mujoco \
&& wget https://mujoco.org/download/mujoco210-linux-x86_64.tar.gz -O mujoco.tar.gz \
&& tar -xf mujoco.tar.gz -C /opt/mujoco \
&& rm mujoco.tar.gz
ENV MUJOCO_PY_MUJOCO_PATH /opt/mujoco/mujoco210
ENV LD_LIBRARY_PATH /opt/mujoco/mujoco210/bin:${LD_LIBRARY_PATH}
ENV LD_LIBRARY_PATH /usr/local/nvidia/lib64:${LD_LIBRARY_PATH}
# COPY vendor/Xdummy /usr/local/bin/Xdummy
# RUN chmod +x /usr/local/bin/Xdummy
# Workaround for https://bugs.launchpad.net/ubuntu/+source/nvidia-graphics-drivers-375/+bug/1674677
# COPY ./vendor/10_nvidia.json /usr/share/glvnd/egl_vendor.d/10_nvidia.json
# RUN git clone --recursive https://github.com/opencv/opencv-python.git \
# && cd opencv-python \
# && CMAKE_ARGS="-DCMAKE_BUILD_TYPE=RELEASE-D WITH_TBB=ON \
# -D ENABLE_FAST_MATH=1 \
# -D CUDA_FAST_MATH=1 \
# -D WITH_CUBLAS=1 \
# -D WITH_CUDA=ON \
# -D BUILD_opencv_cudacodec=OFF \
# -D WITH_CUDNN=ON \
# -D OPENCV_DNN_CUDA=ON \
# -D INSTALL_PYTHON_EXAMPLES=OFF \
# -D INSTALL_C_EXAMPLES=OFF " \
# pip wheel . --verbose
RUN curl -O https://dl.google.com/dl/cloudsdk/channels/rapid/downloads/google-cloud-cli-469.0.0-linux-x86_64.tar.gz
RUN tar -xf google-cloud-cli-469.0.0-linux-x86_64.tar.gz
RUN ./google-cloud-sdk/install.sh --usage-reporting false -q
RUN useradd -m -s /bin/bash user && \
echo user ALL=\(root\) NOPASSWD:ALL > /etc/sudoers.d/user \
&& chmod 0440 /etc/sudoers.d/user
USER user
WORKDIR /home/user
RUN python -m venv --system-site-packages .env \
&& . .env/bin/activate \
&& pip install gymnasium torch "tensorflow==2.15" carla wandb "cython<3" mujoco \
transformers atari-py opencv-python blosc dopamine-rl dopaminekit \
tensorflow-estimator \
ray[all]
#git+https://github.com/Farama-Foundation/d4rl@master#egg=d4rl
RUN git clone https://github.com/TTF2050/d4rl.git && cd d4rl && git checkout update-to-gymnasium && pip install -e .
ENV VIRTUAL_ENV /home/user/.env
ENV PATH /home/user/.env/bin:$PATH
RUN python -c "import d4rl"
RUN git clone https://github.com/karpathy/minGPT.git && cd minGPT && pip install -e .
RUN curl -O https://www.atarimania.com/roms/Atari-2600-VCS-ROM-Collection.zip
RUN unzip Atari-2600-VCS-ROM-Collection.zip -d Atari-2600-VCS-ROM-Collection || true
RUN python -m atari_py.import_roms Atari-2600-VCS-ROM-Collection
# Copy over just requirements.txt at first. That way, the Docker cache doesn't
# expire until we actually change the requirements.
# COPY ./requirements.txt /mujoco_py/
# COPY ./requirements.dev.txt /mujoco_py/
# RUN pip install --no-cache-dir -r requirements.txt
# RUN pip install --no-cache-dir -r requirements.dev.txt
# Delay moving in the entire code until the very end.
# ENTRYPOINT ["/mujoco_py/vendor/Xdummy-entrypoint"]
# CMD ["pytest"]
# COPY . /mujoco_py
# RUN python setup.py install
# COPY entrypoint.sh /
# ENTRYPOINT ["/entrypoint.sh"]