Update configuration and environment probing for improved flexibility and compatibility
- Modified the `load_config` function to allow launch preferences in `gpu-rent.vars` to override `.env` settings for non-secret variables, enhancing user control. - Updated the list of Python candidates in `stack_env_probe.py` to include additional paths for ComfyUI, improving the detection of Python environments. - Added new pip candidates in `tune_swarm_perf.py` to support various ComfyUI installations, ensuring better compatibility with different setups.
This commit is contained in:
@@ -143,8 +143,9 @@ def load_config(*, require_auth: bool = True) -> Config:
|
|||||||
if env_file.is_file():
|
if env_file.is_file():
|
||||||
load_dotenv(env_file, override=False)
|
load_dotenv(env_file, override=False)
|
||||||
|
|
||||||
# Non-secret launch defaults (gpu-rent.vars). Do not override .env / real env.
|
# Launch prefs (gpu-rent.vars) win over .env for non-secrets — so
|
||||||
apply_vars_file(vars_path(), override=False)
|
# LLM_RUNTIME=ollama in vars is not blocked by LLM_RUNTIME=none from env.example.
|
||||||
|
apply_vars_file(vars_path(), override=True)
|
||||||
|
|
||||||
missing: list[str] = []
|
missing: list[str] = []
|
||||||
required = (
|
required = (
|
||||||
|
|||||||
@@ -9,7 +9,14 @@ import subprocess
|
|||||||
import sys
|
import sys
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
|
|
||||||
COMFY_PIPS = [
|
DATA = Path("/mnt/swarm_data")
|
||||||
|
# SwarmUI Linux: dlbackend/ComfyUI/venv (see comfy-install-linux.sh).
|
||||||
|
# Older/alternate layouts kept as fallbacks; dlbackend lives on the data volume.
|
||||||
|
COMFY_PYTHON_CANDIDATES = [
|
||||||
|
DATA / "dlbackend" / "ComfyUI" / "venv" / "bin" / "python",
|
||||||
|
DATA / "dlbackend" / "comfy" / "venv" / "bin" / "python",
|
||||||
|
DATA / "dlbackend" / "comfy" / "ComfyUI" / "venv" / "bin" / "python",
|
||||||
|
Path("/opt/swarmui/dlbackend/ComfyUI/venv/bin/python"),
|
||||||
Path("/opt/swarmui/dlbackend/comfy/venv/bin/python"),
|
Path("/opt/swarmui/dlbackend/comfy/venv/bin/python"),
|
||||||
Path("/opt/swarmui/dlbackend/comfy/ComfyUI/venv/bin/python"),
|
Path("/opt/swarmui/dlbackend/comfy/ComfyUI/venv/bin/python"),
|
||||||
]
|
]
|
||||||
@@ -60,7 +67,14 @@ def check_cuda_runtime() -> dict:
|
|||||||
|
|
||||||
|
|
||||||
def find_comfy_python() -> Path | None:
|
def find_comfy_python() -> Path | None:
|
||||||
for p in COMFY_PIPS:
|
for p in COMFY_PYTHON_CANDIDATES:
|
||||||
|
if p.is_file() and os.access(p, os.X_OK):
|
||||||
|
return p
|
||||||
|
# SwarmUI may nest differently under dlbackend/
|
||||||
|
for p in sorted(DATA.glob("dlbackend/**/venv/bin/python")):
|
||||||
|
if p.is_file() and os.access(p, os.X_OK):
|
||||||
|
return p
|
||||||
|
for p in sorted(Path("/opt/swarmui").glob("dlbackend/**/venv/bin/python")):
|
||||||
if p.is_file() and os.access(p, os.X_OK):
|
if p.is_file() and os.access(p, os.X_OK):
|
||||||
return p
|
return p
|
||||||
return None
|
return None
|
||||||
|
|||||||
@@ -19,8 +19,10 @@ GPU_JSON = DATA / ".gpu-rent-gpu.json"
|
|||||||
MARKER = DATA / ".gpu-rent-perf-tuned"
|
MARKER = DATA / ".gpu-rent-perf-tuned"
|
||||||
BACKENDS = DATA / "Data" / "Backends.fds"
|
BACKENDS = DATA / "Data" / "Backends.fds"
|
||||||
COMFY_VENV_CANDIDATES = [
|
COMFY_VENV_CANDIDATES = [
|
||||||
|
DATA / "dlbackend" / "ComfyUI" / "venv" / "bin" / "pip",
|
||||||
DATA / "dlbackend" / "comfy" / "venv" / "bin" / "pip",
|
DATA / "dlbackend" / "comfy" / "venv" / "bin" / "pip",
|
||||||
DATA / "dlbackend" / "comfy" / "ComfyUI" / "venv" / "bin" / "pip",
|
DATA / "dlbackend" / "comfy" / "ComfyUI" / "venv" / "bin" / "pip",
|
||||||
|
Path("/opt/swarmui/dlbackend/ComfyUI/venv/bin/pip"),
|
||||||
Path("/opt/swarmui/dlbackend/comfy/venv/bin/pip"),
|
Path("/opt/swarmui/dlbackend/comfy/venv/bin/pip"),
|
||||||
Path("/opt/swarmui/dlbackend/comfy/ComfyUI/venv/bin/pip"),
|
Path("/opt/swarmui/dlbackend/comfy/ComfyUI/venv/bin/pip"),
|
||||||
]
|
]
|
||||||
|
|||||||
Reference in New Issue
Block a user