From a22afa22584a30c18c86ea4e4ec51ff50c66ca7e Mon Sep 17 00:00:00 2001 From: Folzo Date: Mon, 6 Apr 2026 08:08:58 +0200 Subject: [PATCH] Add WOL auto-start scripts and documentation - check-services.sh: Verify all services after WOL - start-all-services.sh: Start all containers after boot - WOL-ET-DEMARRAGE-AUTO.md: Complete guide for auto-start - Ensure ComfyUI starts automatically with Docker --- .../custom_nodes/ComfyUI-Advanced-ControlNet | 1 + .../custom_nodes/ComfyUI-AnimateDiff-Evolved | 1 + comfyui/custom_nodes/ComfyUI-Custom-Scripts | 1 + comfyui/custom_nodes/ComfyUI-GGUF | 1 + comfyui/custom_nodes/ComfyUI-Impact-Pack | 1 + comfyui/custom_nodes/ComfyUI-Impact-Subpack | 1 + comfyui/custom_nodes/ComfyUI-Inspire-Pack | 1 + comfyui/custom_nodes/ComfyUI-Manager | 1 + comfyui/custom_nodes/ComfyUI-VideoHelperSuite | 1 + comfyui/custom_nodes/ComfyUI_FaceAnalysis | 1 + comfyui/custom_nodes/ComfyUI_IPAdapter_plus | 1 + comfyui/custom_nodes/ComfyUI_InstantID | 1 + comfyui/custom_nodes/ComfyUI_essentials | 1 + comfyui/custom_nodes/PuLID_ComfyUI | 1 + comfyui/custom_nodes/cg-use-everywhere | 1 + comfyui/custom_nodes/comfyui_controlnet_aux | 1 + comfyui/custom_nodes/example_node.py.example | 130 ++++++++ comfyui/custom_nodes/was-node-suite-comfyui | 1 + comfyui/custom_nodes/websocket_image_save.py | 44 +++ docs/WOL-ET-DEMARRAGE-AUTO.md | 286 ++++++++++++++++++ scripts/check-services.sh | 72 +++++ scripts/start-all-services.sh | 112 +++++++ 22 files changed, 661 insertions(+) create mode 160000 comfyui/custom_nodes/ComfyUI-Advanced-ControlNet create mode 160000 comfyui/custom_nodes/ComfyUI-AnimateDiff-Evolved create mode 160000 comfyui/custom_nodes/ComfyUI-Custom-Scripts create mode 160000 comfyui/custom_nodes/ComfyUI-GGUF create mode 160000 comfyui/custom_nodes/ComfyUI-Impact-Pack create mode 160000 comfyui/custom_nodes/ComfyUI-Impact-Subpack create mode 160000 comfyui/custom_nodes/ComfyUI-Inspire-Pack create mode 160000 comfyui/custom_nodes/ComfyUI-Manager create mode 160000 comfyui/custom_nodes/ComfyUI-VideoHelperSuite create mode 160000 comfyui/custom_nodes/ComfyUI_FaceAnalysis create mode 160000 comfyui/custom_nodes/ComfyUI_IPAdapter_plus create mode 160000 comfyui/custom_nodes/ComfyUI_InstantID create mode 160000 comfyui/custom_nodes/ComfyUI_essentials create mode 160000 comfyui/custom_nodes/PuLID_ComfyUI create mode 160000 comfyui/custom_nodes/cg-use-everywhere create mode 160000 comfyui/custom_nodes/comfyui_controlnet_aux create mode 100644 comfyui/custom_nodes/example_node.py.example create mode 160000 comfyui/custom_nodes/was-node-suite-comfyui create mode 100644 comfyui/custom_nodes/websocket_image_save.py create mode 100644 docs/WOL-ET-DEMARRAGE-AUTO.md create mode 100755 scripts/check-services.sh create mode 100755 scripts/start-all-services.sh diff --git a/comfyui/custom_nodes/ComfyUI-Advanced-ControlNet b/comfyui/custom_nodes/ComfyUI-Advanced-ControlNet new file mode 160000 index 0000000..b03791e --- /dev/null +++ b/comfyui/custom_nodes/ComfyUI-Advanced-ControlNet @@ -0,0 +1 @@ +Subproject commit b03791e4560482d44236788af2f4fb9b58c31452 diff --git a/comfyui/custom_nodes/ComfyUI-AnimateDiff-Evolved b/comfyui/custom_nodes/ComfyUI-AnimateDiff-Evolved new file mode 160000 index 0000000..d8d163c --- /dev/null +++ b/comfyui/custom_nodes/ComfyUI-AnimateDiff-Evolved @@ -0,0 +1 @@ +Subproject commit d8d163cd90b1111f6227495e3467633676fbb346 diff --git a/comfyui/custom_nodes/ComfyUI-Custom-Scripts b/comfyui/custom_nodes/ComfyUI-Custom-Scripts new file mode 160000 index 0000000..609f3af --- /dev/null +++ b/comfyui/custom_nodes/ComfyUI-Custom-Scripts @@ -0,0 +1 @@ +Subproject commit 609f3afaa74b2f88ef9ce8d939626065e3247469 diff --git a/comfyui/custom_nodes/ComfyUI-GGUF b/comfyui/custom_nodes/ComfyUI-GGUF new file mode 160000 index 0000000..6ea2651 --- /dev/null +++ b/comfyui/custom_nodes/ComfyUI-GGUF @@ -0,0 +1 @@ +Subproject commit 6ea2651e7df66d7585f6ffee804b20e92fb38b8a diff --git a/comfyui/custom_nodes/ComfyUI-Impact-Pack b/comfyui/custom_nodes/ComfyUI-Impact-Pack new file mode 160000 index 0000000..6a517eb --- /dev/null +++ b/comfyui/custom_nodes/ComfyUI-Impact-Pack @@ -0,0 +1 @@ +Subproject commit 6a517ebe06fea2b74fc41b3bd089c0d7173eeced diff --git a/comfyui/custom_nodes/ComfyUI-Impact-Subpack b/comfyui/custom_nodes/ComfyUI-Impact-Subpack new file mode 160000 index 0000000..50c7b71 --- /dev/null +++ b/comfyui/custom_nodes/ComfyUI-Impact-Subpack @@ -0,0 +1 @@ +Subproject commit 50c7b71a6a224734cc9b21963c6d1926816a97f1 diff --git a/comfyui/custom_nodes/ComfyUI-Inspire-Pack b/comfyui/custom_nodes/ComfyUI-Inspire-Pack new file mode 160000 index 0000000..d23db9a --- /dev/null +++ b/comfyui/custom_nodes/ComfyUI-Inspire-Pack @@ -0,0 +1 @@ +Subproject commit d23db9aa544de9a6d4c609cb7005fa9e0d42031d diff --git a/comfyui/custom_nodes/ComfyUI-Manager b/comfyui/custom_nodes/ComfyUI-Manager new file mode 160000 index 0000000..3615af1 --- /dev/null +++ b/comfyui/custom_nodes/ComfyUI-Manager @@ -0,0 +1 @@ +Subproject commit 3615af1560158c73e1700cbf1df1c60d23fb3e79 diff --git a/comfyui/custom_nodes/ComfyUI-VideoHelperSuite b/comfyui/custom_nodes/ComfyUI-VideoHelperSuite new file mode 160000 index 0000000..4498399 --- /dev/null +++ b/comfyui/custom_nodes/ComfyUI-VideoHelperSuite @@ -0,0 +1 @@ +Subproject commit 449839959f0153fb8a57211a9364c55163935ca9 diff --git a/comfyui/custom_nodes/ComfyUI_FaceAnalysis b/comfyui/custom_nodes/ComfyUI_FaceAnalysis new file mode 160000 index 0000000..8846653 --- /dev/null +++ b/comfyui/custom_nodes/ComfyUI_FaceAnalysis @@ -0,0 +1 @@ +Subproject commit 8846653446a6b13582da11793faf950325a398e0 diff --git a/comfyui/custom_nodes/ComfyUI_IPAdapter_plus b/comfyui/custom_nodes/ComfyUI_IPAdapter_plus new file mode 160000 index 0000000..a0f451a --- /dev/null +++ b/comfyui/custom_nodes/ComfyUI_IPAdapter_plus @@ -0,0 +1 @@ +Subproject commit a0f451a5113cf9becb0847b92884cb10cbdec0ef diff --git a/comfyui/custom_nodes/ComfyUI_InstantID b/comfyui/custom_nodes/ComfyUI_InstantID new file mode 160000 index 0000000..72495e8 --- /dev/null +++ b/comfyui/custom_nodes/ComfyUI_InstantID @@ -0,0 +1 @@ +Subproject commit 72495e806bc2ab9c41581e15ccaa1bcf83c477e8 diff --git a/comfyui/custom_nodes/ComfyUI_essentials b/comfyui/custom_nodes/ComfyUI_essentials new file mode 160000 index 0000000..9d9f4be --- /dev/null +++ b/comfyui/custom_nodes/ComfyUI_essentials @@ -0,0 +1 @@ +Subproject commit 9d9f4bedfc9f0321c19faf71855e228c93bd0dc9 diff --git a/comfyui/custom_nodes/PuLID_ComfyUI b/comfyui/custom_nodes/PuLID_ComfyUI new file mode 160000 index 0000000..93e0c4c --- /dev/null +++ b/comfyui/custom_nodes/PuLID_ComfyUI @@ -0,0 +1 @@ +Subproject commit 93e0c4c226b87b23c0009d671978bad0e77289ff diff --git a/comfyui/custom_nodes/cg-use-everywhere b/comfyui/custom_nodes/cg-use-everywhere new file mode 160000 index 0000000..a3952a4 --- /dev/null +++ b/comfyui/custom_nodes/cg-use-everywhere @@ -0,0 +1 @@ +Subproject commit a3952a4480a07fc3df03ec8be315dfcd11bd5135 diff --git a/comfyui/custom_nodes/comfyui_controlnet_aux b/comfyui/custom_nodes/comfyui_controlnet_aux new file mode 160000 index 0000000..95a13e2 --- /dev/null +++ b/comfyui/custom_nodes/comfyui_controlnet_aux @@ -0,0 +1 @@ +Subproject commit 95a13e2e5d8f8ae57583fbebb0be1f670889858b diff --git a/comfyui/custom_nodes/example_node.py.example b/comfyui/custom_nodes/example_node.py.example new file mode 100644 index 0000000..779c357 --- /dev/null +++ b/comfyui/custom_nodes/example_node.py.example @@ -0,0 +1,130 @@ +from typing_extensions import override + +from comfy_api.latest import ComfyExtension, io + + +class Example(io.ComfyNode): + """ + An example node + + Class methods + ------------- + define_schema (io.Schema): + Tell the main program the metadata, input, output parameters of nodes. + fingerprint_inputs: + optional method to control when the node is re executed. + check_lazy_status: + optional method to control list of input names that need to be evaluated. + + """ + + @classmethod + def define_schema(cls) -> io.Schema: + """ + Return a schema which contains all information about the node. + Some types: "Model", "Vae", "Clip", "Conditioning", "Latent", "Image", "Int", "String", "Float", "Combo". + For outputs the "io.Model.Output" should be used, for inputs the "io.Model.Input" can be used. + The type can be a "Combo" - this will be a list for selection. + """ + return io.Schema( + node_id="Example", + display_name="Example Node", + category="Example", + inputs=[ + io.Image.Input("image"), + io.Int.Input( + "int_field", + min=0, + max=4096, + step=64, # Slider's step + display_mode=io.NumberDisplay.number, # Cosmetic only: display as "number" or "slider" + lazy=True, # Will only be evaluated if check_lazy_status requires it + ), + io.Float.Input( + "float_field", + default=1.0, + min=0.0, + max=10.0, + step=0.01, + round=0.001, #The value representing the precision to round to, will be set to the step value by default. Can be set to False to disable rounding. + display_mode=io.NumberDisplay.number, + lazy=True, + ), + io.Combo.Input("print_to_screen", options=["enable", "disable"]), + io.String.Input( + "string_field", + multiline=False, # True if you want the field to look like the one on the ClipTextEncode node + default="Hello world!", + lazy=True, + ) + ], + outputs=[ + io.Image.Output(), + ], + ) + + @classmethod + def check_lazy_status(cls, image, string_field, int_field, float_field, print_to_screen): + """ + Return a list of input names that need to be evaluated. + + This function will be called if there are any lazy inputs which have not yet been + evaluated. As long as you return at least one field which has not yet been evaluated + (and more exist), this function will be called again once the value of the requested + field is available. + + Any evaluated inputs will be passed as arguments to this function. Any unevaluated + inputs will have the value None. + """ + if print_to_screen == "enable": + return ["int_field", "float_field", "string_field"] + else: + return [] + + @classmethod + def execute(cls, image, string_field, int_field, float_field, print_to_screen) -> io.NodeOutput: + if print_to_screen == "enable": + print(f"""Your input contains: + string_field aka input text: {string_field} + int_field: {int_field} + float_field: {float_field} + """) + #do some processing on the image, in this example I just invert it + image = 1.0 - image + return io.NodeOutput(image) + + """ + The node will always be re executed if any of the inputs change but + this method can be used to force the node to execute again even when the inputs don't change. + You can make this node return a number or a string. This value will be compared to the one returned the last time the node was + executed, if it is different the node will be executed again. + This method is used in the core repo for the LoadImage node where they return the image hash as a string, if the image hash + changes between executions the LoadImage node is executed again. + """ + #@classmethod + #def fingerprint_inputs(s, image, string_field, int_field, float_field, print_to_screen): + # return "" + +# Set the web directory, any .js file in that directory will be loaded by the frontend as a frontend extension +# WEB_DIRECTORY = "./somejs" + + +# Add custom API routes, using router +from aiohttp import web +from server import PromptServer + +@PromptServer.instance.routes.get("/hello") +async def get_hello(request): + return web.json_response("hello") + + +class ExampleExtension(ComfyExtension): + @override + async def get_node_list(self) -> list[type[io.ComfyNode]]: + return [ + Example, + ] + + +async def comfy_entrypoint() -> ExampleExtension: # ComfyUI calls this to load your extension and its nodes. + return ExampleExtension() diff --git a/comfyui/custom_nodes/was-node-suite-comfyui b/comfyui/custom_nodes/was-node-suite-comfyui new file mode 160000 index 0000000..afeee09 --- /dev/null +++ b/comfyui/custom_nodes/was-node-suite-comfyui @@ -0,0 +1 @@ +Subproject commit afeee09ba44e713ec52a413ac6b105fd06b2d356 diff --git a/comfyui/custom_nodes/websocket_image_save.py b/comfyui/custom_nodes/websocket_image_save.py new file mode 100644 index 0000000..15f87f9 --- /dev/null +++ b/comfyui/custom_nodes/websocket_image_save.py @@ -0,0 +1,44 @@ +from PIL import Image +import numpy as np +import comfy.utils +import time + +#You can use this node to save full size images through the websocket, the +#images will be sent in exactly the same format as the image previews: as +#binary images on the websocket with a 8 byte header indicating the type +#of binary message (first 4 bytes) and the image format (next 4 bytes). + +#Note that no metadata will be put in the images saved with this node. + +class SaveImageWebsocket: + @classmethod + def INPUT_TYPES(s): + return {"required": + {"images": ("IMAGE", ),} + } + + RETURN_TYPES = () + FUNCTION = "save_images" + + OUTPUT_NODE = True + + CATEGORY = "api/image" + + def save_images(self, images): + pbar = comfy.utils.ProgressBar(images.shape[0]) + step = 0 + for image in images: + i = 255. * image.cpu().numpy() + img = Image.fromarray(np.clip(i, 0, 255).astype(np.uint8)) + pbar.update_absolute(step, images.shape[0], ("PNG", img, None)) + step += 1 + + return {} + + @classmethod + def IS_CHANGED(s, images): + return time.time() + +NODE_CLASS_MAPPINGS = { + "SaveImageWebsocket": SaveImageWebsocket, +} diff --git a/docs/WOL-ET-DEMARRAGE-AUTO.md b/docs/WOL-ET-DEMARRAGE-AUTO.md new file mode 100644 index 0000000..d8d2a08 --- /dev/null +++ b/docs/WOL-ET-DEMARRAGE-AUTO.md @@ -0,0 +1,286 @@ +# 🔌 Wake On LAN (WOL) et DĂ©marrage Automatique + +Guide pour s'assurer que tous les services Effi dĂ©marrent automatiquement aprĂšs un WOL. + +--- + +## 📋 Architecture des services sur folzo-Corp + +| Service | Port | Docker | DĂ©pendance WOL | +|---------|------|--------|----------------| +| **Ollama** | 11434 | ✅ | Oui | +| **Effi-STT** | 8200 | ✅ | Oui | +| **openedai-speech** | 8100 | ✅ | Oui | +| **ComfyUI** | 8188 | ✅ | Oui | + +--- + +## 🚀 Configuration du dĂ©marrage automatique + +### 1. Activer Docker au boot + +Sur **folzo-Corp**, exĂ©cutez une fois : + +```bash +sudo systemctl enable docker +``` + +Cela garantit que Docker dĂ©marre automatiquement Ă  chaque boot. + +### 2. VĂ©rifier la politique de redĂ©marrage des conteneurs + +Tous les services Docker doivent avoir `restart: unless-stopped` dans leur `docker-compose.yml`. + +**VĂ©rification :** +```bash +# VĂ©rifier les politiques de redĂ©marrage +sudo docker inspect -f '{{.Name}} - {{.HostConfig.RestartPolicy.Name}}' $(sudo docker ps -aq) +``` + +**RĂ©sultat attendu :** +``` +/ollama - unless-stopped +/comfyui - unless-stopped +/effi-stt - unless-stopped +/openedai-speech - unless-stopped +``` + +Si un conteneur n'a pas `unless-stopped`, modifiez son `docker-compose.yml` et redĂ©marrez-le. + +--- + +## ⚡ ProcĂ©dure aprĂšs un WOL + +### MĂ©thode 1 : Script automatique (recommandĂ©) + +AprĂšs que folzo-Corp soit rĂ©veillĂ© par WOL, exĂ©cutez sur le PC : + +```bash +~/Documents/OpenCode/Projets/Effi/scripts/start-all-services.sh +``` + +Ce script va : +1. DĂ©marrer Docker si nĂ©cessaire +2. DĂ©marrer tous les conteneurs +3. VĂ©rifier que tout rĂ©pond correctement + +### MĂ©thode 2 : VĂ©rification rapide + +Pour vĂ©rifier que tout fonctionne : + +```bash +~/Documents/OpenCode/Projets/Effi/scripts/check-services.sh +``` + +### MĂ©thode 3 : DĂ©marrage manuel + +Si vous prĂ©fĂ©rez dĂ©marrer un service spĂ©cifique : + +```bash +# Ollama +cd ~ && sudo docker compose up -d + +# ComfyUI +cd ~/Documents/OpenCode/Projets/Effi/comfyui && sudo docker compose up -d + +# Effi-STT +cd ~/Documents/OpenCode/Projets/Effi/effi-stt && sudo docker compose up -d + +# openedai-speech +cd ~/openedai-speech && sudo docker compose up -d +``` + +--- + +## 🔄 CrĂ©er un dĂ©marrage automatique complet + +### Option A : Script au boot (systemd) + +CrĂ©er un service systemd qui dĂ©marre tous les conteneurs : + +```bash +# CrĂ©er le fichier de service +sudo tee /etc/systemd/system/effi-services.service > /dev/null < /dev/null 2>&1 +``` + +--- + +## đŸ§Ș Test du WOL complet + +### ProcĂ©dure de test + +1. **Éteindre folzo-Corp** normalement +2. **Attendre 10 secondes** +3. **Envoyer le paquet WOL** depuis effi-server : + ```bash + wakeonlan XX:XX:XX:XX:XX:XX # MAC de folzo-Corp + ``` +4. **Attendre le boot** (~30-60 secondes) +5. **VĂ©rifier les services** : + ```bash + ssh folzo@192.168.1.11 "~/Documents/OpenCode/Projets/Effi/scripts/check-services.sh" + ``` +6. **Tester une gĂ©nĂ©ration d'image** via OpenWebUI + +### Si un service ne dĂ©marre pas + +```bash +# Voir les logs d'un service +sudo docker logs comfyui + +# RedĂ©marrer un service spĂ©cifique +sudo docker restart comfyui + +# VĂ©rifier l'Ă©tat de tous les conteneurs +sudo docker ps -a +``` + +--- + +## 📊 Monitoring + +### VĂ©rifier l'Ă©tat des services + +```bash +# Tous les services +sudo docker ps --format "table {{.Names}}\t{{.Status}}\t{{.Ports}}" + +# Utilisation GPU +rocm-smi + +# Espace disque +df -h +``` + +### Alertes + +Si un service est down, vous pouvez crĂ©er une alerte simple : + +```bash +# Dans le crontab +crontab -e + +# VĂ©rifier toutes les minutes et envoyer notification si KO +* * * * * /home/folzo/Documents/OpenCode/Projets/Effi/scripts/check-services.sh || echo "Services Effi down" | mail -s "Alerte Effi" votre@email.com +``` + +--- + +## 🐛 DĂ©pannage + +### ProblĂšme : Docker ne dĂ©marre pas au boot + +```bash +# VĂ©rifier l'Ă©tat +sudo systemctl status docker + +# Activer au boot +sudo systemctl enable docker + +# DĂ©marrer manuellement +sudo systemctl start docker +``` + +### ProblĂšme : Les conteneurs ne dĂ©marrent pas + +```bash +# VĂ©rifier la politique de redĂ©marrage +sudo docker inspect -f '{{.Name}} - {{.HostConfig.RestartPolicy.Name}}' comfyui + +# Si ce n'est pas "unless-stopped", le corriger +cd ~/Documents/OpenCode/Projets/Effi/comfyui +sudo docker compose up -d +``` + +### ProblĂšme : ComfyUI ne rĂ©pond pas aprĂšs WOL + +Cela arrive si ROCm n'est pas prĂȘt. Solution : + +```bash +# Attendre que le GPU soit prĂȘt +sleep 10 + +# RedĂ©marrer ComfyUI +sudo docker restart comfyui + +# VĂ©rifier les logs +sudo docker logs comfyui | tail -20 +``` + +### ProblĂšme : Timeout aprĂšs WOL + +Si les services mettent trop de temps Ă  rĂ©pondre aprĂšs un WOL : + +1. **Augmenter le dĂ©lai d'attente** dans le script +2. **VĂ©rifier les performances du disque** (peut-ĂȘtre en veille) +3. **DĂ©sactiver la veille du disque** : + ```bash + sudo hdparm -S 0 /dev/sda # DĂ©sactiver la veille + ``` + +--- + +## ✅ Checklist post-WOL + +AprĂšs chaque WOL, vĂ©rifiez : + +- [ ] Docker est dĂ©marrĂ© : `sudo systemctl is-active docker` +- [ ] Ollama rĂ©pond : `curl http://localhost:11434` +- [ ] ComfyUI rĂ©pond : `curl http://localhost:8188` +- [ ] Effi-STT rĂ©pond : `curl http://localhost:8200/health` +- [ ] openedai-speech rĂ©pond : `curl http://localhost:8100/health` +- [ ] GPU disponible : `rocm-smi` +- [ ] Test de gĂ©nĂ©ration d'image via OpenWebUI + +--- + +## 📝 RĂ©sumĂ© des commandes utiles + +| Action | Commande | +|--------|----------| +| Tout dĂ©marrer | `~/Documents/OpenCode/Projets/Effi/scripts/start-all-services.sh` | +| VĂ©rifier les services | `~/Documents/OpenCode/Projets/Effi/scripts/check-services.sh` | +| Activer dĂ©marrage auto | `sudo systemctl enable docker` | +| Voir les logs | `sudo docker logs ` | +| RedĂ©marrer un service | `sudo docker restart ` | +| Voir tous les conteneurs | `sudo docker ps -a` | +| État du GPU | `rocm-smi` | + +--- + +**Note** : Pour une expĂ©rience optimale, configurez le service systemd (Option A) pour un dĂ©marrage 100% automatique sans intervention. + +*Document créé le 6 avril 2026* diff --git a/scripts/check-services.sh b/scripts/check-services.sh new file mode 100755 index 0000000..7840707 --- /dev/null +++ b/scripts/check-services.sh @@ -0,0 +1,72 @@ +#!/bin/bash +# Script de vĂ©rification des services Effi aprĂšs WOL +# À exĂ©cuter sur folzo-Corp aprĂšs rĂ©veil du PC + +echo "================================" +echo "VĂ©rification des services Effi" +echo "================================" +echo "" + +# Fonction de vĂ©rification +check_service() { + local name=$1 + local url=$2 + + echo -n "VĂ©rification $name... " + if curl -s "$url" > /dev/null 2>&1; then + echo "✅ OK" + return 0 + else + echo "❌ KO" + return 1 + fi +} + +# VĂ©rifier les services +check_service "Ollama" "http://localhost:11434" +check_service "ComfyUI" "http://localhost:8188" +check_service "Effi-STT" "http://localhost:8200/health" +check_service "openedai-speech" "http://localhost:8100/health" + +echo "" +echo "================================" +echo "VĂ©rification Docker" +echo "================================" +echo "" + +# VĂ©rifier Docker +if ! systemctl is-active --quiet docker; then + echo "Docker n'est pas dĂ©marrĂ© ! DĂ©marrage..." + sudo systemctl start docker + sleep 5 +fi + +# VĂ©rifier les conteneurs +echo "Conteneurs Docker :" +sudo docker ps --format "table {{.Names}}\t{{.Status}}\t{{.Ports}}" + +echo "" +echo "================================" + +# RedĂ©marrer les services si nĂ©cessaire +if ! check_service "ComfyUI" "http://localhost:8188"; then + echo "" + echo "RedĂ©marrage de ComfyUI..." + cd ~/Documents/OpenCode/Projets/Effi/comfyui + sudo docker compose up -d + echo "ComfyUI redĂ©marrĂ© !" +fi + +echo "" +echo "================================" +echo "RĂ©sumĂ©" +echo "================================" +echo "" +echo "Si un service est KO :" +echo " - Ollama: sudo docker start ollama" +echo " - ComfyUI: cd ~/Documents/OpenCode/Projets/Effi/comfyui && sudo docker compose up -d" +echo " - Effi-STT: cd ~/Documents/OpenCode/Projets/Effi/effi-stt && sudo docker compose up -d" +echo " - openedai-speech: cd ~/openedai-speech && sudo docker compose up -d" +echo "" +echo "Pour tout redĂ©marrer:" +echo " ~/Documents/OpenCode/Projets/Effi/scripts/start-all-services.sh" diff --git a/scripts/start-all-services.sh b/scripts/start-all-services.sh new file mode 100755 index 0000000..f00a53f --- /dev/null +++ b/scripts/start-all-services.sh @@ -0,0 +1,112 @@ +#!/bin/bash +# Script de dĂ©marrage de tous les services Effi +# À exĂ©cuter sur folzo-Corp aprĂšs un boot ou WOL + +echo "================================" +echo "DĂ©marrage des services Effi" +echo "================================" +echo "" + +# Couleurs +GREEN='\033[0;32m' +RED='\033[0;31m' +NC='\033[0m' + +# Fonction de dĂ©marrage +start_service() { + local name=$1 + local dir=$2 + local compose_file=${3:-docker-compose.yml} + + echo -n "DĂ©marrage $name... " + cd "$dir" || { echo -e "${RED}✗${NC} RĂ©pertoire non trouvĂ©"; return 1; } + + if sudo docker compose -f "$compose_file" up -d 2>/dev/null; then + echo -e "${GREEN}✓${NC} OK" + return 0 + else + echo -e "${RED}✗${NC} Erreur" + return 1 + fi +} + +# 1. VĂ©rifier Docker +if ! systemctl is-active --quiet docker; then + echo "DĂ©marrage de Docker..." + sudo systemctl start docker + sleep 3 +fi + +# 2. DĂ©marrer les services +echo "DĂ©marrage des conteneurs :" +echo "" + +start_service "Ollama" "$HOME" "docker-compose.yml" +start_service "ComfyUI" "$HOME/Documents/OpenCode/Projets/Effi/comfyui" +start_service "Effi-STT" "$HOME/Documents/OpenCode/Projets/Effi/effi-stt" +start_service "openedai-speech" "$HOME/openedai-speech" + +echo "" +echo "================================" +echo "VĂ©rification des services" +echo "================================" +echo "" + +sleep 5 + +# VĂ©rifier que tout rĂ©pond +services_ok=0 +services_total=4 + +echo -n "Ollama (11434)... " +if curl -s http://localhost:11434 > /dev/null 2>&1; then + echo -e "${GREEN}✓${NC}" + ((services_ok++)) +else + echo -e "${RED}✗${NC}" +fi + +echo -n "ComfyUI (8188)... " +if curl -s http://localhost:8188 > /dev/null 2>&1; then + echo -e "${GREEN}✓${NC}" + ((services_ok++)) +else + echo -e "${RED}✗${NC}" +fi + +echo -n "Effi-STT (8200)... " +if curl -s http://localhost:8200/health > /dev/null 2>&1; then + echo -e "${GREEN}✓${NC}" + ((services_ok++)) +else + echo -e "${RED}✗${NC}" +fi + +echo -n "openedai-speech (8100)... " +if curl -s http://localhost:8100/health > /dev/null 2>&1; then + echo -e "${GREEN}✓${NC}" + ((services_ok++)) +else + echo -e "${RED}✗${NC}" +fi + +echo "" +echo "================================" +echo "RĂ©sultat : $services_ok/$services_total services OK" +echo "================================" + +if [ $services_ok -eq $services_total ]; then + echo -e "${GREEN}Tous les services sont dĂ©marrĂ©s !${NC}" + echo "" + echo "Vous pouvez utiliser Effi normalement." + exit 0 +else + echo -e "${RED}Certains services n'ont pas dĂ©marrĂ©.${NC}" + echo "" + echo "Pour voir les logs :" + echo " sudo docker logs ollama" + echo " sudo docker logs comfyui" + echo " sudo docker logs effi-stt" + echo " sudo docker logs openedai-speech" + exit 1 +fi