-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathquickstart.sh
More file actions
executable file
·173 lines (148 loc) · 6.15 KB
/
quickstart.sh
File metadata and controls
executable file
·173 lines (148 loc) · 6.15 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
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
#!/usr/bin/env bash
# FIML Quick Start Script
cat << "EOF"
╔═══════════════════════════════════════════════════════════╗
║ ║
║ ███████╗██╗███╗ ██╗ █████╗ ███╗ ██╗ ██████╗███████╗║
║ ██╔════╝██║████╗ ██║██╔══██╗████╗ ██║██╔════╝██╔════╝║
║ █████╗ ██║██╔██╗ ██║███████║██╔██╗ ██║██║ █████╗ ║
║ ██╔══╝ ██║██║╚██╗██║██╔══██║██║╚██╗██║██║ ██╔══╝ ║
║ ██║ ██║██║ ╚████║██║ ██║██║ ╚████║╚██████╗███████╗║
║ ╚═╝ ╚═╝╚═╝ ╚═══╝╚═╝ ╚═╝╚═╝ ╚═══╝ ╚═════╝╚══════╝║
║ ║
║ Financial Intelligence Meta-Layer v0.2.0 ║
║ ║
╚═══════════════════════════════════════════════════════════╝
EOF
echo "🚀 Welcome to FIML Setup!"
echo ""
# Function to check if command exists
command_exists() {
command -v "$1" >/dev/null 2>&1
}
# Check prerequisites
echo "📋 Checking prerequisites..."
echo ""
MISSING_DEPS=()
if ! command_exists docker; then
MISSING_DEPS+=("docker")
fi
if ! command_exists python3; then
MISSING_DEPS+=("python3")
fi
if [ ${#MISSING_DEPS[@]} -ne 0 ]; then
echo "❌ Missing dependencies:"
for dep in "${MISSING_DEPS[@]}"; do
echo " - $dep"
done
echo ""
echo "Please install missing dependencies and try again."
exit 1
fi
echo "✅ All prerequisites met!"
echo ""
# Check .env file
if [ ! -f .env ]; then
echo "📝 Creating .env file from template..."
cp .env.example .env
echo ""
echo "⚠️ IMPORTANT: Please edit .env with your API keys:"
echo " - ALPHA_VANTAGE_API_KEY"
echo " - FMP_API_KEY"
echo " - Other provider keys as needed"
echo ""
read -p "Press Enter after you've configured .env (or continue with defaults for testing)..."
fi
# Offer installation options
echo ""
echo "Choose installation method:"
echo "1) Docker Compose (Recommended - Full stack)"
echo "2) Python Virtual Environment (Development only)"
echo "3) Both"
echo ""
read -p "Enter choice [1-3]: " choice
case $choice in
1|3)
echo ""
echo "🐳 Starting Docker Compose setup..."
echo ""
# Build images
echo "🏗️ Building Docker images..."
docker compose build
# Start services
echo "🚀 Starting services..."
docker compose up -d
# Wait for services
echo "⏳ Waiting for services to be ready..."
sleep 15
# Initialize database
echo "📊 Initializing database..."
docker compose exec -T postgres psql -U fiml -d fiml -f /docker-entrypoint-initdb.d/init.sql 2>/dev/null || true
# Check health
echo ""
echo "🏥 Checking service health..."
if curl -s http://localhost:8000/health > /dev/null; then
echo "✅ FIML server is healthy!"
else
echo "⚠️ FIML server may not be ready yet. Check logs with: make logs"
fi
echo ""
echo "✅ Docker setup complete!"
;;
esac
case $choice in
2|3)
echo ""
echo "🐍 Setting up Python virtual environment..."
# Create venv
if [ ! -d "venv" ]; then
python3 -m venv venv
fi
# Activate venv
source venv/bin/activate
# Install dependencies
echo "📦 Installing dependencies..."
pip install --upgrade pip setuptools wheel
pip install -e ".[dev]"
echo ""
echo "✅ Python environment ready!"
echo " Activate with: source venv/bin/activate"
;;
esac
# Display summary
echo ""
echo "╔═══════════════════════════════════════════════════════════╗"
echo "║ 🎉 FIML Setup Complete! 🎉 ║"
echo "╚═══════════════════════════════════════════════════════════╝"
echo ""
echo "📍 Service URLs:"
echo " • API Server: http://localhost:8000"
echo " • API Docs: http://localhost:8000/docs"
echo " • Health Check: http://localhost:8000/health"
echo " • Grafana: http://localhost:3000 (admin/admin)"
echo " • Prometheus: http://localhost:9090"
echo " • Ray Dashboard: http://localhost:8265"
echo ""
echo "📖 Useful Commands:"
echo " • View logs: make logs"
echo " • Run tests: make test"
echo " • Stop services: make down"
echo " • Format code: make format"
echo " • Shell access: make shell"
echo ""
echo "🎯 Try the examples:"
echo " python examples/basic_usage.py"
echo ""
echo "📚 Documentation:"
echo " • README.md - Getting started"
echo " • ARCHITECTURE.md - System design"
echo " • DEPLOYMENT.md - Production deployment"
echo " • BUILD_SUMMARY.md - Current status & roadmap"
echo ""
echo "🤝 Need help?"
echo " • GitHub Issues: https://github.com/kiarashplusplus/fiml/issues"
echo " • Documentation: https://docs.fiml.ai"
echo ""
echo "⚠️ Disclaimer: FIML provides financial data for informational"
echo " purposes only. Not financial advice. DYOR!"
echo ""