Linux and HPC
Ways of using Neurocommand in Linux and HPC
Section titled “Ways of using Neurocommand in Linux and HPC”- You can use the module files for Neurocontainers directly via CVMFS: /getting-started/neurocontainers/cvmfs/
- Or you can install Neurocommand as described here.
Requirements
Section titled “Requirements”- Python 3.6+: https://www.anaconda.com/docs/getting-started/miniconda/install#linux-terminal-installer
- Singularity: https://docs.sylabs.io/guides/3.5/user-guide/quick_start.html
- git
- Lmod: https://lmod.readthedocs.io/en/latest/
Setup instructions
Section titled “Setup instructions”Install command line (e.g. running on Linux or HPC)
Section titled “Install command line (e.g. running on Linux or HPC)”-
Load Singularity.
For optimal performance, ensure you are using Singularity version 3.x:
Terminal window module load singularity/3.5.0#ormodule load singularity#ormodule load apptainerIf this doesn’t work it might already be loaded. Just run
singularityand check. -
Load aria2 (optional).
To speed up container downloads, you can optionally install or load aria2c:
Terminal window module load aria2c -
Clone and set up the repository.
Clone the repository into a directory with enough storage and ensure you are not using a symbolic link (to be sure run
cd `pwd -P`). It is recommended to perform this setup within a Python virtual environment (venv) or a Conda environment:Terminal window git clone https://github.com/neurodesk/neurocommand.gitcd neurocommandpip3 install -r neurodesk/requirements.txt --userbash build.sh --clibash containers.shexport SINGULARITY_BINDPATH=`pwd -P`# OR, depending on your installation:export APPTAINER_BINDPATH=`pwd -P`
Install containers
Section titled “Install containers”- If these steps are successful, the help will be displayed.
- Install all or only specific containers by following the instructions, e.g.:
-
Search and install specific containers.
To search for containers that have “itksnap” in the name:
Terminal window bash containers.sh itksnap -
Install a specific version.
To install a specific version (e.g., itksnap version 4.0.2 from 20240117):
Terminal window ./local/fetch_containers.sh itksnap 4.0.2 20240117To install all containers with that name:
Terminal window bash containers.sh --itksnapTo download all containers (be careful, there are a lot of containers):
Terminal window bash containers.sh --all
Add your containers to Lmod
Section titled “Add your containers to Lmod”-
To add each container to the module search path, run the following:
Terminal window module use $PWD/local/containers/modules/ -
It may be a good idea to add this to your
.bashrcif it works. When adding to your.bashrcyou will need to replace$PWDto point to the correct path, i.e. the output of:Terminal window echo "module use $PWD/local/containers/modules/" -
It is very important to also set the
SINGULARITY_BINDPATHor theAPPTAINER_BINDPATHvariable in your.bashrc. This variable must contain a comma-separated list of directories you want to access with the Neurodesk tools.e.g.:
Terminal window export SINGULARITY_BINDPATH=/scratch/,/data/# OR, depending on your installation:export APPTAINER_BINDPATH=/scratch/,/data/# Note: use the correct line depending on your installation. Do not add a directory that does not exist, otherwise the containers will not start! -
Run
ml availto see the installed containers at the top of the list (Neurodesk containers will take preference over system modules with the same name):Terminal window module --ignore_cache avail -
Every time you start a new shell you need to run
module use PathToYourContainersor add this command to your.bashrcfile.
To update
Section titled “To update”1. Update the Neurocommand repository
Section titled “1. Update the Neurocommand repository”First, ensure your local repository is up to date by pulling the latest changes:
git pullNext, rebuild Neurocommand by running:
bash build.sh2. Update containers
Section titled “2. Update containers”To update the containers, navigate to the neurodesktop directory and run:
bash containers.sh3. Update specific modules
Section titled “3. Update specific modules”Choose the module you want to update. For example, to update the mrtrix3/3.0.2 module with the eddy_cuda fix:
~/neurocommand/local/fetch_containers.sh mrtrix3 3.0.2 20221108 mrview $@Installation examples
Section titled “Installation examples”We show a couple of specific examples on how Neurodesk can be installed on various HPC systems here.