-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinstall.sh
More file actions
117 lines (99 loc) · 5.02 KB
/
Copy pathinstall.sh
File metadata and controls
117 lines (99 loc) · 5.02 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
#!/usr/bin/env bash
set -e
REPO_ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
BOLD='\033[1m'
CYAN='\033[36m'
GREEN='\033[32m'
YELLOW='\033[33m'
RED='\033[31m'
RESET='\033[0m'
echo ""
echo -e "${BOLD}Outpost Installer${RESET}"
echo -e "${CYAN}─────────────────────────────────────${RESET}"
echo ""
# ── Check OS ──────────────────────────────────────────────────────────────────
OS="$(uname -s)"
ARCH="$(uname -m)"
echo -e " System: ${CYAN}${OS} ${ARCH}${RESET}"
# ── Python ────────────────────────────────────────────────────────────────────
if ! command -v python3 &>/dev/null; then
echo -e "${RED}✗ Python 3.10+ is required but not found.${RESET}"
exit 1
fi
PY_VERSION=$(python3 -c "import sys; print(f'{sys.version_info.major}.{sys.version_info.minor}')")
echo -e " Python: ${CYAN}${PY_VERSION}${RESET}"
# ── Node.js ───────────────────────────────────────────────────────────────────
if ! command -v node &>/dev/null; then
echo -e "${RED}✗ Node.js 18+ is required but not found.${RESET}"
echo " Install from https://nodejs.org"
exit 1
fi
NODE_VERSION=$(node --version)
echo -e " Node: ${CYAN}${NODE_VERSION}${RESET}"
# ── Rust (optional, for future desktop packaging) ─────────────────────────────
if command -v cargo &>/dev/null; then
echo -e " Rust: ${CYAN}$(rustc --version)${RESET}"
else
echo -e " Rust: not installed (optional)"
fi
# ── Ollama ────────────────────────────────────────────────────────────────────
if ! command -v ollama &>/dev/null; then
echo ""
echo -e " Installing Ollama…"
curl -fsSL https://ollama.com/install.sh | sh
else
echo -e " Ollama: ${CYAN}$(ollama --version 2>/dev/null || echo 'installed')${RESET}"
fi
# ── Qdrant ────────────────────────────────────────────────────────────────────
QDRANT_DIR="$HOME/.Outpost/qdrant"
if [ ! -f "$QDRANT_DIR/qdrant" ]; then
echo ""
echo -e " Installing Qdrant…"
mkdir -p "$QDRANT_DIR"
if [ "$OS" = "Darwin" ]; then
QDRANT_URL="https://github.com/qdrant/qdrant/releases/latest/download/qdrant-aarch64-apple-darwin.tar.gz"
else
QDRANT_URL="https://github.com/qdrant/qdrant/releases/latest/download/qdrant-x86_64-unknown-linux-musl.tar.gz"
fi
curl -fsSL "$QDRANT_URL" | tar -xz -C "$QDRANT_DIR"
chmod +x "$QDRANT_DIR/qdrant"
echo -e " ${GREEN}✓ Qdrant installed${RESET}"
fi
# ── Python deps ───────────────────────────────────────────────────────────────
echo ""
echo -e " Installing Python dependencies…"
pip3 install -r "$REPO_ROOT/backend/requirements.txt" -q
# ── Node deps + frontend build ────────────────────────────────────────────────
echo -e " Installing Node dependencies…"
cd "$REPO_ROOT/frontend"
npm install --silent
echo -e " Building frontend…"
npm run build
# ── CLI shortcut ──────────────────────────────────────────────────────────────
cat > /usr/local/bin/Outpost << SCRIPT
#!/usr/bin/env bash
cd "$REPO_ROOT"
python3 -m cli.cli "\$@"
SCRIPT
chmod +x /usr/local/bin/Outpost 2>/dev/null || true
# ── Launch script ─────────────────────────────────────────────────────────────
cat > "$HOME/.Outpost/start.sh" << LAUNCH
#!/usr/bin/env bash
cd "$REPO_ROOT"
# Start Ollama
ollama serve &>/dev/null &
# Start Qdrant
~/.Outpost/qdrant/qdrant --storage-path ~/.Outpost/qdrant/storage &>/dev/null &
# Start backend
python3 -m uvicorn backend.server:app --host 127.0.0.1 --port 8765 &>/dev/null &
echo "Outpost services started"
LAUNCH
chmod +x "$HOME/.Outpost/start.sh"
echo ""
echo -e "${GREEN}${BOLD}✓ Installation complete!${RESET}"
echo ""
echo -e " Frontend: ${CYAN}$REPO_ROOT/frontend/dist${RESET}"
echo -e " Start services: ${CYAN}~/.Outpost/start.sh${RESET}"
echo -e " Use the CLI: ${CYAN}Outpost chat${RESET}"
echo -e " Pull a model first: ${CYAN}Outpost models pull llama3.1:8b${RESET}"
echo ""