Skip to content

Commit 1b6064c

Browse files
authored
Merge branch 'main' into claude/physiological-model-validation-01DN4AYiktu9BtLrrArKd7yD
2 parents 9f77788 + fd777ac commit 1b6064c

33 files changed

+20408
-0
lines changed

.env.example

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
# Database Configuration
2+
POSTGRES_PASSWORD=mhm_secure_password_change_me
3+
POSTGRES_USER=mhm_user
4+
POSTGRES_DB=multi_heart_model
5+
6+
# Redis Configuration
7+
REDIS_PASSWORD=redis_secure_password_change_me
8+
9+
# API Configuration
10+
JWT_SECRET=jwt_super_secret_key_change_me_to_random_string
11+
NODE_RED_SECRET=nodered_secret_key_change_me
12+
13+
# Grafana Configuration
14+
GRAFANA_PASSWORD=admin_change_me
15+
16+
# MQTT Configuration
17+
MQTT_USERNAME=mhm_mqtt
18+
MQTT_PASSWORD=mqtt_password_change_me
19+
20+
# OpenSim Configuration
21+
OPENSIM_API_KEY=your_opensim_api_key_here
22+
23+
# Starlink Configuration
24+
STARLINK_API_KEY=your_starlink_api_key_here
25+
26+
# NASA POWER Configuration
27+
NASA_POWER_API_KEY=your_nasa_power_api_key_here
28+
29+
# Production Mode
30+
NODE_ENV=production
31+
PYTHONUNBUFFERED=1

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,6 @@ dist/
99
*.o
1010
*.so
1111
*.a
12+
.coverage
13+
htmlcov/
1214

Makefile.production

Lines changed: 132 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,132 @@
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

Comments
 (0)