ci: pull from Docker Hub directly, remove broken registry cache/mirrors

This commit is contained in:
Celes Hillyerd
2026-06-26 03:27:12 -07:00
parent 17a044de0f
commit a0eaa7d6c8
9 changed files with 62 additions and 165 deletions
+53 -13
View File
@@ -6,15 +6,18 @@ set -euo pipefail
# Usage: bash deploy-docker.sh [OPTIONS]
#
# Options:
# --host USER@HOST SSH target (default: celes@192.168.42.254)
# --ollama-url URL Ollama API URL (default: auto-detect or install)
# --ollama-model MODEL Ollama model name (default: qwen3.5:9b-fast)
# --dir PATH Remote install directory (default: ~/stonks-oracle)
# --host USER@HOST SSH target (default: celes@192.168.42.254)
# --ollama-model MODEL Ollama model name (default: qwen3.5:9b-fast)
# --external-ollama=URL Use an external Ollama instance instead of deploying one
# --dir PATH Remote install directory (default: ~/stonks-oracle)
# --uninstall Tear down the deployment and remove containers/volumes
# --help Show this help message
#
# Examples:
# bash deploy-docker.sh
# bash deploy-docker.sh --ollama-url http://10.1.1.12:2701 --ollama-model qwen3.6
# bash deploy-docker.sh --external-ollama=http://127.0.0.1:11434/
# bash deploy-docker.sh --host user@myserver --dir /opt/stonks
# bash deploy-docker.sh --uninstall
# -------------------------------------------------------
# Configuration (override via flags or environment)
@@ -24,22 +27,56 @@ REMOTE_DIR="${DEPLOY_DIR:-/home/celes/stonks-oracle}"
OLLAMA_URL="${DEPLOY_OLLAMA_URL:-}"
OLLAMA_MODEL="${DEPLOY_OLLAMA_MODEL:-qwen3.5:9b-fast}"
REPO_URL="http://admin:St0nks0racl3!@10.1.1.12:30300/admin/stonks-oracle.git"
DO_UNINSTALL=false
# Parse command-line flags
while [[ $# -gt 0 ]]; do
case $1 in
--help)
sed -n '3,/^$/p' "$0" | sed 's/^# //;s/^#//'
exit 0 ;;
--host) REMOTE_HOST="$2"; shift 2 ;;
--ollama-url) OLLAMA_URL="$2"; shift 2 ;;
--external-ollama=*) OLLAMA_URL="${1#*=}"; shift ;;
--external-ollama) OLLAMA_URL="$2"; shift 2 ;;
--ollama-model) OLLAMA_MODEL="$2"; shift 2 ;;
--dir) REMOTE_DIR="$2"; shift 2 ;;
--uninstall) DO_UNINSTALL=true; shift ;;
*) echo "Unknown option: $1"; exit 1 ;;
esac
done
# -------------------------------------------------------
# Uninstall mode
# -------------------------------------------------------
if [ "$DO_UNINSTALL" = "true" ]; then
echo "=== Stonks Oracle — Uninstall ==="
echo " Target: ${REMOTE_HOST}:${REMOTE_DIR}"
echo ""
ssh "$REMOTE_HOST" bash -s -- "$REMOTE_DIR" <<'REMOTE_SCRIPT'
set -euo pipefail
REMOTE_DIR="$1"
if [ ! -d "$REMOTE_DIR" ]; then
echo " Nothing to uninstall — $REMOTE_DIR does not exist"
exit 0
fi
cd "$REMOTE_DIR"
echo " Stopping and removing containers, networks, and volumes..."
docker compose down -v 2>/dev/null || true
echo " Removing project directory..."
rm -rf "$REMOTE_DIR"
echo " ✓ Uninstall complete"
REMOTE_SCRIPT
exit 0
fi
echo "=== Stonks Oracle Docker Deployment ==="
echo " Target: ${REMOTE_HOST}:${REMOTE_DIR}"
echo " Model: ${OLLAMA_MODEL}"
echo " Ollama: Docker container (GPU-accelerated)"
if [ -n "$OLLAMA_URL" ] && [ "$OLLAMA_URL" != "http://ollama:11434" ]; then
echo " Ollama: External (${OLLAMA_URL})"
else
echo " Ollama: Docker container (GPU-accelerated)"
fi
echo ""
# -------------------------------------------------------
@@ -285,12 +322,15 @@ echo ""
# Step 2: Detect or configure Ollama
# -------------------------------------------------------
echo "--- Step 2: Configuring Ollama ---"
# Always use the Docker Ollama container with GPU passthrough
# The ollama/ollama image ships with CUDA runtime built-in
USE_DOCKER_OLLAMA=true
OLLAMA_URL="http://ollama:11434"
echo " Using Docker Ollama container (GPU-accelerated via NVIDIA passthrough)"
echo " Host-accessible at localhost:11434"
if [ -n "$OLLAMA_URL" ]; then
USE_DOCKER_OLLAMA=false
echo " Using external Ollama at ${OLLAMA_URL}"
else
USE_DOCKER_OLLAMA=true
OLLAMA_URL="http://ollama:11434"
echo " Using Docker Ollama container (GPU-accelerated via NVIDIA passthrough)"
echo " Host-accessible at localhost:11434"
fi
echo ""
# -------------------------------------------------------