Skip to content

Commit d9234b5

Browse files
Major changes in dependency management, docs, linting, and checks
1 parent 8566037 commit d9234b5

14 files changed

+316
-1
lines changed

.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,6 @@ poetry.lock
123123

124124
# mkdocs documentation
125125
/site
126-
_prebuilt/
127126
_build/
128127

129128
# mypy

docs/_prebuilt/changelog.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
--8<-- "CHANGELOG.md"

docs/_prebuilt/contributing.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
--8<-- "CONTRIBUTING.md"

docs/_prebuilt/index.md

Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
# Home
2+
3+
<h1 align="center">
4+
NEBULA
5+
</h1>
6+
<h2 align="center">
7+
A Platform for Decentralized Federated Learning
8+
</h2>
9+
10+
![NEBULA logo](static/nebula-logo.jpg)
11+
12+
## 🌌 About NEBULA
13+
14+
**NEBULA** is a cutting-edge platform designed to facilitate the
15+
training of federated models within both centralized and decentralized
16+
architectures. It streamlines the development, deployment, and
17+
management of federated applications across physical and virtualized
18+
devices.
19+
20+
## 🚀 Key Components
21+
22+
NEBULA boasts a **modular architecture** that consists of three core
23+
elements:
24+
25+
- **Frontend**: A user-friendly interface for setting up experiments
26+
and monitoring progress.
27+
- **Controller**: An orchestrator that ensures efficient operation
28+
management.
29+
- **Core**: The fundamental component deployed on each device to
30+
handle federated learning processes.
31+
32+
## 🌟 Main Features
33+
34+
- **Decentralized**: Train models without a central server, leveraging
35+
decentralized federated learning.
36+
- **Privacy-preserving**: Maintain data privacy by training on-device
37+
and only sharing model updates.
38+
- **Topology-agnostic**: Support for various network topologies
39+
including star, ring, and mesh.
40+
- **Model-agnostic**: Compatible with a wide range of machine learning
41+
algorithms, from deep learning to traditional methods.
42+
- **Network communication**: Secure and efficient device communication
43+
with features like compression, network failure tolerance, and
44+
condition simulation.
45+
- **Real-time monitoring**: Provides live performance metrics and
46+
visualizations during the learning process.
47+
48+
## 🌍 Scenario Applications
49+
50+
- **Healthcare**: Train models on medical devices such as wearables,
51+
smartphones, and sensors.
52+
- **Industry 4.0**: Implement on industrial devices like robots,
53+
drones, and constrained devices.
54+
- **Mobile services**: Optimize for mobile devices including
55+
smartphones, tablets, and laptops.
56+
- **Military**: Apply to military equipment such as drones, robots,
57+
and sensors.
58+
- **Vehicular scenarios**: Utilize in vehicles including cars, trucks,
59+
and drones.
60+
61+
NEBULA is developed by [Enrique Tomás Martínez
62+
Beltrán](https://www.enriquetomasmb.com/) in collaboration with the
63+
[University of Murcia](https://www.um.es/en),
64+
[Armasuisse](https://www.armasuisse.ch/en), and the [University of
65+
Zurich (UZH)](https://www.uzh.ch/).
66+
67+
For any questions, please contact Enrique Tomás Martínez Beltrán
68+
(<enriquetomas@um.es>).
69+
70+
<p align="center">
71+
<img src="static/umu.jpg" alt="University of Murcia logo" style="width:200px; display:inline-block; margin-right: 10px;">
72+
<img src="static/armasuisse.jpg" alt="Armasuisse logo" style="width:200px; display:inline-block; margin-right: 10px;">
73+
<img src="static/uzh.jpg" alt="University of Zurich logo" style="width:200px; display:inline-block;">
74+
</p>

docs/_prebuilt/installation.md

Lines changed: 240 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,240 @@
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+
> ![Docker required options](static/docker-required-options.png){.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

docs/_prebuilt/static/armasuisse.jpg

109 KB
Loading

docs/_prebuilt/static/custom.css

Whitespace-only changes.
76.2 KB
Loading

docs/_prebuilt/static/nebula-logo.jpg

136 KB
Loading

docs/_prebuilt/static/nebula-logo.pdf

41.1 KB
Binary file not shown.

0 commit comments

Comments
 (0)