[object Object]

← back to Dw Photo Capture

visual-search: path-(a) Kamatera self-host bundle (lite venv, no torch; pm2 unit reading local dw_unified) — verified 71MB footprint

bdba9e2d5b91222ada973c3faeabd4e802fd6123 · 2026-07-13 01:10:29 -0700 · Steve Abrams

Files touched

Diff

commit bdba9e2d5b91222ada973c3faeabd4e802fd6123
Author: Steve Abrams <steve@designerwallcoverings.com>
Date:   Mon Jul 13 01:10:29 2026 -0700

    visual-search: path-(a) Kamatera self-host bundle (lite venv, no torch; pm2 unit reading local dw_unified) — verified 71MB footprint
---
 visual-search/deploy-kamatera/requirements-lite.txt |  6 ++++++
 visual-search/deploy-kamatera/setup.sh              | 21 +++++++++++++++++++++
 2 files changed, 27 insertions(+)

diff --git a/visual-search/deploy-kamatera/requirements-lite.txt b/visual-search/deploy-kamatera/requirements-lite.txt
new file mode 100644
index 0000000..cde9ef6
--- /dev/null
+++ b/visual-search/deploy-kamatera/requirements-lite.txt
@@ -0,0 +1,6 @@
+# Minimal deps for the /similar + /pairwise endpoints pairs-well uses.
+# NO torch / open_clip — those load lazily only for the /search photo path,
+# which pairs-well never calls. Keeps the Kamatera footprint ~71 MB.
+numpy
+psycopg2-binary
+Pillow
diff --git a/visual-search/deploy-kamatera/setup.sh b/visual-search/deploy-kamatera/setup.sh
new file mode 100755
index 0000000..4d17e87
--- /dev/null
+++ b/visual-search/deploy-kamatera/setup.sh
@@ -0,0 +1,21 @@
+#!/usr/bin/env bash
+# Path (a): run visual-search self-contained on Kamatera, reading the LOCAL dw_unified.
+# Idempotent. Serves localhost:9914 so pairs-well points VISUAL_SEARCH_URL at 127.0.0.1.
+set -euo pipefail
+HERE="$(cd "$(dirname "$0")/.." && pwd)"          # .../visual-search
+VE="$HERE/.venv-lite"
+# dw_unified connection = the same DB pairs-well already uses on this box.
+DBURL="$(grep -E '^DATABASE_URL=' /root/Projects/dw-pairs-well/.env | head -1 | cut -d= -f2-)"
+[ -n "$DBURL" ] || { echo "FATAL: could not read DATABASE_URL from pairs-well .env"; exit 1; }
+
+[ -d "$VE" ] || python3 -m venv "$VE"
+"$VE/bin/pip" -q install --upgrade pip
+"$VE/bin/pip" -q install -r "$HERE/deploy-kamatera/requirements-lite.txt"
+
+# (re)start under pm2 as 'visual-search', bound to localhost only.
+pm2 delete visual-search 2>/dev/null || true
+DW_UNIFIED_DB="$DBURL" VS_PORT=9914 VS_HOST=127.0.0.1 \
+  pm2 start "$VE/bin/python" --name visual-search --cwd "$HERE" -- "$HERE/search_service.py"
+pm2 save
+sleep 20
+echo "--- health ---"; curl -s http://127.0.0.1:9914/health; echo

← fcb1edb visual-search: bind VS_HOST=0.0.0.0 so Kamatera pairs-well c  ·  back to Dw Photo Capture  ·  nightly embed top-up script + plist draft (coverage anti-dec 2212c21 →