Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
HBP-25 Add initial version of a Dockerfile with NEST 2.18, Python2, t…
…vb-library and tvb-nest
- Loading branch information
Showing
2 changed files
with
88 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -102,3 +102,6 @@ venv.bak/ | |
|
||
# mypy | ||
.mypy_cache/ | ||
|
||
# IDE | ||
.idea/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,85 @@ | ||
# | ||
# TVB & NEST simulations environment | ||
# | ||
# Install Python 2.7, NEST, then tvb-library from Pypi | ||
# Finally link tvb-scripts and tvb-nest from Github sources | ||
# | ||
|
||
FROM neurodebian:buster | ||
MAINTAINER lia.domide@codemart.ro | ||
|
||
ENV DEBIAN_FRONTEND noninteractive | ||
ENV LANG=C.UTF-8 | ||
|
||
RUN apt-get update; apt-get install -y automake libtool build-essential openmpi-bin libopenmpi-dev git vim \ | ||
wget python libpython-dev libncurses5-dev libreadline-dev libgsl0-dev cython \ | ||
python-all-dev python-pip python-numpy python-scipy python-matplotlib python-nose \ | ||
python-virtualenv ipython libgsl-dev libncurses-dev subversion python-mpi4py cmake; \ | ||
apt-get clean | ||
|
||
RUN useradd -ms /bin/bash docker | ||
USER docker | ||
ENV HOME=/home/docker | ||
RUN mkdir $HOME/env; mkdir $HOME/packages | ||
|
||
# Create a dedicated Python env for working in it | ||
ENV VENV=$HOME/env/neurosci | ||
RUN virtualenv --system-site-packages $VENV | ||
RUN $VENV/bin/pip install --upgrade pip; \ | ||
$VENV/bin/pip install parameters quantities neo "django<1.9" django-tagging future hgapi gitpython sumatra nixio; \ | ||
$VENV/bin/pip install --upgrade nose ipython | ||
|
||
# Install from sources libneurosim (NEST boost dependency) | ||
WORKDIR $HOME/packages | ||
RUN git clone --depth 1 https://github.com/INCF/libneurosim.git | ||
RUN cd libneurosim; ./autogen.sh | ||
RUN mkdir $VENV/build | ||
WORKDIR $VENV/build | ||
RUN mkdir libneurosim; \ | ||
cd libneurosim; \ | ||
PYTHON=$VENV/bin/python $HOME/packages/libneurosim/configure --prefix=$VENV; \ | ||
make; make install; ls $VENV/lib $VENV/include | ||
RUN ln -s /usr/lib/python2.7/config-x86_64-linux-gnu/libpython2.7.so $VENV/lib/ | ||
|
||
# Install NEST, latest stable version (July 2019) | ||
ENV NEST_VER=2.18.0 | ||
ENV NEST=nest-simulator-$NEST_VER | ||
|
||
WORKDIR $HOME/packages | ||
RUN wget https://github.com/nest/nest-simulator/archive/v$NEST_VER.tar.gz -O $HOME/packages/$NEST.tar.gz | ||
RUN tar xzf $NEST.tar.gz; rm $NEST.tar.gz | ||
RUN cd $NEST; \ | ||
cmake -DCMAKE_INSTALL_PREFIX=$VENV \ | ||
-Dwith-mpi=ON \ | ||
###-Dwith-music=ON \ | ||
-Dwith-libneurosim=$VENV \ | ||
-DPYTHON_LIBRARY=$VENV/lib/libpython2.7.so \ | ||
-DPYTHON_INCLUDE_DIR=/usr/include/python2.7 \ | ||
$HOME/packages/$NEST; \ | ||
make; make install | ||
# RUN cd $NEST; make installcheck | ||
|
||
# Install TVB specific packages | ||
WORKDIR $HOME/packages | ||
|
||
RUN $VENV/bin/pip install --upgrade pip; \ | ||
$VENV/bin/pip install tvb-library | ||
|
||
RUN git clone --depth 1 https://github.com/the-virtual-brain/tvb-data.git; \ | ||
$VENV/bin/pip uninstall -y tvb-data; \ | ||
cd tvb-data; \ | ||
$VENV/bin/python setup.py develop | ||
|
||
RUN git clone --depth 1 https://github.com/dionperd/tvb-scripts.git; \ | ||
cd tvb-scripts; \ | ||
$VENV/bin/python setup.py develop | ||
|
||
RUN git clone --depth 1 https://github.com/dionperd/tvb-multiscale.git; \ | ||
cd tvb-multiscale; \ | ||
$VENV/bin/python setup.py develop | ||
# Test tvb-multiscale by running this: | ||
#RUN $VENV/bin/python -m tvb_nest.examples.red_ww_exc_io_inh_i.py | ||
|
||
# Activate the rights python env | ||
WORKDIR /home/docker/ | ||
RUN echo "source $VENV/bin/activate" >> .bashrc |