forked from morphik-org/morphik-core
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinstall_and_start.sh
More file actions
47 lines (36 loc) · 1.42 KB
/
install_and_start.sh
File metadata and controls
47 lines (36 loc) · 1.42 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
#!/usr/bin/env bash
# Morphik Core one-liner installer + server launcher.
# Works on macOS (Apple Silicon or Intel) and Linux.
# Usage: bash install_and_start.sh
set -euo pipefail
# Detect platform
OS=$(uname -s)
ARCH=$(uname -m)
# Check docker availability
if ! command -v docker >/dev/null 2>&1; then
echo "❌ Docker is required (used to run a local Redis container). Install Docker Desktop or docker engine first." >&2
exit 1
fi
printf "\n➡️ Detected OS: %s | Arch: %s\n" "$OS" "$ARCH"
# Ensure uv is installed globally (fallback to pipx if available)
if ! command -v uv >/dev/null 2>&1; then
printf "\n🔧 Installing uv...\n"
python3 -m pip install --user --upgrade uv || {
echo "Failed to install uv – please make sure Python 3 & pip are available."; exit 1; }
fi
# Create virtual-env and sync project deps
printf "\n📦 Installing project dependencies with uv...\n"
uv sync
# shellcheck disable=SC1091
source .venv/bin/activate
# Ensure .env exists for python-dotenv (copy from example if missing)
if [[ ! -f .env && -f .env.example ]]; then
printf "\n📄 Creating default .env from .env.example...\n"
cp .env.example .env
fi
# Install ColPali engine (multimodal retrieval)
printf "\n📦 Installing ColPali engine...\n"
uv pip install \
colpali-engine@git+https://github.com/illuin-tech/colpali@80fb72c9b827ecdb5687a3a8197077d0d01791b3
printf "\n🚀 Starting Morphik server...\n\n"
uv run start_server.py