Installation from Source¶
Note
Currently, only Ubuntu 20.04 is officially supported for the NRP installation from source.
Pre-installation Steps¶
Set the HBP folder:
export HBP=~/NRP4
Add this variable to your .bashrc for persistence:
echo "export HBP=~/NRP4" >> ~/.bashrc
Ensure the HBP folder exists:
mkdir -p "${HBP}"
Install Nginx and HAProxy:
sudo apt-get install nginx-extras lua-cjson haproxy
sudo systemctl disable haproxy.service
sudo service haproxy stop
sudo service nginx stop
Install nvm and Node versions 8 & 14:
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.3/install.sh | bash
source ~/.bashrc
nvm install 8
nvm install 14
Clone nrp-user-scripts repository (for the last stable version use master branch, for the development version use development branch):
cd "${HBP}"
git clone -b master https://bitbucket.org/hbpneurorobotics/nrp-user-scripts.git
Clone nrp-backend, nrp-proxy, nrp-frontend, nrp-core repositories using nrp-user-scripts or do it manually:
cd ${HBP}/nrp-user-scripts
./clone-all-repos
Install NRP-Core. Refer to the NRP-Core Installation instructions.
Warning
The proper installation of the NRP-Core is essential for the functioning of the NRP source installation.
Configuration and Building¶
Add required paths to PYTHONPATH:
export PYTHONPATH="${NRP_INSTALL_DIR}"/lib/python3.8/site-packages:"${PYTHONPATH}"
export PYTHONPATH="${NRP_DEPS_INSTALL_DIR}"/lib/python3.8/site-packages:"${PYTHONPATH}"
For persistence, you can also add it to .bashrc.
Clean old storage or set a non-default STORAGE_PATH in ${HBP}/nrp-user-scripts/nrp_variables.
Source nrp_variables from nrp-user-scripts:
cd "${HBP}"/nrp-user-scripts
source nrp_variables
Warning
Temporarily remove it when the need of rebuilding nrp-core arises (e.g. when developing the latter).
Configure NRP:
./configure_nrp
Update NRP with build option:
./update_nrp build
Add default user to the database (if not added before):
bash ./configure_storage_database
Source nrp_aliases:
source nrp_aliases
Run NRP reverse proxies:
nrp-reverse-proxies
Start the MQTT broker (using the mosquitto Docker broker or another of your choice, ensuring the proper ports are open):
docker run -d -p 1883:1883 -p 9001:9001 -p 8883:8883 -v $HBP/nrp-user-scripts/config_files/mosquitto/mosquitto.conf:/mosquitto/config/mosquitto.conf eclipse-mosquitto
Start NRP:
nrp-start
Access¶
Once everything is set up, the frontend should be accessible at http://localhost:9000.