Merge pull request #871 from borglab/feature/docker_update
commit
f9edcd2799
|
@ -1,6 +1,57 @@
|
||||||
# Instructions
|
# Instructions
|
||||||
|
|
||||||
Build all docker images, in order:
|
# Images on Docker Hub
|
||||||
|
|
||||||
|
There are 4 images available on https://hub.docker.com/orgs/borglab/repositories:
|
||||||
|
|
||||||
|
- `borglab/ubuntu-boost-tbb`: 18.06 Linux (nicknamed `bionic`) base image, with Boost and TBB installed.
|
||||||
|
- `borglab/ubuntu-gtsam`: GTSAM Release version installed in `/usr/local`.
|
||||||
|
- `borglab/ubuntu-gtsam-python`: installed GTSAM with python wrapper.
|
||||||
|
- `borglab/ubuntu-gtsam-python-vnc`: image with GTSAM+python wrapper that will run a VNC server to connect to.
|
||||||
|
|
||||||
|
# Using the images
|
||||||
|
|
||||||
|
## Just GTSAM
|
||||||
|
|
||||||
|
To start the Docker image, execute
|
||||||
|
```bash
|
||||||
|
docker run -it borglab/ubuntu-gtsam:bionic
|
||||||
|
```
|
||||||
|
after you will find yourself in a bash shell, in the directory `/usr/src/gtsam/build`.
|
||||||
|
## GTSAM with Python wrapper
|
||||||
|
|
||||||
|
To use GTSAM via the python wrapper, similarly execute
|
||||||
|
```bash
|
||||||
|
docker run -it borglab/ubuntu-gtsam-python:bionic
|
||||||
|
```
|
||||||
|
and then launch `python3`:
|
||||||
|
```bash
|
||||||
|
python3
|
||||||
|
>>> import gtsam
|
||||||
|
>>> gtsam.Pose2(1,2,3)
|
||||||
|
(1, 2, 3)
|
||||||
|
```
|
||||||
|
|
||||||
|
## GTSAM with Python wrapper and VNC
|
||||||
|
|
||||||
|
First, start the docker image, which will run a VNC server on port 5900:
|
||||||
|
```bash
|
||||||
|
docker run -p 5900:5900 borglab/ubuntu-gtsam-python-vnc:bionic
|
||||||
|
```
|
||||||
|
|
||||||
|
Then open a remote VNC X client, for example:
|
||||||
|
|
||||||
|
### Linux
|
||||||
|
```bash
|
||||||
|
sudo apt-get install tigervnc-viewer
|
||||||
|
xtigervncviewer :5900
|
||||||
|
```
|
||||||
|
### Mac
|
||||||
|
The Finder's "Connect to Server..." with `vnc://127.0.0.1` does not work, for some reason. Using the free [VNC Viewer](https://www.realvnc.com/en/connect/download/viewer/), enter `0.0.0.0:5900` as the server.
|
||||||
|
|
||||||
|
# Re-building the images locally
|
||||||
|
|
||||||
|
To build all docker images, in order:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
(cd ubuntu-boost-tbb && ./build.sh)
|
(cd ubuntu-boost-tbb && ./build.sh)
|
||||||
|
@ -9,13 +60,4 @@ Build all docker images, in order:
|
||||||
(cd ubuntu-gtsam-python-vnc && ./build.sh)
|
(cd ubuntu-gtsam-python-vnc && ./build.sh)
|
||||||
```
|
```
|
||||||
|
|
||||||
Then launch with:
|
Note: building GTSAM can take a lot of memory because of the heavy templating. It is advisable to give Docker enough resources, e.g., 8GB, to avoid OOM errors while compiling.
|
||||||
|
|
||||||
docker run -p 5900:5900 dellaert/ubuntu-gtsam-python-vnc:bionic
|
|
||||||
|
|
||||||
Then open a remote VNC X client, for example:
|
|
||||||
|
|
||||||
sudo apt-get install tigervnc-viewer
|
|
||||||
xtigervncviewer :5900
|
|
||||||
|
|
||||||
|
|
|
@ -1,3 +1,3 @@
|
||||||
# Build command for Docker image
|
# Build command for Docker image
|
||||||
# TODO(dellaert): use docker compose and/or cmake
|
# TODO(dellaert): use docker compose and/or cmake
|
||||||
docker build --no-cache -t dellaert/ubuntu-boost-tbb:bionic .
|
docker build --no-cache -t borglab/ubuntu-boost-tbb:bionic .
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
# This GTSAM image connects to the host X-server via VNC to provide a Graphical User Interface for interaction.
|
# This GTSAM image connects to the host X-server via VNC to provide a Graphical User Interface for interaction.
|
||||||
|
|
||||||
# Get the base Ubuntu/GTSAM image from Docker Hub
|
# Get the base Ubuntu/GTSAM image from Docker Hub
|
||||||
FROM dellaert/ubuntu-gtsam-python:bionic
|
FROM borglab/ubuntu-gtsam-python:bionic
|
||||||
|
|
||||||
# Things needed to get a python GUI
|
# Things needed to get a python GUI
|
||||||
ENV DEBIAN_FRONTEND noninteractive
|
ENV DEBIAN_FRONTEND noninteractive
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
# Build command for Docker image
|
# Build command for Docker image
|
||||||
# TODO(dellaert): use docker compose and/or cmake
|
# TODO(dellaert): use docker compose and/or cmake
|
||||||
# Needs to be run in docker/ubuntu-gtsam-python-vnc directory
|
# Needs to be run in docker/ubuntu-gtsam-python-vnc directory
|
||||||
docker build -t dellaert/ubuntu-gtsam-python-vnc:bionic .
|
docker build -t borglab/ubuntu-gtsam-python-vnc:bionic .
|
||||||
|
|
|
@ -2,4 +2,4 @@
|
||||||
docker run -it \
|
docker run -it \
|
||||||
--workdir="/usr/src/gtsam" \
|
--workdir="/usr/src/gtsam" \
|
||||||
-p 5900:5900 \
|
-p 5900:5900 \
|
||||||
dellaert/ubuntu-gtsam-python-vnc:bionic
|
borglab/ubuntu-gtsam-python-vnc:bionic
|
|
@ -1,7 +1,7 @@
|
||||||
# GTSAM Ubuntu image with Python wrapper support.
|
# GTSAM Ubuntu image with Python wrapper support.
|
||||||
|
|
||||||
# Get the base Ubuntu/GTSAM image from Docker Hub
|
# Get the base Ubuntu/GTSAM image from Docker Hub
|
||||||
FROM dellaert/ubuntu-gtsam:bionic
|
FROM borglab/ubuntu-gtsam:bionic
|
||||||
|
|
||||||
# Install pip
|
# Install pip
|
||||||
RUN apt-get install -y python3-pip python3-dev
|
RUN apt-get install -y python3-pip python3-dev
|
||||||
|
@ -22,7 +22,9 @@ RUN cmake \
|
||||||
..
|
..
|
||||||
|
|
||||||
# Build again, as ubuntu-gtsam image cleaned
|
# Build again, as ubuntu-gtsam image cleaned
|
||||||
RUN make -j4 install && make clean
|
RUN make -j4 install
|
||||||
|
RUN make python-install
|
||||||
|
RUN make clean
|
||||||
|
|
||||||
# Needed to run python wrapper:
|
# Needed to run python wrapper:
|
||||||
RUN echo 'export PYTHONPATH=/usr/local/python/:$PYTHONPATH' >> /root/.bashrc
|
RUN echo 'export PYTHONPATH=/usr/local/python/:$PYTHONPATH' >> /root/.bashrc
|
||||||
|
|
|
@ -1,3 +1,3 @@
|
||||||
# Build command for Docker image
|
# Build command for Docker image
|
||||||
# TODO(dellaert): use docker compose and/or cmake
|
# TODO(dellaert): use docker compose and/or cmake
|
||||||
docker build --no-cache -t dellaert/ubuntu-gtsam-python:bionic .
|
docker build --no-cache -t borglab/ubuntu-gtsam-python:bionic .
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
# Ubuntu image with GTSAM installed. Configured with Boost and TBB support.
|
# Ubuntu image with GTSAM installed. Configured with Boost and TBB support.
|
||||||
|
|
||||||
# Get the base Ubuntu image from Docker Hub
|
# Get the base Ubuntu image from Docker Hub
|
||||||
FROM dellaert/ubuntu-boost-tbb:bionic
|
FROM borglab/ubuntu-boost-tbb:bionic
|
||||||
|
|
||||||
# Install git
|
# Install git
|
||||||
RUN apt-get update && \
|
RUN apt-get update && \
|
||||||
|
|
|
@ -1,3 +1,3 @@
|
||||||
# Build command for Docker image
|
# Build command for Docker image
|
||||||
# TODO(dellaert): use docker compose and/or cmake
|
# TODO(dellaert): use docker compose and/or cmake
|
||||||
docker build --no-cache -t dellaert/ubuntu-gtsam:bionic .
|
docker build --no-cache -t borglab/ubuntu-gtsam:bionic .
|
||||||
|
|
Loading…
Reference in New Issue