Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/main' into back_to_rlbench
Browse files Browse the repository at this point in the history
  • Loading branch information
beneisner committed May 14, 2024
2 parents 2a541d5 + 9e8aa27 commit bdc76c1
Show file tree
Hide file tree
Showing 2 changed files with 68 additions and 56 deletions.
120 changes: 66 additions & 54 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ ENV DEBIAN_FRONTEND=noninteractive
RUN apt-get update && \
apt-get install -y \
curl \
ffmpeg \
git \
build-essential \
libssl-dev \
Expand All @@ -26,21 +27,33 @@ RUN apt-get update && \
tk-dev \
libffi-dev \
liblzma-dev \
python-openssl && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*


# VirtualGL Dependencies
RUN apt-get update && apt-get install -y \
openbox \
libxv1 \
libncursesw5-dev \
libsqlite3-dev \
libssl-dev \
libreadline-dev \
libxml2-dev \
libxmlsec1-dev \
tk-dev \
xz-utils \
zlib1g-dev \
# VirtualGL Dependencies.
libc6 \
libglu1-mesa \
mesa-utils \
libglvnd-dev \
libxv1 \
mesa-utils \
openbox \
wget \
xvfb \
libc6 \
# CoppeliaSim Dependencies.
libglu1-mesa-dev \
'^libxcb.*-dev' \
libxi-dev \
libxkbcommon-dev \
libxkbcommon-x11-dev \
libxrender-dev \
libx11-xcb-dev \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*

# CoppeliaSim Dependencies
Expand Down Expand Up @@ -126,13 +139,35 @@ RUN pip install --no-build-isolation "pyrep @ git+https://github.com/stepjam/PyR
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
# Download CoppeliaSim
RUN mkdir $CODING_ROOT/.coppelia
WORKDIR $CODING_ROOT/.coppelia
RUN curl -L 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

# Set the working directory back to the code directory.
WORKDIR $CODING_ROOT/code

# modify environment variables for coppelia sim
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 VirtualGL
RUN wget --no-check-certificate https://github.com/VirtualGL/virtualgl/releases/download/3.1.1/virtualgl_3.1.1_amd64.deb \
&& dpkg -i virtualgl_*.deb \
&& rm virtualgl_*.deb

# Configure VirtualGL
RUN /opt/VirtualGL/bin/vglserver_config +s +f -t +egl

# Setup environment variables for NVIDIA and VirtualGL
ENV NVIDIA_VISIBLE_DEVICES all
ENV NVIDIA_DRIVER_CAPABILITIES all

# Copy in the requirements.
COPY requirements-gpu.txt .

# Changes to the configs and scripts will not require a rebuild
COPY ./configs $CODING_ROOT/code/configs
Expand All @@ -146,46 +181,23 @@ RUN mkdir $CODING_ROOT/data
# Make a logs directory.
RUN mkdir $CODING_ROOT/logs

# Install gdown.
RUN pip install gdown
# Install pyrep.
RUN pip install --no-cache-dir --no-build-isolation "pyrep @ git+https://github.com/stepjam/PyRep.git"

# Copy the download script.
COPY ./download_data.sh $CODING_ROOT/code/download_data.sh
# Copy in pyproject.toml.
COPY pyproject.toml .
RUN mkdir taxpose
RUN touch taxpose/py.typed

# Install our project.
RUN pip install --no-cache-dir -e ".[develop,rlbench]"

# Install ffmpeg.
RUN apt-get update && apt-get install -y ffmpeg && apt-get clean && rm -rf /var/lib/apt/lists/*
# Copy in the code.
COPY . .

# Make directories for mounting.
RUN mkdir $CODING_ROOT/data
RUN mkdir $CODING_ROOT/logs

COPY ./docker/entrypoint.sh /opt/baeisner/entrypoint.sh
ENTRYPOINT ["/opt/baeisner/entrypoint.sh"]

# RUN pip install --force-reinstall 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

# RUN pip install --force-reinstall torch==2.0.1 torchvision==0.15.2 torchaudio==2.0.2 --index-url https://download.pytorch.org/whl/cu118
# RUN pip install --force-reinstall pyg_lib torch_scatter torch_sparse torch_cluster torch_spline_conv -f https://data.pyg.org/whl/torch-2.0.0+cu118.html
# RUN pip uninstall -y pytorch3d
# RUN pip install --force-reinstall fvcore iopath && \
# pip install --no-index --no-cache-dir pytorch3d -f https://dl.fbaipublicfiles.com/pytorch3d/packaging/wheels/py39_cu118_pyt201/download.html
#
# RUN rm -r /opt/baeisner/.coppelia
# # COPY docker/.coppelia /opt/baeisner/.coppelia
# COPY docker/.coppelia/coppeliasim.tar.xz /opt/baeisner/.coppelia/coppeliasim.tar.xz
# WORKDIR $CODING_ROOT/.coppelia
# RUN tar -xf /opt/baeisner/.coppelia/coppeliasim.tar.xz
# WORKDIR $CODING_ROOT/code

# 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"
# RUN chmod 777 /opt/baeisner/.coppelia/CoppeliaSim_Edu_V4_1_0_Ubuntu20_04

# RUN echo "Hello"
# RUN pip install --user --no-build-isolation "pyrep @ git+https://github.com/stepjam/PyRep.git"

# RUN curl -L https://downloads.coppeliarobotics.com/V4_6_0_rev18/CoppeliaSim_Pro_V4_6_0_rev18_Ubuntu20_04.tar.xz -o CoppeliaSim_Pro_V4_6_0_rev18_Ubuntu20_04.tar.xz && \
# tar -xf CoppeliaSim_Pro_V4_6_0_rev18_Ubuntu20_04.tar.xz && \
# rm CoppeliaSim_Pro_V4_6_0_rev18_Ubuntu20_04.tar.xz

# Set up the entry point
CMD ["python", "-c", "import torch; print(torch.cuda.is_available())"]
4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,8 @@ develop = [
]
rlbench = [
# These should be installed manually...
"pyrep",
"rlbench",
# "pyrep",
# "rlbench @ git+https://github.com/stepjam/RLBench.git",
"rpad-rlbench-utils @ git+https://github.com/r-pad/rlbench_utils.git",
]
build_docs = ["mkdocs-material", "mkdocstrings[python]"]
Expand Down

0 comments on commit bdc76c1

Please sign in to comment.