debug
Some checks failed
Builder / Build addons (localai-p2p-master, amd64) (push) Failing after 8s
Builder / Build addons (localai-p2p-worker, amd64) (push) Failing after 8s
Validate / validate (push) Failing after 2s
Builder / Create release (push) Has been skipped

This commit is contained in:
2025-05-30 14:54:08 +02:00
parent cca21d9c3b
commit 85b6876fdd
3 changed files with 45 additions and 11 deletions

View File

@@ -2,24 +2,41 @@
CONFIG_PATH=/data/options.json CONFIG_PATH=/data/options.json
GPU_LAYERS="$(bashio::config 'gpu_layers')" GPU_LAYERS="$(bashio::config 'gpu_layers')"
TOKEN="$(bashio::config 'master_token' || echo '')" TOKEN="$(bashio::config 'master_token')"
MODELS_PATH="$(bashio::config 'models_path')" MODELS_PATH="$(bashio::config 'models_path')"
echo "DEBUG: GPU_LAYERS=$GPU_LAYERS"
echo "DEBUG: TOKEN from config: '$TOKEN'" echo "DEBUG: TOKEN from config: '$TOKEN'"
echo "DEBUG: MODELS_PATH=$MODELS_PATH"
if [ -n "$TOKEN" ] && [ "$TOKEN" != "" ]; then # Forcer l'utilisation du token si fourni
if [ -n "$TOKEN" ] && [ "$TOKEN" != "null" ] && [ "$TOKEN" != "" ]; then
echo "DEBUG: Setting LOCALAI_P2P_TOKEN to: $TOKEN" echo "DEBUG: Setting LOCALAI_P2P_TOKEN to: $TOKEN"
export LOCALAI_P2P_TOKEN="$TOKEN" export LOCALAI_P2P_TOKEN="$TOKEN"
# Aussi définir la variable pour LocalAI
export P2P_TOKEN="$TOKEN"
else else
echo "DEBUG: No token provided in configuration" echo "DEBUG: No valid token provided in configuration"
fi fi
echo "DEBUG: LOCALAI_P2P_TOKEN is set to: '$LOCALAI_P2P_TOKEN'" echo "DEBUG: LOCALAI_P2P_TOKEN is set to: '$LOCALAI_P2P_TOKEN'"
echo "DEBUG: P2P_TOKEN is set to: '$P2P_TOKEN'"
# Créer le répertoire des modèles s'il n'existe pas # Créer le répertoire des modèles s'il n'existe pas
mkdir -p "$MODELS_PATH" mkdir -p "$MODELS_PATH"
# Nettoyer les fichiers de configuration corrompus (contenant du code shell) # Nettoyer les fichiers de configuration corrompus
find "$MODELS_PATH" -name "*.yaml" -exec grep -l "#!/usr/bin/with-contenv bashio" {} \; | xargs rm -f 2>/dev/null || true echo "DEBUG: Cleaning corrupted config files in $MODELS_PATH"
# Supprimer les fichiers contenant du code shell
find "$MODELS_PATH" -name "*.yaml" -exec grep -l "#!/usr/bin/with-contenv bashio" {} \; | while read file; do
echo "DEBUG: Removing corrupted file: $file"
rm -f "$file"
done 2>/dev/null || true
# Supprimer aussi les fichiers avec des erreurs de mapping YAML
find "$MODELS_PATH" -name "*.yaml" -exec grep -l "mapping values are not allowed in this context" {} \; | while read file; do
echo "DEBUG: Removing YAML mapping error file: $file"
rm -f "$file"
done 2>/dev/null || true
exec /build/local-ai run --models-path="$MODELS_PATH" --gpu-layers="$GPU_LAYERS" --address="0.0.0.0:8080" --cors --cors-allow-origins="*" exec /build/local-ai run --models-path="$MODELS_PATH" --gpu-layers="$GPU_LAYERS" --address="0.0.0.0:8080" --cors --cors-allow-origins="*"

View File

