diff --git a/scripts/deploy-rsync.zsh b/scripts/deploy-rsync.zsh new file mode 100755 index 0000000..b802066 --- /dev/null +++ b/scripts/deploy-rsync.zsh @@ -0,0 +1,23 @@ +#!/usr/bin/env zsh +set -euo pipefail + +repo_root="$(cd -- "$(dirname -- "$0")/.." && pwd)" +remote="${EVANESCERE_DEPLOY_REMOTE:-felis@192.168.1.44}" +remote_dir="${EVANESCERE_DEPLOY_DIR:-~/evanescere/}" + +print "Syncing Evanescere to ${remote}:${remote_dir}" +print "Keeping remote config.toml and storage/ untouched." + +rsync -az --delete --progress \ + --exclude ".git/" \ + --exclude "config.toml" \ + --exclude "storage/" \ + --exclude "frontend/node_modules/" \ + --exclude "frontend/dist/" \ + --exclude "__pycache__/" \ + --exclude ".pytest_cache/" \ + "${repo_root}/" "${remote}:${remote_dir}" + +print +print "Sync complete. Rebuild on the Framework box with:" +print " ssh ${remote} 'cd ${remote_dir} && docker compose up -d --build'" diff --git a/scripts/reset-prod-queue.zsh b/scripts/reset-prod-queue.zsh new file mode 100755 index 0000000..392fff8 --- /dev/null +++ b/scripts/reset-prod-queue.zsh @@ -0,0 +1,143 @@ +#!/usr/bin/env zsh +set -euo pipefail + +remote="${EVANESCERE_DEPLOY_REMOTE:-felis@192.168.1.44}" +remote_dir="${EVANESCERE_DEPLOY_DIR:-/home/felis/evanescere}" +reset_mode="${EVANESCERE_RESET_MODE:-baseline}" +assume_yes=false + +while (( $# > 0 )); do + case "$1" in + --yes|-y) + assume_yes=true + shift + ;; + --pending) + reset_mode="pending" + shift + ;; + --baseline) + reset_mode="baseline" + shift + ;; + *) + print -u2 "Unknown argument: $1" + print -u2 "Usage: $0 [--yes] [--baseline|--pending]" + exit 2 + ;; + esac +done + +if [[ "$reset_mode" != "baseline" && "$reset_mode" != "pending" ]]; then + print -u2 "EVANESCERE_RESET_MODE must be baseline or pending." + exit 2 +fi + +print "This will reset queued/running Evanescere jobs on ${remote}:${remote_dir}" +print +print "Actions:" +print " - stop scheduler, worker-ai, and worker-media" +print " - flush the project Redis database" +print " - mark non-terminal pipeline runs as cancelled" +print " - reset queued/running clip render and upload statuses to pending" +if [[ "$reset_mode" == "baseline" ]]; then + print " - mark affected queued/running videos as existing_done/done so they will not auto-requeue" +else + print " - mark affected queued/running videos as stable/pending so scheduler can queue them again" +fi +print " - restart the Compose stack" +print + +if [[ "$assume_yes" != true ]]; then + printf "Continue? [y/N] " + read -r reply + if [[ ! "$reply" =~ '^[Yy]$' ]]; then + print "Cancelled." + exit 0 + fi +fi + +ssh "$remote" \ + "EVANESCERE_DEPLOY_DIR=${remote_dir:q} EVANESCERE_RESET_MODE=${reset_mode:q} zsh -s" <<'REMOTE' +set -euo pipefail + +cd "$EVANESCERE_DEPLOY_DIR" + +docker compose stop scheduler worker-ai worker-media +docker compose exec -T redis redis-cli FLUSHDB