Skip to content

Commit 04a9d28

Browse files
2 parents 4c146df + 24ba2b2 commit 04a9d28

File tree

4 files changed

+30
-7
lines changed

4 files changed

+30
-7
lines changed

nebula/addons/reporter.py

+4-5
Original file line numberDiff line numberDiff line change
@@ -120,14 +120,13 @@ async def run_reporter(self):
120120
- Reloads the configuration file every 50 cycles to reflect any updates.
121121
122122
Notes:
123-
- Status reporting to the controller is currently disabled.
124123
- The reporting frequency is determined by the 'report_frequency' setting in the config file.
125124
"""
126125
while True:
127-
# NOTE: currently disabled
128-
if self.config.participant["scenario_args"]["controller"] != "nebula-test":
129-
await self.__report_status_to_controller()
130-
await self.__report_data_queue()
126+
if self.config.participant["reporter_args"]["report_status_data_queue"]:
127+
if self.config.participant["scenario_args"]["controller"] != "nebula-test":
128+
await self.__report_status_to_controller()
129+
await self.__report_data_queue()
131130
await self.__report_resources()
132131
self.counter += 1
133132
if self.counter % 50 == 0:

nebula/frontend/config/participant.json.example

+2-1
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,8 @@
122122
},
123123
"reporter_args": {
124124
"grace_time_reporter": 10,
125-
"report_frequency": 5
125+
"report_frequency": 5,
126+
"report_status_data_queue": true
126127
},
127128
"discoverer_args": {
128129
"grace_time_discovery": 0,

nebula/frontend/templates/deployment.html

+20-1
Original file line numberDiff line numberDiff line change
@@ -429,7 +429,7 @@ <h5 class="step-title">Aggregation algorithm</h5>
429429
<div id="expert-container" class="col-md-12 " style="display: none">
430430
<div class="form-group row container-shadow tiny grey">
431431
<h5 class="step-number">Participants <i class="fa fa-users"></i>
432-
<input type="checkbox" id="participants-lock" onchange="lock('rounds', 'loggingLevel', checked)" style="display: none;">
432+
<input type="checkbox" id="participants-lock" onchange="lock('rounds', 'loggingLevel', 'reportingSwitch', checked)" style="display: none;">
433433
<label for="participants-lock" class="icon-container" style="float: right;">
434434
<i class="fa fa-lock"></i>
435435
</label>
@@ -447,6 +447,10 @@ <h5 class="step-title">Logging</h5>
447447
<option value="true" selected>Alerts and logs</option>
448448
</select>
449449
</div>
450+
<h5 class="step-title">Reporting</h5>
451+
<div class="form-check form-switch" style="margin-left: 23px;">
452+
<input class="form-check-input" type="checkbox" id="reportingSwitch" checked="true" style="display: inline; width: 80px; height: 30px;">
453+
</div>
450454
<h5 class="step-title">Individual participants</h5>
451455
<div id="participant-items" class="row"></div>
452456
</div>
@@ -1041,6 +1045,7 @@ <h5 class="step-title">Schema of deployment</h5>
10411045
// Step 8
10421046
data["rounds"] = document.getElementById("rounds").value
10431047
data["logginglevel"] = document.getElementById("loggingLevel").value === "true"
1048+
data["report_status_data_queue"] = document.getElementById("reportingSwitch").checked
10441049
// Step 9
10451050
data["accelerator"] = document.getElementById("resourceUsage").value
10461051
// Step 10-11
@@ -1137,6 +1142,12 @@ <h5 class="step-title">Schema of deployment</h5>
11371142
// Step 8
11381143
document.getElementById("rounds").value = data["rounds"];
11391144
document.getElementById("loggingLevel").value = data["logginglevel"] ? "true" : "false";
1145+
document.getElementById("reportingSwitch").checked = data["report_status_data_queue"] ? true : false;
1146+
if (data["n_nodes"] > 10) {
1147+
document.getElementById("reportingSwitch").disabled = true;
1148+
} else {
1149+
document.getElementById("reportingSwitch").disabled = false;
1150+
}
11401151
// Step 9
11411152
document.getElementById("resourceUsage").value = data["accelerator"];
11421153
// Step 10-11
@@ -2421,6 +2432,14 @@ <h5 class="step-title">Schema of deployment</h5>
24212432
}
24222433
}
24232434

2435+
if (document.getElementById("predefined-topology-nodes").value > 10) {
2436+
document.getElementById("reportingSwitch").checked = false;
2437+
document.getElementById("reportingSwitch").disabled = true;
2438+
} else {
2439+
document.getElementById("reportingSwitch").checked = true;
2440+
document.getElementById("reportingSwitch").disabled = false;
2441+
}
2442+
24242443
// Update the graph
24252444
updateGraph();
24262445

nebula/scenarios.py

+4
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ def __init__(
4141
agg_algorithm,
4242
rounds,
4343
logginglevel,
44+
report_status_data_queue,
4445
accelerator,
4546
network_subnet,
4647
network_gateway,
@@ -86,6 +87,7 @@ def __init__(
8687
agg_algorithm (str): Aggregation algorithm.
8788
rounds (int): Number of rounds.
8889
logginglevel (str): Logging level.
90+
report_status_data_queue (bool): Indicator to report information about the nodes of the scenario
8991
accelerator (str): Accelerator used.
9092
network_subnet (str): Network subnet.
9193
network_gateway (str): Network gateway.
@@ -125,6 +127,7 @@ def __init__(
125127
self.agg_algorithm = agg_algorithm
126128
self.rounds = rounds
127129
self.logginglevel = logginglevel
130+
self.report_status_data_queue = report_status_data_queue
128131
self.accelerator = accelerator
129132
self.network_subnet = network_subnet
130133
self.network_gateway = network_gateway
@@ -350,6 +353,7 @@ def __init__(self, scenario):
350353
participant_config["mobility_args"]["radius_federation"] = self.scenario.radius_federation
351354
participant_config["mobility_args"]["scheme_mobility"] = self.scenario.scheme_mobility
352355
participant_config["mobility_args"]["round_frequency"] = self.scenario.round_frequency
356+
participant_config["reporter_args"]["report_status_data_queue"] = self.scenario.report_status_data_queue
353357

354358
with open(participant_file, "w") as f:
355359
json.dump(participant_config, f, sort_keys=False, indent=2)

0 commit comments

Comments
 (0)