generated from intersystems-community/integratedml-demo-template
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
143 lines (121 loc) · 3.72 KB
/
Makefile
File metadata and controls
143 lines (121 loc) · 3.72 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
# IntegratedML Custom Models - Development Automation
# Simplified workflow for IRIS + local development
.PHONY: help setup start stop clean install test format lint notebooks
# Default target
help:
@echo "IntegratedML Custom Models - Available Commands:"
@echo ""
@echo "Setup & Environment:"
@echo " setup - Complete project setup (dependencies + IRIS)"
@echo " install - Install Python dependencies only"
@echo " start - Start IRIS database"
@echo " stop - Stop IRIS database"
@echo " clean - Clean up containers and volumes"
@echo ""
@echo "Development:"
@echo " notebooks - Open notebooks directory in VS Code"
@echo " test - Run all tests"
@echo " format - Format code with black"
@echo " lint - Run linting checks"
@echo ""
@echo "Quick Start:"
@echo " make setup && make notebooks"
# Environment setup
setup: install start
@echo "✅ Setup complete! Run 'make notebooks' to start exploring."
install:
@echo "📦 Installing Python dependencies with uv..."
@if command -v uv >/dev/null 2>&1; then \
uv sync; \
else \
echo "⚠️ uv not found, falling back to pip..."; \
pip install -r requirements.txt; \
fi
@echo "✅ Dependencies installed"
install-uv:
@echo "🚀 Installing uv (ultra-fast Python package manager)..."
curl -LsSf https://astral.sh/uv/install.sh | sh
@echo "✅ uv installed! Restart your shell or run: source ~/.cargo/env"
# IRIS database management
start:
@echo "🚀 Starting IRIS database..."
docker-compose up -d iris
@echo "⏳ Waiting for IRIS to be ready..."
@timeout 120 bash -c 'until docker-compose exec iris iris session iris -U USER "w \"Database ready\""; do sleep 2; done'
@echo "✅ IRIS database is ready!"
@echo " Management Portal: http://localhost:52773/csp/sys/UtilHome.csp"
@echo " Database Port: localhost:1972"
stop:
@echo "🛑 Stopping IRIS database..."
docker-compose stop iris
@echo "✅ IRIS stopped"
restart: stop start
# Development tools
notebooks:
@echo "📓 Opening notebooks in VS Code..."
code notebooks/ demos/
test:
@echo "🧪 Running tests..."
@pytest demos/*/tests/ -v --tb=short
@echo "✅ Tests completed"
format:
@echo "🎨 Formatting code..."
black .
@echo "✅ Code formatted"
lint:
@echo "🔍 Running linting..."
flake8 . --max-line-length=88 --extend-ignore=E203,W503
mypy shared/ --ignore-missing-imports
@echo "✅ Linting completed"
# Cleanup
clean:
@echo "🧹 Cleaning up..."
docker-compose down -v
docker system prune -f
@echo "✅ Cleanup completed"
# Demo-specific targets
demo-credit:
@echo "💳 Running Credit Risk demo..."
python run_credit_risk_demo.py
demo-fraud:
@echo "🔒 Running Fraud Detection demo..."
python run_fraud_detection_demo.py
demo-sales:
@echo "📈 Running Sales Forecasting demo..."
python run_sales_forecasting_demo.py
demo-dna:
@echo "🧬 Running DNA Similarity demo..."
python run_dna_similarity_demo.py
# Quick demo runner
demos: start
@echo "🎬 Running all demos..."
@$(MAKE) demo-credit
@$(MAKE) demo-fraud
@$(MAKE) demo-sales
@$(MAKE) demo-dna
@echo "✅ All demos completed!"
# Status check
status:
@echo "📊 System Status:"
@echo ""
@docker-compose ps
@echo ""
@if docker-compose exec iris iris session iris -U USER "w \"IRIS Status: Online\"" 2>/dev/null; then \
echo "✅ IRIS: Online"; \
else \
echo "❌ IRIS: Offline"; \
fi
# Development utilities
dev-setup: install
@echo "🛠️ Setting up development environment..."
pip install pre-commit
pre-commit install
@echo "✅ Development tools configured"
# Container logs
logs:
docker-compose logs -f iris
# Database initialization
init-db: start
@echo "🗃️ Initializing database with sample data..."
python setup_iris_integratedml.py
@echo "✅ Database initialized"