@@ -1,5 +1,5 @@
name: "LocalAI P2P Worker" name: "LocalAI P2P Worker"
version: "1.0.3.3" # Incrémentez aussi la version version: "1.0.3.4" # Incrémentez aussi la version
slug: "localai-p2p-worker" # ⬅️ IMPORTANT : doit correspondre au nom du dossier slug: "localai-p2p-worker" # ⬅️ IMPORTANT : doit correspondre au nom du dossier
description: "LocalAI P2P federation worker node" description: "LocalAI P2P federation worker node"
arch: arch:

View File

@@ -2,24 +2,41 @@
CONFIG_PATH=/data/options.json CONFIG_PATH=/data/options.json
GPU_LAYERS="$(bashio::config 'gpu_layers')" GPU_LAYERS="$(bashio::config 'gpu_layers')"
TOKEN="$(bashio::config 'master_token' || echo '')" TOKEN="$(bashio::config 'master_token')"
MODELS_PATH="$(bashio::config 'models_path')" MODELS_PATH="$(bashio::config 'models_path')"
echo "DEBUG: GPU_LAYERS=$GPU_LAYERS"
echo "DEBUG: TOKEN from config: '$TOKEN'" echo "DEBUG: TOKEN from config: '$TOKEN'"
echo "DEBUG: MODELS_PATH=$MODELS_PATH"
if [ -n "$TOKEN" ] && [ "$TOKEN" != "" ]; then # Forcer l'utilisation du token si fourni
if [ -n "$TOKEN" ] && [ "$TOKEN" != "null" ] && [ "$TOKEN" != "" ]; then
echo "DEBUG: Setting LOCALAI_P2P_TOKEN to: $TOKEN" echo "DEBUG: Setting LOCALAI_P2P_TOKEN to: $TOKEN"
export LOCALAI_P2P_TOKEN="$TOKEN" export LOCALAI_P2P_TOKEN="$TOKEN"
# Aussi définir la variable pour LocalAI
export P2P_TOKEN="$TOKEN"
else else
echo "DEBUG: No token provided in configuration" echo "DEBUG: No valid token provided in configuration"
fi fi
echo "DEBUG: LOCALAI_P2P_TOKEN is set to: '$LOCALAI_P2P_TOKEN'" echo "DEBUG: LOCALAI_P2P_TOKEN is set to: '$LOCALAI_P2P_TOKEN'"
echo "DEBUG: P2P_TOKEN is set to: '$P2P_TOKEN'"
# Créer le répertoire des modèles s'il n'existe pas # Créer le répertoire des modèles s'il n'existe pas
mkdir -p "$MODELS_PATH" mkdir -p "$MODELS_PATH"
# Nettoyer les fichiers de configuration corrompus (contenant du code shell) # Nettoyer les fichiers de configuration corrompus
find "$MODELS_PATH" -name "*.yaml" -exec grep -l "#!/usr/bin/with-contenv bashio" {} \; | xargs rm -f 2>/dev/null || true echo "DEBUG: Cleaning corrupted config files in $MODELS_PATH"
# Supprimer les fichiers contenant du code shell
find "$MODELS_PATH" -name "*.yaml" -exec grep -l "#!/usr/bin/with-contenv bashio" {} \; | while read file; do
echo "DEBUG: Removing corrupted file: $file"
rm -f "$file"
done 2>/dev/null || true
# Supprimer aussi les fichiers avec des erreurs de mapping YAML
find "$MODELS_PATH" -name "*.yaml" -exec grep -l "mapping values are not allowed in this context" {} \; | while read file; do
echo "DEBUG: Removing YAML mapping error file: $file"
rm -f "$file"
done 2>/dev/null || true
exec /build/local-ai run --models-path="$MODELS_PATH" --gpu-layers="$GPU_LAYERS" --address="0.0.0.0:8080" --cors --cors-allow-origins="*" exec /build/local-ai run --models-path="$MODELS_PATH" --gpu-layers="$GPU_LAYERS" --address="0.0.0.0:8080" --cors --cors-allow-origins="*"