Skip to content

Commit c8f99c8

Browse files
Update NEBULA requirements
1 parent 5009003 commit c8f99c8

File tree

6 files changed

+83
-62
lines changed

6 files changed

+83
-62
lines changed

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,6 @@ RUN python3.11 -m pip install --upgrade pip
4040
RUN apt-get update && apt-get install -y build-essential gcc g++ clang git make cmake
4141

4242
WORKDIR /nebula
43-
COPY requirements.txt .
43+
COPY nebula/requirements.txt .
4444
# Install the required packages
4545
RUN python3.11 -m pip install --ignore-installed -r requirements.txt

nebula/core/engine.py

Lines changed: 20 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import asyncio
22
import logging
33
import os
4-
54
import docker
65
from nebula.addons.functions import print_msg_box
76
from nebula.addons.attacks.attacks import create_attack
@@ -10,9 +9,14 @@
109
from nebula.core.eventmanager import EventManager, event_handler
1110
from nebula.core.network.communications import CommunicationsManager
1211
from nebula.core.pb import nebula_pb2
13-
from nebula.core.utils.nebulalogger_tensorboard import NebulaTensorBoardLogger
14-
from nebula.core.utils.nebulalogger import NebulaLogger
1512
from nebula.core.utils.locker import Locker
13+
from lightning.pytorch.loggers import CSVLogger
14+
from nebula.core.utils.nebulalogger_tensorboard import NebulaTensorBoardLogger
15+
16+
try:
17+
from nebula.core.utils.nebulalogger import NebulaLogger
18+
except:
19+
pass
1620

1721
logging.getLogger("requests").setLevel(logging.WARNING)
1822
logging.getLogger("urllib3").setLevel(logging.WARNING)
@@ -22,14 +26,9 @@
2226
logging.getLogger("plotly").setLevel(logging.ERROR)
2327

2428
import threading
25-
26-
from lightning.pytorch.loggers import CSVLogger
27-
2829
from nebula.config.config import Config
2930
from nebula.core.training.lightning import Lightning
30-
3131
from nebula.core.utils.helper import cosine_metric
32-
3332
import sys
3433
import pdb
3534

