Skip to content

Commit 6992538

Browse files
author
David von Wrangel
committed
added docker files
1 parent dc9ea92 commit 6992538

File tree

4 files changed

+114
-25
lines changed

4 files changed

+114
-25
lines changed

README.md

Lines changed: 37 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -17,28 +17,39 @@ Note: The PRM and Bimanual reproductions do not yet work on Deepnote and the UAV
1717

1818
## Running locally
1919

20-
### Installing Dependencies
21-
This code depends on [Drake](https://drake.mit.edu), specifically its Python bindings. To install Drake bindings follow the instruction on [Drake's Installation Page](https://drake.mit.edu/installation.html). Any of the installation methods listed should work. You can check that the installation was sucessful by following the instruction [here](https://drake.mit.edu/python_bindings.html#using-the-python-bindings).
20+
### Option 1: Docker
21+
We provide a [dockerfile](docker/deepnote/Dockerfile) with a custom build of [Drake](https://drake.mit.edu) that entails sampling based planners for the comparison. Note that the docker does not include a build of Gurobi, which has been only used in the Iris region generation.
2222

23-
We have used Mosek to solve most of the examples. To solve using Mosek, you'll need to give Drake access to a Mosek license file as described [here](https://drake.mit.edu/bazel.html#mosek). Mosek provides a personal academic license for free.
24-
25-
You will also need to install `gcs` and its dependencies. You can do this by running
23+
Pull the docker:
24+
```sh
25+
docker pull wrangelvid/drake:gcs-science-robotics
2626
```
27-
pip install -r requirements.txt
27+
28+
Run the docker:
29+
```sh
30+
docker run -i -p 7000:7000 -p 8888:8888 -w /gcs-science-robotics -t wrangelvid/drake:gcs-science-robotics
2831
```
2932

30-
### Running Examples
31-
Once all the dependencies have been installed, you can run the examples with jupyter notebooks which can be launched by calling
33+
In another shell, copy over your mosek license:
34+
35+
```sh
36+
docker cp [PATH_TO_MOSEK.lic] [container_id]:/tmp/mosek.lic
3237
```
33-
jupyter-notebook
38+
39+
Once the docker has been build and run, you can run the examples with jupyter notebooks:
40+
41+
In the docker run the jupyter server:
42+
```sh
43+
jupyter notebook --ip 0.0.0.0 --no-browser --allow-root --NotebookApp.token=''
3444
```
35-
from inside this repository.
3645

37-
### Running the Sampling Based Comparison
38-
If you want to compare GCS to sampling based planners (such as PRM), you'll need to install a custom fork of drake that includes bindings for sampling based planners. To do this run the following, including any of the proprietary solvers you have access to.
46+
On your machine go to http://localhost:8888/ You will find the reproduction notebooks in the reproduction folder.
47+
48+
### Option 2: Local Installation
49+
If you want to compare GCS to sampling based planners (such as PRM), you'll need to install a custom fork of [Drake](https://drake.mit.edu) that includes bindings for sampling based planners. To do this run the following, including any of the proprietary solvers you have access to. You may build it with Gurobi.
3950

4051
```
41-
git clone -b gcs_paper [email protected]:wrangelvid/drake.git
52+
git clone -b gcs-science-robotics [email protected]:wrangelvid/drake.git
4253
mkdir drake-build
4354
cd drake-build
4455
cmake -DWITH_MOSEK=ON [-DWITH_GUROBI=ON -DWITH_ROBOTLOCOMOTION_SNOPT=ON] ../drake
@@ -58,3 +69,16 @@ For macOS:
5869
cd drake-build
5970
export PYTHONPATH=${PWD}/install/lib/python3.9/site-packages:$PYTHONPATH
6071
```
72+
73+
We have used Mosek to solve most of the examples. To solve using Mosek, you'll need to give Drake access to a Mosek license file as described [here](https://drake.mit.edu/bazel.html#mosek). Mosek provides a personal academic license for free.
74+
75+
You will also need to install `gcs-science-robotics` and its dependencies. From inside this repository, run the following:
76+
```
77+
pip install -e .
78+
```
79+
80+
Once all the dependencies have been installed, you can run the examples with jupyter notebooks which can be launched by calling
81+
```
82+
jupyter-notebook
83+
```
84+
from inside this repository.

docker/deepnote/Dockerfile

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
# -*- mode: dockerfile -*-
2+
# vi: set ft=dockerfile :
3+
4+
# git clone -b gcs-science-robotics [email protected]:wrangelvid/drake.git
5+
# mkdir drake-build
6+
# cd drake-build
7+
# cmake -DWITH_MOSEK=ON ../drake
8+
# make -j
9+
# Then copy this Dockerfile into the drake-build folder
10+
# docker build -f Dockerfile -t wrangelvid/drake:gcs-science-robotics ./install
11+
#
12+
# docker login
13+
# docker push wrangelvid/drake:gcs-science-robotics
14+
15+
FROM ubuntu:jammy
16+
ARG DEBIAN_FRONTEND=noninteractive
17+
ENV SHELL /bin/bash
18+
# Open ports for meshcat:
19+
EXPOSE 7000-7099/tcp
20+
EXPOSE 8888/tcp
21+
22+
LABEL org.opencontainers.image.authors="David von Wrangel"
23+
LABEL org.opencontainers.image.description="Drake with sampling based planning for the gcs paper"
24+
LABEL org.opencontainers.image.licenses="BSD-3-Clause"
25+
LABEL org.opencontainers.image.source="https://github.com/wrangelvid/drake/tree/gcs-science-robotics"
26+
LABEL org.opencontainers.image.vendor="Massachusetts Institute of Technology"
27+
28+
ENV LANG en_US.UTF-8
29+
ENV LANGUAGE en_US.UTF-8
30+
ENV LC_ALL en_US.UTF-8
31+
ENV TZ=America/New_York
32+
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
33+
34+
# Install curl and useful transport
35+
RUN apt-get update && yes "Y" \
36+
| apt-get install --no-install-recommends curl apt-transport-https
37+
RUN apt install -y tzdata
38+
COPY . /opt/drake/
39+
40+
# Install drake prereqs.
41+
RUN apt-get update \
42+
&& yes "Y" | bash /opt/drake/share/drake/setup/install_prereqs
43+
44+
RUN apt install python3-pip -y
45+
RUN apt install python-is-python3
46+
47+
# Install deepnote dependencies.
48+
RUN apt-get update \
49+
&& yes "Y" | bash /opt/drake/share/drake/setup/deepnote/install_nginx
50+
RUN apt-get update \
51+
&& yes "Y" | bash /opt/drake/share/drake/setup/deepnote/install_xvfb
52+
53+
RUN apt-get -q update && apt-get -q install -y --no-install-recommends git nginx-light xvfb && apt-get -q clean
54+
RUN pip3 install lxml matplotlib networkx numpy pandas pydot scipy
55+
RUN pip3 install -I ipywidgets
56+
RUN pip3 install jupyter_server
57+
RUN pip3 install --upgrade notebook
58+
59+
# Install GCS repository.
60+
ENV DISPLAY=:1
61+
ENV MOSEKLM_LICENSE_FILE="/tmp/mosek.lic"
62+
RUN git clone https://github.com/RobotLocomotion/gcs-science-robotics.git
63+
ENV PYTHONPATH=/gcs-science-robotics:${PYTHONPATH}
64+
65+
# Source environment of Drake installed to /drake
66+
ENV PYTHONPATH=/opt/drake/lib/python3.10/site-packages:${PYTHONPATH}

requirements.txt

Lines changed: 0 additions & 11 deletions
This file was deleted.

setup.py

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,15 @@
33
setup(
44
name='gcs',
55
version='0.1.0',
6-
packages=find_packages()
6+
packages=find_packages(),
7+
install_requires=[
8+
'lxml',
9+
'matplotlib',
10+
'networkx',
11+
'notebook',
12+
'numpy',
13+
'pandas',
14+
'pydot',
15+
'scipy',
16+
]
717
)

0 commit comments

Comments
 (0)