Skip to content

Commit

Permalink
added Dockerfile and installation info on README (#61)
Browse files Browse the repository at this point in the history
  • Loading branch information
salman1993 authored and Impavidity committed Sep 6, 2018
1 parent 9be0a4f commit ccceb91
Show file tree
Hide file tree
Showing 2 changed files with 113 additions and 0 deletions.
28 changes: 28 additions & 0 deletions README.md
Expand Up @@ -30,3 +30,31 @@ There are four main components to our formulation of the problem, as detailed in
+ `entity_detection` and `relation_prediction` can be run independently.
+ `entity_detection` needs to be run before `entity_linking`.
+ `entity_linking` and `relation_prediction` needs to be run before `evidence_integration`.


## Running the Code with Docker (GPU, Ubuntu 16, Cuda 9.0 base)

- Make sure you have the Docker daemon running

- Build the image from Dockerfile
```
cp docker_files/Dockerfile_gpu Dockerfile
docker build -t buboqa .
```

- Run the Docker image on GPU with nvidia-docker installed. Notice that we are mounting the current directory so that data persists.
```
nvidia-docker run -it --rm \
-v "$(pwd)":/code \
buboqa
```
- OR ... Run the Docker image on CPU (not tested)
```
docker run -it --rm \
-v "$(pwd)":/code \
buboqa
```
- Exit shell when needed
```
$ exit
```
85 changes: 85 additions & 0 deletions docker_files/Dockerfile_gpu
@@ -0,0 +1,85 @@
FROM nvidia/cuda:9.0-base-ubuntu16.04

LABEL maintainer="Salman Mohammed"

ENV LC_ALL C

# Setting CUDA paths
LABEL com.nvidia.volumes.needed="nvidia_driver"
ENV PATH /usr/local/nvidia/bin:/usr/local/cuda/bin:${PATH}
ENV LD_LIBRARY_PATH /usr/local/nvidia/lib:/usr/local/nvidia/lib64:usr/local/cuda-9.0/lib64:/usr/lib/x86_64-linux-gnu
ENV CUDA_HOME /usr/local/cuda-9.0


# Pick up some TF dependencies
RUN apt-get update && apt-get install -y --no-install-recommends \
build-essential \
cuda-command-line-tools-9-0 \
cuda-cublas-9-0 \
cuda-cufft-9-0 \
cuda-curand-9-0 \
cuda-cusolver-9-0 \
cuda-cusparse-9-0 \
curl \
libcudnn7=7.0.5.15-1+cuda9.0 \
libfreetype6-dev \
libhdf5-serial-dev \
libpng12-dev \
libzmq3-dev \
pkg-config \
vim \
strace \
rsync \
software-properties-common \
unzip \
&& \
apt-get clean && \
rm -rf /var/lib/apt/lists/*

RUN add-apt-repository ppa:deadsnakes/ppa
RUN apt-get update
RUN apt-get install -y python3.6 python3.6-dev python3-pip python3.6-venv python3.6-tk python3-setuptools locales
RUN apt-get install -y git


# Python should link to Python 3.6
RUN ln -s -f /usr/bin/python3.6 /usr/bin/python3
RUN ln -s -f /usr/bin/python3 /usr/bin/python

RUN pip3 install pip --upgrade
RUN pip3 install wheel


# Required Python packages
RUN pip3 --no-cache-dir install \
Pillow \
h5py \
ipykernel \
ipython \
jupyter \
matplotlib \
numpy \
pandas \
scipy \
sklearn \
PyYaml \
sklearn-pandas \
feather-format \
spacy \
nltk \
fuzzywuzzy

# Install Spacy model and NLTK data
RUN python -m spacy download en
RUN python -m nltk.downloader all

# Install PyTorch version 0.4 for Cuda 9.0 & Python 3.6
RUN pip3 install http://download.pytorch.org/whl/cu90/torch-0.4.0-cp36-cp36m-linux_x86_64.whl

# Install torchtext 0.2.3
RUN pip3 install torchtext==0.2.3


WORKDIR /code
COPY ./ /code

0 comments on commit ccceb91

Please sign in to comment.