feat: Add platform-specific directories and Unix scripts#8
Open
ShmuelOps wants to merge 1 commit into
Open
Conversation
c5a4467 to
23bcafd
Compare
This PR adds platform organization with Unix/Windows script directories, fixes the Mac SIGABRT crash, and ensures proper directory path handling. Platform Organization: - Created windows/ directory for Windows batch scripts (.bat files) - Created unix/ directory for macOS/Linux shell scripts (.sh files) - Updated README.md with platform-specific installation instructions Mac SIGABRT Crash Fix (Critical): - Force CPU processing only on macOS (sys.platform == 'darwin') - Preserve CUDA support for Windows/Linux (no performance impact) - Prevents MPS (Metal Performance Shaders) memory exhaustion on Mac - Fixes: Worker exited prematurely with signal 6 (SIGABRT) Platform-specific behavior: - macOS: Force CPU to avoid MPS crashes (slower but stable) - Windows/Linux: Use CUDA if available (full GPU acceleration) Directory Path Handling: - Unix scripts navigate to project root: PROJECT_ROOT="\$(...)/.." - Windows scripts navigate to project root: PROJECT_ROOT=%~dp0.. - All scripts work correctly from subdirectories - Renamed SCRIPT_DIR to PROJECT_ROOT for clarity Platform-specific scripts: - windows/install.bat: One-click installer for Windows - windows/start.bat: Service launcher for Windows - windows/stop.bat: Service shutdown for Windows - unix/install.sh: One-click installer for macOS/Linux - unix/start.sh: Service launcher for macOS/Linux - unix/stop.sh: Service shutdown for macOS/Linux Unix script features: - Automatic platform detection (macOS vs Linux) - Redis installation via Homebrew (Mac) or apt/yum (Linux) - Platform-specific PyTorch (CUDA for Linux, MPS for Mac) - Service health checks with retry logic - Proper conda environment activation - Background process management README changes: - Added platform-specific installation sections - Updated requirements for Windows, macOS, and Linux - Updated project structure to show new directories - Added notes about Mac CPU processing Files changed: - backend/workers/tasks.py (Mac CPU fix) - README.md (platform documentation) - unix/install.sh (new) - unix/start.sh (new) - unix/stop.sh (new) - windows/install.bat (organized + path fix) - windows/start.bat (organized + path fix) - windows/stop.bat (organized) Tested on: macOS M4 Pro with 48GB RAM Needs testing: Windows, Linux (community feedback welcome)
0b3ad27 to
7130cab
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Overview
This PR organizes platform-specific scripts into dedicated directories, adds complete Unix support, and fixes the Mac SIGABRT crash.
Changes
1. Platform-Specific Directory Structure
windows/directory for Windows batch scripts (.bat files)unix/directory for macOS/Linux shell scripts (.sh files)2. Mac SIGABRT Crash Fix (Critical)
sys.platform == 'darwin')Platform-Specific Behavior:
3. Directory Path Fixes
SCRIPT_DIR/../%~dp0..backend/,frontend/, etc. from project root4. Windows Scripts (Organized)
windows/install.bat- One-click installerwindows/start.bat- Service launcherwindows/stop.bat- Service shutdown5. Unix Scripts (New!)
unix/install.sh- One-click installer for macOS/Linuxunix/start.sh- Service launcher with health checksunix/stop.sh- Clean service shutdown6. Unix Script Features
Installer (
unix/install.sh):Launcher (
unix/start.sh):Shutdown (
unix/stop.sh):7. README.md Updates
Files Changed
backend/workers/tasks.py(Mac CPU fix)README.md(platform sections)Directory Structure
Testing
✅ Tested On
unix/directory⏳ Needs Community Testing
Migration Guide
Windows Users
macOS/Linux Users
Performance Impact
macOS Users (CPU Processing)
smallorbasemodelsWindows/Linux Users (CUDA Processing)
Breaking Changes
None - Root-level scripts still work for backward compatibility.
Related PRs
Checklist