-
Notifications
You must be signed in to change notification settings - Fork 49
Expand file tree
/
Copy pathdeploy-gpu.sh
More file actions
executable file
·73 lines (61 loc) · 1.95 KB
/
deploy-gpu.sh
File metadata and controls
executable file
·73 lines (61 loc) · 1.95 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
#!/bin/bash
# SAFLA GPU Deployment Script for Fly.io
# This script deploys SAFLA with GPU optimization to Fly.io
set -e
echo "🚀 SAFLA GPU Deployment to Fly.io"
echo "=================================="
# Check if flyctl is installed
if ! command -v flyctl &> /dev/null; then
echo "❌ flyctl is not installed. Please install it first:"
echo " curl -L https://fly.io/install.sh | sh"
exit 1
fi
# Check if logged in to Fly.io
if ! flyctl auth whoami &> /dev/null; then
echo "❌ Not logged in to Fly.io. Please login first:"
echo " flyctl auth login"
exit 1
fi
# Create Fly.io app if it doesn't exist
if ! flyctl apps list | grep -q "safla"; then
echo "📝 Creating Fly.io app..."
flyctl apps create safla --org personal
fi
# Create volume for persistent storage
echo "💾 Creating persistent volume..."
flyctl volumes create safla_data --region ord --size 50 --app safla || true
# Set secrets
echo "🔐 Setting up secrets..."
if [ -f ".env" ]; then
flyctl secrets import < .env --app safla
else
echo "⚠️ No .env file found. Setting default secrets..."
flyctl secrets set \
SAFLA_SECRET_KEY="$(openssl rand -hex 32)" \
SAFLA_JWT_SECRET="$(openssl rand -hex 32)" \
--app safla
fi
# Deploy to Fly.io
echo "🚀 Deploying to Fly.io..."
flyctl deploy --app safla --remote-only
# Check deployment status
echo "🔍 Checking deployment status..."
flyctl status --app safla
# Show logs
echo "📋 Recent logs:"
flyctl logs --app safla --lines 20
echo ""
echo "✅ Deployment complete!"
echo "🌐 Your SAFLA GPU instance is available at:"
echo " https://safla.fly.dev"
echo ""
echo "📊 Monitor your app:"
echo " flyctl status --app safla"
echo " flyctl logs --app safla"
echo ""
echo "💡 GPU Optimization Features:"
echo " - NVIDIA A10 GPU (24GB VRAM)"
echo " - Flash Attention 2 enabled"
echo " - Mixed precision training"
echo " - Optimized batch processing"
echo " - Persistent model storage"