Skip to content

Commit

Permalink
Fix dockerfile
Browse files Browse the repository at this point in the history
  • Loading branch information
mmattamala committed Jan 19, 2024
1 parent d0061dc commit f031f40
Show file tree
Hide file tree
Showing 4 changed files with 57 additions and 22 deletions.
34 changes: 24 additions & 10 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,11 @@ ARG ROS_VERSION="noetic"
# ==
ARG DEBIAN_FRONTEND=noninteractive

# ==
# Select shell
# ==
SHELL ["/bin/bash", "-c"]

# ==
# Install ROS
# ==
Expand All @@ -26,6 +31,7 @@ RUN apt update \
&& apt install --no-install-recommends -y ros-${ROS_VERSION}-desktop-full \
&& apt install --no-install-recommends -y \
python3-pip \
python3-venv \
python3-rosdep \
python3-rosinstall \
python3-rosinstall-generator \
Expand All @@ -40,19 +46,22 @@ RUN apt update \
# ==
# Install python packages
# ==
RUN pip3 install --no-cache-dir \
torch==2.1.0+cu118 torchvision --extra-index-url https://download.pytorch.org/whl/cu118

RUN pip3 install --no-cache-dir \
RUN cd /root \
&& python3 -m venv env --system-site-packages \
&& source /root/env/bin/activate \
&& pip install --upgrade pip \
&& pip3 install --no-cache-dir \
torch==2.1.0 torchvision --extra-index-url https://download.pytorch.org/whl/cu121 \
&& pip3 install --no-cache-dir \
black \
flake8 \
jupyter \
wget \
numpy \
tqdm \
kornia>=0.6.5 \
kornia \
torchmetrics \
pytorch_lightning==1.6.5 \
pytorch_lightning \
pytest \
scipy \
scikit-image \
Expand All @@ -69,9 +78,8 @@ RUN pip3 install --no-cache-dir \
hydra-core \
prettytable \
termcolor \
pydensecrf@git+https://github.com/lucasb-eyer/pydensecrf.git#egg=pydensecrf \
liegroups@git+https://github.com/mmattamala/liegroups#egg=liegroups \
stego@git+https://github.com/leggedrobotics/stego.git#egg=stego==0.0.1 \
pydensecrf@git+https://github.com/lucasb-eyer/pydensecrf.git \
liegroups@git+https://github.com/mmattamala/liegroups \
opencv-python>=4.6

# ==
Expand Down Expand Up @@ -100,12 +108,18 @@ FROM base as dev

ENV DEBIAN_FRONTEND=noninteractive

RUN apt-get update \
RUN mkdir -p catkin_ws/src \
&& source /opt/ros/noetic/setup.bash \
&& source "/root/.bashrc" \
&& cd /root/catkin_ws && catkin build \
&& apt-get update \
&& apt-get install -y \
ros-noetic-jackal-simulator \
ros-noetic-jackal-desktop \
ros-noetic-teleop-twist-keyboard \
ros-noetic-rqt-robot-steering \
&& rm -rf /var/lib/apt/lists/*

RUN echo "source /root/catkin_ws/devel/setup.bash" >> ~/.bashrc
RUN echo "source /root/env/bin/activate" >> ~/.bashrc
ENV DEBIAN_FRONTEND=dialog
19 changes: 18 additions & 1 deletion docker/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,30 @@

## Build and run containers

To build and run the standard container (terminal-based):
To build the container:

```sh
docker compose -f docker-compose.yaml build
```

To run the container (terminal-based):

```sh
docker compose -f docker-compose.yaml up -d
```

To launch bash on the container:

```sh
docker compose exec wvn bash
```

To stop the container:

```sh
docker compose -f docker-compose.yaml stop
```

To run the GUI-enabled version and check the Gazebo environment:

```sh
Expand Down
15 changes: 10 additions & 5 deletions docker/docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,15 @@ services:
stdin_open: true
tty: true
network_mode: "host"
environment:
- NVIDIA_VISIBLE_DEVICES=all
- NVIDIA_DRIVER_CAPABILITIES=all
runtime: nvidia
volumes:
- ../../wild_visual_navigation:/root/catkin_ws/src/wild_visual_navigation
command: '/bin/bash'
- ../../self_supervised_segmentation:/root/catkin_ws/src/self_supervised_segmentation
environment:
- ROS_IP=127.0.0.1
command: "/bin/bash"
# command: >
# /bin/bash -c "pip3 install -e /root/catkin_ws/src/wild_visual_navigation
# && pip3 install -e /root/catkin_ws/src/self_supervised_segmentation
# && cd /root/catkin_ws && catkin build
# && cd /root
# && source /root/catkin_ws/devel/setup.bash"
11 changes: 5 additions & 6 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@
"kornia>=0.6.5",
"pip",
"torchvision",
"torch@https://download.pytorch.org/whl/torch-2.1.0+cu121-cp38-cp38-linux_x86_64.whl",
"torch>=1.21",
"torchmetrics",
"pytorch_lightning==1.6.5",
"pytorch_lightning>=1.6.5",
"pytest",
"scipy",
"scikit-image",
Expand All @@ -28,9 +28,8 @@
"hydra-core",
"prettytable",
"termcolor",
"pydensecrf@git+https://github.com/lucasb-eyer/pydensecrf.git#egg=pydensecrf",
"liegroups@git+https://github.com/mmattamala/liegroups#egg=liegroups",
"stego@git+https://github.com/leggedrobotics/stego.git#egg=stego==0.0.1",
"pydensecrf@git+https://github.com/lucasb-eyer/pydensecrf.git",
"liegroups@git+https://github.com/mmattamala/liegroups",
"opencv-python>=4.6",
"wget",
"rospkg",
Expand All @@ -39,7 +38,7 @@
name="wild_visual_navigation",
version="0.0.1",
author="Jonas Frey, Matias Mattamala",
author_email="jonfrey@ethz.ch, matias@leggedrobotics.com",
author_email="jonfrey@ethz.ch, matias@robots.oex.ac.uk",
packages=find_packages(),
python_requires=">=3.7",
description="A small example package",
Expand Down

0 comments on commit f031f40

Please sign in to comment.