-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathDockerfile
88 lines (66 loc) · 3.09 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
# Use the official Ubuntu 20.04 image as the base
FROM ubuntu:20.04
# Set environment variables to avoid interactive prompts during installation
ENV DEBIAN_FRONTEND=noninteractive
# Install necessary dependencies
RUN apt-get update && \
apt-get install -y curl git build-essential libssl-dev zlib1g-dev libbz2-dev \
git \
libreadline-dev libsqlite3-dev wget llvm libncurses5-dev libncursesw5-dev \
xz-utils tk-dev libffi-dev liblzma-dev python-openssl && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*
# Install pyenv
ENV CODING_ROOT="/opt/baeisner"
WORKDIR $CODING_ROOT
RUN git clone --depth=1 https://github.com/pyenv/pyenv.git .pyenv
ENV PYENV_ROOT="$CODING_ROOT/.pyenv"
ENV PATH="$PYENV_ROOT/shims:$PYENV_ROOT/bin:$PATH"
# Install Python 3.10 using pyenv
RUN pyenv install 3.9.12
RUN pyenv global 3.9.12
# Install PyTorch with CUDA support (make sure to adjust this depending on your CUDA version)
RUN pip install torch==1.13.0+cu116 torchvision==0.14.0+cu116 --extra-index-url https://download.pytorch.org/whl/cu116
# Install pytorch geometric.
RUN pip install torch-scatter==2.0.9 torch-sparse==0.6.15 torch-cluster==1.6.0 torch-spline-conv==1.2.1 pyg_lib==0.1.0 -f https://data.pyg.org/whl/torch-1.13.0+cu116.html
# Install pytorch3d
RUN pip install fvcore iopath && \
pip install --no-index --no-cache-dir pytorch3d -f https://dl.fbaipublicfiles.com/pytorch3d/packaging/wheels/py39_cu116_pyt1130/download.html
# Download CoppeliaSim
RUN mkdir $CODING_ROOT/.coppelia
WORKDIR $CODING_ROOT/.coppelia
RUN curl https://www.coppeliarobotics.com/files/V4_1_0/CoppeliaSim_Edu_V4_1_0_Ubuntu20_04.tar.xz -o CoppeliaSim_Edu_V4_1_0_Ubuntu20_04.tar.xz && \
tar -xf CoppeliaSim_Edu_V4_1_0_Ubuntu20_04.tar.xz && \
rm CoppeliaSim_Edu_V4_1_0_Ubuntu20_04.tar.xz
# modify environment variables
ENV COPPELIASIM_ROOT="$CODING_ROOT/.coppelia/CoppeliaSim_Edu_V4_1_0_Ubuntu20_04"
ENV LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$COPPELIASIM_ROOT"
ENV QT_QPA_PLATFORM_PLUGIN_PATH="$COPPELIASIM_ROOT"
# Install CFFI
RUN pip install cffi==1.14.2 wheel
# Install PyRep
RUN pip install --no-build-isolation "pyrep @ git+https://github.com/stepjam/PyRep.git"
# Make the working directory the home directory
RUN mkdir $CODING_ROOT/code
WORKDIR $CODING_ROOT/code
# Only copy in the source code that is necessary for the dependencies to install
COPY ./taxpose $CODING_ROOT/code/taxpose
COPY ./third_party $CODING_ROOT/code/third_party
COPY ./setup.py $CODING_ROOT/code/setup.py
COPY ./pyproject.toml $CODING_ROOT/code/pyproject.toml
RUN pip install -e ".[rlbench]"
RUN pip install -e third_party/ndf_robot
# Changes to the configs and scripts will not require a rebuild
COPY ./configs $CODING_ROOT/code/configs
COPY ./scripts $CODING_ROOT/code/scripts
RUN git config --global --add safe.directory /root/code
# Make a data directory.
RUN mkdir $CODING_ROOT/data
# Make a logs directory.
RUN mkdir $CODING_ROOT/logs
# Install gdown.
RUN pip install gdown
# Copy the download script.
COPY ./download_data.sh $CODING_ROOT/code/download_data.sh
# Set up the entry point
CMD ["python", "-c", "import torch; print(torch.cuda.is_available())"]