diff --git a/model-orchestrator/requirements.txt b/model-orchestrator/requirements.txt index fa6e4d3..794b4af 100644 --- a/model-orchestrator/requirements.txt +++ b/model-orchestrator/requirements.txt @@ -4,5 +4,3 @@ httpx==0.25.1 docker==6.1.3 pyyaml==6.0.1 pydantic==2.5.0 -watchdog==3.0.0 -webdavclient3==3.14.6 diff --git a/scripts/start-all.sh b/scripts/start-all.sh deleted file mode 100644 index ce381ce..0000000 --- a/scripts/start-all.sh +++ /dev/null @@ -1,77 +0,0 @@ -#!/bin/bash -# -# Start AI Services with Supervisor -# Starts supervisor daemon which manages ComfyUI and orchestrator -# - -set -e - -WORKSPACE_DIR="${WORKSPACE_DIR:-/workspace}" -SUPERVISORD_CONF="${WORKSPACE_DIR}/supervisord.conf" -AI_DIR="${WORKSPACE_DIR}/ai" - -cd "${AI_DIR}" - -echo "=========================================" -echo " Starting AI Services with Supervisor" -echo "=========================================" -echo "" - -# Check for .env file -if [ ! -f .env ]; then - echo "Warning: .env file not found" - echo "Copy .env.example to .env and add your configuration" - echo "" -fi - -# Source .env if it exists -if [ -f .env ]; then - set -a - source .env - set +a -fi - -# Check if supervisord is already running -if [ -f "${WORKSPACE_DIR}/supervisord.pid" ]; then - PID=$(cat "${WORKSPACE_DIR}/supervisord.pid") - if ps -p "$PID" > /dev/null 2>&1; then - echo "Supervisor is already running (PID: $PID)" - echo "" - echo "Checking service status..." - supervisorctl -c "${SUPERVISORD_CONF}" status - exit 0 - else - echo "Removing stale PID file..." - rm -f "${WORKSPACE_DIR}/supervisord.pid" - fi -fi - -# Start supervisord -echo "Starting Supervisor daemon..." -supervisord -c "${SUPERVISORD_CONF}" - -# Wait a moment for supervisor to start -sleep 2 - -# Check status -echo "" -echo "Service Status:" -echo "---------------" -supervisorctl -c "${SUPERVISORD_CONF}" status - -echo "" -echo "=========================================" -echo "Services started successfully!" -echo "=========================================" -echo "" -echo "Useful commands:" -echo " supervisorctl status - Check status" -echo " supervisorctl start orchestrator - Start orchestrator" -echo " supervisorctl restart comfyui - Restart ComfyUI" -echo " supervisorctl stop all - Stop all services" -echo " supervisorctl tail -f comfyui - Follow ComfyUI logs" -echo "" -echo "Web interface: http://localhost:9001" -echo " Username: admin" -echo " Password: runpod2024" -echo "" diff --git a/scripts/status.sh b/scripts/status.sh deleted file mode 100644 index 3b1dfa8..0000000 --- a/scripts/status.sh +++ /dev/null @@ -1,47 +0,0 @@ -#!/bin/bash -# -# Check AI Services Status -# Shows status of all services managed by Supervisor -# - -WORKSPACE_DIR="${WORKSPACE_DIR:-/workspace}" -SUPERVISORD_CONF="${WORKSPACE_DIR}/supervisord.conf" - -echo "=========================================" -echo " AI Services Status" -echo "=========================================" -echo "" - -# Check if supervisord is running -if [ ! -f "${WORKSPACE_DIR}/supervisord.pid" ]; then - echo "❌ Supervisor is not running" - echo "" - echo "To start services, run:" - echo " bash scripts/start-all.sh" - exit 1 -fi - -PID=$(cat "${WORKSPACE_DIR}/supervisord.pid") -if ! ps -p "$PID" > /dev/null 2>&1; then - echo "❌ Supervisor PID file exists but process is not running" - echo "" - echo "To start services, run:" - echo " bash scripts/start-all.sh" - exit 1 -fi - -echo "✅ Supervisor is running (PID: $PID)" -echo "" - -# Show service status -echo "Service Status:" -echo "---------------" -supervisorctl -c "${SUPERVISORD_CONF}" status - -echo "" -echo "Useful commands:" -echo " supervisorctl start orchestrator - Start orchestrator" -echo " supervisorctl restart comfyui - Restart ComfyUI" -echo " supervisorctl stop all - Stop all services" -echo " supervisorctl tail -f comfyui - Follow ComfyUI logs" -echo "" diff --git a/scripts/stop-all.sh b/scripts/stop-all.sh deleted file mode 100644 index 31fd6e3..0000000 --- a/scripts/stop-all.sh +++ /dev/null @@ -1,49 +0,0 @@ -#!/bin/bash -# -# Stop AI Services -# Gracefully stops all services managed by Supervisor -# - -set -e - -WORKSPACE_DIR="${WORKSPACE_DIR:-/workspace}" -SUPERVISORD_CONF="${WORKSPACE_DIR}/supervisord.conf" - -echo "=========================================" -echo " Stopping AI Services" -echo "=========================================" -echo "" - -# Check if supervisord is running -if [ ! -f "${WORKSPACE_DIR}/supervisord.pid" ]; then - echo "Supervisor is not running (no PID file found)" - echo "Cleaning up any stray processes..." - pkill -f "orchestrator_subprocess.py" || echo " - Orchestrator not running" - pkill -f "ComfyUI.*main.py" || echo " - ComfyUI not running" - echo "" - echo "All services stopped" - exit 0 -fi - -PID=$(cat "${WORKSPACE_DIR}/supervisord.pid") -if ! ps -p "$PID" > /dev/null 2>&1; then - echo "Supervisor PID file exists but process is not running" - echo "Removing stale PID file..." - rm -f "${WORKSPACE_DIR}/supervisord.pid" - echo "" - echo "All services stopped" - exit 0 -fi - -# Stop all supervised services -echo "Stopping all supervised services..." -supervisorctl -c "${SUPERVISORD_CONF}" stop all - -sleep 2 - -# Shutdown supervisord -echo "Shutting down Supervisor daemon..." -supervisorctl -c "${SUPERVISORD_CONF}" shutdown - -echo "" -echo "All services stopped" diff --git a/supervisord.conf b/supervisord.conf index a872e3f..84f7551 100644 --- a/supervisord.conf +++ b/supervisord.conf @@ -58,8 +58,8 @@ stopwaitsecs=30 # ComfyUI WebDAV Sync Service [program:webdav-sync] -command=python3 /workspace/ai/scripts/comfyui_webdav_sync.py -directory=/workspace/ai +command=python3 /workspace/ai/webdav-sync/webdav_sync.py +directory=/workspace/ai/webdav-sync autostart=true autorestart=true startretries=3 diff --git a/webdav-sync/requirements.txt b/webdav-sync/requirements.txt new file mode 100644 index 0000000..0b2548a --- /dev/null +++ b/webdav-sync/requirements.txt @@ -0,0 +1,2 @@ +watchdog==3.0.0 +webdavclient3==3.14.6 diff --git a/scripts/comfyui_webdav_sync.py b/webdav-sync/webdav_sync.py similarity index 100% rename from scripts/comfyui_webdav_sync.py rename to webdav-sync/webdav_sync.py