Skip to content

Commit ac6adae

Browse files
committed
fix: improve error messages for resource limitations and WebSocket issues
1 parent 0c14f56 commit ac6adae

25 files changed

+306
-275
lines changed

docs/_prebuilt/developerguide.md

Lines changed: 31 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -45,12 +45,12 @@ This section explains the structure of the frontend and provides instructions on
4545
start_services.sh
4646
```
4747

48-
The frontend is organized within the `frontend/` directory. Key files and folders include:
48+
The frontend is organized within the `frontend/` directory. Key files and folders include:
4949

5050
- `config/` → Contains the **participant.json.example**, the default structure for the paramteres passed to each participant.
51-
- `databases/` → Contains the different databases for NEBULA
52-
- `static/` → Holds static assets (CSS, images, JS, etc.).
53-
- `templates/` → Contains HTML templates. Focus on **deployment.html**
51+
- `databases/` → Contains the different databases for NEBULA
52+
- `static/` → Holds static assets (CSS, images, JS, etc.).
53+
- `templates/` → Contains HTML templates. Focus on **deployment.html**
5454

5555
### **Adding a New Parameter**
5656

@@ -119,7 +119,7 @@ To implement a new attack type, first locate the section where attacks are defin
119119
</h5>
120120
<div class="form-check form-check-inline" style="display: none;" id="new-parameter-container">
121121
<input type="number" class="form-control" id="new-parameter-value"
122-
placeholder="new parameter value" min="0" value="0">
122+
placeholder="new parameter value" min="0" value="0">
123123
</div>
124124
</div>
125125
</div>
@@ -204,43 +204,43 @@ To view the documentation of functions in more detail, you must go to the **NEBU
204204
utils.py
205205
```
206206

207-
The backend is organized within the `/nebula/` directory. Key files and folders include:
207+
The backend is organized within the `/nebula/` directory. Key files and folders include:
208208

209209
**Addons/**
210210

211211
The `addons/` directory contains extended functionalities that can be integrated into the core system.
212212

213-
- **`attacks/`** → Simulates attacks, primarily for security purposes, including adversarial attacks in machine learning.
214-
- **`blockchain/`** → Integrates blockchain technology, potentially for decentralized storage or security enhancements.
215-
- **`trustworthiness/`** → Evaluates the trustworthiness and reliability of participants, focusing on security and ethical considerations.
216-
- **`waf/`** → Implements a Web Application Firewall (WAF) to filter and monitor HTTP traffic for potential threats.
213+
- **`attacks/`** → Simulates attacks, primarily for security purposes, including adversarial attacks in machine learning.
214+
- **`blockchain/`** → Integrates blockchain technology, potentially for decentralized storage or security enhancements.
215+
- **`trustworthiness/`** → Evaluates the trustworthiness and reliability of participants, focusing on security and ethical considerations.
216+
- **`waf/`** → Implements a Web Application Firewall (WAF) to filter and monitor HTTP traffic for potential threats.
217217

218-
**Core/**
218+
**Core/**
219219

220220
The `core/` directory contains the essential components for the backend operation.
221221

222-
- **`aggregation/`** → Manages the aggregation of data from different nodes.
223-
- **`datasets/`** → Handles dataset management, including loading and preprocessing data.
224-
- **`models/`** → Defines machine learning model architectures and related functionalities, such as training and evaluation.
225-
- **`network/`** → Manages communication between participants in a distributed system.
226-
- **`pb/`** → Implements Protocol Buffers (PB) for efficient data serialization and communication.
227-
- **`training/`** → Contains the logic for model training, optimization, and evaluation.
228-
- **`utils/`** → Provides utility functions for file handling, logging, and common tasks.
222+
- **`aggregation/`** → Manages the aggregation of data from different nodes.
223+
- **`datasets/`** → Handles dataset management, including loading and preprocessing data.
224+
- **`models/`** → Defines machine learning model architectures and related functionalities, such as training and evaluation.
225+
- **`network/`** → Manages communication between participants in a distributed system.
226+
- **`pb/`** → Implements Protocol Buffers (PB) for efficient data serialization and communication.
227+
- **`training/`** → Contains the logic for model training, optimization, and evaluation.
228+
- **`utils/`** → Provides utility functions for file handling, logging, and common tasks.
229229

230-
**Files**
230+
**Files**
231231

232-
- **`engine.py`** → The main engine orchestrating participant communications, training, and overall behavior.
233-
- **`eventmanager.py`** → Handles event management, logging, and notifications within the system.
234-
- **`role.py`** → Defines participant roles and their interactions.
232+
- **`engine.py`** → The main engine orchestrating participant communications, training, and overall behavior.
233+
- **`eventmanager.py`** → Handles event management, logging, and notifications within the system.
234+
- **`role.py`** → Defines participant roles and their interactions.
235235

236-
**Standalone Scripts**
236+
**Standalone Scripts**
237237

238238
These scripts act as entry points or controllers for various backend functionalities.
239239

240-
- **`controller.py`** → Manages the flow of operations, coordinating tasks and interactions.
241-
- **`participant.py`** → Represents a participant in the decentralized network, handling computations and communication.
242-
- **`scenarios.py`** → Defines different simulation scenarios for testing and running participants under specific conditions.
243-
- **`utils.py`** → Contains helper functions that simplify development and maintenance.
240+
- **`controller.py`** → Manages the flow of operations, coordinating tasks and interactions.
241+
- **`participant.py`** → Represents a participant in the decentralized network, handling computations and communication.
242+
- **`scenarios.py`** → Defines different simulation scenarios for testing and running participants under specific conditions.
243+
- **`utils.py`** → Contains helper functions that simplify development and maintenance.
244244

245245

246246
### **Adding new Datasets**
@@ -371,7 +371,7 @@ If you want to import a dataset, you must first create a folder named **data** w
371371
# self._load_data(self.path_to_data)
372372

373373
mode = "train" if self.is_train else "test"
374-
self.image_list = glob.glob(os.path.join(self.path_to_data, f"{self.name}/{mode}/*/*.npy"))
374+
self.image_list = glob.glob(os.path.join(self.path_to_data, f"{self.name}/{mode}/*/*.npy"))
375375
self.label_list = glob.glob(os.path.join(self.path_to_data, f"{self.name}/{mode}/*/*.json"))
376376
self.image_list = sorted(self.image_list, key=os.path.basename)
377377
self.label_list = sorted(self.label_list, key=os.path.basename)
@@ -424,7 +424,7 @@ Then you must create a **MilitarySARDataset** class in order to use it, as shown
424424

