├── osb ├── runLocal.sh ├── regenerateAll.sh ├── generate.sh ├── regenerate.sh └── Dockerfile ├── osb_models ├── runLocal.sh ├── regenerateAll.sh ├── generate.sh ├── regenerate.sh └── Dockerfile ├── simulation ├── runLocal.sh ├── generate.sh ├── regenerate.sh ├── README.md └── Dockerfile ├── .gitignore ├── analysis ├── Dockerfile └── README.md ├── base ├── regenerate.sh └── Dockerfile ├── simulationx ├── generate.sh ├── regenerate.sh ├── Dockerfile └── README.md ├── README.md ├── LICENSE ├── pyNN07 └── Dockerfile └── .github └── workflows └── docker-image.yml /osb/runLocal.sh: -------------------------------------------------------------------------------- 1 | docker run -i -t neuralensemble/osb /bin/bash 2 | -------------------------------------------------------------------------------- /osb_models/runLocal.sh: -------------------------------------------------------------------------------- 1 | docker run -i -t osb_models_new /bin/bash 2 | -------------------------------------------------------------------------------- /simulation/runLocal.sh: -------------------------------------------------------------------------------- 1 | docker run -i -t neuralensemble/simulation /bin/bash 2 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .idea 2 | /base/generate.sh 3 | /simulationx/runLocal.sh 4 | /simulationx/regenerateAll.sh 5 | /base/runLocal.sh 6 | -------------------------------------------------------------------------------- /osb_models/regenerateAll.sh: -------------------------------------------------------------------------------- 1 | set -e 2 | 3 | cd ../osb 4 | 5 | ./regenerateAll.sh 6 | 7 | cd ../osb_models 8 | 9 | ./regenerate.sh 10 | -------------------------------------------------------------------------------- /osb/regenerateAll.sh: -------------------------------------------------------------------------------- 1 | set -e 2 | 3 | cd ../base 4 | ./regenerate.sh 5 | 6 | cd ../simulation 7 | ./regenerate.sh 8 | 9 | cd ../simulationx 10 | 11 | ./regenerate.sh 12 | 13 | cd ../osb 14 | 15 | ./regenerate.sh 16 | 17 | -------------------------------------------------------------------------------- /analysis/Dockerfile: -------------------------------------------------------------------------------- 1 | # 2 | # A Docker image for neuroscience data analysis with Python 3 | # 4 | 5 | 6 | FROM neuralensemble/base 7 | MAINTAINER andrew.davison@unic.cnrs-gif.fr 8 | 9 | RUN $VENV/bin/pip install elephant 10 | 11 | # in analysisX, add SpykeViewer, OpenElectrophy, KlustaSuite 12 | 13 | WORKDIR /home/docker/ 14 | -------------------------------------------------------------------------------- /osb/generate.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -ex 3 | 4 | 5 | # Set the platform flag if we're on ARM 6 | arch=$(uname -m) 7 | if [[ "$arch" == "arm64" || "$arch" == "aarch64" ]]; then 8 | platform_flag="--platform linux/amd64" 9 | else 10 | platform_flag="" 11 | fi 12 | 13 | 14 | docker build $platform_flag -t neuralensemble/osb . 15 | -------------------------------------------------------------------------------- /osb_models/generate.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -ex 3 | 4 | 5 | # Set the platform flag if we're on ARM 6 | arch=$(uname -m) 7 | if [[ "$arch" == "arm64" || "$arch" == "aarch64" ]]; then 8 | platform_flag="--platform linux/amd64" 9 | else 10 | platform_flag="" 11 | fi 12 | 13 | 14 | docker build $platform_flag -t osb_models_new . 15 | -------------------------------------------------------------------------------- /base/regenerate.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -ex 3 | 4 | 5 | # Set the platform flag if we're on ARM 6 | arch=$(uname -m) 7 | if [[ "$arch" == "arm64" || "$arch" == "aarch64" ]]; then 8 | platform_flag="--platform linux/amd64" 9 | else 10 | platform_flag="" 11 | fi 12 | 13 | 14 | docker build $platform_flag -t neuralensemble/base --no-cache . 15 | -------------------------------------------------------------------------------- /osb_models/regenerate.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -ex 3 | 4 | 5 | # Set the platform flag if we're on ARM 6 | arch=$(uname -m) 7 | if [[ "$arch" == "arm64" || "$arch" == "aarch64" ]]; then 8 | platform_flag="--platform linux/amd64" 9 | else 10 | platform_flag="" 11 | fi 12 | 13 | 14 | docker build $platform_flag -t osb_models_new --no-cache . 15 | -------------------------------------------------------------------------------- /simulation/generate.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -ex 3 | 4 | 5 | # Set the platform flag if we're on ARM 6 | arch=$(uname -m) 7 | if [[ "$arch" == "arm64" || "$arch" == "aarch64" ]]; then 8 | platform_flag="--platform linux/amd64" 9 | else 10 | platform_flag="" 11 | fi 12 | 13 | 14 | docker build $platform_flag -t neuralensemble/simulation . 15 | -------------------------------------------------------------------------------- /simulationx/generate.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -ex 3 | 4 | 5 | # Set the platform flag if we're on ARM 6 | arch=$(uname -m) 7 | if [[ "$arch" == "arm64" || "$arch" == "aarch64" ]]; then 8 | platform_flag="--platform linux/amd64" 9 | else 10 | platform_flag="" 11 | fi 12 | 13 | 14 | docker build $platform_flag -t neuralensemble/simulationx . 15 | -------------------------------------------------------------------------------- /osb/regenerate.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -ex 3 | 4 | 5 | # Set the platform flag if we're on ARM 6 | arch=$(uname -m) 7 | if [[ "$arch" == "arm64" || "$arch" == "aarch64" ]]; then 8 | platform_flag="--platform linux/amd64" 9 | else 10 | platform_flag="" 11 | fi 12 | 13 | 14 | docker build $platform_flag -t neuralensemble/osb --no-cache . 15 | 16 | -------------------------------------------------------------------------------- /simulation/regenerate.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -ex 3 | 4 | 5 | # Set the platform flag if we're on ARM 6 | arch=$(uname -m) 7 | if [[ "$arch" == "arm64" || "$arch" == "aarch64" ]]; then 8 | platform_flag="--platform linux/amd64" 9 | else 10 | platform_flag="" 11 | fi 12 | 13 | 14 | docker build $platform_flag -t neuralensemble/simulation --no-cache . 15 | -------------------------------------------------------------------------------- /simulationx/regenerate.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -ex 3 | 4 | 5 | # Set the platform flag if we're on ARM 6 | arch=$(uname -m) 7 | if [[ "$arch" == "arm64" || "$arch" == "aarch64" ]]; then 8 | platform_flag="--platform linux/amd64" 9 | else 10 | platform_flag="" 11 | fi 12 | 13 | 14 | docker build $platform_flag -t neuralensemble/simulationx --no-cache . 15 | -------------------------------------------------------------------------------- /simulationx/Dockerfile: -------------------------------------------------------------------------------- 1 | # 2 | # A Docker image for running neuronal network simulations 3 | # 4 | # This image extends the basic "simulation" image by adding support 5 | # for SSH access and Xwindows. 6 | # 7 | 8 | FROM neuralensemble/simulation 9 | MAINTAINER andrew.davison@unic.cnrs-gif.fr 10 | 11 | USER root 12 | 13 | RUN apt-get update; apt-get install -y openssh-server libx11-dev libxext-dev x11-apps 14 | RUN mkdir /var/run/sshd 15 | EXPOSE 22 16 | ENV KEYFILE=/home/docker/.ssh/id_rsa 17 | RUN mkdir /home/docker/.ssh; chown docker /home/docker/.ssh 18 | RUN /usr/bin/ssh-keygen -q -t rsa -N "" -f $KEYFILE; cat $KEYFILE.pub >> /home/docker/.ssh/authorized_keys 19 | RUN echo "IdentityFile ~/.ssh/id_rsa" >> /etc/ssh/ssh_config 20 | RUN touch /home/docker/.Xauthority; chown docker /home/docker/.Xauthority 21 | CMD ["/usr/sbin/sshd", "-D"] 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Docker images for neuroscience 2 | 3 | ## Available images: 4 | 5 | - simulation: NEST, NEURON, Brian, PyNN (for specific versions see [Dockerfile](simulation/Dockerfile)) and the scientific Python stack 6 | - For **Python 3** use the [master branch](https://github.com/NeuralEnsemble/neuralensemble-docker/tree/master/simulation) 7 | - For **Python 2** use the [python2 branch](https://github.com/NeuralEnsemble/neuralensemble-docker/tree/python2/simulation) 8 | - simulationx: like "simulation", but with support for X11 forwarding over SSH 9 | - For **Python 3** use the [master branch](https://github.com/NeuralEnsemble/neuralensemble-docker/tree/master/simulationx) 10 | - For **Python 2** use the [python2 branch](https://github.com/NeuralEnsemble/neuralensemble-docker/tree/python2/simulationx) 11 | 12 | ## Sources: 13 | 14 | https://github.com/NeuralEnsemble/neuralensemble-docker 15 | 16 | ## Docker Hub 17 | 18 | More information on the various images which have been released can be found at: https://hub.docker.com/r/neuralensemble/ 19 | -------------------------------------------------------------------------------- /analysis/README.md: -------------------------------------------------------------------------------- 1 | # Neuroscience data analysis with Python 2 | 3 | ## What it gives you 4 | 5 | * shell environment with Neo (development version) and Elephant installed. 6 | * IPython, scipy, matplotlib and OpenMPI are also installed. 7 | * use directly or as a base for your own project-specific Docker images. 8 | 9 | More analysis tools will be added in future releases, coming soon! 10 | 11 | ## Basic use 12 | 13 | The following command starts a container with the bash shell, running as user `docker`. 14 | 15 | ``` 16 | docker run -i -t neuralensemble/analysis /bin/bash 17 | ``` 18 | 19 | You should then activate the "neurosci" virtual environment: 20 | 21 | ``` 22 | source ~/env/neurosci/bin/activate 23 | ``` 24 | 25 | after which you can run .... 26 | 27 | Note that this image does not provide an X11 graphical environment, so GUI tools will not work; 28 | use the `neuralensemble/analysisx` image if you need X11. 29 | 30 | ## Documentation 31 | 32 | For documentation of the tools installed in the image, see http://neuralensemble.org/projects/ 33 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2015-2018 NeuralEnsemble 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | 23 | -------------------------------------------------------------------------------- /pyNN07/Dockerfile: -------------------------------------------------------------------------------- 1 | # 2 | # A Docker image for running neuronal network simulations 3 | # 4 | 5 | FROM neuralensemble/base:py2 6 | MAINTAINER andrew.davison@unic.cnrs-gif.fr 7 | 8 | ENV NEST_VER=2.2.2 NRN_VER=7.4 9 | ENV NEST=nest-$NEST_VER NRN=nrn-$NRN_VER 10 | 11 | WORKDIR /home/docker/packages 12 | RUN wget https://github.com/nest/nest-simulator/releases/download/v$NEST_VER/$NEST.tar.gz 13 | RUN wget http://www.neuron.yale.edu/ftp/neuron/versions/v$NRN_VER/$NRN.tar.gz 14 | RUN tar xzf $NEST.tar.gz; tar xzf $NRN.tar.gz; rm $NEST.tar.gz $NRN.tar.gz 15 | 16 | RUN mkdir $VENV/build 17 | WORKDIR $VENV/build 18 | RUN mkdir $NEST; \ 19 | cd $NEST; \ 20 | PYTHON=$VENV/bin/python $HOME/packages/$NEST/configure --with-mpi --prefix=$VENV --with-python=$VENV/bin/python --with-pynest-prefix=$VENV; \ 21 | make; make install 22 | RUN mkdir $NRN; \ 23 | cd $NRN; \ 24 | $HOME/packages/$NRN/configure --with-paranrn --with-nrnpython=$VENV/bin/python --disable-rx3d --without-iv --prefix=$VENV; \ 25 | make; make install; \ 26 | cd src/nrnpython; $VENV/bin/python setup.py install; \ 27 | cd $VENV/bin; ln -s ../x86_64/bin/nrnivmodl 28 | 29 | 30 | ENV PATH=$VENV/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin 31 | RUN $VENV/bin/pip install brian nrnutils PyNN==0.7.5 32 | 33 | WORKDIR /home/docker/ 34 | -------------------------------------------------------------------------------- /base/Dockerfile: -------------------------------------------------------------------------------- 1 | # 2 | # A base Docker image for Python-based computational neuroscience and neurophysiology 3 | # 4 | 5 | FROM neurodebian:jammy 6 | MAINTAINER andrew.davison@unic.cnrs-gif.fr 7 | 8 | ENV DEBIAN_FRONTEND noninteractive 9 | ENV LANG=C.UTF-8 10 | 11 | RUN apt-get update; apt-get install -y automake libtool build-essential openmpi-bin libopenmpi-dev git vim \ 12 | wget python3 libpython3-dev libncurses5-dev libreadline-dev libgsl0-dev cython3 \ 13 | python3-numpy python3-scipy python3-matplotlib python3-jinja2 python3-mock \ 14 | ipython3 python3-httplib2 python3-docutils python3-yaml \ 15 | subversion python3-venv python3-mpi4py python3-tables python3-h5py cmake zlib1g-dev 16 | 17 | RUN useradd -ms /bin/bash docker 18 | USER docker 19 | ENV HOME=/home/docker 20 | RUN mkdir $HOME/env; mkdir $HOME/packages 21 | 22 | ENV VENV=$HOME/env/neurosci 23 | 24 | # we run venv twice because of this bug: https://bugs.python.org/issue24875 25 | # using the workaround proposed by Georges Racinet 26 | RUN python3 -m venv $VENV && python3 -m venv --system-site-packages $VENV 27 | 28 | RUN $VENV/bin/pip3 install --upgrade pip 29 | RUN $VENV/bin/pip3 install parameters quantities neo django==1.8.19 django-tagging future hgapi gitpython sumatra nixio 30 | RUN $VENV/bin/pip3 install --upgrade nose ipython 31 | -------------------------------------------------------------------------------- /.github/workflows/docker-image.yml: -------------------------------------------------------------------------------- 1 | name: Docker Image CI 2 | 3 | on: 4 | push: 5 | branches: [ master, test_pynn* ] 6 | pull_request: 7 | branches: [ master, test_pynn* ] 8 | 9 | jobs: 10 | 11 | build: 12 | 13 | runs-on: ${{ matrix.runs-on }} 14 | strategy: 15 | fail-fast: false 16 | matrix: 17 | runs-on: [ubuntu-latest ] # macos-13 takes too long to build nest 18 | 19 | 20 | steps: 21 | - uses: actions/checkout@v4 22 | 23 | - name: Setup docker (missing on MacOS) 24 | if: runner.os == 'macos' 25 | run: | 26 | brew install docker colima 27 | colima start 28 | 29 | - name: Build the base Docker image 30 | run: | 31 | cd base 32 | ./regenerate.sh 33 | 34 | - name: Build the simulation Docker image 35 | run: | 36 | cd simulation 37 | ./generate.sh 38 | 39 | - name: Build the simulationx Docker image 40 | run: | 41 | cd simulationx 42 | ./generate.sh 43 | 44 | - name: Build the osb Docker image 45 | run: | 46 | cd osb 47 | ./generate.sh 48 | 49 | - name: Print info on installed packages 50 | run: | 51 | docker run -t neuralensemble/osb /bin/bash -c "omv list -V" 52 | 53 | - name: Print info on docker images 54 | run: | 55 | docker images 56 | -------------------------------------------------------------------------------- /simulation/README.md: -------------------------------------------------------------------------------- 1 | # Biological neuronal network simulations with Python 2 | 3 | ## What it gives you 4 | 5 | * shell environment with NEST, NEURON, Brian and PyNN installed (for specific versions see [Dockerfile](Dockerfile)). 6 | * The Python 2 version provides Brian 1.4, the Python 3 version provides Brian 2. 7 | * IPython, scipy, matplotlib and OpenMPI are also installed. 8 | * use directly or as a base for your own project-specific Docker images. 9 | 10 | ## Basic use 11 | 12 | The following command starts a container with the bash shell, running as user `docker`, 13 | in a Python virtual environment named "neurosci" 14 | 15 | ``` 16 | docker run -i -t neuralensemble/simulation /bin/bash 17 | ``` 18 | 19 | after which you can run simulations with Python and MPI. This will use **Python 3.5** as the Python version; if you'd prefer **Python 2.7** use: 20 | 21 | ``` 22 | docker run -i -t neuralensemble/simulation:py2 /bin/bash 23 | ``` 24 | 25 | Note that this image does not provide an X11 graphical environment, so GUI tools will not work; 26 | use the `neuralensemble/simulationx` image if you need X11. 27 | 28 | ## Docker Hub 29 | 30 | More information on the various images which have been released can be found at: https://hub.docker.com/r/neuralensemble/ 31 | 32 | ## Documentation for simulators 33 | 34 | For documentation of the simulation tools installed in the image, see http://neuralensemble.org/projects/ 35 | -------------------------------------------------------------------------------- /osb_models/Dockerfile: -------------------------------------------------------------------------------- 1 | # 2 | # A Docker image containing a number of core models from Open Source Brain 3 | # 4 | # This image extends the basic "simulationx" image by adding support 5 | # for libraries required for OSB models 6 | # 7 | 8 | # Version from Dockerhub 9 | #FROM opensourcebrain/simulation:osb-v0.8.4 10 | 11 | # Local build 12 | FROM neuralensemble/osb 13 | 14 | MAINTAINER p.gleeson@gmail.com 15 | 16 | USER root 17 | 18 | RUN git clone https://github.com/OpenSourceBrain/osb-model-validation.git 19 | 20 | # Clone core set of models 21 | 22 | RUN osb-model-validation/utilities/getcoreosbprojects.sh 23 | 24 | # Pre-compile mod files for some models 25 | 26 | RUN cd coreprojects/SmithEtAl2013-L23DendriticSpikes/NEURON/test && nrnivmodl ../mod.files 27 | 28 | RUN cd coreprojects/L5bPyrCellHayEtAl2011/NEURON/test && nrnivmodl ../mod 29 | 30 | # Note: sgate.mod is not required and throws an error on later NEURON versions 31 | RUN cd coreprojects/ca1 && rm sgate.mod && cd NeuroML2 && nrnivmodl .. 32 | 33 | RUN cd coreprojects/SadehEtAl2017-InhibitionStabilizedNetworks && ./make_tests.sh 34 | 35 | RUN cd coreprojects/PotjansDiesmann2014/ && ./make_tests.sh 36 | 37 | # For Allen 38 | RUN $VENV/bin/pip install allensdk 39 | RUN cd coreprojects/AllenInstituteNeuroML/CellTypesDatabase/models/ && python download.py 40 | 41 | 42 | RUN echo "Built OSB models Docker image!" 43 | 44 | 45 | 46 | -------------------------------------------------------------------------------- /simulation/Dockerfile: -------------------------------------------------------------------------------- 1 | # 2 | # A Docker image for running neuronal network simulations 3 | # 4 | 5 | FROM neuralensemble/base 6 | MAINTAINER andrew.davison@unic.cnrs-gif.fr 7 | 8 | RUN ln -s /usr/bin/2to3-3.5 $VENV/bin/2to3 9 | 10 | 11 | #### Set versions 12 | 13 | ENV NEST_VER=3.5 14 | ENV NRN_VER=8.2.2 15 | ENV BRIAN2_VER=2.5.4 16 | ENV PYNN_VER=0.11.0 17 | 18 | 19 | #### Install NEST 20 | 21 | ENV NEST=nest-simulator-$NEST_VER 22 | 23 | WORKDIR $HOME/packages 24 | RUN wget https://github.com/nest/nest-simulator/archive/v$NEST_VER.tar.gz -O $HOME/packages/$NEST.tar.gz; 25 | RUN tar xzf $NEST.tar.gz; rm $NEST.tar.gz 26 | RUN git clone https://github.com/INCF/libneurosim.git 27 | RUN cd libneurosim; git checkout 03646747c8fe64fa3439ac2d282623b659f60c22; ./autogen.sh 28 | 29 | RUN mkdir $VENV/build 30 | WORKDIR $VENV/build 31 | RUN mkdir libneurosim; \ 32 | cd libneurosim; \ 33 | PYTHON=$VENV/bin/python $HOME/packages/libneurosim/configure --prefix=$VENV; \ 34 | make; make install; ls $VENV/lib $VENV/include 35 | RUN mkdir $NEST; \ 36 | cd $NEST; \ 37 | ln -s /usr/lib/python3.8/config-3.8-x86_64-linux-gnu/libpython3.8.so $VENV/lib/; \ 38 | cmake -DCMAKE_INSTALL_PREFIX=$VENV \ 39 | -Dwith-mpi=ON \ 40 | ###-Dwith-music=ON \ 41 | -Dwith-libneurosim=ON \ 42 | -DPYTHON_EXECUTABLE:FILEPATH=$VENV/bin/python \ 43 | -DPYTHON_LIBRARY=$VENV/lib/libpython3.8.so \ 44 | -DPYTHON_INCLUDE_DIR=/usr/include/python3.8 \ 45 | $HOME/packages/$NEST; \ 46 | make -j4; make install 47 | 48 | 49 | #### Install NEURON 50 | 51 | RUN $VENV/bin/pip install neuron==$NRN_VER 52 | 53 | 54 | #### Install Brian2 55 | 56 | # Note: Brian 1.4.1 not Python 3 compatible 57 | RUN $VENV/bin/pip install brian2==$BRIAN2_VER 58 | 59 | 60 | #### Set paths 61 | 62 | ENV PATH=$PATH:$VENV/bin 63 | 64 | 65 | #### Install PyNN 66 | 67 | RUN $VENV/bin/pip install PyNN==$PYNN_VER 68 | RUN cd /home/docker/env/neurosci/lib/python3.8/site-packages/pyNN/neuron/nmodl; nrnivmodl; cd - 69 | 70 | 71 | #### Activate Python environment 72 | 73 | WORKDIR /home/docker/ 74 | 75 | RUN echo "source $VENV/bin/activate" >> .bashrc 76 | -------------------------------------------------------------------------------- /simulationx/README.md: -------------------------------------------------------------------------------- 1 | # Biological neuronal network simulations with Python 2 | 3 | 4 | ## What it gives you 5 | 6 | * shell environment with NEST, NEURON, Brian and PyNN installed (for specific versions see [Dockerfile](../simulation/Dockerfile)). 7 | * The Python 2.7 version provides Brian 1.4, the Python 3.5 version provides Brian 2. 8 | * IPython, scipy, matplotlib and OpenMPI are also installed. 9 | * ssh access, so you can access the container with multiple terminals. 10 | * X-windows support, so you can display windows running in the container on your host display. 11 | * use directly or as a base for your own project-specific Docker images. 12 | 13 | 14 | ## Setup 15 | 16 | To enable ssh access you will need to obtain the private key for the image. First run the following command: 17 | 18 | ``` 19 | (host)$ docker run -i -t neuralensemble/simulationx /bin/cat /home/docker/.ssh/id_rsa > docker_key 20 | ``` 21 | 22 | Now set the access permissions on the key file so only you can read it, i.e. `chmod go-r docker_key`. 23 | 24 | (Note: since anyone can obtain this key by downloading the image, it is not safe for running on the public web, 25 | and is intended only for running locally. If you wish to run this image in the cloud, you should create a new 26 | key pair). 27 | 28 | ## Python version 29 | 30 | The Dockerfiles in the [master branch](https://github.com/NeuralEnsemble/neuralensemble-docker) use **Python 3.5** as the Python version; if you'd prefer **Python 2.7** (Dockerfiles in [python2 branch](https://github.com/NeuralEnsemble/neuralensemble-docker/tree/python2)) replace `neuralensemble/simulationx` with `neuralensemble/simulationx:py2`, e.g. 31 | 32 | ``` 33 | docker run -i -t neuralensemble/simulationx:py2 /bin/bash 34 | ``` 35 | 36 | ## Basic use 37 | 38 | In normal use, you will run the container as an SSH server: 39 | 40 | ``` 41 | (host)$ docker run -d -p 22 neuralensemble/simulationx 42 | ``` 43 | 44 | Run `docker ps` to obtain the port number, and then use this to connect to the container: 45 | 46 | ``` 47 | (host)$ ssh -Y -i ./docker_key -p 32782 docker@localhost 48 | ``` 49 | 50 | On connection, you should already be in the "neurosci" virtual environment. If not, run 51 | 52 | ``` 53 | (docker)$ source ~/env/neurosci/bin/activate 54 | ``` 55 | 56 | after which you can run simulations with Python and MPI. To test that X11 forwarding is working, run `xeyes`. 57 | 58 | 59 | ## Mac OS X 60 | 61 | On Mac OS X, you will need to launch XQuartz if you want to display X11 windows. 62 | 63 | If using `boot2docker` or `docker-machine`, you will need to obtain the IP address of the VM, e.g. 64 | 65 | ``` 66 | (host)$ docker-machine ip default 67 | 192.168.99.100 68 | (host)$ ssh -Y -i ./docker_key -p 32782 docker@192.168.99.100 69 | ``` 70 | 71 | ## Docker Hub 72 | 73 | More information on the various images which have been released can be found at: https://hub.docker.com/r/neuralensemble/ 74 | 75 | ## Documentation 76 | 77 | For documentation of the simulation tools installed in the image, see http://neuralensemble.org/projects/ 78 | -------------------------------------------------------------------------------- /osb/Dockerfile: -------------------------------------------------------------------------------- 1 | # 2 | # A Docker image for running neuronal models from Open Source Brain 3 | # 4 | # This image extends the basic "simulationx" image by adding support 5 | # for libraries required for OSB models 6 | # 7 | 8 | # Use tagged version of neuralensemble/simulationx, e.g. Python 2, PyNN 0.9.1 9 | #FROM neuralensemble/simulationx:py2_pynn094 10 | # For local testing 11 | FROM neuralensemble/simulationx 12 | MAINTAINER p.gleeson@gmail.com 13 | 14 | USER root 15 | 16 | RUN apt-get update 17 | RUN apt-get install -y default-jdk python-tk octave maven 18 | RUN apt-get install -y htop libxml2-dev libxslt-dev zlib1g-dev 19 | RUN apt-get install -y python3-setuptools unzip 20 | 21 | RUN /bin/bash -c "source ~/env/neurosci/bin/activate" 22 | 23 | #### Set versions 24 | 25 | # This will set the versions of simulators installed with 'omv install ...' 26 | ENV OMV_VER=v0.3.3 27 | 28 | ENV PYNEUROML_VER=1.3.8 29 | ENV NETPYNE_VER=1.0.6 30 | # omv install arbor with 0.9.0 throwing 'Illegal instruction'..? 31 | ENV ARBOR_VER=0.8.1 32 | 33 | 34 | # Install NeuroML Python libraries 35 | 36 | RUN $VENV/bin/pip install pyNeuroML==$PYNEUROML_VER # will set versions of libNeuroML, pylems, NeuroMLlite... 37 | 38 | 39 | # Install OMV 40 | 41 | RUN $VENV/bin/pip install git+https://github.com/OpenSourceBrain/osb-model-validation@${OMV_VER} 42 | RUN sed -i -e s/'\/usr\/bin\/python'/'\/home\/docker\/env\/neurosci\/bin\/python'/g $VENV/bin/omv 43 | 44 | 45 | # Install jNeuroML, PyLEMS & NeuroML2 46 | 47 | RUN $VENV/bin/omv install jNeuroML 48 | ENV JNML_HOME=$HOME/jnml/jNeuroMLJar 49 | 50 | RUN $VENV/bin/omv install jLEMS 51 | ENV LEMS_HOME=$HOME/jLEMS 52 | 53 | RUN $VENV/bin/omv install PyLEMS_NeuroML2 54 | 55 | ENV PATH=$PATH:$JNML_HOME:$LEMS_HOME 56 | 57 | 58 | # Set up NEURON (TODO: should be set in neuralensemble/simulationx...) 59 | 60 | ENV PATH=$PATH:$HOME/env/neurosci/bin 61 | ENV NEURON_HOME=$HOME/env/neurosci 62 | 63 | 64 | # Set up NEST 65 | 66 | ENV NEST_INSTALL_DIR=$HOME/env/neurosci 67 | 68 | 69 | # Install NetPyNE 70 | 71 | RUN apt-get remove -y python3-cycler python3-matplotlib python3-dateutil 72 | RUN $VENV/bin/pip install netpyne==$NETPYNE_VER 73 | 74 | 75 | ######### Disabled for now, issues compiling on bionic.... 76 | # Install GENESIS 77 | 78 | #RUN apt-get install -y bison flex unzip 79 | #RUN $VENV/bin/omv install genesis 80 | #ENV PATH=$PATH:$HOME/genesis/genesis2.4gamma-master/src 81 | 82 | 83 | # Install OSB_API 84 | 85 | RUN git clone https://github.com/OpenSourceBrain/OSB_API.git 86 | RUN cd OSB_API/python && pip install . && cd - 87 | 88 | 89 | # Install neuroConstruct 90 | 91 | RUN git clone https://github.com/NeuralEnsemble/neuroConstruct.git 92 | RUN cd neuroConstruct && ./updatenC.sh && ./nC.sh -make && cd - 93 | 94 | 95 | # Install Moose 96 | 97 | RUN omv install moose 98 | 99 | # Install Arbor 100 | 101 | RUN omv install arbor:$ARBOR_VER 102 | 103 | # Install EDEN 104 | 105 | RUN omv install eden 106 | 107 | 108 | USER root 109 | 110 | RUN which python 111 | 112 | RUN $VENV/bin/pip install 'numpy<2.0.0' # as there are still some packages not compliant with this 113 | 114 | # Some aliases 115 | 116 | RUN echo '\n\nalias cd..="cd .."\nalias h=history\nalias ll="ls -alt"' >> ~/.bashrc 117 | 118 | RUN $VENV/bin/omv list -V 119 | RUN echo "Built the main OSB Docker image!" 120 | --------------------------------------------------------------------------------