|
| 1 | +# Multi-Heart-Model Production Infrastructure Makefile |
| 2 | + |
| 3 | +.PHONY: help setup start stop restart logs build clean test validate |
| 4 | + |
| 5 | +help: |
| 6 | + @echo "Multi-Heart-Model Production Infrastructure" |
| 7 | + @echo "===========================================" |
| 8 | + @echo "" |
| 9 | + @echo "Available commands:" |
| 10 | + @echo " make setup - Initial setup (create .env, initialize database)" |
| 11 | + @echo " make build - Build all Docker images" |
| 12 | + @echo " make start - Start all services" |
| 13 | + @echo " make stop - Stop all services" |
| 14 | + @echo " make restart - Restart all services" |
| 15 | + @echo " make logs - View logs from all services" |
| 16 | + @echo " make clean - Clean up containers and volumes" |
| 17 | + @echo " make test - Run integration tests" |
| 18 | + @echo " make validate - Run all validation suites" |
| 19 | + @echo " make status - Show service status" |
| 20 | + @echo "" |
| 21 | + |
| 22 | +setup: |
| 23 | + @echo "Setting up production environment..." |
| 24 | + @if [ ! -f .env ]; then \ |
| 25 | + cp .env.example .env; \ |
| 26 | + echo "✓ Created .env file - PLEASE EDIT WITH SECURE PASSWORDS"; \ |
| 27 | + else \ |
| 28 | + echo "✓ .env file already exists"; \ |
| 29 | + fi |
| 30 | + @mkdir -p data results logs |
| 31 | + @echo "✓ Created data directories" |
| 32 | + @echo "" |
| 33 | + @echo "Next steps:" |
| 34 | + @echo " 1. Edit .env with secure passwords" |
| 35 | + @echo " 2. Run 'make build' to build images" |
| 36 | + @echo " 3. Run 'make start' to start services" |
| 37 | + |
| 38 | +build: |
| 39 | + @echo "Building Docker images..." |
| 40 | + docker-compose build |
| 41 | + @echo "✓ Build complete" |
| 42 | + |
| 43 | +start: |
| 44 | + @echo "Starting all services..." |
| 45 | + docker-compose up -d |
| 46 | + @echo "✓ Services started" |
| 47 | + @echo "" |
| 48 | + @echo "Access points:" |
| 49 | + @echo " Dashboard: http://localhost" |
| 50 | + @echo " API: http://localhost/api" |
| 51 | + @echo " FastAPI: http://localhost/fastapi" |
| 52 | + @echo " Node-RED: http://localhost/nodered" |
| 53 | + @echo " Grafana: http://localhost/grafana" |
| 54 | + @echo " Prometheus: http://localhost:9090" |
| 55 | + |
| 56 | +stop: |
| 57 | + @echo "Stopping all services..." |
| 58 | + docker-compose down |
| 59 | + @echo "✓ Services stopped" |
| 60 | + |
| 61 | +restart: stop start |
| 62 | + |
| 63 | +logs: |
| 64 | + docker-compose logs -f |
| 65 | + |
| 66 | +logs-api: |
| 67 | + docker-compose logs -f api_server |
| 68 | + |
| 69 | +logs-fastapi: |
| 70 | + docker-compose logs -f fastapi_backend |
| 71 | + |
| 72 | +logs-postgres: |
| 73 | + docker-compose logs -f postgres |
| 74 | + |
| 75 | +status: |
| 76 | + @echo "Service Status:" |
| 77 | + @docker-compose ps |
| 78 | + |
| 79 | +clean: |
| 80 | + @echo "Cleaning up..." |
| 81 | + docker-compose down -v |
| 82 | + @echo "✓ Containers and volumes removed" |
| 83 | + |
| 84 | +test: |
| 85 | + @echo "Running integration tests..." |
| 86 | + python -m pytest tests/integration/test_production_infrastructure.py -v |
| 87 | + @echo "✓ Tests complete" |
| 88 | + |
| 89 | +validate: |
| 90 | + @echo "Running validation suites..." |
| 91 | + @echo "" |
| 92 | + @echo "1. SpaceX/Tesla/PX4/CARLA Validation" |
| 93 | + python validation/spacex_tesla_px4_carla_tests.py |
| 94 | + @echo "" |
| 95 | + @echo "2. Lipschitz Stability Validation" |
| 96 | + python validation/lipschitz_stability.py |
| 97 | + @echo "" |
| 98 | + @echo "3. Performance Monitoring Demo" |
| 99 | + python monitoring/performance_monitor.py |
| 100 | + @echo "" |
| 101 | + @echo "✓ All validations complete" |
| 102 | + |
| 103 | +demo-tesla: |
| 104 | + @echo "Running Tesla/Neuralink demo..." |
| 105 | + python examples/tesla_neuralink_demo.py |
| 106 | + |
| 107 | +demo-starlink: |
| 108 | + @echo "Running Starlink integration demo..." |
| 109 | + python integration/starlink_network.py |
| 110 | + |
| 111 | +demo-nasa: |
| 112 | + @echo "Running NASA POWER integration demo..." |
| 113 | + python integration/nasa_power_environmental.py |
| 114 | + |
| 115 | +demo-opensim: |
| 116 | + @echo "Running OpenSim integration demo..." |
| 117 | + python integration/opensim_layer.py |
| 118 | + |
| 119 | +install-deps: |
| 120 | + @echo "Installing Python dependencies..." |
| 121 | + pip install -r requirements_web_panel.txt |
| 122 | + pip install scipy psutil pytest |
| 123 | + @echo "✓ Dependencies installed" |
| 124 | + |
| 125 | +db-shell: |
| 126 | + docker-compose exec postgres psql -U mhm_user -d multi_heart_model |
| 127 | + |
| 128 | +redis-cli: |
| 129 | + docker-compose exec redis redis-cli |
| 130 | + |
| 131 | +mqtt-sub: |
| 132 | + docker-compose exec mqtt mosquitto_sub -t '#' -v |
0 commit comments