Sign inSign up

fruitflybrain/fbl

By fruitflybrain

•Updated 12 months ago

Docker Image For Running FlyBrainLab

Image
0

2.9K

fruitflybrain/fbl repository overview

⁠Prerequisite

Tested on Ubuntu 18.04 and 20.04 Hosts. Must have a CUDA-enabled GPU and nvidia-docker⁠ installed. Docker⁠ 19.03 or later recommended. If CUDA version not specified in the tag, it is the default with CUDA 10.2. Your Nvidia GPU driver⁠ version must support this version of CUDA to start a container. Support for earlier CUDA version will be added shortly.

Currently only Linux system is supported. For Windows, use the Window Subsystem for Linux (WSL) 2⁠ through the Windows Insider Program⁠'s Dev Channel⁠, install a linux system and use docker-ce within the linux system, see here⁠ and here⁠ for getting CUDA to work in WSL2. Ubuntu 20.04 under WSL2 has been tested.

We provide an Amazon Machine Image (AMI) that meets all the prerequisite. The AMI ID is ami-0e7d25297242fda33 in us-east-1 region. It must be launched using a GPU instance (a Tesla GPU is recommended), with at least 50GB of storage volume. You can launch a GPU instance directly using the following link:

https://console.aws.amazon.com/ec2/v2/home?region=us-east-1#LaunchInstanceWizard:ami=ami-02218ae5a3d1fd06d⁠

⁠Basic Usage

WARNING: The FlyBrainLab image provides minimal security. Password for root and the user ffbo are both exposed in the build. Do not map any personal information in your local file system onto the Docker container if you intend to host the image publicly. To change the passwords, see Advanced Usage below..

There are two options to start FlyBrainLab using the docker images, depending on if you want the databases to be persistent across container launches.

⁠Option 1: Databases will be removed after container is removed, but persistent over start/stop of container

Step 1: Pull the Docker image:

docker pull fruitflybrain/fbl:latest

Step 2: Start a Docker container:

docker run --gpus all --name fbl -p 8085:8888 -it fruitflybrain/fbl:latest

You will be asked if you want to download datasets to /home/ffbo/orientdb, and subsequently each of the datasets.

After a bit of wait, you should see regular Jupyter lab/notebook messages in the terminal. The message contains the JupyterLab token needed in Step 3.

Step 3: Launch FlyBrainLab from your host's browser at http://localhost:8085. When asked, copy and paste the JupyterLab token. If the Docker container runs on a remote machine, replace localhost with the IP of the remote machine. 8085 can be replaced by any unused/unreserved port number.

Step 4 Accessing the container:

You can login to the running container by

docker exec -it fbl bash

where fbl is the name of the container specified previously using --name. See Advanced Usage below for more details of the setup.

Step 5 Stop FlyBrainLab container:

press ctrl+c twice to stop the container.

Step 6 (optional) Restart FlyBrainLab container:

docker start -i fbl

where fbl is the name of the container specified previously using --name. You will be asked if you want to download datasets. You can skip this if you have already downloaded the datasets you wanted. You may also download additional datasets in this step. You can also choose to load a fresh copy of the datasets by overwriting the existing ones.

⁠Option 2: Database will not be destroyed after container is removed

In this option, we will map a few empty directories from your host file system to the container and restore the databases inside these directories. The restored database will then live on the host's file system and will not be destroyed after the container is removed. This way, you can use the same folders when launching another container.

Step 1: Pull the Docker image:

docker pull fruitflybrain/fbl:latest

Step 2: Create a few directories on your own machine:

mkdir databases
cd databases
mkdir hemibrain
mkdir flycircuit
mkdir l1em
mkdir medulla

Here we present the full list of preloaded databases. If you only wish to work with one or several of the datasets, you can skip creating these directories.

