diff --git a/coordinator/Makefile b/coordinator/Makefile index 54aa7ae..faab4ee 100644 --- a/coordinator/Makefile +++ b/coordinator/Makefile @@ -1,6 +1,6 @@ .DEFAULT_GOAL := help -.PHONY: help build run test test-integration vet lint tidy check migrate-up migrate-down up down down-clean logs ps rebuild psql smoke demo-ui demo-down demo-logs +.PHONY: help build run test test-integration vet lint tidy check migrate-up migrate-down up down down-clean logs ps rebuild psql smoke demo-ui demo-down demo-reset demo-logs # `check` deliberately uses its own Compose project and host ports. This keeps # it from connecting to or replacing a developer's local PostgreSQL instance. @@ -33,6 +33,7 @@ help: ' make demo-ui [WORKERS=3] Start isolated UI demo services and local workers.' \ ' make demo-logs Follow coordinator logs for the UI demo.' \ ' make demo-down Stop the demo services and workers.' \ + ' make demo-reset Stop the demo and wipe its data volumes.' \ ' make test / make vet Run Go verification.' \ '' \ 'Demo UI: http://localhost:18080/ui (login page; admin root@scimesh.local / rootpassword).' @@ -56,6 +57,15 @@ demo-down: DEMO_DIR="$(DEMO_DIR)" \ ./scripts/demo-ui.sh stop +demo-reset: + @DEMO_PROJECT="$(DEMO_PROJECT)" \ + DEMO_POSTGRES_PORT="$(DEMO_POSTGRES_PORT)" \ + DEMO_COORDINATOR_PORT="$(DEMO_COORDINATOR_PORT)" \ + DEMO_UI_TOKEN="$(DEMO_UI_TOKEN)" \ + DEMO_WORKER_TOKEN="$(DEMO_WORKER_TOKEN)" \ + DEMO_DIR="$(DEMO_DIR)" \ + ./scripts/demo-ui.sh reset + demo-logs: @DEMO_PROJECT="$(DEMO_PROJECT)" \ DEMO_POSTGRES_PORT="$(DEMO_POSTGRES_PORT)" \ diff --git a/coordinator/scripts/demo-ui.sh b/coordinator/scripts/demo-ui.sh index 3d58183..92d40f2 100755 --- a/coordinator/scripts/demo-ui.sh +++ b/coordinator/scripts/demo-ui.sh @@ -177,12 +177,19 @@ case "$action" in compose down echo "SciMesh manual demo stopped." ;; + reset) + # Like stop, but also drops the data volumes so the next start is pristine + # (empty Postgres, no leftover workers/jobs/tasks, no cached artifacts). + stop_workers + compose down -v + echo "SciMesh manual demo stopped and data volumes removed." + ;; logs) echo "Worker logs: $logs_dir" compose logs -f coordinator ;; *) - echo "Usage: $0 {start|stop|logs}" >&2 + echo "Usage: $0 {start|stop|reset|logs}" >&2 exit 2 ;; esac