@@ -109,9 +108,18 @@ def __init__(
109108
elif self.config.participant["tracking_args"]["local_tracking"] == "basic":
110109
nebulalogger = NebulaTensorBoardLogger(self.config.participant["scenario_args"]["start_time"], f"{self.log_dir}", name="metrics", version=f"participant_{self.idx}", log_graph=True)
111110
elif self.config.participant["tracking_args"]["local_tracking"] == "advanced":
112-
nebulalogger = NebulaLogger(config=self.config, engine=self, scenario_start_time=self.config.participant["scenario_args"]["start_time"], repo=f"{self.config.participant['tracking_args']['log_dir']}",
113-
experiment=self.experiment_name, run_name=f"participant_{self.idx}",
114-
train_metric_prefix='train_', test_metric_prefix='test_', val_metric_prefix='val_', log_system_params=False)
111+
nebulalogger = NebulaLogger(
112+
config=self.config,
113+
engine=self,
114+
scenario_start_time=self.config.participant["scenario_args"]["start_time"],
115+
repo=f"{self.config.participant['tracking_args']['log_dir']}",
116+
experiment=self.experiment_name,
117+
run_name=f"participant_{self.idx}",
118+
train_metric_prefix="train_",
119+
test_metric_prefix="test_",
120+
val_metric_prefix="val_",
121+
log_system_params=False,
122+
)
115123
# nebulalogger_aim = NebulaLogger(config=self.config, engine=self, scenario_start_time=self.config.participant["scenario_args"]["start_time"], repo=f"aim://nebula-frontend:8085",
116124
# experiment=self.experiment_name, run_name=f"participant_{self.idx}",
117125
# train_metric_prefix='train_', test_metric_prefix='test_', val_metric_prefix='val_', log_system_params=False)
@@ -450,7 +458,7 @@ async def _learning_cycle(self):
450458
print_msg_box(msg=f"Federated Learning process has been completed.", indent=2, title="End of the experiment")
451459
# Enable loggin info
452460
logging.getLogger().disabled = True
453-
# Report
461+
# Report
454462
if self.config.participant["scenario_args"]["controller"] == "nebula-frontend":
455463
self.reporter.report_scenario_finished()
456464
# Kill itself

nebula/frontend/app.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,6 @@ class Settings:
6868
templates_dir: str = "templates"
6969

7070
settings = Settings()
71-
initialize_databases()
7271

7372
logging.info(f"NEBULA_DEBUG: {settings.debug}")
7473
logging.info(f"NEBULA_ADVANCED_ANALYTICS: {settings.advanced_analytics}")
@@ -148,6 +147,7 @@ def set_default_user():
148147

149148
@app.on_event("startup")
150149
async def startup_event():
150+
await initialize_databases()
151151
set_default_user()
152152

153153
nodes_registration = {}

nebula/frontend/requirements.txt

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,28 @@
1-
setuptools==69.5.1
1+
setuptools==70.3.0
22
wheel==0.43.0
33
protobuf==4.25.3
4-
tensorboard==2.16.2
4+
# tensorboard==2.17.0
5+
tb-nightly==2.18.0a20240711
56
tensorboardx==2.6.2.2
67
pandas==2.2.2
78
fastapi[all]==0.111.0
89
uvicorn==0.30.1
910
jinja2==3.1.4
10-
pytest==8.2.0
11-
matplotlib==3.8.4
11+
pytest==8.2.2
12+
matplotlib==3.9.1
1213
plotly==5.22.0
1314
python-dotenv==1.0.1
1415
networkx==3.3
15-
requests==2.31.0
16-
ansi2html==1.9.1
16+
requests==2.32.3
17+
ansi2html==1.9.2
1718
gunicorn==22.0.0
1819
geopy==2.4.1
19-
cryptography==42.0.7
20+
cryptography==42.0.8
2021
pyOpenSSL==24.1.0
2122
pycryptodome==3.20.0
2223
pyinstrument==4.6.2
2324
cffi==1.16.0
24-
web3==6.15.1
25-
aim==3.20.1
25+
web3==6.20.0
2626
aiosqlite==0.20.0
27-
docker==6.1.3
27+
docker==7.1.0
28+
# aim==3.22.0

nebula/requirements.txt

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
# pip install --upgrade --force-reinstall -r requirements.txt
2+
protobuf==4.25.3
3+
qtconsole==5.5.2
4+
aiohttp==3.9.5
5+
async-timeout==4.0.3
6+
netifaces==0.11.0
7+
tcconfig==0.28.1
8+
geopy==2.4.1
9+
numpy==2.0.0
10+
torch==2.3.1
11+
torchvision==0.18.1
12+
torchtext
13+
torchdata==0.7.1
14+
torchmetrics==1.4.0
15+
lightning==2.3.3
16+
plotly==5.22.0
17+
# tensorboard==2.17.0
18+
tb-nightly==2.18.0a20240711
19+
tensorboardx==2.6.2.2
20+
pytest==8.2.2
21+
python-dotenv==1.0.1
22+
PyYAML==6.0.1
23+
setuptools==70.3.0
24+
matplotlib==3.9.1
25+
networkx==3.3
26+
requests==2.32.3
27+
Pillow==10.4.0
28+
ansi2html==1.9.2
29+
pycryptodome==3.20.0
30+
cryptography==42.0.8
31+
psutil==6.0.0
32+
rich==13.7.1
33+
seaborn==0.13.2
34+
scikit-learn==1.5.1
35+
scikit-image==0.24.0
36+
datasets==2.20.0
37+
timm==1.0.7
38+
nvidia-ml-py==12.555.43
39+
web3==6.20.0
40+
tabulate==0.9.0
41+
retry==0.9.2
42+
docker==7.1.0
43+
# aim==3.22.0

requirements.txt

Lines changed: 7 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -1,42 +1,11 @@
11
# pip install --upgrade --force-reinstall -r requirements.txt
2-
protobuf==4.25.3
3-
qtconsole==5.5.2
4-
aiohttp==3.9.5
5-
async-timeout==4.0.3
6-
netifaces==0.11.0
7-
tcconfig==0.28.1
8-
geopy==2.4.1
9-
numpy==1.26.4
10-
torch==2.3.0
11-
torchvision==0.18.0
12-
torchtext
13-
torchdata==0.7.1
14-
torchmetrics==1.4.0
15-
lightning==2.2.5
16-
plotly==5.22.0
17-
tensorboard==2.16.2
18-
tensorboardx==2.6.2.2
19-
pytest==8.2.0
202
python-dotenv==1.0.1
21-
PyYAML==6.0.1
22-
setuptools==69.5.1
23-
matplotlib==3.8.4
3+
requests==2.32.3
4+
docker==7.1.0
5+
web3==6.20.0
6+
matplotlib==3.9.1
247
networkx==3.3
25-
requests==2.31.0
26-
Pillow==10.3.0
27-
ansi2html==1.9.1
8+
psutil==6.0.0
289
pycryptodome==3.20.0
29-
cryptography==42.0.7
30-
psutil==5.9.8
31-
rich==13.7.1
32-
seaborn==0.13.2
33-
scikit-learn==1.4.2
34-
scikit-image==0.23.2
35-
datasets==2.19.1
36-
timm==0.9.16
37-
nvidia-ml-py==12.550.52
38-
web3==6.15.1
39-
tabulate==0.9.0
40-
retry==0.9.2
41-
aim==3.22.0
42-
docker==6.1.3
10+
cryptography==42.0.8
11+
nvidia-ml-py==12.555.43

0 commit comments

Comments
 (0)