Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
enriquetomasmb committed Nov 11, 2024
2 parents 4c146df + 24ba2b2 commit 04a9d28
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 7 deletions.
9 changes: 4 additions & 5 deletions nebula/addons/reporter.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,14 +120,13 @@ async def run_reporter(self):
- Reloads the configuration file every 50 cycles to reflect any updates.
Notes:
- Status reporting to the controller is currently disabled.
- The reporting frequency is determined by the 'report_frequency' setting in the config file.
"""
while True:
# NOTE: currently disabled
if self.config.participant["scenario_args"]["controller"] != "nebula-test":
await self.__report_status_to_controller()
await self.__report_data_queue()
if self.config.participant["reporter_args"]["report_status_data_queue"]:
if self.config.participant["scenario_args"]["controller"] != "nebula-test":
await self.__report_status_to_controller()
await self.__report_data_queue()
await self.__report_resources()
self.counter += 1
if self.counter % 50 == 0:
Expand Down
3 changes: 2 additions & 1 deletion nebula/frontend/config/participant.json.example
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,8 @@
},
"reporter_args": {
"grace_time_reporter": 10,
"report_frequency": 5
"report_frequency": 5,
"report_status_data_queue": true
},
"discoverer_args": {
"grace_time_discovery": 0,
Expand Down
21 changes: 20 additions & 1 deletion nebula/frontend/templates/deployment.html
Original file line number Diff line number Diff line change
Expand Up @@ -429,7 +429,7 @@ <h5 class="step-title">Aggregation algorithm</h5>
<div id="expert-container" class="col-md-12 " style="display: none">
<div class="form-group row container-shadow tiny grey">
<h5 class="step-number">Participants <i class="fa fa-users"></i>
<input type="checkbox" id="participants-lock" onchange="lock('rounds', 'loggingLevel', checked)" style="display: none;">
<input type="checkbox" id="participants-lock" onchange="lock('rounds', 'loggingLevel', 'reportingSwitch', checked)" style="display: none;">
<label for="participants-lock" class="icon-container" style="float: right;">
<i class="fa fa-lock"></i>
</label>
Expand All @@ -447,6 +447,10 @@ <h5 class="step-title">Logging</h5>
<option value="true" selected>Alerts and logs</option>
</select>
</div>
<h5 class="step-title">Reporting</h5>
<div class="form-check form-switch" style="margin-left: 23px;">
<input class="form-check-input" type="checkbox" id="reportingSwitch" checked="true" style="display: inline; width: 80px; height: 30px;">
</div>
<h5 class="step-title">Individual participants</h5>
<div id="participant-items" class="row"></div>
</div>
Expand Down Expand Up @@ -1041,6 +1045,7 @@ <h5 class="step-title">Schema of deployment</h5>
// Step 8
data["rounds"] = document.getElementById("rounds").value
data["logginglevel"] = document.getElementById("loggingLevel").value === "true"
data["report_status_data_queue"] = document.getElementById("reportingSwitch").checked
// Step 9
data["accelerator"] = document.getElementById("resourceUsage").value
// Step 10-11
Expand Down Expand Up @@ -1137,6 +1142,12 @@ <h5 class="step-title">Schema of deployment</h5>
// Step 8
document.getElementById("rounds").value = data["rounds"];
document.getElementById("loggingLevel").value = data["logginglevel"] ? "true" : "false";
document.getElementById("reportingSwitch").checked = data["report_status_data_queue"] ? true : false;
if (data["n_nodes"] > 10) {
document.getElementById("reportingSwitch").disabled = true;
} else {
document.getElementById("reportingSwitch").disabled = false;
}
// Step 9
document.getElementById("resourceUsage").value = data["accelerator"];
// Step 10-11
Expand Down Expand Up @@ -2421,6 +2432,14 @@ <h5 class="step-title">Schema of deployment</h5>
}
}

if (document.getElementById("predefined-topology-nodes").value > 10) {
document.getElementById("reportingSwitch").checked = false;
document.getElementById("reportingSwitch").disabled = true;
} else {
document.getElementById("reportingSwitch").checked = true;
document.getElementById("reportingSwitch").disabled = false;
}

// Update the graph
updateGraph();

Expand Down
4 changes: 4 additions & 0 deletions nebula/scenarios.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ def __init__(
agg_algorithm,
rounds,
logginglevel,
report_status_data_queue,
accelerator,
network_subnet,
network_gateway,
Expand Down Expand Up @@ -86,6 +87,7 @@ def __init__(
agg_algorithm (str): Aggregation algorithm.
rounds (int): Number of rounds.
logginglevel (str): Logging level.
report_status_data_queue (bool): Indicator to report information about the nodes of the scenario
accelerator (str): Accelerator used.
network_subnet (str): Network subnet.
network_gateway (str): Network gateway.
Expand Down Expand Up @@ -125,6 +127,7 @@ def __init__(
self.agg_algorithm = agg_algorithm
self.rounds = rounds
self.logginglevel = logginglevel
self.report_status_data_queue = report_status_data_queue
self.accelerator = accelerator
self.network_subnet = network_subnet
self.network_gateway = network_gateway
Expand Down Expand Up @@ -350,6 +353,7 @@ def __init__(self, scenario):
participant_config["mobility_args"]["radius_federation"] = self.scenario.radius_federation
participant_config["mobility_args"]["scheme_mobility"] = self.scenario.scheme_mobility
participant_config["mobility_args"]["round_frequency"] = self.scenario.round_frequency
participant_config["reporter_args"]["report_status_data_queue"] = self.scenario.report_status_data_queue

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

0 comments on commit 04a9d28

Please sign in to comment.