425425
#### Define transforms
426426

427-
You can apply transformations like cropping and normalization using `torchvision.transforms`.
427+
You can apply transformations like cropping and normalization using `torchvision.transforms`.
428428

429429
For example, the **MilitarySAR** dataset uses **RandomCrop** for training and **CenterCrop** for testing.
430430

@@ -483,7 +483,7 @@ For example, the **MilitarySAR** dataset uses **RandomCrop** for training and **
483483
apply_transforms = [CenterCrop(88), transforms.ToTensor()]
484484
if train:
485485
apply_transforms = [RandomCrop(88), transforms.ToTensor()]
486-
486+
487487
return MilitarySAR(name="soc", is_train=train, transform=transforms.Compose(apply_transforms))
488488
```
489489

@@ -816,4 +816,4 @@ The new aggregator must inherit from the **Aggregator** class. You can use **Fed
816816

817817
# self.print_model_size(accum)
818818
return accum
819-
```
819+
```

docs/_prebuilt/installation.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,17 +22,17 @@ Or clone the repository using git:
2222

2323
Now, you can move to the source directory:
2424

25-
<pre><code><span style="color: blue;">user@host</span>:~$ <span style="color: green;">cd nebula</span></code></pre>
25+
<pre><code><span style="color: blue;">user@host</span>:~$ <span style="color: green;">cd nebula</span></code></pre>
2626

2727
### **Installing NEBULA**
2828

2929
Install required dependencies and set up Docker containers by running:
3030

31-
<pre><code><span style="color: blue;">user@host</span>:~$ <span style="color: green;">make install</span></code></pre>
31+
<pre><code><span style="color: blue;">user@host</span>:~$ <span style="color: green;">make install</span></code></pre>
3232

3333
Next, activate the virtual environment:
3434

35-
<pre><code><span style="color: blue;">user@host</span>:~$ <span style="color: green;">source .venv/bin/activate</span></code></pre>
35+
<pre><code><span style="color: blue;">user@host</span>:~$ <span style="color: green;">source .venv/bin/activate</span></code></pre>
3636

3737
If you forget this command, you can type:
3838

docs/_prebuilt/js/toc.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
document.addEventListener('DOMContentLoaded', function() {
22
if (window.location.pathname.includes("api")) {
3-
document.querySelector('.md-sidebar--primary').style.display = 'block';
3+
document.querySelector('.md-sidebar--primary').style.display = 'block';
44
}
55
});

0 commit comments

Comments
 (0)