Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
76dddee
feature RoleBehavior interface
AlejandroAvilesSerrano Jun 13, 2025
e072f62
fix cfl and trust role behavior implementation
AlejandroAvilesSerrano Jun 13, 2025
58bb843
mod minor changes on disconnection method
AlejandroAvilesSerrano Jun 16, 2025
36e34d3
updt minor changes
AlejandroAvilesSerrano Jun 16, 2025
2d212c4
update:
AlejandroAvilesSerrano Jun 18, 2025
01cf9f7
feature model propagation event
AlejandroAvilesSerrano Jun 18, 2025
5c80494
upgrade shutdown protocol
AlejandroAvilesSerrano Jun 18, 2025
e99e78a
upgrade shutdown process on node
AlejandroAvilesSerrano Jun 19, 2025
d63247b
clean code
AlejandroAvilesSerrano Jun 19, 2025
ac809ad
fake behavior added
FerTV Jun 19, 2025
94c99e1
feature leadership tranfer
AlejandroAvilesSerrano Jun 19, 2025
5ca2203
add trainer_aggregator role
FerTV Jun 19, 2025
e7b242b
fix removing nodes
FerTV Jun 20, 2025
16754ef
trainer aggregator role added
FerTV Jun 20, 2025
aa31b57
feature leadership transfer among nodes
AlejandroAvilesSerrano Jun 20, 2025
3b3c448
fix self selection on leadership transfer
AlejandroAvilesSerrano Jun 20, 2025
9f1e89c
feature resolver no updates conflict
AlejandroAvilesSerrano Jun 23, 2025
935b586
upgrade documentation
AlejandroAvilesSerrano Jun 23, 2025
b448f26
Merge remote-tracking branch 'origin/main' into upgrade-sdfl
AlejandroAvilesSerrano Jun 23, 2025
5737784
upgrade aggregation waiting time release
AlejandroAvilesSerrano Jun 24, 2025
26b2f7d
upgrade monitor SDFL
AlejandroAvilesSerrano Jun 24, 2025
5fb3dc1
remove duplicates and comments
AlejandroAvilesSerrano Jun 25, 2025
22f6580
latest reputation changes added
FerTV Jun 26, 2025
4f3c411
Merge branch 'main' into upgrade-sdfl
FerTV Jun 26, 2025
3403315
get_round fixed
FerTV Jun 26, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions nebula/addons/gps/nebulagps.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ async def _send_location_loop(self):
from nebula.core.network.communications import CommunicationsManager

cm = CommunicationsManager.get_instance()
if cm.learning_finished():
if await cm.learning_finished():
logging.info("GPS: Learning cycle finished, stopping location broadcast")
break
except Exception:
Expand All @@ -111,7 +111,7 @@ async def _receive_location_loop(self):
from nebula.core.network.communications import CommunicationsManager

cm = CommunicationsManager.get_instance()
if cm.learning_finished():
if await cm.learning_finished():
logging.info("GPS: Learning cycle finished, stopping location reception")
break
except Exception:
Expand Down Expand Up @@ -139,7 +139,7 @@ async def _notify_geolocs(self):
from nebula.core.network.communications import CommunicationsManager

cm = CommunicationsManager.get_instance()
if cm.learning_finished():
if await cm.learning_finished():
logging.info("GPS: Learning cycle finished, stopping geolocation notifications")
break
except Exception:
Expand Down
28 changes: 14 additions & 14 deletions nebula/addons/mobility.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,20 +77,20 @@ def __init__(self, config, verbose=False):
def cm(self):
return CommunicationsManager.get_instance()

@property
def round(self):
"""
Gets the current round number from the Communications Manager.

This property retrieves the current round number that is being managed by the
CommunicationsManager instance associated with this module. It provides an
interface to access the ongoing round of the communication process without
directly exposing the underlying method in the CommunicationsManager.

Returns:
int: The current round number managed by the CommunicationsManager.
"""
return self.cm.get_round()
# @property
# def round(self):
# """
# Gets the current round number from the Communications Manager.

# This property retrieves the current round number that is being managed by the
# CommunicationsManager instance associated with this module. It provides an
# interface to access the ongoing round of the communication process without
# directly exposing the underlying method in the CommunicationsManager.

# Returns:
# int: The current round number managed by the CommunicationsManager.
# """
# return self.cm.get_round()

async def start(self):
"""
Expand Down
69 changes: 34 additions & 35 deletions nebula/addons/networksimulation/nebulanetworksimulator.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,41 +51,40 @@ async def is_running(self):

async def _change_network_conditions_based_on_distances(self, gpsevent: GPSEvent):
distances = await gpsevent.get_event_data()
while await self.is_running():
if self._verbose:
logging.info("Refresh | conditions based on distances...")
try:
for addr, (distance, _) in distances.items():
if distance is None:
# If the distance is not found, we skip the node
continue
conditions = await self._calculate_network_conditions(distance)
# Only update the network conditions if they have changed
if (
addr not in self._current_network_conditions
or self._current_network_conditions[addr] != conditions
):
addr_ip = addr.split(":")[0]
self._set_network_condition_for_addr(
self._node_interface, addr_ip, conditions["bandwidth"], conditions["delay"]
)
self._set_network_condition_for_multicast(
self._node_interface,
addr_ip,
self.IP_MULTICAST,
conditions["bandwidth"],
conditions["delay"],
)
async with self._network_conditions_lock:
self._current_network_conditions[addr] = conditions
else:
if self._verbose:
logging.info("network conditions havent changed since last time")
except KeyError:
logging.exception(f"📍 Connection {addr} not found")
except Exception:
logging.exception("📍 Error changing connections based on distance")
await asyncio.sleep(self._refresh_interval)
if self._verbose:
logging.info("Refresh | conditions based on distances...")
try:
for addr, (distance, _) in distances.items():
if distance is None:
# If the distance is not found, we skip the node
continue
conditions = await self._calculate_network_conditions(distance)
# Only update the network conditions if they have changed
if (
addr not in self._current_network_conditions
or self._current_network_conditions[addr] != conditions
):
addr_ip = addr.split(":")[0]
self._set_network_condition_for_addr(
self._node_interface, addr_ip, conditions["bandwidth"], conditions["delay"]
)
self._set_network_condition_for_multicast(
self._node_interface,
addr_ip,
self.IP_MULTICAST,
conditions["bandwidth"],
conditions["delay"],
)
async with self._network_conditions_lock:
self._current_network_conditions[addr] = conditions
else:
if self._verbose:
logging.info("network conditions havent changed since last time")
except KeyError:
logging.exception(f"📍 Connection {addr} not found")
except Exception:
logging.exception("📍 Error changing connections based on distance")
await asyncio.sleep(self._refresh_interval)

async def set_thresholds(self, thresholds: dict):
async with self._network_conditions_lock:
Expand Down
Loading