Compare commits
3
Commits
40b524e393
...
9e8ffe2dc5
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
9e8ffe2dc5 | ||
|
|
6578578acb | ||
|
|
b17d41802d |
@@ -1,16 +1,24 @@
|
||||
services:
|
||||
# Long-running local services restart after a Docker or Mac restart, unless stopped with stop.
|
||||
# One-shot services (embedding-model-init, catalog-migrate) and workspace-maintenance keep "no".
|
||||
catalog-db:
|
||||
restart: unless-stopped
|
||||
|
||||
embedding:
|
||||
restart: unless-stopped
|
||||
|
||||
core:
|
||||
environment:
|
||||
NODE_ENV: development
|
||||
THT_WORKSPACE_INSTALLATION_ID: ${THT_WORKSPACE_INSTALLATION_ID:-local}
|
||||
ports:
|
||||
- "127.0.0.1:${THOTH_CORE_HTTP_PORT:-8787}:8787"
|
||||
restart: "no"
|
||||
restart: unless-stopped
|
||||
|
||||
frontend:
|
||||
ports:
|
||||
- "127.0.0.1:${THOTH_HTTP_PORT:-8080}:8080"
|
||||
restart: "no"
|
||||
restart: unless-stopped
|
||||
|
||||
workspace-maintenance:
|
||||
environment:
|
||||
@@ -22,4 +30,4 @@ services:
|
||||
qdrant:
|
||||
ports:
|
||||
- "127.0.0.1:6333:6333"
|
||||
restart: "no"
|
||||
restart: unless-stopped
|
||||
|
||||
+5
-30
@@ -1,36 +1,11 @@
|
||||
#!/usr/bin/env bash
|
||||
# run-stack.sh — avvia lo stack Compose locale di ThothII in primo piano.
|
||||
# run-stack.sh — avvia lo stack locale di ThothII (installazione PSD) tramite tht.
|
||||
#
|
||||
# Il core include Pi; DWH e LLM restano endpoint esterni configurati in deploy/env/local.env.
|
||||
# Qdrant e Ollama embedding sono servizi Compose privati. Non richiede un eseguibile Pi sull'host.
|
||||
#
|
||||
# Preparazione: cp deploy/env/local.env.example deploy/env/local.env e compilare i valori.
|
||||
# Uso: ./scripts/run-stack.sh [argomenti aggiuntivi per docker compose up]
|
||||
# Il percorso Compose diretto non genera le proiezioni dei modelli né i secret dell'installazione,
|
||||
# quindi non può avviare lo stack. Questo script delega al percorso supportato: scripts/thothii-local.sh.
|
||||
# Uso: ./scripts/run-stack.sh [--build]
|
||||
set -euo pipefail
|
||||
|
||||
ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd -P)"
|
||||
LOCAL_ENV_FILE="${THT_LOCAL_ENV_FILE:-$ROOT/deploy/env/local.env}"
|
||||
|
||||
[[ -f "$LOCAL_ENV_FILE" ]] || {
|
||||
echo "ERRORE: $LOCAL_ENV_FILE mancante. Copia deploy/env/local.env.example e configura gli endpoint." >&2
|
||||
exit 1
|
||||
}
|
||||
|
||||
compose_files=(-f "$ROOT/compose.yaml" -f "$ROOT/deploy/compose.local.yaml")
|
||||
if [[ "${THOTH_ENABLE_EMBEDDING_GPU:-0}" == "1" ]]; then
|
||||
compose_files+=(-f "$ROOT/deploy/compose.embedding-gpu.yaml")
|
||||
fi
|
||||
if [[ "${THOTH_ENABLE_SENSITIVITY_NER:-0}" == "1" ]]; then
|
||||
compose_files+=(-f "$ROOT/deploy/compose.sensitivity-ner.yaml")
|
||||
fi
|
||||
|
||||
compose=(docker compose --env-file "$LOCAL_ENV_FILE" "${compose_files[@]}")
|
||||
|
||||
# Migrations are an explicit one-shot operation, never hidden in backend startup. The local
|
||||
# launcher runs that operation before bringing the foreground stack up so a fresh checkout is
|
||||
# immediately usable while production operators can invoke the same service during rollout.
|
||||
"${compose[@]}" build core
|
||||
"${compose[@]}" up -d catalog-db
|
||||
"${compose[@]}" run --rm catalog-migrate
|
||||
|
||||
exec "${compose[@]}" up --build "$@"
|
||||
exec "$ROOT/scripts/thothii-local.sh" start "$@"
|
||||
|
||||
Executable
+73
@@ -0,0 +1,73 @@
|
||||
#!/usr/bin/env bash
|
||||
# thothii-local.sh — avvia, ferma e controlla lo stack locale ThothII tramite tht.
|
||||
#
|
||||
# Prima di avviare ferma gli altri progetti Compose thothii-* in esecuzione (solo stop: container
|
||||
# e volumi restano) e verifica che le porte pubblicate siano libere. PeopleKitchens non viene
|
||||
# toccato: lo script segnala solo che è attivo.
|
||||
# Uso: ./scripts/thothii-local.sh start [--build] | stop | status
|
||||
set -euo pipefail
|
||||
|
||||
ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd -P)"
|
||||
INSTALLATION="$ROOT/deploy/psd/thothii-installation.yaml"
|
||||
PORTS=(8080 8787 6333)
|
||||
|
||||
tht_cmd() {
|
||||
tht --installation "$INSTALLATION" "$@"
|
||||
}
|
||||
|
||||
running_thothii_projects() {
|
||||
docker ps --filter 'label=com.docker.compose.project' \
|
||||
--format '{{.Label "com.docker.compose.project"}}' | sort -u | grep '^thothii' || true
|
||||
}
|
||||
|
||||
warn_peoplekitchens() {
|
||||
if docker ps --format '{{.Names}}' | grep -q '^peoplekitchens'; then
|
||||
echo "ATTENZIONE: container PeopleKitchens attivi (consumo memoria, non fermati da questo script)." >&2
|
||||
fi
|
||||
}
|
||||
|
||||
stop_other_thothii_projects() {
|
||||
local project
|
||||
while read -r project; do
|
||||
[[ -n "$project" ]] || continue
|
||||
echo "Fermo il progetto Compose $project (container e volumi conservati)"
|
||||
docker compose -p "$project" stop
|
||||
done < <(running_thothii_projects)
|
||||
}
|
||||
|
||||
check_ports_free() {
|
||||
local port busy=0
|
||||
for port in "${PORTS[@]}"; do
|
||||
if lsof -nP -iTCP:"$port" -sTCP:LISTEN >/dev/null 2>&1; then
|
||||
echo "ERRORE: porta $port occupata da:" >&2
|
||||
lsof -nP -iTCP:"$port" -sTCP:LISTEN >&2 || true
|
||||
busy=1
|
||||
fi
|
||||
done
|
||||
return "$busy"
|
||||
}
|
||||
|
||||
case "${1:-}" in
|
||||
start)
|
||||
shift
|
||||
warn_peoplekitchens
|
||||
tht_cmd stop >/dev/null 2>&1 || true
|
||||
stop_other_thothii_projects
|
||||
check_ports_free
|
||||
tht_cmd start "$@"
|
||||
;;
|
||||
stop)
|
||||
tht_cmd stop
|
||||
stop_other_thothii_projects
|
||||
;;
|
||||
status)
|
||||
tht_cmd status
|
||||
echo "--- progetti thothii in esecuzione:"
|
||||
running_thothii_projects
|
||||
warn_peoplekitchens
|
||||
;;
|
||||
*)
|
||||
echo "Uso: $0 start [--build] | stop | status" >&2
|
||||
exit 2
|
||||
;;
|
||||
esac
|
||||
Reference in New Issue
Block a user