Skip to content

Commit

Permalink
remove unrelated configs
Browse files Browse the repository at this point in the history
  • Loading branch information
beneisner committed May 2, 2024
1 parent ae5913a commit 9b73770
Show file tree
Hide file tree
Showing 374 changed files with 80 additions and 9,450 deletions.
203 changes: 38 additions & 165 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,192 +1,65 @@
# Use the official Ubuntu 20.04 image as the base
# FROM ubuntu:20.04
FROM nvidia/cuda:11.8.0-cudnn8-runtime-ubuntu20.04
FROM nvidia/cuda:12.4.1-base-ubuntu22.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 \
# Set up the environment.
ENV CODING_ROOT=/opt/baeisner
WORKDIR $CODING_ROOT

# Install the dependencies.
RUN apt-get update && apt-get install -y \
# Dependencies required for python.
build-essential \
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/*


# VirtualGL Dependencies
RUN apt-get update && apt-get install -y \
openbox \
libxv1 \
libglu1-mesa \
mesa-utils \
libglvnd-dev \
wget \
xvfb \
libc6 \
libncursesw5-dev \
libsqlite3-dev \
libssl-dev \
libreadline-dev \
libxml2-dev \
libxmlsec1-dev \
tk-dev \
xz-utils \
zlib1g-dev \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*

# CoppeliaSim Dependencies
RUN apt-get update && \
apt-get install '^libxcb.*-dev' libx11-xcb-dev libglu1-mesa-dev libxrender-dev libxi-dev libxkbcommon-dev libxkbcommon-x11-dev -y && \
rm -rf /var/lib/apt/lists/*

# Install pyenv
ENV CODING_ROOT="/opt/baeisner"

WORKDIR $CODING_ROOT
# Install pyenv.
RUN git clone --depth=1 https://github.com/pyenv/pyenv.git .pyenv

ENV PYENV_ROOT="$CODING_ROOT/.pyenv"
ENV PYENV_ROOT=$CODING_ROOT/.pyenv
ENV PATH="$PYENV_ROOT/shims:$PYENV_ROOT/bin:$PATH"

# Install Python 3.9 using pyenv
# Install python.
RUN pyenv install 3.9.12
RUN pyenv global 3.9.12

###########################
# OLD STUFF
###########################

# 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

###########################
# END OLD STUFF
###########################

# 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

# 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"


# TODO: put this above the code copying.
# 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 graphics,utility,compute
ENV NVIDIA_DRIVER_CAPABILITIES all

###########################
# Special Torch Install
###########################

RUN pip install torch==2.0.1 torchvision==0.15.2 torchaudio==2.0.2 --index-url https://download.pytorch.org/whl/cu118
RUN pip install 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 install fvcore iopath && \
pip install --no-index --no-cache-dir pytorch3d -f https://dl.fbaipublicfiles.com/pytorch3d/packaging/wheels/py39_cu118_pyt201/download.html


# 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
# Copy in the requirements.
COPY requirements-gpu.txt .

# Install gdown.
RUN pip install gdown
RUN pip install --upgrade pip && pip install wheel==0.40.0

# Copy the download script.
COPY ./download_data.sh $CODING_ROOT/code/download_data.sh
# Install the requirements.
RUN pip install -r requirements-gpu.txt

# Copy in the third-party directory.
COPY third_party third_party

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


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"
# Install the third-party libraries.
RUN pip install -e third_party/ndf_robot

# 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
# Copy in pyproject.toml.
COPY pyproject.toml .
RUN mkdir taxpose
RUN touch taxpose/py.typed

# Set up the entry point
CMD ["python", "-c", "import torch; print(torch.cuda.is_available())"]
RUN pip install -e ".[develop]"

# Copy in the code.
COPY . .
54 changes: 3 additions & 51 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,7 @@ For our experiments, we installed torch 1.11 with cuda 11.3:

```
# pip install torch==1.11.0+cu113 torchvision==0.12.0+cu113 --extra-index-url https://download.pytorch.org/whl/cu113
# pip install torch==1.13.0+cu116 torchvision==0.14.0+cu116 --extra-index-url https://download.pytorch.org/whl/cu116
pip install torch==2.0.1 torchvision==0.15.2 torchaudio==2.0.2 --index-url https://download.pytorch.org/whl/cu118
pip install torch==1.13.0+cu116 torchvision==0.14.0+cu116 --extra-index-url https://download.pytorch.org/whl/cu116
```

### `pytorch-geometric`
Expand All @@ -70,8 +68,7 @@ For our experiments, we installed with the following command:

```
# 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.11.0+cu113.html
# 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
pip install pyg_lib torch_scatter torch_sparse torch_cluster torch_spline_conv -f https://data.pyg.org/whl/torch-2.1.0+cu121.html
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
```

### `pytorch3d`
Expand All @@ -83,9 +80,7 @@ We ran the following:
```
pip install fvcore iopath
# pip install --no-index --no-cache-dir pytorch3d -f https://dl.fbaipublicfiles.com/pytorch3d/packaging/wheels/py39_cu113_pyt1110/download.html
# pip install --no-index --no-cache-dir pytorch3d -f https://dl.fbaipublicfiles.com/pytorch3d/packaging/wheels/py39_cu116_pyt1130/download.html
# pip install --no-index --no-cache-dir pytorch3d -f https://dl.fbaipublicfiles.com/pytorch3d/packaging/wheels/py39_cu118_pyt201/download.html
pip install --no-index --no-cache-dir pytorch3d -f https://dl.fbaipublicfiles.com/pytorch3d/packaging/wheels/py39_cu116_pyt1130/download.html
```

### `dgl`
Expand All @@ -98,9 +93,6 @@ pip install --pre dgl -f https://data.dgl.ai/wheels/cu113/repo.html
pip install --pre dglgo -f https://data.dgl.ai/wheels-test/repo.html
```

# NOTE
Cursed vglrun requires us to pipe in our own custom LD_LIBRARY_PATH. This is a hacky way to do it, but it works for now.

## Install `taxpose`.

This part should be really simple:
Expand Down Expand Up @@ -153,9 +145,6 @@ python setup.py
```





# Code Structure

TODO(beisner): Clean this up.
Expand Down Expand Up @@ -659,40 +648,3 @@ These are real-world experiments we ran, and so can't be reproduced purely from
## Supplement Tables 11-14: Expanded results

These are granular results of the experiments in Table 1.


## Docker

### Build a Docker container.

```
docker build -t beisner/taxpose .
```

### This command works for RLBench eval. Hard-fought.
```
docker run --gpus "device=1" -it --rm -v /usr/share/glvnd/egl_vendor.d/10_nvidia.json:/usr/share/glvnd/egl_vendor.d/10_nvidia.json -v /home/beisner/datasets/:/data -v ./artifacts:/opt/artifacts beisner/taxpose python scripts/eval_rlbench.py --config-name commands/rlbench/reach_target/taxpose_all/eval_rlbench.yaml num_trials=100 resources.num_workers=20 wandb.artifact_dir=/opt/artifacts wandb.group=rlbench_push_button headless=True task.action_mode=gripper_and_object task.anchor_mode=background_robot_removed model.num_points=512
```

### Run training.

```
WANDB_API_KEY=<API_KEY>
USERNAME=<USERNAME>
# Optional: mount current directory to run / test new code.
# Mount data directory to access data.
docker run \
--shm-size=256m\
-v /data/ndf:/opt/baeisner/data \
-v $(pwd)/trained_models:/opt/baeisner/code/trained_models \
-v $(pwd)/logs:/opt/baeisner/logs \
--gpus all \
-e WANDB_API_KEY=$WANDB_API_KEY \
-e WANDB_DOCKER_IMAGE=beisner/taxpose \
beisner/taxpose python scripts/train_residual_flow.py \
task=mug_grasp \
model=taxpose \
+mode=train \
benchmark.dataset_root=/opt/baeisner/data \
log_dir=/opt/baeisner/logs
```
48 changes: 0 additions & 48 deletions autobot.md

This file was deleted.

2 changes: 0 additions & 2 deletions configs/benchmark/real_world_mug.yaml

This file was deleted.

2 changes: 0 additions & 2 deletions configs/benchmark/rlbench.yaml

This file was deleted.

16 changes: 0 additions & 16 deletions configs/commands/ablations/se3_augmentation/_base.yaml

This file was deleted.

Loading

0 comments on commit 9b73770

Please sign in to comment.