|
| 1 | +# Installation |
| 2 | + |
| 3 | +NEBULA is a modular, adaptable and extensible platform for creating |
| 4 | +centralized and decentralized architectures using Federated Learning. |
| 5 | +Also, the platform enables the creation of a standard approach for |
| 6 | +developing, deploying, and managing federated learning applications. |
| 7 | + |
| 8 | +The platform enables developers to create distributed applications that |
| 9 | +use federated learning algorithms to improve user experience, security, |
| 10 | +and privacy. It provides features for managing data, managing models, |
| 11 | +and managing federated learning processes. It also provides a |
| 12 | +comprehensive set of tools to help developers monitor and analyze the |
| 13 | +performance of their applications. |
| 14 | + |
| 15 | +## Prerequisites |
| 16 | + |
| 17 | +- Python 3.8 or higher (3.11 recommended) |
| 18 | +- pip3 |
| 19 | +- Docker Engine 24.0.4 or higher (24.0.7 recommended, |
| 20 | + <https://docs.docker.com/engine/install/>) |
| 21 | +- Docker Compose 2.19.0 or higher (2.19.1 recommended, |
| 22 | + <https://docs.docker.com/compose/install/>) |
| 23 | +- For using NVIDIA GPUs, NVIDIA driver version \>=525.60.13 (Linux) |
| 24 | + \>=528.33 (Windows), and CUDA 12.1 (mandatory). For more |
| 25 | + information, see |
| 26 | + <https://docs.nvidia.com/cuda/cuda-installation-guide-microsoft-windows/index.html> |
| 27 | + (Windows) or |
| 28 | + <https://docs.nvidia.com/cuda/cuda-installation-guide-linux/index.html> |
| 29 | + (Linux) |
| 30 | + |
| 31 | +## Deploy a virtual environment {#deploy_venv} |
| 32 | + |
| 33 | +Virtualenv is a tool to build isolated Python environments. |
| 34 | + |
| 35 | +It\'s a great way to quickly test new libraries without cluttering your |
| 36 | +global site-packages or run multiple projects on the same machine which |
| 37 | +depend on a particular library but not the same version of the library. |
| 38 | + |
| 39 | +Since Python version 3.3, there is also a module in the standard library |
| 40 | +called [venv]{.title-ref} with roughly the same functionality. |
| 41 | + |
| 42 | +### Create virtual environment |
| 43 | + |
| 44 | +In order to create a virtual environment called e.g. nebula using |
| 45 | +[venv]{.title-ref}, run: |
| 46 | + |
| 47 | + $ python3 -m venv nebula-venv |
| 48 | + |
| 49 | +### Activate the environment |
| 50 | + |
| 51 | +Once the environment is created, you need to activate it. Just change |
| 52 | +directory into it and source the script [Scripts/activate]{.title-ref} |
| 53 | +or [bin/activate]{.title-ref}. |
| 54 | + |
| 55 | +With bash: |
| 56 | + |
| 57 | + $ cd nebula-venv |
| 58 | + $ . Scripts/activate |
| 59 | + (nebula-venv) $ |
| 60 | + |
| 61 | +With csh/tcsh: |
| 62 | + |
| 63 | + $ cd nebula-venv |
| 64 | + $ source Scripts/activate |
| 65 | + (nebula-venv) $ |
| 66 | + |
| 67 | +Notice that the prompt changes once you are activate the environment. To |
| 68 | +deactivate it just type deactivate: |
| 69 | + |
| 70 | + (nebula-venv) $ deactivate |
| 71 | + $ |
| 72 | + |
| 73 | +After you have created the environment, you can install nebula following |
| 74 | +the instructions below. |
| 75 | + |
| 76 | +## Building from source |
| 77 | + |
| 78 | +Obtaining the platform \-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-- |
| 79 | + |
| 80 | +You can obtain the source code from |
| 81 | +<https://github.com/enriquetomasmb/nebula> |
| 82 | + |
| 83 | +Or, if you happen to have git configured, you can clone the repository: |
| 84 | + |
| 85 | + git clone https://github.com/enriquetomasmb/nebula.git |
| 86 | + |
| 87 | +Now, you can move to the source directory: |
| 88 | + |
| 89 | + cd nebula |
| 90 | + |
| 91 | +### Dependencies |
| 92 | + |
| 93 | +NEBULA requires the additional packages in order to be able to be |
| 94 | +installed and work properly. |
| 95 | + |
| 96 | +You can install them using pip: |
| 97 | + |
| 98 | + pip3 install -r requirements.txt |
| 99 | + |
| 100 | +### Checking the installation |
| 101 | + |
| 102 | +Once the installation is finished, you can check by listing the version |
| 103 | +of the NEBULA with the following command line: |
| 104 | + |
| 105 | + python app/main.py --version |
| 106 | + |
| 107 | +## Building the nebula node |
| 108 | + |
| 109 | +There are two ways to deploy the node in the federation: using Docker |
| 110 | +containers or isolated processes. You can choose the one that best fits |
| 111 | +your needs in the frontend. |
| 112 | + |
| 113 | +### 1. Using Docker containers |
| 114 | + |
| 115 | +You need to build the docker image using the following command line in |
| 116 | +the root directory: |
| 117 | + |
| 118 | + docker build -t nebula-core . |
| 119 | + |
| 120 | +In case of using GPU in the docker, you have to follow the instructions |
| 121 | +in the following link to install nvidia-container-toolkit: |
| 122 | + |
| 123 | +<https://docs.nvidia.com/datacenter/cloud-native/container-toolkit/install-guide.html> |
| 124 | + |
| 125 | +You can check the docker images using the following command line: |
| 126 | + |
| 127 | + docker images |
| 128 | + |
| 129 | +### 2. Using isolated processes |
| 130 | + |
| 131 | +You need to install the requirements of the node (core) using the |
| 132 | +following command line in the root directory: |
| 133 | + |
| 134 | + pip3 install -r nebula/requirements.txt |
| 135 | + |
| 136 | +## Running NEBULA |
| 137 | + |
| 138 | +To run NEBULA, you can use the following command line: |
| 139 | + |
| 140 | + python app/main.py [PARAMS] |
| 141 | + |
| 142 | +The first time you run the platform, the nebula-frontend docker image |
| 143 | +will be built. This process can take a few minutes. |
| 144 | + |
| 145 | +You can show the PARAMS using: |
| 146 | + |
| 147 | + python app/main.py --help |
| 148 | + |
| 149 | +The frontend will be available at <http://127.0.0.1:6060> (by default) |
| 150 | + |
| 151 | +To change the default port of the frontend, you can use the following |
| 152 | +command line: |
| 153 | + |
| 154 | + python app/main.py --webport [PORT] |
| 155 | + |
| 156 | +To change the default port of the statistics endpoint, you can use the |
| 157 | +following command line: |
| 158 | + |
| 159 | + python app/main.py --statsport [PORT] |
| 160 | + |
| 161 | +## NEBULA Frontend |
| 162 | + |
| 163 | +You can login with the following credentials: |
| 164 | + |
| 165 | + - User: admin |
| 166 | + - Password: admin |
| 167 | + |
| 168 | +If not working the default credentials, send an email to [Enrique Tomás |
| 169 | +Martínez Beltrán](mailto:enriquetomas@um.es) to get the credentials. |
| 170 | + |
| 171 | +## Stop NEBULA |
| 172 | + |
| 173 | +To stop NEBULA, you can use the following command line: |
| 174 | + |
| 175 | + python app/main.py --stop |
| 176 | + |
| 177 | +Be careful, this command will stop all the containers related to NEBULA: |
| 178 | +frontend, controller, and nodes. |
| 179 | + |
| 180 | +## Possible issues during the installation or execution |
| 181 | + |
| 182 | +If frontend is not working, check the logs in app/logs/server.log |
| 183 | + |
| 184 | +If any of the following errors appear, take a look at the docker logs of |
| 185 | +the nebula-frontend container: |
| 186 | + |
| 187 | +docker logs nebula-frontend |
| 188 | + |
| 189 | +------------------------------------------------------------------------ |
| 190 | + |
| 191 | +Network nebula_X Error failed to create network nebula_X: Error response |
| 192 | +from daemon: Pool overlaps with other one on this address space |
| 193 | + |
| 194 | +Solution: Delete the docker network nebula_X |
| 195 | + |
| 196 | +> docker network rm nebula_X |
| 197 | +
|
| 198 | +------------------------------------------------------------------------ |
| 199 | + |
| 200 | +Error: Cannot connect to the Docker daemon at |
| 201 | +unix:///var/run/docker.sock. Is the docker daemon running? |
| 202 | + |
| 203 | +Solution: Start the docker daemon |
| 204 | + |
| 205 | +> sudo dockerd |
| 206 | +
|
| 207 | +Solution: Enable the following option in Docker Desktop |
| 208 | + |
| 209 | +Settings -\> Advanced -\> Allow the default Docker socket to be used |
| 210 | + |
| 211 | +> {.align-center} |
| 212 | +
|
| 213 | +------------------------------------------------------------------------ |
| 214 | + |
| 215 | +Error: Cannot connect to the Docker daemon at tcp://X.X.X.X:2375. Is the |
| 216 | +docker daemon running? |
| 217 | + |
| 218 | +Solution: Start the docker daemon |
| 219 | + |
| 220 | +> sudo dockerd -H tcp://X.X.X.X:2375 |
| 221 | +
|
| 222 | +------------------------------------------------------------------------ |
| 223 | + |
| 224 | +If frontend is not working, restart docker daemon |
| 225 | + |
| 226 | +> sudo systemctl restart docker |
| 227 | +
|
| 228 | +------------------------------------------------------------------------ |
| 229 | + |
| 230 | +Error: Too many open files |
| 231 | + |
| 232 | +Solution: Increase the number of open files |
| 233 | + |
| 234 | +> ulimit -n 65536 |
| 235 | +
|
| 236 | +Also, you can add the following lines to the file |
| 237 | +/etc/security/limits.conf |
| 238 | + |
| 239 | +> - soft nofile 65536 |
| 240 | +> - hard nofile 65536 |
0 commit comments