Переглянути джерело

[#1] Save latest changes before complete remote reinstall

Lange François 2 тижнів тому
батько
коміт
d4144c0a36
5 змінених файлів з 35 додано та 15 видалено
  1. 1 1
      docs/User_Description.md
  2. 8 5
      docs/distributed_deployment.md
  3. 17 7
      generate_docs.py
  4. 3 0
      my.cnf
  5. 6 2
      scripts/setup_deploy.py

+ 1 - 1
docs/User_Description.md

@@ -6,7 +6,7 @@ The current version is #ident "@(#)$Format:LocalFoodAI_lanfr144:User_Description
 ## 1. System Vision
 ## 1. System Vision
 The **Local Food AI** system is a strictly local, privacy-first, professional-grade clinical dietetics assistant. Developed specifically for clinics and healthcare practitioners, it provides offline nutritional analysis, meal planning, and warning flags based on dynamic patient health profiles. 
 The **Local Food AI** system is a strictly local, privacy-first, professional-grade clinical dietetics assistant. Developed specifically for clinics and healthcare practitioners, it provides offline nutritional analysis, meal planning, and warning flags based on dynamic patient health profiles. 
 
 
-Since the system operates entirely locally on physical servers or local hypervisors, **zero patient medical data or search queries ever leave the server boundary**, ensuring 100% HIPAA compliance and data sovereignty.
+Since the system operates entirely locally on local hypervisors, **zero patient medical data or search queries ever leave the server boundary**, ensuring 100% HIPAA compliance and data sovereignty.
 
 
 ---
 ---
 
 

+ 8 - 5
docs/distributed_deployment.md

@@ -4,12 +4,15 @@ The current version is #ident "@(#)$Format:LocalFoodAI_lanfr144:distributed_depl
 
 
 This document outlines the procedure to deploy the Local Food AI stack across a mixed topology of physical Unix servers, Windows 11 subsystems, and hypervisors on the same local network.
 This document outlines the procedure to deploy the Local Food AI stack across a mixed topology of physical Unix servers, Windows 11 subsystems, and hypervisors on the same local network.
 
 
-## Supported Network & Hypervisor Topologies
+## Supported Hypervisor Topologies
 You can distribute the services across any combination of:
 You can distribute the services across any combination of:
-- **Physical Unix/Linux Server (Bare-Metal)**: Ideal for high-performance production hosting, running directly on physical hardware (e.g., Ubuntu Server).
-- **Windows Subsystem for Linux (WSL 2)**: Ideal for developer environments, local frontend, and LLM execution.
-- **Hyper-V**: Ideal for containerized Database nodes or virtualized system infrastructure.
-- **VirtualBox**: Ideal for isolated test environments or Monitoring nodes.
+- **Windows Subsystem for Linux (WSL 2)**: Ideal for the frontend and LLM nodes.
+- **Hyper-V**: Ideal for the Database node.
+- **VirtualBox**: Ideal for isolated Monitoring nodes.
+
+### Native Unix/Linux Server (No Virtualization)
+Alternatively, the installation can be made natively on a physical Unix/Linux server (bare-metal) without virtualization. This is ideal for production environments where services run directly on physical hardware.
+
 
 
 ## Port Conflict Matrix
 ## Port Conflict Matrix
 When deploying nodes on the same IP subnet or host machine, ensure the following ports are open on your host firewall (e.g., Windows Defender Firewall) and not conflicting with existing services:
 When deploying nodes on the same IP subnet or host machine, ensure the following ports are open on your host firewall (e.g., Windows Defender Firewall) and not conflicting with existing services:

+ 17 - 7
generate_docs.py

@@ -850,7 +850,7 @@ netstat -tulpn | grep -E "80|3307|8081|11434"
 
 
 # Local Food AI - Detailed Operator Installation Guide
 # Local Food AI - Detailed Operator Installation Guide
 
 
-This document is a step-by-step installation, mapping, configuration, and verification manual for deploying the **Local Food AI** system in an enterprise environment. It covers hybrid hypervisor infrastructure (WSL2, Hyper-V, and VirtualBox), cross-node networking, SNMPv3 monitoring, alert channels, and acceptance testing.
+This document is a step-by-step installation, configuration, and verification manual for deploying the **Local Food AI** system in an enterprise environment. It covers mixed environments ranging from native, physical Unix/Linux servers (bare-metal) to hybrid hypervisor infrastructures (WSL2, Hyper-V, and VirtualBox), cross-node networking, SNMPv3 monitoring, alert channels, and acceptance testing.
 
 
 ---
 ---
 
 
@@ -870,15 +870,15 @@ Before running installation scripts, the operator **must** collect the following
 
 
 ## 2. Platform Mapping: Which Container Goes Where?
 ## 2. Platform Mapping: Which Container Goes Where?
 
 
-To maximize CPU/GPU efficiency and secure database read/writes, services are distributed across three distinct environments:
+To maximize CPU/GPU efficiency and secure database read/writes, services can be distributed across native physical servers or virtualized environment hypervisors:
 
 
 | COMPONENT CONTAINER | DEPLOYMENT ENVIRONMENT | WHY |
 | COMPONENT CONTAINER | DEPLOYMENT ENVIRONMENT | WHY |
 | :--- | :--- | :--- |
 | :--- | :--- | :--- |
-| **streamlit-app (app.py)** | Local WSL2 (Windows) | Low-latency rendering and direct client access |
-| **mysql (Database Node)** | Hyper-V VM (Server A) | Persistent enterprise-grade disk storage |
-| **ollama (NLP llama3.2:3b Engine)** | VirtualBox VM (Server B) | Dedicated CPU/GPU virtualization allocation |
-| **zabbix-server & web (Monitoring)** | Hyper-V VM (Server A) | Centralized SNMPv3 alert processing and logs |
-| **searxng (Meta-Search Gateway)** | Local WSL2 (Windows) | Dynamic browser-level loopbacks |
+| **streamlit-app (app.py)** | Local WSL2 or Bare-Metal Unix | Low-latency rendering and direct client access |
+| **mysql (Database Node)** | Bare-Metal Server or Hyper-V VM | Persistent enterprise-grade disk storage |
+| **ollama (NLP llama3.2:3b Engine)** | Bare-Metal Server or VirtualBox VM | Dedicated CPU/GPU resource allocation |
+| **zabbix-server & web (Monitoring)** | Bare-Metal Server or Hyper-V VM | Centralized SNMPv3 alert processing and logs |
+| **searxng (Meta-Search Gateway)** | Local WSL2 or Bare-Metal Unix | Dynamic browser-level loopbacks |
 
 
 ---
 ---
 
 
@@ -914,6 +914,16 @@ vboxmanage storageattach "FoodAI-AI-Node" --storagectl "SATA Controller" --port
 vboxmanage startvm "FoodAI-AI-Node" --type headless
 vboxmanage startvm "FoodAI-AI-Node" --type headless
 ```
 ```
 
 
+### 3.4: Native Physical Unix/Linux Server (No Virtualization)
+For a native physical installation directly on the hardware (bare-metal Ubuntu Server):
+1. Install Ubuntu Server 22.04 LTS or 24.04 LTS on the physical machine.
+2. Ensure SSH is installed and running:
+   ```bash
+   sudo apt update && sudo apt install -y openssh-server
+   sudo systemctl enable --now ssh
+   ```
+3. Configure a static IP address and ensure the host firewall allows traffic on the required ports (e.g. 80, 8502, 3306, 8081).
+
 ---
 ---
 
 
 ## 4. Secure Authentication & SSH Exchange
 ## 4. Secure Authentication & SSH Exchange

+ 3 - 0
my.cnf

@@ -12,6 +12,9 @@ secure_file_priv = ""
 # Enable local infile on the server side
 # Enable local infile on the server side
 local_infile = 1
 local_infile = 1
 
 
+# Allow creation of stored functions/triggers when binary logging is enabled
+log_bin_trust_function_creators = 1
+
 # Note: We configure validate_password via SQL directly if needed, instead of my.cnf.
 # Note: We configure validate_password via SQL directly if needed, instead of my.cnf.
 
 
 [mysql]
 [mysql]

+ 6 - 2
scripts/setup_deploy.py

@@ -284,8 +284,12 @@ with open("docker-compose.yml", "w") as f:
     f.write(compose_content + footer)
     f.write(compose_content + footer)
 
 
 print("\n" + "="*60)
 print("\n" + "="*60)
-print("⚠️ IMPORTANT HYPERVISOR NETWORKING REMINDER:")
-print("If this node is running inside VirtualBox or Hyper-V, you MUST configure the VM network adapter to use a 'Bridged Adapter' or 'External Virtual Switch' so it shares the host's subnet. Otherwise, cross-node communication will fail.")
+print("⚠️ IMPORTANT NETWORKING REMINDER:")
+print("- If this node is running inside VirtualBox or Hyper-V, you MUST configure the VM")
+print("  network adapter to use a 'Bridged Adapter' or 'External Virtual Switch'.")
+print("- If this node is running natively on a physical Bare-Metal Unix/Linux server,")
+print("  ensure that the host firewalls permit traffic on the designated ports.")
+print("Otherwise, cross-node communication will fail.")
 print("="*60)
 print("="*60)
 
 
 print("\nDone! You can now run `docker compose up -d`.")
 print("\nDone! You can now run `docker compose up -d`.")