#!/usr/bin/env bash # ------------------------------------------------------------------ # 06_setup_openwebui.sh # Pulls the Open WebUI container image and creates the data directory # for persistent storage (user accounts, chat history, settings). # # Usage: # bash 06_setup_openwebui.sh # ------------------------------------------------------------------ set -euo pipefail SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)" SIF_FILE="${SCRIPT_DIR}/open-webui.sif" DATA_DIR="${SCRIPT_DIR}/openwebui-data" if [ -f "$SIF_FILE" ]; then echo "Open WebUI container already exists at ${SIF_FILE}" echo "Delete it first if you want to rebuild:" echo " rm ${SIF_FILE}" exit 0 fi echo "=== Pulling Open WebUI container image ===" echo " Source: ghcr.io/open-webui/open-webui:main" echo " This may take 5-10 minutes (~4 GB)..." echo "" apptainer pull "$SIF_FILE" docker://ghcr.io/open-webui/open-webui:main mkdir -p "$DATA_DIR" echo "" echo "=== Setup complete ===" echo "Image: ${SIF_FILE} ($(du -sh "$SIF_FILE" | cut -f1))" echo "Data dir: ${DATA_DIR}" echo "" echo "Next: bash 07_start_openwebui.sh"