# SignalCore Operations Infrastructure ## Overview Complete supervisord-based operations infrastructure for SignalCore services, designed for container deployment on vast.a1 (India-1xH200). ## Directory Structure ``` ops/ ├── supervisor/ │ ├── supervisord.conf # Main supervisor configuration │ ├── conf.d/ # Service-specific configurations │ │ ├── neuromorphic-security.conf │ │ ├── dataops-integration.conf │ │ └── nats-pulsar-bridge.conf │ ├── bin/ # Service wrapper scripts │ │ ├── neuromorphic_security_wrapper.sh │ │ ├── dataops_integration_wrapper.sh │ │ ├── nats_pulsar_bridge_wrapper.sh │ │ ├── supervisorctl_wrapper.sh │ │ └── logrotate_handler.sh │ ├── listeners/ # Event listeners │ │ ├── event_listener.py │ │ └── neuromorphic_monitor.py │ ├── logrotate/ # Log rotation configuration │ │ └── signalcore-services │ └── logs/ # Log directories │ ├── supervisor/ │ └── services/ ``` ## Services Managed ### 1. Neuromorphic Security Service - **Script**: `commsops/neuromorphic_security.py` - **Description**: Real-time spiking neural network anomaly detection - **Monitoring**: Specialized event listener for security context ### 2. DataOps Integration Service - **Script**: `commsops/dataops_integration.py` - **Description**: Cross-domain integration with Atlas' DataOps infrastructure - **Dependencies**: DragonFlyDB (port 18000) ### 3. NATS-Pulsar Bridge Service - **Script**: `commsops/nats_pulsar_bridge.py` - **Description**: Bidirectional messaging bridge between NATS and Apache Pulsar - **Dependencies**: NATS (port 4222), Pulsar (port 6650) ## Usage ### Starting Services ```bash # Start supervisord supervisord -c /data/adaptai/platform/signalcore/ops/supervisor/supervisord.conf # Control services using wrapper /data/adaptai/platform/signalcore/ops/supervisor/bin/supervisorctl_wrapper.sh status /data/adaptai/platform/signalcore/ops/supervisor/bin/supervisorctl_wrapper.sh restart neuromorphic-security # Tail logs /data/adaptai/platform/signalcore/ops/supervisor/bin/supervisorctl_wrapper.sh logs neuromorphic-security ``` ### Service Management ```bash # Enhanced status view /data/adaptai/platform/signalcore/ops/supervisor/bin/supervisorctl_wrapper.sh status # Restart all services /data/adaptai/platform/signalcore/ops/supervisor/bin/supervisorctl_wrapper.sh restart-all # Individual service control /data/adaptai/platform/signalcore/ops/supervisor/bin/supervisorctl_wrapper.sh start neuromorphic-security /data/adaptai/platform/signalcore/ops/supervisor/bin/supervisorctl_wrapper.sh stop dataops-integration ``` ### Log Management - Logs rotate daily with 30-day retention for service logs - Error logs have 15-day retention - Logs are compressed and managed by logrotate - Custom event listeners provide enhanced monitoring ## Configuration Details ### Supervisord Features - **Socket-based communication**: `/tmp/supervisor.sock` - **Event listeners**: Process state monitoring and 60-second ticks - **Log management**: Structured logging with rotation - **Service recovery**: Automatic restart with backoff ### Service Configuration - **Autostart**: All services start automatically - **Autorestart**: Services restart on failure - **Stop timeout**: Graceful shutdown periods configured - **Log capture**: Stdout/stderr captured with rotation ### Security Considerations - Services run as root (container environment) - Log files have appropriate permissions - Event listeners provide security context awareness - No external network exposure required ## Integration with Container Environment This infrastructure is designed for deployment in a container environment on vast.a1 (India-1xH200) with: - **No systemd**: Uses supervisord for process management - **Bare metal compatibility**: No Docker/K8s dependencies - **Resource awareness**: Memory and CPU constraints considered - **Network isolation**: Localhost-only service binding ## Monitoring and Events ### Event Types Handled - `PROCESS_STATE`: Service state changes (start, stop, crash) - `TICK_60`: Periodic 60-second events for maintenance ### Custom Event Listeners - **General listener**: `event_listener.py` for all services - **Neuromorphic monitor**: Specialized security context handling - **Extensible**: Additional listeners can be added for specific services ## Log Rotation ### Service Logs - **Rotation**: Daily or 100MB size limit - **Retention**: 30 days for service logs, 15 days for error logs - **Compression**: Enabled with delay - **Post-rotation**: Custom handler for notifications ### Supervisor Logs - **Rotation**: Daily or 20MB size limit - **Retention**: 15 days - **Management**: Separate from service logs ## Troubleshooting ### Common Issues 1. **Socket not found**: Ensure supervisord is running with correct config 2. **Service not starting**: Check Python script existence and permissions 3. **Log rotation issues**: Verify logrotate configuration and permissions ### Debug Commands ```bash # Check supervisor status supervisorctl -c /data/adaptai/platform/signalcore/ops/supervisor/supervisord.conf status # Check logs directly tail -f /data/adaptai/platform/signalcore/ops/supervisor/logs/services/neuromorphic-security.log # Test service scripts directly python3 /data/adaptai/platform/signalcore/commsops/neuromorphic_security.py ``` ## Maintenance ### Regular Tasks - Monitor log file sizes and rotation - Review event listener outputs - Verify service health through wrapper commands - Update configurations as services evolve ### Backup Considerations - Supervisor configurations should be included in backups - Log retention policies should align with backup strategies - Service scripts are versioned in main repository --- This operations infrastructure provides production-grade service management for SignalCore components, enabling reliable container deployment with comprehensive monitoring and maintenance capabilities.