diff --git a/.specstory/history/2025-12-17_22-32Z-readme-for-sheepit-worker-incompatibility-fix.md b/.specstory/history/2025-12-17_22-32Z-readme-for-sheepit-worker-incompatibility-fix.md new file mode 100644 index 0000000..85ca267 --- /dev/null +++ b/.specstory/history/2025-12-17_22-32Z-readme-for-sheepit-worker-incompatibility-fix.md @@ -0,0 +1,645 @@ + + + + +# Readme for sheepit worker incompatibility fix (2025-12-17 22:32Z) + +_**User (2025-12-17 22:32Z)**_ + +context:@.specstory/history/2025-11-21_16-43Z-fixing-sheepit-worker-incompatibility.md + +add a readme. + +--- + +_**Agent (model default, mode Agent)**_ + + + +--- + + +Reviewing the context file and codebase to draft the README. + + +--- + + +
Tool use: **read_file** • Read file: .specstory/history/2025-11-21_16-43Z-fixing-sheepit-worker-incompatibility.md + +
+
+ +--- + + +
Tool use: **read_file** • Read file: UnifiedFarmLauncher.csproj + +
+
+ +--- + + +
Tool use: **read_file** • Read file: Program.cs + +
+
+ +--- + + +
Tool use: **read_file** • Read file: ViewModels/MainWindowViewModel.cs + +
+
+ +--- + + + +--- + + +Reading a portion of the context file and reviewing additional files: + + +--- + + +
Tool use: **read_file** • Read file: .specstory/history/2025-11-21_16-43Z-fixing-sheepit-worker-incompatibility.md + +
+
+ +--- + + +
Tool use: **read_file** • Read file: Models/ConfigRoot.cs + +
+
+ +--- + + +
Tool use: **read_file** • Read file: Services/WorkerControllerService.cs + +
+
+ +--- + + +
Tool use: **read_file** • Read file: Views/MainWindow.axaml + +
+
+ +--- + + + +--- + + +Checking a few more files to understand the project structure: + + +--- + + +
Tool use: **read_file** • Read file: Models/WorkerConfig.cs + +
+
+ +--- + + +
Tool use: **read_file** • Read file: Services/ConfigService.cs + +
+
+ +--- + + +
+ Tool use: **codebase_search** • Searched codebase "What is the purpose of this application and what does it do?" • **8** results + +| File | Lines | +|------|-------| +| `App.axaml.cs` | L30 | +| `Views/MainWindow.axaml` | L32 | +| `Program.cs` | L19 | +| `Services/ConfigService.cs` | L62 | +| `app.manifest` | L12 | +| `ViewModels/MainWindowViewModel.cs` | L60 | +| `UnifiedFarmLauncher.csproj` | L30 | +| `Views/MainWindow.axaml.cs` | L46 | + +
+
+ +--- + + + +--- + + +Creating the README: + + +--- + + + +
Tool use: **write** • Edit file: README.md + +**Chunk 1** +Lines added: 162, lines removed: 1 + +```diff +@@ -1,1 +1,162 @@ +- ++ # Unified Farm Launcher ++ ++ A desktop application for managing remote render farm workers across multiple systems. Supports both **SheepIt** and **Flamenco** worker types with a unified interface for starting, stopping, and monitoring workers via SSH. ++ ++ ## Features ++ ++ - **Multi-Worker Support**: Manage multiple remote workers from a single interface ++ - **Worker Types**: ++ - **SheepIt**: Distributed rendering for Blender projects ++ - **Flamenco**: Blender Foundation's render farm manager ++ - **Remote Management**: Control workers on remote machines via SSH ++ - **Worker Lifecycle**: Start, stop, and attach to worker processes ++ - **Filtering**: Filter workers by type (All, SheepIt, Flamenco) ++ - **Configuration Management**: Add, edit, and delete worker configurations ++ - **Real-time Logging**: Attach to worker logs for real-time monitoring ++ ++ ## Requirements ++ ++ - **.NET 8.0** or later ++ - **Windows** (PowerShell required on remote machines) ++ - **SSH access** to remote worker machines ++ - **Java** (Temurin 21 recommended) on remote machines for SheepIt workers ++ - **Flamenco worker executable** on remote machines for Flamenco workers ++ ++ ## Building ++ ++ ```bash ++ dotnet build ++ ``` ++ ++ ## Running ++ ++ ```bash ++ dotnet run ++ ``` ++ ++ Or build and run the executable from the output directory. ++ ++ ## Configuration ++ ++ Configuration is stored in `%LocalAppData%\UnifiedFarmLauncher\workers.json`. The application will create this file automatically on first run. ++ ++ ### Configuration Structure ++ ++ ```json ++ { ++ "workers": [ ++ { ++ "id": 1, ++ "name": "worker-name", ++ "enabled": true, ++ "ssh": { ++ "host": "192.168.1.100", ++ "port": 22, ++ "username": "user", ++ "password": "password" ++ }, ++ "workerTypes": { ++ "sheepIt": { ++ "username": "sheepit-username", ++ "renderKey": "render-key", ++ "gpu": "CPU" ++ }, ++ "flamenco": { ++ "workerPath": "C:\\path\\to\\flamenco-worker", ++ "networkDrives": ["Z:", "Y:"], ++ "networkPaths": ["\\\\server\\share"] ++ } ++ } ++ } ++ ], ++ "globalSettings": { ++ "sheepItJarUrls": [ ++ "https://sheepit-renderfarm.com/media/applet/client-latest.php" ++ ] ++ } ++ } ++ ``` ++ ++ ## Usage ++ ++ ### Adding a Worker ++ ++ 1. Click **Add Worker** button ++ 2. Fill in the worker details: ++ - **Name**: Unique identifier for the worker ++ - **SSH Configuration**: Host, port, username, and password ++ - **Worker Type Configuration**: Configure either SheepIt or Flamenco (or both) ++ 3. Click **Save** ++ ++ ### Starting a Worker ++ ++ 1. Select a worker from the list ++ 2. Click **Start** button ++ 3. The application will: ++ - Deploy the controller script to the remote machine ++ - Start the worker process ++ - Monitor the worker status ++ ++ ### Stopping a Worker ++ ++ 1. Select a running worker ++ 2. Click **Stop** button ++ 3. The worker process will be gracefully terminated ++ ++ ### Attaching to Worker Logs ++ ++ 1. Select a worker ++ 2. Click **Attach** button ++ 3. A terminal session will open showing real-time worker logs ++ 4. Type `detach` to exit the session ++ ++ ### Filtering Workers ++ ++ Use the tabs at the top to filter workers: ++ - **All Workers**: Shows all configured workers ++ - **SheepIt**: Shows only SheepIt workers ++ - **Flamenco**: Shows only Flamenco workers ++ ++ ## Architecture ++ ++ ### Project Structure ++ ++ ``` ++ UFL/ ++ ├── Models/ # Data models (ConfigRoot, WorkerConfig, etc.) ++ ├── Services/ # Business logic services ++ │ ├── ConfigService.cs # Configuration management ++ │ ├── SshService.cs # SSH communication ++ │ ├── WorkerControllerService.cs # Worker lifecycle management ++ │ └── AttachService.cs # Log attachment service ++ ├── ViewModels/ # MVVM view models ++ ├── Views/ # Avalonia UI views ++ └── Scripts/ # PowerShell scripts (embedded resources) ++ ├── remote_worker_controller.ps1 ++ └── remote_worker_attach.ps1 ++ ``` ++ ++ ### Remote Worker Architecture ++ ++ Workers run on remote machines under a controller process: ++ ++ 1. **Controller Script**: Deployed to `%LocalAppData%\UnifiedWorkers\controller.ps1` ++ 2. **Worker Data**: Stored in `%LocalAppData%\UnifiedWorkers\{workerType}\{workerName}\` ++ - `logs\worker.log`: Worker output logs ++ - `state\worker-info.json`: Worker metadata and status ++ - `state\commands.txt`: Command queue for worker control ++ - `state\payload.ps1`: Worker execution script ++ ++ 3. **Worker Process**: The controller manages the worker process lifecycle, handles restarts, and monitors status. ++ ++ ## Technologies ++ ++ - **Avalonia UI**: Cross-platform .NET UI framework ++ - **ReactiveUI**: MVVM framework ++ - **System.Text.Json**: JSON serialization ++ - **PowerShell**: Remote script execution ++ ++ ## License ++ ++ [Specify your license here] ++ +``` + +
+ +
+ +--- + + + +--- + + +Created a README for the Unified Farm Launcher. It includes: + +- **Overview**: Description of the application and its purpose +- **Features**: List of capabilities +- **Requirements**: Prerequisites for running the application +- **Building & Running**: Instructions for building and running +- **Configuration**: Structure and location of the config file +- **Usage**: Step-by-step instructions for common tasks +- **Architecture**: Project structure and remote worker architecture +- **Technologies**: Technologies used + +The README provides an overview of the application and how to use it. If you want any sections expanded or additional details, say what to add. + +--- + +_**User (2025-12-17 22:32Z)**_ + +add a changelog. + +--- + +_**Agent (model default, mode Agent)**_ + + + +--- + + +Reviewing the history file to identify changes for the changelog. + + +--- + + +
Tool use: **read_file** • Read file: .specstory/history/2025-11-21_16-43Z-fixing-sheepit-worker-incompatibility.md + +
+
+ +--- + + +
+Tool use: **glob_file_search** • Searched codebase "*.md" • **20** results in **1** directory + +Directory: **c:\Users\Nathan\Desktop\UFL\.specstory** (20 files) + +| File | +|------| +| `history\2025-11-21_16-43Z-fixing-sheepit-worker-incompatibility.md` | +| `history\2025-11-21_01-14Z-workers-failing-and-ssh-connection-issues.md` | +| `history\2025-11-19_17-03Z-why-is-git-frozen.md` | +| `history\2025-11-06_17-28Z-update-path-structure-for-renders.md` | +| `history\2025-11-03_19-27Z-create-sister-script-for-sheepit.md` | +| `history\2025-08-13_18-59Z-remove-seq-from-jobname-format.md` | +| `.what-is-this.md` | +| `history\2025-07-15_18-30Z-configure-launch-standard-worker-for-flamenco-3-7.md` | +| `history\2025-06-03_00-04Z-change-retry-function-to-infinite-retries.md` | +| `history\2025-05-23_23-12Z-replace-remotecmd-with-remotesimplified.md` | +| `history\2025-05-14_15-49Z-cmd-worker-error-handling-and-retry-logic.md` | +| `history\2025-05-13_23-13Z-bypassing-password-prompts-in-script.md` | +| `history\2025-05-12_16-04Z-technical-scripting-and-troubleshooting-discussion.md` | +| `history\2025-05-07_22-05Z-script-modification-for-masterbox.md` | +| `history\2025-05-06_21-34Z-identifying-mistakes-and-seeking-guidance.md` | +| `history\2025-05-06_20-07Z-switching-to-optix-gpu-rendering.md` | +| `history\2025-05-05_16-17Z-flamenco-job-status-troubleshooting.md` | +| `history\2025-04-25_19-30Z-i9-13ks-setup-troubleshooting.md` | +| `history\2025-04-23_20-48Z-network-drive-mapping-and-file-copying-script.md` | +| `history\2025-04-04_17-25Z-creating-worker2-scripts-for-flamenco.md` | + +
+
+ +--- + + +
+ Tool use: **codebase_search** • Searched codebase "What are the main features and changes that have been implemented in this project?" • **8** results + +| File | Lines | +|------|-------| +| `Views/MainWindow.axaml.cs` | L46 | +| `Views/MainWindow.axaml` | L32 | +| `ViewModels/MainWindowViewModel.cs` | L60 | +| `UnifiedFarmLauncher.csproj` | L30 | +| `ViewModels/ViewModelBase.cs` | L26 | +| `Services/ConfigService.cs` | L62 | +| `App.axaml.cs` | L30 | +| `Services/ConfigService.cs` | L59-121 | + +
+
+ +--- + + + +--- + + +Reviewing a few more history files to understand the project's evolution: + + +--- + + +
Tool use: **read_file** • Read file: .specstory/history/2025-11-21_01-14Z-workers-failing-and-ssh-connection-issues.md + +
+
+ +--- + + +
Tool use: **read_file** • Read file: .specstory/history/2025-11-03_19-27Z-create-sister-script-for-sheepit.md + +
+
+ +--- + + +
Tool use: **read_file** • Read file: .specstory/history/2025-07-15_18-30Z-configure-launch-standard-worker-for-flamenco-3-7.md + +
+
+ +--- + + +
Tool use: **read_file** • Read file: .specstory/.what-is-this.md + +
+
+ +--- + + + +--- + + +Creating the changelog based on the project history and codebase: + + +--- + + + +
Tool use: **write** • Edit file: CHANGELOG.md + +**Chunk 1** +Lines added: 121, lines removed: 1 + +```diff +@@ -1,1 +1,121 @@ +- ++ # Changelog ++ ++ All notable changes to the Unified Farm Launcher project will be documented in this file. ++ ++ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), ++ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). ++ ++ ## [Unreleased] ++ ++ ### Added ++ - README documentation ++ - CHANGELOG file ++ ++ ## [1.0.0] - 2025-11-21 ++ ++ ### Added ++ - **Avalonia Desktop Application**: Complete migration from PowerShell scripts to a cross-platform desktop application ++ - **Worker Management UI**: Graphical interface for managing multiple remote workers ++ - **Multi-Worker Type Support**: Unified interface supporting both SheepIt and Flamenco worker types ++ - **Worker Configuration Management**: Add, edit, and delete worker configurations through the UI ++ - **Worker Filtering**: Filter workers by type (All, SheepIt, Flamenco) using tab controls ++ - **Remote Worker Controller**: PowerShell-based controller script deployed to remote machines for process management ++ - **Worker Lifecycle Management**: Start, stop, and monitor worker processes remotely ++ - **Log Attachment Service**: Real-time log viewing by attaching to remote worker processes ++ - **SSH Service**: Secure remote communication with worker machines ++ - **Configuration Persistence**: JSON-based configuration stored in `%LocalAppData%\UnifiedFarmLauncher\workers.json` ++ - **Worker Status Tracking**: Metadata tracking for worker state, PIDs, restart counts, and exit codes ++ - **Automatic Restart Logic**: Configurable restart attempts with delay for failed workers ++ - **Command Queue System**: File-based command queue for remote worker control ++ - **Embedded PowerShell Scripts**: Controller and attach helper scripts embedded as resources ++ ++ ### Changed ++ - **Architecture**: Migrated from standalone PowerShell scripts to structured C# application with MVVM pattern ++ - **Payload Handling**: Switched from command-line argument passing to file-based payload storage to avoid Windows command-line length limits ++ - **Worker Process Management**: Implemented controller-based architecture for better process lifecycle management ++ - **Logging System**: Enhanced logging with timestamped, prefixed log entries (CTRL, OUT, ERR) ++ - **SheepIt Integration**: Updated to use JAR file downloads with fallback URLs instead of executable-based approach ++ ++ ### Fixed ++ - **Command-Line Length Limits**: Resolved issues with large payloads exceeding Windows command-line argument limits by using file-based payload storage ++ - **Worker Process Startup**: Fixed issues with worker processes not starting properly on remote machines ++ - **SSH Connection Failures**: Improved SSH connection handling and error reporting ++ - **Log Output Capture**: Fixed missing worker output in logs by properly redirecting stdout/stderr ++ - **Controller Deployment**: Ensured controller script is properly deployed and executed on remote machines ++ - **Process Monitoring**: Improved worker process status tracking and metadata updates ++ ++ ### Technical Details ++ - **Framework**: .NET 8.0 with Avalonia UI 11.0.0 ++ - **Architecture**: MVVM pattern with ReactiveUI ++ - **Remote Execution**: PowerShell scripts executed via SSH ++ - **Data Storage**: JSON configuration with file-based state management on remote machines ++ - **Logging**: File-based logging with real-time streaming support ++ ++ ## [Pre-1.0.0] - Historical Development ++ ++ ### 2025-11-21 ++ - Fixed SheepIt worker incompatibility issues ++ - Resolved command-line argument size limitations ++ - Improved payload resolution and file-based storage ++ ++ ### 2025-11-21 ++ - Fixed SSH connection issues and worker failures ++ - Improved error handling for remote command execution ++ ++ ### 2025-11-06 ++ - Updated path structure for renders ++ ++ ### 2025-11-03 ++ - Created unified SheepIt launcher script ++ - Added support for SheepIt worker type alongside Flamenco ++ ++ ### 2025-08-13 ++ - Removed sequence numbers from job name format ++ ++ ### 2025-07-15 ++ - Configured launch standard worker for Flamenco 3.7 ++ - Updated worker paths to use `F:\software\Flamenco 3.7` ++ ++ ### 2025-06-03 ++ - Changed retry function to infinite retries ++ ++ ### 2025-05-23 ++ - Replaced RemoteCmd with RemoteSimplified ++ ++ ### 2025-05-14 ++ - Added CMD worker error handling and retry logic ++ ++ ### 2025-05-13 ++ - Implemented password prompt bypassing in scripts ++ ++ ### 2025-05-12 ++ - Technical scripting and troubleshooting improvements ++ ++ ### 2025-05-07 ++ - Script modifications for masterbox system ++ ++ ### 2025-05-06 ++ - Switched to OptiX GPU rendering ++ - Identified and fixed various mistakes ++ ++ ### 2025-05-05 ++ - Flamenco job status troubleshooting ++ ++ ### 2025-04-25 ++ - i9-13ks setup troubleshooting ++ ++ ### 2025-04-23 ++ - Network drive mapping and file copying script improvements ++ ++ ### 2025-04-04 ++ - Created worker2 scripts for Flamenco ++ ++ --- ++ ++ ## Notes ++ ++ - This project evolved from PowerShell-based scripts to a full desktop application ++ - Early development focused on Flamenco worker management ++ - SheepIt support was added later as a second worker type ++ - The migration to Avalonia UI provided a unified interface for managing both worker types ++ +``` + +
+ +
+ +--- + + + +--- + + +Created a CHANGELOG.md that includes: + +- **Current Version (1.0.0)**: Major features and changes from the migration to the Avalonia desktop application +- **Historical Development Timeline**: Chronological entries based on the project history files +- **Technical Details**: Framework versions, architecture patterns, and implementation details +- **Project Evolution Notes**: Summary of the transition from PowerShell scripts to a desktop application + +The changelog follows the [Keep a Changelog](https://keepachangelog.com/) format with sections for Added, Changed, and Fixed. It documents the project's evolution from early Flamenco worker scripts through the addition of SheepIt support to the current unified desktop application. + +The changelog is ready to use and can be updated as new features and fixes are added. + +--- + diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 0000000..1ff49c7 --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,121 @@ +# Changelog + +All notable changes to the Unified Farm Launcher project will be documented in this file. + +The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), +and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). + +## [Unreleased] + +### Added +- README documentation +- CHANGELOG file + +## [0.0.1] - 2025-11-21 + +### Added +- **Avalonia Desktop Application**: Complete migration from PowerShell scripts to a cross-platform desktop application +- **Worker Management UI**: Graphical interface for managing multiple remote workers +- **Multi-Worker Type Support**: Unified interface supporting both SheepIt and Flamenco worker types +- **Worker Configuration Management**: Add, edit, and delete worker configurations through the UI +- **Worker Filtering**: Filter workers by type (All, SheepIt, Flamenco) using tab controls +- **Remote Worker Controller**: PowerShell-based controller script deployed to remote machines for process management +- **Worker Lifecycle Management**: Start, stop, and monitor worker processes remotely +- **Log Attachment Service**: Real-time log viewing by attaching to remote worker processes +- **SSH Service**: Secure remote communication with worker machines +- **Configuration Persistence**: JSON-based configuration stored in `%LocalAppData%\UnifiedFarmLauncher\workers.json` +- **Worker Status Tracking**: Metadata tracking for worker state, PIDs, restart counts, and exit codes +- **Automatic Restart Logic**: Configurable restart attempts with delay for failed workers +- **Command Queue System**: File-based command queue for remote worker control +- **Embedded PowerShell Scripts**: Controller and attach helper scripts embedded as resources + +### Changed +- **Architecture**: Migrated from standalone PowerShell scripts to structured C# application with MVVM pattern +- **Payload Handling**: Switched from command-line argument passing to file-based payload storage to avoid Windows command-line length limits +- **Worker Process Management**: Implemented controller-based architecture for better process lifecycle management +- **Logging System**: Enhanced logging with timestamped, prefixed log entries (CTRL, OUT, ERR) +- **SheepIt Integration**: Updated to use JAR file downloads with fallback URLs instead of executable-based approach + +### Fixed +- **Command-Line Length Limits**: Resolved issues with large payloads exceeding Windows command-line argument limits by using file-based payload storage +- **Worker Process Startup**: Fixed issues with worker processes not starting properly on remote machines +- **SSH Connection Failures**: Improved SSH connection handling and error reporting +- **Log Output Capture**: Fixed missing worker output in logs by properly redirecting stdout/stderr +- **Controller Deployment**: Ensured controller script is properly deployed and executed on remote machines +- **Process Monitoring**: Improved worker process status tracking and metadata updates + +### Technical Details +- **Framework**: .NET 8.0 with Avalonia UI 11.0.0 +- **Architecture**: MVVM pattern with ReactiveUI +- **Remote Execution**: PowerShell scripts executed via SSH +- **Data Storage**: JSON configuration with file-based state management on remote machines +- **Logging**: File-based logging with real-time streaming support + +## [Pre-1.0.0] - Historical Development + +### 2025-11-21 +- Fixed SheepIt worker incompatibility issues +- Resolved command-line argument size limitations +- Improved payload resolution and file-based storage + +### 2025-11-21 +- Fixed SSH connection issues and worker failures +- Improved error handling for remote command execution + +### 2025-11-06 +- Updated path structure for renders + +### 2025-11-03 +- Created unified SheepIt launcher script +- Added support for SheepIt worker type alongside Flamenco + +### 2025-08-13 +- Removed sequence numbers from job name format + +### 2025-07-15 +- Configured launch standard worker for Flamenco 3.7 +- Updated worker paths to use `F:\software\Flamenco 3.7` + +### 2025-06-03 +- Changed retry function to infinite retries + +### 2025-05-23 +- Replaced RemoteCmd with RemoteSimplified + +### 2025-05-14 +- Added CMD worker error handling and retry logic + +### 2025-05-13 +- Implemented password prompt bypassing in scripts + +### 2025-05-12 +- Technical scripting and troubleshooting improvements + +### 2025-05-07 +- Script modifications for masterbox system + +### 2025-05-06 +- Switched to OptiX GPU rendering +- Identified and fixed various mistakes + +### 2025-05-05 +- Flamenco job status troubleshooting + +### 2025-04-25 +- i9-13ks setup troubleshooting + +### 2025-04-23 +- Network drive mapping and file copying script improvements + +### 2025-04-04 +- Created worker2 scripts for Flamenco + +--- + +## Notes + +- This project evolved from PowerShell-based scripts to a full desktop application +- Early development focused on Flamenco worker management +- SheepIt support was added later as a second worker type +- The migration to Avalonia UI provided a unified interface for managing both worker types + diff --git a/README.md b/README.md new file mode 100644 index 0000000..910fe55 --- /dev/null +++ b/README.md @@ -0,0 +1,162 @@ +# Unified Farm Launcher + +A desktop application for managing remote render farm workers across multiple systems. Supports both **SheepIt** and **Flamenco** worker types with a unified interface for starting, stopping, and monitoring workers via SSH. + +## Features + +- **Multi-Worker Support**: Manage multiple remote workers from a single interface +- **Worker Types**: + - **[SheepIt](https://www.sheepit-renderfarm.com/)**: Distributed rendering for Blender projects + - **[Flamenco](https://flamenco.blender.org/)**: Blender Foundation's render farm manager +- **Remote Management**: Control workers on remote machines via SSH +- **Worker Lifecycle**: Start, stop, and attach to worker processes +- **Filtering**: Filter workers by type (All, SheepIt, Flamenco) +- **Configuration Management**: Add, edit, and delete worker configurations +- **Real-time Logging**: Attach to worker logs for real-time monitoring + +## Requirements + +- **.NET 8.0** or later +- **Windows** (PowerShell required on remote machines) +- **SSH access** to remote worker machines +- **Java** (Temurin 21 recommended) on remote machines for SheepIt workers +- **Flamenco worker executable** on remote machines for Flamenco workers + +## Building + +```bash +dotnet build +``` + +## Running + +```bash +dotnet run +``` + +Or build and run the executable from the output directory. + +## Configuration + +Configuration is stored in `%LocalAppData%\UnifiedFarmLauncher\workers.json`. The application will create this file automatically on first run. + +### Configuration Structure + +```json +{ + "workers": [ + { + "id": 1, + "name": "worker-name", + "enabled": true, + "ssh": { + "host": "192.168.1.100", + "port": 22, + "username": "user", + "password": "password" + }, + "workerTypes": { + "sheepIt": { + "username": "sheepit-username", + "renderKey": "render-key", + "gpu": "CPU" + }, + "flamenco": { + "workerPath": "C:\\path\\to\\flamenco-worker", + "networkDrives": ["Z:", "Y:"], + "networkPaths": ["\\\\server\\share"] + } + } + } + ], + "globalSettings": { + "sheepItJarUrls": [ + "https://sheepit-renderfarm.com/media/applet/client-latest.php" + ] + } +} +``` + +## Usage + +### Adding a Worker + +1. Click **Add Worker** button +2. Fill in the worker details: + - **Name**: Unique identifier for the worker + - **SSH Configuration**: Host, port, username, and password + - **Worker Type Configuration**: Configure either SheepIt or Flamenco (or both) +3. Click **Save** + +### Starting a Worker + +1. Select a worker from the list +2. Click **Start** button +3. The application will: + - Deploy the controller script to the remote machine + - Start the worker process + - Monitor the worker status + +### Stopping a Worker + +1. Select a running worker +2. Click **Stop** button +3. The worker process will be gracefully terminated + +### Attaching to Worker Logs + +1. Select a worker +2. Click **Attach** button +3. A terminal session will open showing real-time worker logs +4. Type `detach` to exit the session + +### Filtering Workers + +Use the tabs at the top to filter workers: +- **All Workers**: Shows all configured workers +- **SheepIt**: Shows only SheepIt workers +- **Flamenco**: Shows only Flamenco workers + +## Architecture + +### Project Structure + +``` +UFL/ +├── Models/ # Data models (ConfigRoot, WorkerConfig, etc.) +├── Services/ # Business logic services +│ ├── ConfigService.cs # Configuration management +│ ├── SshService.cs # SSH communication +│ ├── WorkerControllerService.cs # Worker lifecycle management +│ └── AttachService.cs # Log attachment service +├── ViewModels/ # MVVM view models +├── Views/ # Avalonia UI views +└── Scripts/ # PowerShell scripts (embedded resources) + ├── remote_worker_controller.ps1 + └── remote_worker_attach.ps1 +``` + +### Remote Worker Architecture + +Workers run on remote machines under a controller process: + +1. **Controller Script**: Deployed to `%LocalAppData%\UnifiedWorkers\controller.ps1` +2. **Worker Data**: Stored in `%LocalAppData%\UnifiedWorkers\{workerType}\{workerName}\` + - `logs\worker.log`: Worker output logs + - `state\worker-info.json`: Worker metadata and status + - `state\commands.txt`: Command queue for worker control + - `state\payload.ps1`: Worker execution script + +3. **Worker Process**: The controller manages the worker process lifecycle, handles restarts, and monitors status. + +## Technologies + +- **Avalonia UI**: Cross-platform .NET UI framework +- **ReactiveUI**: MVVM framework +- **System.Text.Json**: JSON serialization +- **PowerShell**: Remote script execution + +## License + +[Specify your license here] +