Step 3: Start a Docker container (change `/path/to/data/folder' to where you decompress the database):

docker run --gpus all --name fbl -p 8085:8888 -v databases/hemibrain:/home/ffbo/orientdb/databases/hemibrain -v databases/flycircuit:/home/ffbo/orientdb/databases/flycircuit -v databases/l1em:/home/ffbo/orientdb/databases/l1em -v databases/medulla:/home/ffbo/orientdb/databases/medulla  -it fruitflybrain/fbl:latest

Again, you can skip mapping the directories using -v option if you do not need these datasets.

You will be asked if you want to download datasets to /home/ffbo/orientdb, and subsequently each of the datasets.

After a bit of wait, you should see regular Jupyter lab/notebook messages in the terminal. The message contains the JupyterLab token needed in Step 3.

Step 3: Launch FlyBrainLab from your host's browser at http://localhost:8085. When asked, copy and paste the JupyterLab token. If the Docker container runs on a remote machine, replace localhost with the IP of the remote machine. 8085 can be replaced by any unused/unreserved port number.

Step 4 Accessing the container:

You can login to the running container by

docker exec -it fbl bash

where fbl is the name of the container specified previously using --name. See Advanced Usage below for more details of the setup.

Step 5 Stop FlyBrainLab container:

press ctrl+c twice to stop the container.

Step 6 (optional) Restart FlyBrainLab container:

docker start -i fbl

where fbl is the name of the container specified previously using --name. -i option is required for interaction. You will be asked if you want to download datasets. You can skip this if you have already downloaded the datasets you wanted. You may download additional datasets in this step. You can also choose to load a fresh copy of the datasets by overwriting the existing ones.

Step 7 (optional): Remove the container and start a new container with the databases on your host

You can remove the container by once it is stopped (database will survive, all other changes you have made to the codebase will be removed):

docker rm fbl

Since the databases now lives on your host's file system, after the container is removed, the databases will persist. You can now simply launch FlyBrainLab for the second time by

docker run --gpus all --name fbl -p 8085:8888 -v databases/hemibrain:/home/ffbo/orientdb/databases/hemibrain -v databases/flycircuit:/home/ffbo/orientdb/databases/flycircuit -v databases/l1em:/home/ffbo/orientdb/databases/l1em -v databases/medulla:/home/ffbo/orientdb/databases/medulla  -it fruitflybrain/fbl:latest

You will be asked if you want to download datasets. You can skip this if you have already downloaded the datasets you wanted. You may also download additional datasets in this step.

⁠Advanced Usage

Default user in the docker container is ffbo, and its password is Drosophila.

The image contains two conda environments: ffbo and crossbar.

  • crossbaronly contains packages necessary for running the FFBO processor with a crossbar.io router.
  • ffbo contains packages to run all servers, including NeuroNLP, NeuroArch, Neurokernel, and FlyBrainLab, in Python 3.9. Additional Python libraries should be installed in this environment.

OrientDB is installed in /home/ffbo/orientdb.

We provide a set of scripts in ~/ffbo/bin to launch servers and applications.

  • Shortcuts (recommended way of starting FlyBrainLab):
    • start.sh: start FlyBrainLab, including starting all backend servers, each in a tmux session.
    • shutdown.sh: stop FlyBrainLab and all backend servers, the tmux sessions will be killed.
    • update.sh: update all packages to the latest version.
  • Individual scripts (must be executed in the following order):
    • run_processor.sh: start crossbar and FFBO processor.
    • run_nlp.sh: start NeuroNLP server.
    • run_database.sh: start OrientDB database.
    • run_neuroarch.sh: start NeuroArch server.
    • run_neurokernel.sh: start Neurokernel server.
    • run_fbl.sh: start FlyBrainLab.
  • download_datasets.sh: download some or all datasets.

⁠Tags

  • latest: CUDA 11.2.1, FlyBrainLab 1.1.9, NeuroMynerva 0.2.14
  • dev: CUDA 11.2.1, FlyBrainLab 1.1.9, NeuroMynerva 0.2.14 (all FFBO packages installed locally in develop mode instead of into the environment site-package).

Tag summary

Content type

Image

Digest

sha256:7c51bfdc3…

Size

10.3 GB

Last updated

12 months ago

docker pull fruitflybrain/fbl