diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000000000000000000000000000000000000..e140877b76a92966a454abb0a7f72cf746896dc4 --- /dev/null +++ b/.dockerignore @@ -0,0 +1,4 @@ +*.zip +.git +datasets/linemod/Linemod_preprocessed +datasets/ycb/YCB_Video_Dataset diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..c1b3c7788b96314928f1ee2555e529b647d77aae --- /dev/null +++ b/Dockerfile @@ -0,0 +1,33 @@ +FROM nvidia/cuda:10.0-cudnn7-devel-ubuntu16.04 + +ARG DEBIAN_FRONTEND=noninteractive + +# Essentials: developer tools, build tools, OpenBLAS +RUN apt-get update && apt-get install -y --no-install-recommends \ + apt-utils git curl vim unzip openssh-client wget \ + build-essential cmake \ + libopenblas-dev + +# Python 3.5 +# For convenience, alias (but don't sym-link) python & pip to python3 & pip3 as recommended in: +# http://askubuntu.com/questions/351318/changing-symlink-python-to-python3-causes-problems +RUN apt-get update && apt-get install -y --no-install-recommends python3.5 python3.5-dev python3-pip python3-tk && \ + pip3 install --no-cache-dir --upgrade pip setuptools && \ + echo "alias python='python3'" >> /root/.bash_aliases && \ + echo "alias pip='pip3'" >> /root/.bash_aliases +# Pillow and it's dependencies +RUN apt-get update && apt-get install -y --no-install-recommends libjpeg-dev zlib1g-dev && \ + pip3 --no-cache-dir install Pillow +# Science libraries and other common packages +RUN pip3 --no-cache-dir install \ + numpy scipy pyyaml cffi pyyaml matplotlib Cython requests + +# Tensorflow 1.11 - GPU +RUN pip3 install https://download.pytorch.org/whl/cu100/torch-1.0.1.post2-cp35-cp35m-linux_x86_64.whl +RUN pip3 install torchvision==0.2.2.post3 + +# Expose port for TensorBoard +EXPOSE 6006 + +# cd to home on login +RUN echo "cd /root/dense_fusion" >> /root/.bashrc diff --git a/build.sh b/build.sh new file mode 100755 index 0000000000000000000000000000000000000000..e7d85044f7562a1a6381eb017fe0a886a3978117 --- /dev/null +++ b/build.sh @@ -0,0 +1,4 @@ +#!/bin/bash + +#docker build --no-cache -t hri -f Dockerfile . +docker build -t dense_fusion -f Dockerfile . diff --git a/run.sh b/run.sh new file mode 100755 index 0000000000000000000000000000000000000000..b7081c85d1feb8133420aba375dc79be3e1af7ed --- /dev/null +++ b/run.sh @@ -0,0 +1,29 @@ +#!/bin/sh + +# Runs a docker container with the image created by build.sh +until nvidia-docker ps +do + echo "Waiting for docker server" + sleep 1 +done + +XSOCK=/tmp/.X11-unix + +XAUTH=/root/.Xauthority + +SRC_CONTAINER=/root/dense_fusion +SRC_HOST="$(pwd)" + +xhost local:root + +nvidia-docker run \ + --name dense_fusion \ + -it --rm \ + --volume=$XSOCK:$XSOCK:rw \ + --volume=$XAUTH:$XAUTH:rw \ + --volume=$SRC_HOST:$SRC_CONTAINER:rw \ + --env="XAUTHORITY=${XAUTH}" \ + --env="DISPLAY=${DISPLAY}" \ + --privileged -v /dev/bus/usb:/dev/bus/usb \ + --net=host \ + dense_fusion