-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup_local_simple.sh
More file actions
executable file
·136 lines (120 loc) · 3.62 KB
/
setup_local_simple.sh
File metadata and controls
executable file
·136 lines (120 loc) · 3.62 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
#!/bin/bash
# Simple local setup without sudo requirements
set -e
echo "=========================================="
echo " Biotact Simple Local Setup "
echo "=========================================="
echo ""
GREEN='\033[0;32m'
YELLOW='\033[0;33m'
RED='\033[0;31m'
NC='\033[0m'
# Create necessary directories
echo -e "${GREEN}Creating directories...${NC}"
mkdir -p logs
mkdir -p data/redis
mkdir -p data/postgres
mkdir -p data/qdrant
mkdir -p ~/qdrant-storage
# Check Python
echo -n "Checking Python 3.11... "
if command -v python3.11 &> /dev/null; then
echo -e "${GREEN}✓ Found${NC}"
else
echo -e "${YELLOW}Using python3${NC}"
PYTHON_CMD=python3
fi
# Create virtual environment
echo -e "${GREEN}Setting up Python virtual environment...${NC}"
if [ ! -d "venv" ]; then
python3 -m venv venv
echo -e "${GREEN}✓ Created venv${NC}"
else
echo -e "${YELLOW}✓ venv already exists${NC}"
fi
# Activate and install packages
source venv/bin/activate
echo -e "${GREEN}Installing Python packages...${NC}"
pip install --quiet --upgrade pip
# Install only essential packages for now
pip install --quiet \
fastapi==0.115.0 \
uvicorn[standard]==0.32.0 \
sqlalchemy==2.0.36 \
psycopg2-binary==2.9.10 \
redis==5.2.0 \
qdrant-client==1.12.1 \
openai==1.58.1 \
anthropic==0.40.0 \
pydantic==2.10.4 \
pydantic-settings==2.6.1 \
python-jose[cryptography]==3.3.0 \
passlib[argon2]==1.7.4 \
python-multipart==0.0.18 \
python-dotenv==1.0.1 \
aiofiles==24.1.0 \
httpx==0.28.1
echo -e "${GREEN}✓ Python packages installed${NC}"
# Check if services are available
echo ""
echo -e "${YELLOW}Checking services...${NC}"
# PostgreSQL
echo -n "PostgreSQL: "
if command -v psql &> /dev/null; then
echo -e "${GREEN}✓ Installed${NC}"
# Try to create database (will fail if no permissions)
echo -e "${YELLOW}Note: You may need to manually create the database:${NC}"
echo " sudo -u postgres psql"
echo " CREATE USER biotact_admin WITH PASSWORD 'biotact_password';"
echo " CREATE DATABASE biotact_production OWNER biotact_admin;"
echo " \q"
else
echo -e "${RED}✗ Not installed${NC}"
echo " Install with: sudo apt-get install postgresql"
fi
# Redis
echo -n "Redis: "
if command -v redis-server &> /dev/null; then
echo -e "${GREEN}✓ Installed${NC}"
echo " Will run Redis locally with custom config"
else
echo -e "${RED}✗ Not installed${NC}"
echo " Install with: sudo apt-get install redis-server"
fi
# Qdrant
echo -n "Qdrant: "
if [ -f ~/qdrant ]; then
echo -e "${GREEN}✓ Found${NC}"
else
echo -e "${YELLOW}⚠ Not found${NC}"
echo " Downloading Qdrant..."
cd ~
wget -q https://github.com/qdrant/qdrant/releases/download/v1.12.5/qdrant-x86_64-unknown-linux-gnu.tar.gz
tar -xzf qdrant-x86_64-unknown-linux-gnu.tar.gz
rm qdrant-x86_64-unknown-linux-gnu.tar.gz
cd -
echo -e "${GREEN}✓ Downloaded Qdrant${NC}"
fi
echo ""
echo "=========================================="
echo -e "${GREEN}✅ Setup complete!${NC}"
echo "=========================================="
echo ""
echo "To start services:"
echo ""
echo "1. Start Redis locally:"
echo " redis-server infrastructure/redis/redis.conf"
echo ""
echo "2. Start Qdrant:"
echo " ~/qdrant --storage-path ~/qdrant-storage"
echo ""
echo "3. Start Backend API:"
echo " source venv/bin/activate"
echo " cd backend"
echo " python -m uvicorn app.main:app --reload"
echo ""
echo "Services will be available at:"
echo " - API: http://localhost:8000"
echo " - API Docs: http://localhost:8000/docs"
echo " - Qdrant: http://localhost:6333"
echo " - Redis: localhost:6379"