Initial setup

Installation

Clone the starting repository

Clone the brainflex-node repository:

git clone https://github.com/neurodatascience/brainflex-node
cd brainflex-node

Create virtual environment and install Python dependencies

With uv

uv venv --python 3.14
source .venv/bin/activate
uv pip install -r requirements.txt

With venv

Make sure your Python version is between 3.11 and 3.14 inclusive.

python3 -m venv .venv --prompt brainflex-node
source .venv/bin/activate
pip install -r requirements.txt

With conda

conda create --name brainflex-node python=3.14
conda activate brainflex-node
pip install -r requirements.txt

Verify installation

The above step installs three packages/tools:

  1. bagel: Neurobagel CLI

  2. nipoppy: Nipoppy CLI

  3. brainflex: Custom helper tool for this project

You can verify that they were installed successfully by running <TOOL_NAME> --help, where <TOOL_NAME> is one of bagel, nipoppy, and brainflex. This should print information about the CLI commands and options.

Initial survey

Answer a short survey about your prior experience with Nipoppy, Neurobagel and Fed-BioMed:

brainflex initial-survey

Node configuration

Attention

config.env and .env are Git-ignored and should never be shared.

config.env file

Put the config.env file that was shared with you in the vpn_config/ directory:

mv <PATH_TO_CONFIG_ENV> vpn_config/config.env

.env file

Create a .env file from the provided template:

cp .env.example .env

Edit .env and set:

  • FBM_NODE_NAME to the value of FEDBIOMED_NODEID in the config.env file that was shared with you

  • CONTAINER_UID and CONTAINER_GID to the output of id -u and id -g, respectively

Data download

Download the OpenNeuro dataset assigned to your site, replacing <DATASET_ID> with its ID (beginning with ds):

brainflex get-data <DATASET_ID>

This creates a minimal Nipoppy study in nipoppy_study that contains all the data needed for the federated learning experiment.