Fed-BioMed node: Part 1¶
We will be using Fed-BioMed to conduct the federated learning experiment. See this page of the Fed-BioMed website for more information about how it works. Essentially, each site participating in the federated experiment needs to deploy a node, and the person responsible for running the experiment (i.e. training the models) deploys a server (researcher in Fed-BioMed vocabulary) to which all nodes connect to.
During training, the researcher sends experiment-specific code (a training plan) to all nodes. Nodes use this code to train a local model, then send model weights to the researcher (subject-level data never leave the node). The researcher aggregates the set of all weights to produce a global model, which can be sent back to the nodes for further training.
Note
All commands assume that the working directory is the root of the brainflex-node repository.
They will need to be modified if that is not the case.
Record start time¶
brainflex record fedbiomed_node_part_1 start
Deploy the node¶
Run this to download the images (about 18 GB in total) and start them:
docker compose up -d
[+] Running 3/3
✔ Network brainflex-node_default Created
✔ Container brainflex-vpn-default Healthy
✔ Container brainflex-node-default Started
The download can take a couple of (maybe 5–10) minutes, depending on your Internet connection.
The two services are:
vpn: a WireGuard VPN client that connects to the central VPN servernode: the node image distributed by Fed-BioMed
Troubleshooting: disk quota error¶
If you run out of disk space and have already tried changing the Docker data directories as previously described, you can remove the FreeSurfer image downloaded in the IDP extraction step, as it is not needed anymore.
List your images:
docker image ls --filter reference=freesurfer/freesurfer:7.3.2
Example output¶IMAGE ID DISK USAGE CONTENT SIZE EXTRA freesurfer/freesurfer:7.3.2 e04a8cf308a8 22.5GB 6.88GB
Note the
IDthat corresponds to thefreesurfer/freesurfer:7.3.2image.Remove the image
docker image rm <IMAGE_ID>
If you get an error about a container (running or stopped) still using the image, find it:
docker container ls --all --filter ancestor=freesurfer/freesurfer:7.3.2
Note its
ID. Stop it if it’s running, then remove it:docker container stop <CONTAINER ID> docker container rm <CONTAINER ID>
Then remove the image:
docker image rm <IMAGE_ID>
Check Fed-BioMed node status¶
Run this to confirm that the node is running:
docker compose exec -u fedbiomed node fedbiomed node -p /fbm-node status
# Using component located at: /fbm-node #
2026-11-03 19:27:17,690 fedbiomed INFO - Syslog configuration is disabled or not found in configuration. Disabling syslog logging.
Node status: NodeState.RUNNING
Troubleshooting: permission error¶
If the command fails with a permission error like this:
PermissionError: [Errno 13] Permission denied: '/fbm-node/log'
check that CONTAINER_UID and CONTAINER_GID in your .env file match the output of id -u and id -g (see Initial setup), then restart the containers:
docker compose down
docker compose up -d
Add datasets to the node¶
Run the two commands below to register the datasets created by nipoppy2fedbiomed:
docker compose exec -u fedbiomed node fedbiomed node -p /fbm-node dataset add --file /nipoppy_study/derivatives/nipoppy2fedbiomed/0.1.0/output/age/dataset_info.json
docker compose exec -u fedbiomed node fedbiomed node -p /fbm-node dataset add --file /nipoppy_study/derivatives/nipoppy2fedbiomed/0.1.0/output/sex/dataset_info.json
Confirm that they have been added:
docker compose exec -u fedbiomed node fedbiomed node -p /fbm-node dataset list
You should see a table like this:
Listing your data available
name data_type tags description path shape dataset_id dataset_parameters
------ ----------- -------------------- --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- ------------------------------------------------------------------------- ------------------ -------------------------------------------- --------------------
age csv ['brainflex', 'age'] Generated by nipoppy2fedbiomed (sources: nb:Age, nb:Sex, freesurfer 7.3.2 idp/fs_stats-*/fs7.3.2-aparc.DKTatlas-thickness.tsv, freesurfer 7.3.2 idp/fs_stats-*/fs7.3.2-aseg-volume.tsv) /nipoppy_study/derivatives/nipoppy2fedbiomed/0.1.0/output/age/dataset.csv {'csv': [80, 131]} dataset_f555e76c-e98c-46f4-81f8-6936edc5a004 {}
sex csv ['brainflex', 'sex'] Generated by nipoppy2fedbiomed (sources: nb:Age, nb:Sex, freesurfer 7.3.2 idp/fs_stats-*/fs7.3.2-aparc.DKTatlas-thickness.tsv, freesurfer 7.3.2 idp/fs_stats-*/fs7.3.2-aseg-volume.tsv) /nipoppy_study/derivatives/nipoppy2fedbiomed/0.1.0/output/sex/dataset.csv {'csv': [80, 131]} dataset_4b7addc7-37c4-404c-a530-279554e3237d {}
Record end time¶
brainflex record fedbiomed_node_part_1 end
Wait¶
Once all the above steps are done, wait until you hear back from the FL experiment coordinator before doing Part 2.