33800 Docs

← Retour

Task: Système Pause/Resume AI-Orchestrator

Date : 24/01/2026 09:57 Status : TERMINÉ ET TESTÉ ✅

Objectif

Permettre de mettre en pause le traitement des jobs IA pour libérer le GPU (RTX 3090) quand l'utilisateur veut jouer à un jeu.

Implémentation

Backend (ai-orchestrator)

Nouvelle clé Redis :

WORKER_PAUSED_KEY = "ai:worker:paused"

Modification worker loop :

Nouveaux endpoints : | Endpoint | Méthode | Description | |----------|---------|-------------| | /api/worker/status | GET | Retourne {status: "running"|"paused"} | | /api/worker/pause | POST | Met en pause, option stop_tools=true | | /api/worker/resume | POST | Reprend le traitement |

Frontend (Dashboard)

Modifications CSS :

Modifications HTML :

Fonctions JavaScript :

Fichiers modifiés

Fichier Lignes ajoutées
ai-orchestrator/app/main.py +63
monitoring/generate.d/20-ai-jobs.sh +150

Commits

Tests effectués

# Test status
curl http://192.168.1.12:5501/api/worker/status
# → {"status":"running","active_tool":null}

# Test pause
curl -X POST "http://192.168.1.12:5501/api/worker/pause?stop_tools=false"
# → {"status":"paused","stopped_tools":[],"message":"..."}

# Test resume
curl -X POST "http://192.168.1.12:5501/api/worker/resume"
# → {"status":"running","pending_jobs":87655,"message":"..."}

Utilisation

Quand tu veux jouer :

  1. Va sur https://dashboard.nowhere84.com/ai-jobs.html
  2. Clique sur le bouton "Pause" (orange)
  3. Les outils IA s'arrêtent, VRAM libérée
  4. Joue tranquille

Quand tu as fini de jouer :

  1. Clique sur le bouton "Resume" (vert)
  2. Le worker reprend le traitement des jobs

Ou via curl :

# Pause (arrête les outils pour libérer VRAM)
curl -X POST "https://ai-orchestrator.33800.nowhere84.com/api/worker/pause?stop_tools=true"

# Resume
curl -X POST "https://ai-orchestrator.33800.nowhere84.com/api/worker/resume"