Skip to content

Commit

Permalink
Provide a Dockerfile and instructions to run the notebooks using it.
Browse files Browse the repository at this point in the history
The existing installation instructions for building Gen locally are complex
(and contain some errors). I anticipate that users will face difficulty getting
those instructions to work on their machien so a Dockerized system should be easier
for users who just need a "Quick Installation".

In the next commit I will populate the "Advanced Installation" section with a
documentation of the steps taken in the Dockerfile that address some issues with
the current documentation.
  • Loading branch information
Feras A Saad committed Jan 21, 2019
1 parent 8b99c16 commit b7e6b88
Show file tree
Hide file tree
Showing 4 changed files with 56 additions and 1 deletion.
1 change: 1 addition & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
**/.git
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
**/.ipynb_checkpoints
32 changes: 32 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
FROM ubuntu:16.04
MAINTAINER MIT Probabilistic Computing Project

RUN apt-get update -qq \
&& apt-get install -qq -y \
hdf5-tools \
python3-pip \
wget

RUN pip3 install --upgrade pip
RUN pip3 install jupyter matplotlib tensorflow

RUN wget https://julialang-s3.julialang.org/bin/linux/x64/1.0/julia-1.0.3-linux-x86_64.tar.gz
RUN tar -xzv < julia-1.0.3-linux-x86_64.tar.gz
RUN ln -s /julia-1.0.3/bin/julia /usr/bin/julia

ADD . /gen-examples
ENV JULIA_PROJECT=/gen-examples

RUN JUPYTER=$(which jupyter) julia -e 'using Pkg; Pkg.build("IJulia")'
RUN julia -e 'using Pkg; ENV["PYTHON"] = "/usr/bin/python3"; Pkg.build("PyCall")'
RUN julia -e 'using Pkg; Pkg.add("PyPlot")'

WORKDIR /gen-examples

ENTRYPOINT jupyter notebook \
--ip='0.0.0.0' \
--port=8080 \
--no-browser \
--NotebookApp.token= \
--allow-root \
--NotebookApp.iopub_data_rate_limit=-1
23 changes: 22 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,29 @@ For reference on Gen see:

- The [GenViz documentation](https://probcomp.github.io/GenTF/dev/)

## Quick Installation

## Installation
First obtain [docker](https://www.docker.com/).

Next, build the image using the following command:

$ docker build -t gen:v0 .

Then run the image using:

$ docker run -it --name gen -p 8080:8080 gen:v0

Open `localhost:8080` in your browser and begin with `tutorial-modeling-intro`.

All the changes made to the notebooks will be saved in your docker container.

To stop the image, run `ctrl+c`.

To restart the image and resume your work, run:

$ docker start -ia gen

## Advanced Installation

These notebooks have been tested on Ubuntu Linux and Mac OS X.

Expand Down

0 comments on commit b7e6b88

Please sign in to comment.