-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup.sh
More file actions
executable file
·61 lines (50 loc) · 1.57 KB
/
setup.sh
File metadata and controls
executable file
·61 lines (50 loc) · 1.57 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
#!/bin/bash
# OpsLens Setup Script
echo "🚀 Setting up OpsLens..."
# Check if Docker is running
if ! docker info > /dev/null 2>&1; then
echo "❌ Docker is not running. Please start Docker Desktop and try again."
exit 1
fi
# Check if secrets.env exists
if [ ! -f "secrets.env" ]; then
echo "📝 Creating secrets.env from template..."
cp secrets.env.example secrets.env
echo "⚠️ Please edit secrets.env and add your API keys before continuing."
echo " Required keys:"
echo " - HUGGINGFACE_API_KEY"
echo " - GITHUB_API_KEY"
echo " - PAGERDUTY_API_KEY"
read -p "Press Enter after you've added your API keys..."
fi
# Create artifacts directory
mkdir -p artifacts
# Start Docker containers
echo "🐳 Starting Docker containers..."
docker-compose up -d
# Wait for services to be ready
echo "⏳ Waiting for services to be ready..."
sleep 10
# Initialize database
echo "🗄️ Initializing database..."
docker-compose exec -T backend python -m app.db.init_db
# Generate synthetic data (optional)
read -p "Generate synthetic data? (y/n) " -n 1 -r
echo
if [[ $REPLY =~ ^[Yy]$ ]]; then
echo "📊 Generating synthetic data..."
docker-compose exec -T backend python -m app.data.generate_synthetic
fi
echo ""
echo "✅ Setup complete!"
echo ""
echo "🌐 Access the application:"
echo " Frontend: http://localhost:3000"
echo " Backend API: http://localhost:8000"
echo " API Docs: http://localhost:8000/docs"
echo ""
echo "📝 To view logs:"
echo " docker-compose logs -f"
echo ""
echo "🛑 To stop:"
echo " docker-compose down"