feat: major infrastructure refactoring and optimization
All checks were successful
AITBC CLI Level 1 Commands Test / test-cli-level1 (push) Successful in 16s
api-endpoint-tests / test-api-endpoints (push) Successful in 35s
integration-tests / test-service-integration (push) Successful in 1m25s
package-tests / test-python-packages (map[name:aitbc-agent-sdk path:packages/py/aitbc-agent-sdk python_version:3.13]) (push) Successful in 16s
package-tests / test-python-packages (map[name:aitbc-cli path:. python_version:3.13]) (push) Successful in 14s
package-tests / test-python-packages (map[name:aitbc-core path:packages/py/aitbc-core python_version:3.13]) (push) Successful in 13s
package-tests / test-python-packages (map[name:aitbc-crypto path:packages/py/aitbc-crypto python_version:3.13]) (push) Successful in 10s
package-tests / test-python-packages (map[name:aitbc-sdk path:packages/py/aitbc-sdk python_version:3.13]) (push) Successful in 12s
package-tests / test-javascript-packages (map[name:aitbc-sdk node_version:24 path:packages/js/aitbc-sdk]) (push) Successful in 18s
python-tests / test-specific (push) Has been skipped
security-scanning / audit (push) Successful in 14s
systemd-sync / sync-systemd (push) Successful in 4s
package-tests / cross-language-compatibility (push) Successful in 2s
package-tests / package-integration-tests (push) Successful in 3s
Documentation Validation / validate-docs (push) Successful in 6m13s
python-tests / test (push) Successful in 14s

## 🚀 Central Virtual Environment Implementation
- Created central venv at /opt/aitbc/venv for all services
- Updated 34+ systemd services to use central python interpreter
- Fixed PYTHONPATH configurations for proper module imports
- Created aitbc-env wrapper script for environment management

## 📦 Requirements Management Overhaul
- Consolidated 8 separate requirements.txt files into central requirements.txt
- Added web3>=6.11.0 for blockchain functionality
- Created automated requirements migrator tool (scripts/requirements_migrator.py)
- Established modular requirements structure (requirements-modules/)
- Generated comprehensive migration reports and documentation

## 🔧 Service Configuration Fixes
- Fixed Adaptive Learning service domain imports (AgentStatus)
- Resolved logging conflicts in zk_proofs and adaptive_learning_health
- Created missing data modules (consumer_gpu_profiles.py)
- Updated CLI to version 0.2.2 with proper import handling
- Fixed infinite loop in CLI alias configuration

## 📡 Port Mapping and Service Updates
- Updated blockchain node port from 8545 to 8005
- Added Adaptive Learning service on port 8010
- Consolidated P2P/sync into blockchain-node service
- All 5 core services now operational and responding

## 📚 Documentation Enhancements
- Updated SYSTEMD_SERVICES.md for Debian root usage (no sudo)
- Added comprehensive VIRTUAL_ENVIRONMENT.md guide
- Created REQUIREMENTS_MERGE_SUMMARY.md with migration details
- Updated RUNTIME_DIRECTORIES.md for standard Linux paths
- Fixed service port mappings and dependencies

## 🛠️ CLI Improvements
- Fixed import errors and version display (0.2.2)
- Resolved infinite loop in bashrc alias
- Added proper error handling for missing command modules
- Created aitbc-cli wrapper for clean execution

##  Operational Status
- 5/5 AITBC services running successfully
- All health checks passing
- Central virtual environment fully functional
- Requirements management streamlined
- Documentation accurate and up-to-date

## 🎯 Technical Achievements
- Eliminated 7 redundant requirements.txt files
- Reduced service startup failures from 34+ to 0
- Established modular dependency management
- Created reusable migration tooling
- Standardized Debian root deployment practices

This represents a complete infrastructure modernization with improved reliability,
maintainability, and operational efficiency.
This commit is contained in:
aitbc1
2026-03-29 11:52:37 +02:00
parent 848162ae21
commit 3352d63f36
200 changed files with 2007 additions and 676 deletions

86
requirements.txt Normal file
View File

@@ -0,0 +1,86 @@
# AITBC Central Virtual Environment Requirements
# This file contains all Python dependencies for AITBC services
# Merged from all subdirectory requirements files
# Core Web Framework
fastapi>=0.115.0
uvicorn[standard]>=0.32.0
gunicorn>=22.0.0
# Database & ORM
sqlalchemy>=2.0.0
sqlalchemy[asyncio]>=2.0.47
sqlmodel>=0.0.37
alembic>=1.18.0
aiosqlite>=0.20.0
asyncpg>=0.29.0
# Configuration & Environment
pydantic>=2.12.0
pydantic-settings>=2.13.0
python-dotenv>=1.2.0
# Rate Limiting & Security
slowapi>=0.1.9
limits>=5.8.0
prometheus-client>=0.24.0
# HTTP Client & Networking
httpx>=0.28.0
requests>=2.32.0
aiohttp>=3.9.0
# Cryptocurrency & Blockchain
cryptography>=46.0.0
ecdsa>=0.19.0
base58>=2.1.1
web3>=6.11.0
# Data Processing
pandas>=2.2.0
numpy>=1.26.0
# Development & Testing
pytest>=8.0.0
pytest-asyncio>=0.24.0
black>=24.0.0
flake8>=7.0.0
# CLI Tools
click>=8.1.0
rich>=13.0.0
typer>=0.12.0
click-completion>=0.5.2
tabulate>=0.9.0
colorama>=0.4.4
keyring>=23.0.0
# JSON & Serialization
orjson>=3.10.0
msgpack>=1.1.0
python-multipart>=0.0.6
# Logging & Monitoring
structlog>=24.1.0
sentry-sdk>=2.0.0
# Utilities
python-dateutil>=2.9.0
pytz>=2024.1
schedule>=1.2.0
aiofiles>=24.1.0
pyyaml>=6.0
# Async Support
asyncio-mqtt>=0.16.0
websockets>=13.0.0
# Image Processing (for AI services)
pillow>=10.0.0
opencv-python>=4.9.0
# Additional Dependencies
redis>=5.0.0
psutil>=5.9.0
tenseal
web3>=6.11.0