Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,6 @@ _build

# Test artifacts
mcmc.sqlite

# Docker development
notebooks/
10 changes: 10 additions & 0 deletions scripts/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
FROM continuumio/miniconda3

MAINTAINER Austin Rochford <austin.rochford@gmail.com>

USER $NB_USER

RUN wget -O /tmp/create_testenv.sh https://raw.githubusercontent.com/pymc-devs/pymc3/master/scripts/create_testenv.sh
RUN sh /tmp/create_testenv.sh --global

ENV PYTHONPATH $PYTHONPATH:$HOME/pymc3
27 changes: 22 additions & 5 deletions scripts/create_testenv.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,22 +2,39 @@

set -e # fail on first error

while test $# -gt 0
do
case "$1" in
--global)
GLOBAL=1
shift
;;
--no-setup)
NO_SETUP=1
shift
;;
esac
done

PYTHON_VERSION=${PYTHON_VERSION:-3.5} # if no python specified, use 3.5

if [[ "$*" != *--global* ]]
if [ -z ${GLOBAL} ]
then
conda create -n testenv --yes pip python=${PYTHON_VERSION}
source activate testenv
conda create -n testenv --yes pip python=${PYTHON_VERSION}
source activate testenv
fi

conda install --yes pyqt=4.11.4 jupyter pyzmq numpy scipy nose matplotlib pandas Cython patsy statsmodels joblib coverage
if [ ${PYTHON_VERSION} == "2.7" ]; then
conda install --yes mock enum34;
conda install --yes mock enum34;
fi

pip install tqdm
pip install --no-deps numdifftools
pip install git+https://github.com/Theano/Theano.git
pip install git+https://github.com/mahmoudimus/nose-timer.git

python setup.py build_ext --inplace
if [ -z ${NO_SETUP} ]
then
python setup.py build_ext --inplace
fi
12 changes: 12 additions & 0 deletions scripts/start_container.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#! /bin/bash

PORT=${PORT:-8888}
SRC_DIR=${SRC_DIR:-`pwd`}
NOTEBOOK_DIR=${NOTEBOOK_DIR:-$SRC_DIR/notebooks}

docker build -t pymc3 $SRC_DIR/scripts
docker run -d \
-p $PORT:8888 \
-v $SRC_DIR:/home/jovyan/pymc3 \
-v $NOTEBOOK_DIR:/home/jovyan/work/ \
--name pymc3 pymc3