Add Cython to Python dependencies for model compilation

Add Cython==3.0.5 to python_ml/requirements.txt and update replit.md to reflect this change, resolving a compilation issue with the eif library.

Replit-Commit-Author: Agent
Replit-Commit-Session-Id: 7a657272-55ba-4a79-9a2e-f1ed9bc7a528
Replit-Commit-Checkpoint-Type: full_checkpoint
Replit-Commit-Event-Id: f24578fc-6be7-42c0-9a9c-5ffe13dacdbe
Replit-Commit-Screenshot-Url: https://storage.googleapis.com/screenshot-production-us-central1/449cf7c4-c97a-45ae-8234-e5c5b8d6a84f/7a657272-55ba-4a79-9a2e-f1ed9bc7a528/2lUhxO2
This commit is contained in:
marco370 2025-11-24 16:35:15 +00:00
parent 152e22621b
commit b4aaa5456f
3 changed files with 106 additions and 2 deletions

View File

@ -0,0 +1,101 @@
./deployment/update_from_git.sh --db
╔═══════════════════════════════════════════════╗
║  AGGIORNAMENTO SISTEMA IDS DA GIT ║
╚═══════════════════════════════════════════════╝
 Verifica configurazione git...
 Backup configurazione locale...
✅ .env salvato in .env.backup
 Verifica modifiche locali...
⚠ Ci sono modifiche locali non committate
Esegui 'git status' per vedere i dettagli
Vuoi procedere comunque? (y/n) y
Salvo modifiche locali temporaneamente...
No local changes to save
 Download aggiornamenti da git.alfacom.it...
remote: Enumerating objects: 21, done.
remote: Counting objects: 100% (21/21), done.
remote: Compressing objects: 100% (13/13), done.
remote: Total 13 (delta 9), reused 0 (delta 0), pack-reused 0 (from 0)
Unpacking objects: 100% (13/13), 3.37 KiB | 492.00 KiB/s, done.
From https://git.alfacom.it/marco/ids.alfacom.it
3a945ec..152e226 main -> origin/main
* [new tag] v1.0.56 -> v1.0.56
From https://git.alfacom.it/marco/ids.alfacom.it
* branch main -> FETCH_HEAD
Updating 3a945ec..152e226
Fast-forward
attached_assets/Pasted--deployment-update-from-git-sh-db-AGGIOR-1764001889941_1764001889941.txt | 90 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
database-schema/schema.sql | 4 ++--
python_ml/requirements.txt | 2 +-
replit.md | 5 +++--
version.json | 16 ++++++++--------
5 files changed, 104 insertions(+), 13 deletions(-)
create mode 100644 attached_assets/Pasted--deployment-update-from-git-sh-db-AGGIOR-1764001889941_1764001889941.txt
✅ Aggiornamenti scaricati con successo
 Ripristino configurazione locale...
✅ .env ripristinato
 Aggiornamento dipendenze Node.js...
up to date, audited 492 packages in 2s
65 packages are looking for funding
run `npm fund` for details
9 vulnerabilities (3 low, 5 moderate, 1 high)
To address issues that do not require attention, run:
npm audit fix
To address all issues (including breaking changes), run:
npm audit fix --force
Run `npm audit` for details.
✅ Dipendenze Node.js aggiornate
📦 Aggiornamento dipendenze Python...
Defaulting to user installation because normal site-packages is not writeable
Requirement already satisfied: fastapi==0.104.1 in /home/ids/.local/lib/python3.11/site-packages (from -r requirements.txt (line 1)) (0.104.1)
Requirement already satisfied: uvicorn==0.24.0 in /home/ids/.local/lib/python3.11/site-packages (from -r requirements.txt (line 2)) (0.24.0)
Requirement already satisfied: pandas==2.1.3 in /home/ids/.local/lib/python3.11/site-packages (from -r requirements.txt (line 3)) (2.1.3)
Requirement already satisfied: numpy==1.26.2 in /home/ids/.local/lib/python3.11/site-packages (from -r requirements.txt (line 4)) (1.26.2)
Requirement already satisfied: scikit-learn==1.3.2 in /home/ids/.local/lib/python3.11/site-packages (from -r requirements.txt (line 5)) (1.3.2)
Requirement already satisfied: psycopg2-binary==2.9.9 in /home/ids/.local/lib/python3.11/site-packages (from -r requirements.txt (line 6)) (2.9.9)
Requirement already satisfied: python-dotenv==1.0.0 in /home/ids/.local/lib/python3.11/site-packages (from -r requirements.txt (line 7)) (1.0.0)
Requirement already satisfied: pydantic==2.5.0 in /home/ids/.local/lib/python3.11/site-packages (from -r requirements.txt (line 8)) (2.5.0)
Requirement already satisfied: httpx==0.25.1 in /home/ids/.local/lib/python3.11/site-packages (from -r requirements.txt (line 9)) (0.25.1)
Collecting xgboost==2.0.3
Using cached xgboost-2.0.3-py3-none-manylinux2014_x86_64.whl (297.1 MB)
Collecting joblib==1.3.2
Using cached joblib-1.3.2-py3-none-any.whl (302 kB)
Collecting eif==2.0.2
Downloading eif-2.0.2.tar.gz (1.6 MB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 1.6/1.6 MB 2.8 MB/s eta 0:00:00
Preparing metadata (setup.py) ... error
error: subprocess-exited-with-error
× python setup.py egg_info did not run successfully.
│ exit code: 1
╰─> [6 lines of output]
Traceback (most recent call last):
File "<string>", line 2, in <module>
File "<pip-setuptools-caller>", line 34, in <module>
File "/tmp/pip-install-7w_zhzdf/eif_d01f9f1e418b4512a5d7b4cf0e1128e2/setup.py", line 4, in <module>
from Cython.Distutils import build_ext
ModuleNotFoundError: No module named 'Cython'
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
error: metadata-generation-failed
× Encountered error while generating package metadata.
╰─> See above for output.
note: This is an issue with the package mentioned above, not pip.
hint: See above for details.

View File

@ -7,6 +7,7 @@ psycopg2-binary==2.9.9
python-dotenv==1.0.0
pydantic==2.5.0
httpx==0.25.1
Cython==3.0.5
xgboost==2.0.3
joblib==1.3.2
eif==2.0.2

View File

@ -99,8 +99,10 @@ The IDS employs a React-based frontend for real-time monitoring, detection visua
- `python_ml/dataset_loader.py` - CICIDS2017 loader con mappatura 80→25 features
- `python_ml/validation_metrics.py` - Production-grade metrics calculator
- `python_ml/train_hybrid.py` - CLI training script (test/train/validate)
- **Dipendenze Nuove**: xgboost==2.0.3, joblib==1.3.2, eif==2.0.2
- **Dipendenze Nuove**: Cython==3.0.5, xgboost==2.0.3, joblib==1.3.2, eif==2.0.2
- **Backward Compatibility**: USE_HYBRID_DETECTOR env var (default=true)
- **Target Metrics**: Precision≥90%, Recall≥80%, FPR≤5%, F1≥85%
- **Deploy**: Vedere `deployment/CHECKLIST_ML_HYBRID.md`
- **Fix Deploy (24 Nov 2025 - 19:00)**: Corretto `eif==2.0.0``eif==2.0.2` (versione 2.0.0 non disponibile su PyPI)
- **Fix Deploy (24 Nov 2025 - 19:15)**:
- Corretto `eif==2.0.0``eif==2.0.2` (versione 2.0.0 non disponibile)
- Aggiunto `Cython==3.0.5` come dipendenza (richiesto per compilare eif da source)