Merge pull request #324 from langflow-ai/windows-point-to-wsl

Windows point to wsl
This commit is contained in:
Sebastián Estévez 2025-10-28 14:11:58 -04:00 committed by GitHub
commit 091481f4c7
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 61 additions and 0 deletions

View file

@ -497,6 +497,18 @@ def copy_compose_files(*, force: bool = False) -> None:
def run_tui():
"""Run the OpenRAG TUI application."""
# Check for native Windows before launching TUI
from .utils.platform import PlatformDetector
platform_detector = PlatformDetector()
if platform_detector.is_native_windows():
print("\n" + "=" * 60)
print("⚠️ Native Windows Not Supported")
print("=" * 60)
print(platform_detector.get_wsl_recommendation())
print("=" * 60 + "\n")
sys.exit(1)
app = None
try:
# Keep bundled assets aligned with the packaged versions

View file

@ -15,6 +15,7 @@ from rich.text import Text
from ..managers.container_manager import ContainerManager
from ..utils.clipboard import copy_text_to_clipboard
from ..utils.platform import PlatformDetector
class DiagnosticsScreen(Screen):
@ -52,6 +53,7 @@ class DiagnosticsScreen(Screen):
def __init__(self):
super().__init__()
self.container_manager = ContainerManager()
self.platform_detector = PlatformDetector()
self._logger = logging.getLogger("openrag.diagnostics")
self._status_timer = None
@ -199,6 +201,23 @@ class DiagnosticsScreen(Screen):
"""Get system information text."""
info_text = Text()
# Platform information
info_text.append("Platform Information\n", style="bold")
info_text.append("=" * 30 + "\n")
info_text.append(f"System: {self.platform_detector.platform_system}\n")
info_text.append(f"Machine: {self.platform_detector.platform_machine}\n")
# Windows-specific warning
if self.platform_detector.is_native_windows():
info_text.append("\n")
info_text.append("⚠️ Native Windows Detected\n", style="bold yellow")
info_text.append("-" * 30 + "\n")
info_text.append(self.platform_detector.get_wsl_recommendation())
info_text.append("\n")
info_text.append("\n")
# Container runtime information
runtime_info = self.container_manager.get_runtime_info()
info_text.append("Container Runtime Information\n", style="bold")

View file

@ -30,6 +30,15 @@ class PlatformDetector:
self.platform_system = platform.system()
self.platform_machine = platform.machine()
def is_native_windows(self) -> bool:
"""
Check if running on native Windows (not WSL).
Returns True if running on native Windows, False otherwise.
WSL environments will return False since they identify as Linux.
"""
return self.platform_system == "Windows"
def detect_runtime(self) -> RuntimeInfo:
"""Detect available container runtime and compose capabilities."""
# First check if we have podman installed
@ -166,6 +175,23 @@ class PlatformDetector:
) as e:
return False, 0, f"Error checking Podman VM memory: {e}"
def get_wsl_recommendation(self) -> str:
"""Get recommendation message for native Windows users to use WSL."""
return """
Running on native Windows detected.
For the best experience, we recommend using Windows Subsystem for Linux (WSL).
To set up WSL:
1. Open PowerShell or Command Prompt as Administrator
2. Run: wsl --install
3. Restart your computer
4. Set up your Linux distribution (Ubuntu recommended)
5. Install Docker or Podman in WSL
Learn more: https://docs.microsoft.com/en-us/windows/wsl/install
"""
def get_installation_instructions(self) -> str:
if self.platform_system == "Darwin":
return """
@ -200,6 +226,10 @@ Docker Desktop for Windows:
Or Podman Desktop:
https://podman-desktop.io/downloads
For better performance, consider using WSL:
Run: wsl --install
https://docs.microsoft.com/en-us/windows/wsl/install
"""
else:
return """