sheep overhaul

This commit is contained in:
Nathan
2025-11-05 16:19:24 -07:00
parent 37bdfcb862
commit 07a413e23f
2 changed files with 1048 additions and 62 deletions

View File

@@ -882,3 +882,959 @@ Run option 2 again; you should now see any worker processes SheepIt spins up lis
--- ---
_**User (2025-11-05 22:17Z)**_
let's have it:
1. ssh into the target system
2. download the sheepit jarfile to
3. run it on each system with ui text and the full output (i forget the argument)
I want to be able to interact with the CLI after it's done.
---
_**Agent (model gpt-5-codex, mode Plan)**_
<think><details><summary>Thought Process</summary>
**Formulating clarifying questions for SSH jar deployment**</details></think>
---
1. Where do you want the SheepIt jar saved on each system?
- a) `C:\Users\Nathan\Desktop\sheepit-client.jar`
- b) Ill specify a different path/name
2. To launch it, should we run `java -jar sheepit-client.jar -ui text -full` (keeping the SSH session attached so you can interact), or do you need a different command/flags?
---
_**User (2025-11-05 22:17Z)**_
%appdata%\sheepit is a good location. We should make sure to do -gpu optix 0. And I think -full is the wrong arg. It's --verbose --stdout or something
---
_**Agent (model gpt-5-codex, mode Plan)**_
<think><details><summary>Thought Process</summary>
**Planning jar download and execution**</details></think>
---
Well fetch the SheepIt jar from their “latest client” URL by default, unless you have a different download link. Is `https://www.sheepit-renderfarm.com/media/applet/client-latest.jar` okay?
---
_**User (2025-11-05 22:17Z)**_
yes. also, use renderkey.
---
_**Agent (model gpt-5-codex, mode Plan)**_
<think><details><summary>Thought Process</summary>
**Planning SSH jar launch workflow**
Im gathering all the details needed to update the script so it SSHs into each remote worker, downloads the jar to `%APPDATA%\sheepit`, and runs it with Java using the specified CLI options including `--renderkey`. Im also figuring out how to keep the remote SSH session interactive after the jar finishes, likely by opening a new Windows Terminal tab for the session. Since the render key is essential but not provided, I'll plan to prompt the user for it during the script run and cache it. Next, Ill create a concise plan outlining these script modifications and interactive session handling.</details></think>
---
<tool-use data-tool-type="unknown" data-tool-name="create_plan">
<details>
<summary>Tool use: **create_plan**</summary>
Parameters:
```json
{
&quot;plan&quot;: &quot;# SheepIt Jar Upgrade Plan\n\n1. Gather Render Key\n - Add session-level prompt storing the render key (secure string optional) so remote commands can inject &#96;--renderkey&#96;.\n\n2. Update Remote SheepIt Command\n - Replace executable launch with PowerShell that ensures &#96;%APPDATA%\\sheepit&#96; exists, downloads &#96;client-latest.jar&#96; to &#96;sheepit-client.jar&#96;, and runs &#96;java -jar&#96; with &#96;--ui text --stdout --verbose -gpu optix 0 --renderkey &lt;key&gt;&#96;.\n\n3. Make Launch Interactive\n - Adjust &#96;Start-SheepItWorker&#96; / &#96;Start-AllSheepIt&#96; to open each worker in its own terminal tab (like the Flamenco launcher) so the SSH session stays open after the jar exits, allowing CLI interaction.&quot;,
&quot;name&quot;: &quot;she&quot;,
&quot;todos&quot;: [
{
&quot;content&quot;: &quot;Add render key prompt/state to unified_sheepit_launcher.ps1&quot;,
&quot;status&quot;: &quot;pending&quot;,
&quot;id&quot;: &quot;renderkey-prompt&quot;
},
{
&quot;content&quot;: &quot;Implement remote script to download jar to %APPDATA%\\sheepit and run java with requested flags&quot;,
&quot;status&quot;: &quot;pending&quot;,
&quot;id&quot;: &quot;remote-jar-command&quot;
},
{
&quot;content&quot;: &quot;Update worker launch functions to run ssh in interactive tabs retaining session control&quot;,
&quot;status&quot;: &quot;pending&quot;,
&quot;id&quot;: &quot;interactive-launch&quot;
}
],
&quot;overview&quot;: &quot;Switch SheepIt launcher to fetch the jar client per worker and run it interactively with render key support.&quot;
}
```
Additional data:
```json
{
&quot;status&quot;: &quot;accepted&quot;,
&quot;reviewData&quot;: {
&quot;status&quot;: &quot;Requested&quot;,
&quot;selectedOption&quot;: &quot;none&quot;,
&quot;isShowingInput&quot;: false
}
}
```
Result:
```json
{
&quot;accepted&quot;: {
&quot;finalTodos&quot;: [
{
&quot;content&quot;: &quot;Add render key prompt/state to unified_sheepit_launcher.ps1&quot;,
&quot;status&quot;: &quot;pending&quot;,
&quot;id&quot;: &quot;renderkey-prompt&quot;
},
{
&quot;content&quot;: &quot;Implement remote script to download jar to %APPDATA%\\sheepit and run java with requested flags&quot;,
&quot;status&quot;: &quot;pending&quot;,
&quot;id&quot;: &quot;remote-jar-command&quot;
},
{
&quot;content&quot;: &quot;Update worker launch functions to run ssh in interactive tabs retaining session control&quot;,
&quot;status&quot;: &quot;pending&quot;,
&quot;id&quot;: &quot;interactive-launch&quot;
}
]
}
}
```
Status: **completed**
</details>
</tool-use>
---
_**User (2025-11-05 22:17Z)**_
username RaincloudTheDragon
renderkey IfCOWBHFQpceG0601DmyrwOOJOAp2UJAQ0O0X0jF
---
_**Agent (model gpt-5-codex, mode Plan)**_
<think><details><summary>Thought Process</summary>
**Confirming plan before execution**</details></think>
---
Got it: username `RaincloudTheDragon`, render key `IfCOWBHFQpceG0601DmyrwOOJOAp2UJAQ0O0X0jF`. Ready to implement the plan—just let me know when to proceed.
---
_**User (2025-11-05 22:17Z)**_
Implement the plan as specified, it is attached for your reference. Do NOT edit the plan file itself.
To-do's from the plan have already been created. Do not create them again. Mark them as in_progress as you work, starting with the first one. Don't stop until you have completed all the to-dos.
---
_**Agent (model gpt-5-codex, mode Agent)**_
<tool-use data-tool-type="generic" data-tool-name="todo_write">
<details><summary>Tool use: **todo_write** • Todo List</summary>
- [-] Add render key prompt/state to unified_sheepit_launcher.ps1
- [ ] Implement remote script to download jar to %APPDATA%\sheepit and run java with requested flags
- [ ] Update worker launch functions to run ssh in interactive tabs retaining session control
</details>
</tool-use>
---
<think><details><summary>Thought Process</summary>
**Planning SheepIt launcher enhancements**
I'm outlining detailed steps to prompt for and store username and render key at script start, update the remote PowerShell script to download and run the SheepIt client jar interactively with these credentials, and revise worker-launching functions to open each SSH session in a new Windows Terminal tab so users can interact with the SheepIt CLI after launch.
**Designing terminal tab launching with encoded SSH**
I'm planning how to generate per-worker session scripts that run SSH with the encoded remote command inside new Windows Terminal tabs, carefully handling quoting and user interaction so the remote SheepIt client runs interactively and the local tab waits for user input before closing; Ill also ensure credential prompts happen only once and integrate this flow smoothly with the existing worker-start functions.
**Preparing to apply code modifications**</details></think>
---
<tool-use data-tool-type="read" data-tool-name="read_file">
<details><summary>Tool use: **read_file** • Read file: unified_sheepit_launcher.ps1</summary>
</details>
</tool-use>
---
<think><details><summary>Thought Process</summary>
**Reworking SheepIt script structure**</details></think>
---
<tool-use data-tool-type="write" data-tool-name="apply_patch">
<details>
<summary>Tool use: **apply_patch** • Apply patch for undefined</summary>
```diff
*** Begin Patch
*** Update File: C:\Users\Nathan\Desktop\flamenco\unified_sheepit_launcher.ps1
@@
-$defaultSheepItPath = &quot;C:\Users\Nathan\Desktop\sheepit-autoupdate.exe&quot;
-
-$workers = @(
- @{ ID = 1; Name = &quot;i9kf&quot;; SSHArgs = &quot;-t i9kf&quot;; SheepItPath = $defaultSheepItPath; Enabled = $false },
- @{ ID = 2; Name = &quot;blender-boss&quot;; SSHArgs = &quot;-t blender-boss&quot;; SheepItPath = $defaultSheepItPath; Enabled = $true },
- @{ ID = 3; Name = &quot;max&quot;; SSHArgs = &quot;-t max&quot;; SheepItPath = $defaultSheepItPath; Enabled = $true },
- @{ ID = 4; Name = &quot;masterbox&quot;; SSHArgs = &quot;-t masterbox&quot;; SheepItPath = $defaultSheepItPath; Enabled = $true },
- @{ ID = 5; Name = &quot;echo&quot;; SSHArgs = &quot;-t echo&quot;; SheepItPath = $defaultSheepItPath; Enabled = $true },
- @{ ID = 6; Name = &quot;i9-13ks&quot;; SSHArgs = &quot;-t -p 22146 i9-13ks&quot;; SheepItPath = $defaultSheepItPath; Enabled = $true }
-)
+$SheepItJarUrl = &#39;https://www.sheepit-renderfarm.com/media/applet/client-latest.jar&#39;
+$script:SheepItUsername = $null
+$script:SheepItRenderKey = $null
+
+function Initialize-SheepItCredentials {
+ if (-not $script:SheepItUsername) {
+ $script:SheepItUsername = Read-Host &quot;SheepIt username&quot; -Default &quot;RaincloudTheDragon&quot;
+ }
+
+ if (-not $script:SheepItRenderKey) {
+ $script:SheepItRenderKey = Read-Host &quot;SheepIt render key&quot; -Default &quot;IfCOWBHFQpceG0601DmyrwOOJOAp2UJAQ0O0X0jF&quot;
+ }
+}
+
+$workers = @(
+ @{ ID = 1; Name = &quot;i9kf&quot;; SSHArgs = &quot;-t i9kf&quot;; Enabled = $false },
+ @{ ID = 2; Name = &quot;blender-boss&quot;; SSHArgs = &quot;-t blender-boss&quot;; Enabled = $true },
+ @{ ID = 3; Name = &quot;max&quot;; SSHArgs = &quot;-t max&quot;; Enabled = $true },
+ @{ ID = 4; Name = &quot;masterbox&quot;; SSHArgs = &quot;-t masterbox&quot;; Enabled = $true },
+ @{ ID = 5; Name = &quot;echo&quot;; SSHArgs = &quot;-t echo&quot;; Enabled = $true },
+ @{ ID = 6; Name = &quot;i9-13ks&quot;; SSHArgs = &quot;-t -p 22146 i9-13ks&quot;; Enabled = $true }
+)
*** End Patch
```
</details>
</tool-use>
---
<think><details><summary>Thought Process</summary>
**Updating remote command function with sanitization**</details></think>
---
<tool-use data-tool-type="write" data-tool-name="apply_patch">
<details>
<summary>Tool use: **apply_patch** • Apply patch for undefined</summary>
```diff
*** Begin Patch
*** Update File: C:\Users\Nathan\Desktop\flamenco\unified_sheepit_launcher.ps1
@@
-function Get-RemoteSheepItCommand {
- param([string]$ExecutablePath)
-
-@&quot;
-&#96;$exe = &quot;$ExecutablePath&quot;
-if (-not (Test-Path &#96;$exe)) {
- Write-Host &quot;SheepIt launcher not found at &#96;$exe&quot; -ForegroundColor Red
- exit 1
-}
-
-&#96;$dir = Split-Path &#96;$exe
-Write-Host &quot;Launching SheepIt at &#96;$exe&quot; -ForegroundColor Cyan
-&#96;$proc = Start-Process -FilePath &#96;$exe -WorkingDirectory &#96;$dir -WindowStyle Minimized -PassThru
-if (&#96;$proc) {
- &#96;$id = &#96;$proc.Id
- Write-Host (&quot;SheepIt launcher started (PID: {0}).&quot; -f &#96;$id) -ForegroundColor Green
- Start-Sleep -Seconds 1
-
- if (Get-Process -Id &#96;$id -ErrorAction SilentlyContinue) {
- Write-Host (&quot;SheepIt launcher is still running (PID: {0}).&quot; -f &#96;$id) -ForegroundColor Green
- }
- else {
- try {
- &#96;$children = Get-CimInstance Win32_Process -Filter &quot;ParentProcessId=&#96;$id&quot;
- if (&#96;$children) {
- Write-Host &quot;Launcher handed off to:&quot; -ForegroundColor Green
- foreach (&#96;$child in &#96;$children) {
- Write-Host (&quot; {0} (PID: {1})&quot; -f &#96;$child.Name, &#96;$child.ProcessId) -ForegroundColor Green
- }
- }
- else {
- Write-Host &quot;Launcher exited immediately after starting. Check Task Manager for SheepIt/Java processes.&quot; -ForegroundColor Yellow
- }
- }
- catch {
- Write-Host &quot;Unable to inspect child processes.&quot; -ForegroundColor Yellow
- }
- }
-}
-else {
- Write-Host &quot;SheepIt start confirmed.&quot; -ForegroundColor Green
-}
-exit 0
-&quot;@
-}
+function Get-RemoteSheepItCommand {
+ param(
+ [string]$RenderKey,
+ [string]$Username
+ )
+
+ $safeKey = $RenderKey -replace &quot;&#39;&quot;, &quot;&#39;&#39;&quot;
+ $safeUser = $Username -replace &quot;&#39;&quot;, &quot;&#39;&#39;&quot;
+
+@&quot;
+&#96;$ErrorActionPreference = &#39;Stop&#39;
+
+try {
+ &#96;$appData = [Environment]::GetFolderPath(&#39;ApplicationData&#39;)
+ &#96;$sheepDir = Join-Path &#96;$appData &#39;sheepit&#39;
+ if (-not (Test-Path &#96;$sheepDir)) {
+ New-Item -Path &#96;$sheepDir -ItemType Directory -Force | Out-Null
+ }
+
+ &#96;$jarPath = Join-Path &#96;$sheepDir &#39;sheepit-client.jar&#39;
+ Write-Host &quot;Downloading SheepIt client...&quot; -ForegroundColor Cyan
+ Invoke-WebRequest -Uri &#39;$SheepItJarUrl&#39; -OutFile &#96;$jarPath -UseBasicParsing
+ Write-Host &quot;Download complete.&quot; -ForegroundColor Green
+
+ Write-Host &quot;Starting SheepIt client...&quot; -ForegroundColor Cyan
+ if (&#39;${safeUser}&#39;) {
+ Write-Host &quot;Authenticating as ${safeUser} via render key.&quot; -ForegroundColor Yellow
+ }
+
+ Set-Location &#96;$sheepDir
+ &amp; java -jar &#96;$jarPath --ui text --stdout --verbose -gpu optix 0 --renderkey &#39;${safeKey}&#39;
+}
+catch {
+ Write-Host &quot;Error: &#96;$($_.Exception.Message)&quot; -ForegroundColor Red
+}
+&quot;@
+}
*** End Patch
```
</details>
</tool-use>
---
<think><details><summary>Thought Process</summary>
**Refining remote script string handling**</details></think>
---
The model made no changes to the file.
---
<think><details><summary>Thought Process</summary>
**Confirming code changes before patching**</details></think>
---
<tool-use data-tool-type="read" data-tool-name="read_file">
<details><summary>Tool use: **read_file** • Read file: unified_sheepit_launcher.ps1</summary>
</details>
</tool-use>
---
<think><details><summary>Thought Process</summary>
**Patching script to add userLine injection**</details></think>
---
<tool-use data-tool-type="write" data-tool-name="apply_patch">
<details>
<summary>Tool use: **apply_patch** • Apply patch for undefined</summary>
```diff
*** Begin Patch
*** Update File: C:\Users\Nathan\Desktop\flamenco\unified_sheepit_launcher.ps1
@@
- $safeKey = $RenderKey -replace &quot;&#39;&quot;, &quot;&#39;&#39;&quot;
- $safeUser = $Username -replace &quot;&#39;&quot;, &quot;&#39;&#39;&quot;
-
-@&quot;
+ $safeKey = $RenderKey -replace &quot;&#39;&quot;, &quot;&#39;&#39;&quot;
+ $safeUser = $Username -replace &quot;&#39;&quot;, &quot;&#39;&#39;&quot;
+ $userLine = if ([string]::IsNullOrWhiteSpace($Username)) {
+ &#39;&#39;
+ } else {
+ &quot; Write-Host &#39;Authenticating as ${safeUser} via render key.&#39; -ForegroundColor Yellow&#96;n&quot;
+ }
+
+@&quot;
&#96;$ErrorActionPreference = &#39;Stop&#39;
try {
@@
- Write-Host &quot;Starting SheepIt client...&quot; -ForegroundColor Cyan
- if (&#39;${safeUser}&#39;) {
- Write-Host &quot;Authenticating as ${safeUser} via render key.&quot; -ForegroundColor Yellow
- }
-
- Set-Location &#96;$sheepDir
+ Write-Host &quot;Starting SheepIt client...&quot; -ForegroundColor Cyan
+${userLine} Set-Location &#96;$sheepDir
&amp; java -jar &#96;$jarPath --ui text --stdout --verbose -gpu optix 0 --renderkey &#39;${safeKey}&#39;
}
catch {
*** End Patch
```
</details>
</tool-use>
---
<think><details><summary>Thought Process</summary>
**Rewriting SheepIt worker functions**</details></think>
---
<tool-use data-tool-type="write" data-tool-name="apply_patch">
<details>
<summary>Tool use: **apply_patch** • Apply patch for undefined</summary>
```diff
*** Begin Patch
*** Update File: C:\Users\Nathan\Desktop\flamenco\unified_sheepit_launcher.ps1
@@
-function Start-SheepItWorker {
- param([object]$Worker)
-
- if (-not $Worker.Enabled) {
- Write-Host &quot;$($Worker.Name) does not have SheepIt configured yet.&quot; -ForegroundColor Yellow
- return
- }
-
- $remoteCommand = Get-RemoteSheepItCommand -ExecutablePath $Worker.SheepItPath
- $encoded = [Convert]::ToBase64String([System.Text.Encoding]::Unicode.GetBytes($remoteCommand))
- $ssh = &quot;ssh -o ServerAliveInterval=60 -o ServerAliveCountMax=30 $($Worker.SSHArgs) &#96;&quot;powershell -NoLogo -NoProfile -EncodedCommand $encoded&#96;&quot;&quot;
-
- Write-Host &quot;Connecting to $($Worker.Name)...&quot; -ForegroundColor Cyan
- try {
- Invoke-Expression $ssh
- $exitCode = $LASTEXITCODE
-
- if ($exitCode -eq 0) {
- Write-Host &quot;SheepIt launched on $($Worker.Name).&quot; -ForegroundColor Green
- } else {
- Write-Host &quot;Launch on $($Worker.Name) exited with $exitCode.&quot; -ForegroundColor Red
- }
- }
- catch {
- Write-Host &quot;Connection to $($Worker.Name) failed: $($_.Exception.Message)&quot; -ForegroundColor Red
- }
-}
+function New-SheepItSessionScript {
+ param(
+ [object]$Worker,
+ [string]$EncodedCommand
+ )
+
+@&quot;
+Write-Host &#39;Connecting to $($Worker.Name)...&#39; -ForegroundColor Cyan
+ssh -o ServerAliveInterval=60 -o ServerAliveCountMax=30 $($Worker.SSHArgs) &#96;&quot;powershell -NoLogo -NoProfile -ExecutionPolicy Bypass -EncodedCommand $EncodedCommand&#96;&quot;
+Write-Host &quot;&#96;nSSH session ended.&quot; -ForegroundColor Yellow
+Read-Host &quot;Press Enter to close&quot;
+&quot;@
+}
+
+function Launch-SheepItTab {
+ param(
+ [string]$Title,
+ [string]$Content
+ )
+
+ $tempScript = [System.IO.Path]::GetTempFileName() + &#39;.ps1&#39;
+ Set-Content -Path $tempScript -Value $Content -Encoding UTF8
+
+ if (Get-Command wt.exe -ErrorAction SilentlyContinue) {
+ Start-Process wt.exe -ArgumentList &quot;-w 0 new-tab --title &#96;&quot;$Title&#96;&quot; powershell -NoLogo -NoProfile -ExecutionPolicy Bypass -File &#96;&quot;$tempScript&#96;&quot;&quot;
+ } else {
+ Start-Process powershell -ArgumentList &quot;-NoLogo -NoProfile -ExecutionPolicy Bypass -File &#96;&quot;$tempScript&#96;&quot;&quot;
+ }
+}
+
+function Start-SheepItWorker {
+ param([object]$Worker)
+
+ if (-not $Worker.Enabled) {
+ Write-Host &quot;$($Worker.Name) is not enabled for SheepIt.&quot; -ForegroundColor Yellow
+ return
+ }
+
+ Initialize-SheepItCredentials
+
+ $remoteCommand = Get-RemoteSheepItCommand -RenderKey $script:SheepItRenderKey -Username $script:SheepItUsername
+ $encoded = [Convert]::ToBase64String([System.Text.Encoding]::Unicode.GetBytes($remoteCommand))
+ $sessionScript = New-SheepItSessionScript -Worker $Worker -EncodedCommand $encoded
+ $title = &quot;$($Worker.Name) - SheepIt&quot;
+
+ Launch-SheepItTab -Title $title -Content $sessionScript
+ Write-Host &quot;Opened SheepIt session for $($Worker.Name) in a new terminal tab.&quot; -ForegroundColor Green
+}
*** End Patch
```
</details>
</tool-use>
---
<think><details><summary>Thought Process</summary>
**Refining script startup and status updates**</details></think>
---
<tool-use data-tool-type="write" data-tool-name="apply_patch">
<details>
<summary>Tool use: **apply_patch** • Apply patch for undefined</summary>
```diff
*** Begin Patch
*** Update File: C:\Users\Nathan\Desktop\flamenco\unified_sheepit_launcher.ps1
@@
- foreach ($worker in $workers) {
- $status = if ($worker.Enabled) { &quot;ready&quot; } else { &quot;missing exe&quot; }
- $color = if ($worker.Enabled) { &quot;Green&quot; } else { &quot;DarkYellow&quot; }
+ foreach ($worker in $workers) {
+ $status = if ($worker.Enabled) { &quot;ready&quot; } else { &quot;disabled&quot; }
+ $color = if ($worker.Enabled) { &quot;Green&quot; } else { &quot;DarkYellow&quot; }
Write-Host (&quot;{0}. {1} ({2})&quot; -f $worker.ID, $worker.Name, $status) -ForegroundColor $color
}
*** End Patch
```
</details>
</tool-use>
---
<think><details><summary>Thought Process</summary>
**Improving Start-AllSheepIt function**</details></think>
---
<tool-use data-tool-type="write" data-tool-name="apply_patch">
<details>
<summary>Tool use: **apply_patch** • Apply patch for undefined</summary>
```diff
*** Begin Patch
*** Update File: C:\Users\Nathan\Desktop\flamenco\unified_sheepit_launcher.ps1
@@
-function Start-AllSheepIt {
- $targets = $workers | Where-Object { $_.Enabled }
+function Start-AllSheepIt {
+ Initialize-SheepItCredentials
+
+ $targets = $workers | Where-Object { $_.Enabled }
@@
- Start-Sleep -Seconds 1
+ Start-Sleep -Milliseconds 200
}
}
*** End Patch
```
</details>
</tool-use>
---
<think><details><summary>Thought Process</summary>
**Optimizing initialization calls**</details></think>
---
<tool-use data-tool-type="write" data-tool-name="apply_patch">
<details>
<summary>Tool use: **apply_patch** • Apply patch for undefined</summary>
```diff
*** Begin Patch
*** Update File: C:\Users\Nathan\Desktop\flamenco\unified_sheepit_launcher.ps1
@@
-function Select-SheepItWorker {
+function Select-SheepItWorker {
@@
}
+Initialize-SheepItCredentials
+
while ($true) {
*** End Patch
```
</details>
</tool-use>
---
<think><details><summary>Thought Process</summary>
**Checking for leftover SheepItPath references**</details></think>
---
<tool-use data-tool-type="grep" data-tool-name="grep">
<details>
<summary>Tool use: **grep** • Grep for "SheepItPath" in "unified_sheepit_launcher.ps1" • 0 matches</summary>
Output mode: content
_No matches found_
</details>
</tool-use>
---
<think><details><summary>Thought Process</summary>
**Verifying script variable substitution and formatting**</details></think>
---
<tool-use data-tool-type="generic" data-tool-name="read_lints">
<details>
<summary>Tool use: **read_lints** • Read lints for 1 file</summary>
Lint paths:
- `unified_sheepit_launcher.ps1`
Lint results
Lint errors for `unified_sheepit_launcher.ps1`
| Message | Range | Severity |
|-------|-------|----------|
| The cmdlet 'Launch-SheepItTab' uses an unapproved verb. | 85:10-85:27 | DIAGNOSTIC_SEVERITY_WARNING |
</details>
</tool-use>
---
<think><details><summary>Thought Process</summary>
**Renaming function to approved verb**</details></think>
---
<tool-use data-tool-type="write" data-tool-name="apply_patch">
<details>
<summary>Tool use: **apply_patch** • Apply patch for undefined</summary>
```diff
*** Begin Patch
*** Update File: C:\Users\Nathan\Desktop\flamenco\unified_sheepit_launcher.ps1
@@
-function Launch-SheepItTab {
+function Start-SheepItTab {
@@
- if (Get-Command wt.exe -ErrorAction SilentlyContinue) {
- Start-Process wt.exe -ArgumentList &quot;-w 0 new-tab --title &#96;&quot;$Title&#96;&quot; powershell -NoLogo -NoProfile -ExecutionPolicy Bypass -File &#96;&quot;$tempScript&#96;&quot;&quot;
- } else {
- Start-Process powershell -ArgumentList &quot;-NoLogo -NoProfile -ExecutionPolicy Bypass -File &#96;&quot;$tempScript&#96;&quot;&quot;
- }
+ if (Get-Command wt.exe -ErrorAction SilentlyContinue) {
+ Start-Process wt.exe -ArgumentList &quot;-w 0 new-tab --title &#96;&quot;$Title&#96;&quot; powershell -NoLogo -NoProfile -ExecutionPolicy Bypass -File &#96;&quot;$tempScript&#96;&quot;&quot;
+ } else {
+ Start-Process powershell -ArgumentList &quot;-NoLogo -NoProfile -ExecutionPolicy Bypass -File &#96;&quot;$tempScript&#96;&quot;&quot;
+ }
}
@@
- Launch-SheepItTab -Title $title -Content $sessionScript
+ Start-SheepItTab -Title $title -Content $sessionScript
*** End Patch
```
</details>
</tool-use>
---
<think><details><summary>Thought Process</summary>
**Rerunning lint checks**</details></think>
---
<tool-use data-tool-type="generic" data-tool-name="read_lints">
<details>
<summary>Tool use: **read_lints** • Read lints for 1 file</summary>
Lint paths:
- `unified_sheepit_launcher.ps1`
Lint results
**No lint errors found**
</details>
</tool-use>
---
<think><details><summary>Thought Process</summary>
**Managing task status updates**</details></think>
---
<tool-use data-tool-type="generic" data-tool-name="todo_write">
<details><summary>Tool use: **todo_write** • Todo List</summary>
- [x] Add render key prompt/state to unified_sheepit_launcher.ps1
- [-] Implement remote script to download jar to %APPDATA%\sheepit and run java with requested flags
- [ ] Update worker launch functions to run ssh in interactive tabs retaining session control
</details>
</tool-use>
---
<think><details><summary>Thought Process</summary>
**Updating task statuses**</details></think>
---
<tool-use data-tool-type="generic" data-tool-name="todo_write">
<details><summary>Tool use: **todo_write** • Todo List</summary>
- [x] Add render key prompt/state to unified_sheepit_launcher.ps1
- [x] Implement remote script to download jar to %APPDATA%\sheepit and run java with requested flags
- [-] Update worker launch functions to run ssh in interactive tabs retaining session control
</details>
</tool-use>
---
<think><details><summary>Thought Process</summary>
**Completing interactive launch features**</details></think>
---
<tool-use data-tool-type="generic" data-tool-name="todo_write">
<details><summary>Tool use: **todo_write** • Todo List</summary>
- [x] Add render key prompt/state to unified_sheepit_launcher.ps1
- [x] Implement remote script to download jar to %APPDATA%\sheepit and run java with requested flags
- [x] Update worker launch functions to run ssh in interactive tabs retaining session control
</details>
</tool-use>
---
<think><details><summary>Thought Process</summary>
**Checking initialization and constants usage**</details></think>
---
<tool-use data-tool-type="read" data-tool-name="read_file">
<details><summary>Tool use: **read_file** • Read file: unified_sheepit_launcher.ps1</summary>
</details>
</tool-use>
---
<think><details><summary>Thought Process</summary>
**Reviewing script insertion and finalizing**
Im carefully verifying how the userLine variable is injected into the script to confirm it interpolates correctly without adding stray colons or whitespace. I want to ensure default behaviors work if userLine is empty and that no security risks arise by embedding the render key plainly. Then, Im consolidating the final notes to highlight key new features like startup prompts, remote jar download, launching Windows Terminal tabs, and verifying instructions, along with referencing exact code snippet lines for clarity.</details></think>
---
## Summary
- Prompt the SheepIt username/render key once per session (defaults injected) so launches reuse the saved credentials.
- Remote command now ensures `%APPDATA%\sheepit\sheepit-client.jar` is downloaded fresh, then runs `java -jar` with `--ui text --stdout --verbose -gpu optix 0 --renderkey …` for interactive CLI use.
- Worker launches open in dedicated Windows Terminal (or PowerShell) tabs, keeping the SSH session attached so you can interact with the client directly.
```33:117:unified_sheepit_launcher.ps1
try {
$appData = [Environment]::GetFolderPath('ApplicationData')
$sheepDir = Join-Path $appData 'sheepit'
...
& java -jar $jarPath --ui text --stdout --verbose -gpu optix 0 --renderkey 'IfCOWBHFQpceG0601DmyrwOOJOAp2UJAQ0O0X0jF'
}
```
```71:118:unified_sheepit_launcher.ps1
Write-Host 'Connecting to $(Worker.Name)...'
ssh ... "powershell -NoLogo -NoProfile -ExecutionPolicy Bypass -EncodedCommand <base64>"
Write-Host "`nSSH session ended."
Read-Host "Press Enter to close"
```
## Next Steps
- Launch `unified_sheepit_launcher.ps1`, confirm the credential prompts, then start a worker; a new tab should appear with the SheepIt CLI ready for input.
---
_**User (2025-11-05 22:17Z)**_
@PowerShell Extension (5-14) I'm going to test on i9kf for now.
---
_**Agent (model gpt-5-codex, mode Agent)**_
<think><details><summary>Thought Process</summary>
**Enabling i9kf worker**</details></think>
---
<tool-use data-tool-type="write" data-tool-name="apply_patch">
<details>
<summary>Tool use: **apply_patch** • Apply patch for undefined</summary>
```diff
*** Begin Patch
*** Update File: C:\Users\Nathan\Desktop\flamenco\unified_sheepit_launcher.ps1
@@
-$workers = @(
- @{ ID = 1; Name = &quot;i9kf&quot;; SSHArgs = &quot;-t i9kf&quot;; Enabled = $false },
+$workers = @(
+ @{ ID = 1; Name = &quot;i9kf&quot;; SSHArgs = &quot;-t i9kf&quot;; Enabled = $true },
*** End Patch
```
</details>
</tool-use>
---
<think><details><summary>Thought Process</summary>
**Preparing to run linter checks**</details></think>
---
<tool-use data-tool-type="generic" data-tool-name="read_lints">
<details>
<summary>Tool use: **read_lints** • Read lints for 1 file</summary>
Lint paths:
- `unified_sheepit_launcher.ps1`
Lint results
**No lint errors found**
</details>
</tool-use>
---
<think><details><summary>Thought Process</summary>
**Preparing final summary**</details></think>
---
- Enabled the `i9kf` entry in `unified_sheepit_launcher.ps1`, so it now appears as “ready” in the selector and can be launched like the other systems.
```23:29:unified_sheepit_launcher.ps1
$workers = @(
@{ ID = 1; Name = "i9kf"; SSHArgs = "-t i9kf"; Enabled = $true },
@{ ID = 2; Name = "blender-boss"; SSHArgs = "-t blender-boss"; Enabled = $true },
...
```
Run the launcher again and pick option `1`; it should open an interactive SheepIt session for `i9kf`.
---
_**User (2025-11-05 22:17Z)**_
let's not have it prompt for username and renderkey, just go with the default.
---
_**Agent (model gpt-5-codex, mode Agent)**_
<think><details><summary>Thought Process</summary>
**Removing interactive prompts from initialization**</details></think>
---
<tool-use data-tool-type="write" data-tool-name="apply_patch">
<details>
<summary>Tool use: **apply_patch** • Apply patch for undefined</summary>
```diff
*** Begin Patch
*** Update File: C:\Users\Nathan\Desktop\flamenco\unified_sheepit_launcher.ps1
@@
function Initialize-SheepItCredentials {
if (-not $script:SheepItUsername) {
- $script:SheepItUsername = Read-Host &quot;SheepIt username&quot; -Default &quot;RaincloudTheDragon&quot;
+ $script:SheepItUsername = &quot;RaincloudTheDragon&quot;
}
if (-not $script:SheepItRenderKey) {
- $script:SheepItRenderKey = Read-Host &quot;SheepIt render key&quot; -Default &quot;IfCOWBHFQpceG0601DmyrwOOJOAp2UJAQ0O0X0jF&quot;
+ $script:SheepItRenderKey = &quot;IfCOWBHFQpceG0601DmyrwOOJOAp2UJAQ0O0X0jF&quot;
}
}
*** End Patch
```
</details>
</tool-use>
---
<think><details><summary>Thought Process</summary>
**Reviewing credential prompt calls**</details></think>
---
- Stopped prompting for credentials by hard-setting the defaults in `Initialize-SheepItCredentials`, so the launcher always uses your preferred username and render key without asking.
```13:20:unified_sheepit_launcher.ps1
function Initialize-SheepItCredentials {
if (-not $script:SheepItUsername) {
$script:SheepItUsername = "RaincloudTheDragon"
}
if (-not $script:SheepItRenderKey) {
$script:SheepItRenderKey = "IfCOWBHFQpceG0601DmyrwOOJOAp2UJAQ0O0X0jF"
}
}
```
Run the launcher again—no credential prompts will appear.
---

View File

@@ -6,92 +6,120 @@ function Show-Header {
Write-Host Write-Host
} }
$defaultSheepItPath = "C:\Users\Nathan\Desktop\sheepit-autoupdate.exe" $SheepItJarUrl = 'https://www.sheepit-renderfarm.com/media/applet/client-latest.jar'
$script:SheepItUsername = $null
$script:SheepItRenderKey = $null
function Initialize-SheepItCredentials {
if (-not $script:SheepItUsername) {
$script:SheepItUsername = "RaincloudTheDragon"
}
if (-not $script:SheepItRenderKey) {
$script:SheepItRenderKey = "IfCOWBHFQpceG0601DmyrwOOJOAp2UJAQ0O0X0jF"
}
}
$workers = @( $workers = @(
@{ ID = 1; Name = "i9kf"; SSHArgs = "-t i9kf"; SheepItPath = $defaultSheepItPath; Enabled = $false }, @{ ID = 1; Name = "i9kf"; SSHArgs = "-t i9kf"; Enabled = $true },
@{ ID = 2; Name = "blender-boss"; SSHArgs = "-t blender-boss"; SheepItPath = $defaultSheepItPath; Enabled = $true }, @{ ID = 2; Name = "blender-boss"; SSHArgs = "-t blender-boss"; Enabled = $true },
@{ ID = 3; Name = "max"; SSHArgs = "-t max"; SheepItPath = $defaultSheepItPath; Enabled = $true }, @{ ID = 3; Name = "max"; SSHArgs = "-t max"; Enabled = $true },
@{ ID = 4; Name = "masterbox"; SSHArgs = "-t masterbox"; SheepItPath = $defaultSheepItPath; Enabled = $true }, @{ ID = 4; Name = "masterbox"; SSHArgs = "-t masterbox"; Enabled = $true },
@{ ID = 5; Name = "echo"; SSHArgs = "-t echo"; SheepItPath = $defaultSheepItPath; Enabled = $true }, @{ ID = 5; Name = "echo"; SSHArgs = "-t echo"; Enabled = $true },
@{ ID = 6; Name = "i9-13ks"; SSHArgs = "-t -p 22146 i9-13ks"; SheepItPath = $defaultSheepItPath; Enabled = $true } @{ ID = 6; Name = "i9-13ks"; SSHArgs = "-t -p 22146 i9-13ks"; Enabled = $true }
) )
function Get-RemoteSheepItCommand { function Get-RemoteSheepItCommand {
param([string]$ExecutablePath) param(
[string]$RenderKey,
[string]$Username
)
$safeKey = $RenderKey -replace "'", "''"
$safeUser = $Username -replace "'", "''"
$userLine = if ([string]::IsNullOrWhiteSpace($Username)) {
''
} else {
" Write-Host 'Authenticating as ${safeUser} via render key.' -ForegroundColor Yellow`n"
}
@" @"
`$exe = "$ExecutablePath" `$ErrorActionPreference = 'Stop'
if (-not (Test-Path `$exe)) {
Write-Host "SheepIt launcher not found at `$exe" -ForegroundColor Red
exit 1
}
`$dir = Split-Path `$exe try {
Write-Host "Launching SheepIt at `$exe" -ForegroundColor Cyan `$appData = [Environment]::GetFolderPath('ApplicationData')
`$proc = Start-Process -FilePath `$exe -WorkingDirectory `$dir -WindowStyle Minimized -PassThru `$sheepDir = Join-Path `$appData 'sheepit'
if (`$proc) { if (-not (Test-Path `$sheepDir)) {
`$id = `$proc.Id New-Item -Path `$sheepDir -ItemType Directory -Force | Out-Null
Write-Host ("SheepIt launcher started (PID: {0})." -f `$id) -ForegroundColor Green }
Start-Sleep -Seconds 1
if (Get-Process -Id `$id -ErrorAction SilentlyContinue) { `$jarPath = Join-Path `$sheepDir 'sheepit-client.jar'
Write-Host ("SheepIt launcher is still running (PID: {0})." -f `$id) -ForegroundColor Green Write-Host "Downloading SheepIt client..." -ForegroundColor Cyan
} Invoke-WebRequest -Uri '$SheepItJarUrl' -OutFile `$jarPath -UseBasicParsing
else { Write-Host "Download complete." -ForegroundColor Green
try {
`$children = Get-CimInstance Win32_Process -Filter "ParentProcessId=`$id" Write-Host "Starting SheepIt client..." -ForegroundColor Cyan
if (`$children) { ${userLine} Set-Location `$sheepDir
Write-Host "Launcher handed off to:" -ForegroundColor Green & java -jar `$jarPath --ui text --stdout --verbose -gpu optix 0 --renderkey '${safeKey}'
foreach (`$child in `$children) {
Write-Host (" {0} (PID: {1})" -f `$child.Name, `$child.ProcessId) -ForegroundColor Green
}
}
else {
Write-Host "Launcher exited immediately after starting. Check Task Manager for SheepIt/Java processes." -ForegroundColor Yellow
}
}
catch {
Write-Host "Unable to inspect child processes." -ForegroundColor Yellow
}
}
} }
else { catch {
Write-Host "SheepIt start confirmed." -ForegroundColor Green Write-Host "Error: `$($_.Exception.Message)" -ForegroundColor Red
} }
exit 0
"@ "@
} }
function New-SheepItSessionScript {
param(
[object]$Worker,
[string]$EncodedCommand
)
@"
Write-Host 'Connecting to $($Worker.Name)...' -ForegroundColor Cyan
ssh -o ServerAliveInterval=60 -o ServerAliveCountMax=30 $($Worker.SSHArgs) `"powershell -NoLogo -NoProfile -ExecutionPolicy Bypass -EncodedCommand $EncodedCommand`"
Write-Host "`nSSH session ended." -ForegroundColor Yellow
Read-Host "Press Enter to close"
"@
}
function Start-SheepItTab {
param(
[string]$Title,
[string]$Content
)
$tempScript = [System.IO.Path]::GetTempFileName() + '.ps1'
Set-Content -Path $tempScript -Value $Content -Encoding UTF8
if (Get-Command wt.exe -ErrorAction SilentlyContinue) {
Start-Process wt.exe -ArgumentList "-w 0 new-tab --title `"$Title`" powershell -NoLogo -NoProfile -ExecutionPolicy Bypass -File `"$tempScript`""
} else {
Start-Process powershell -ArgumentList "-NoLogo -NoProfile -ExecutionPolicy Bypass -File `"$tempScript`""
}
}
function Start-SheepItWorker { function Start-SheepItWorker {
param([object]$Worker) param([object]$Worker)
if (-not $Worker.Enabled) { if (-not $Worker.Enabled) {
Write-Host "$($Worker.Name) does not have SheepIt configured yet." -ForegroundColor Yellow Write-Host "$($Worker.Name) is not enabled for SheepIt." -ForegroundColor Yellow
return return
} }
$remoteCommand = Get-RemoteSheepItCommand -ExecutablePath $Worker.SheepItPath Initialize-SheepItCredentials
$remoteCommand = Get-RemoteSheepItCommand -RenderKey $script:SheepItRenderKey -Username $script:SheepItUsername
$encoded = [Convert]::ToBase64String([System.Text.Encoding]::Unicode.GetBytes($remoteCommand)) $encoded = [Convert]::ToBase64String([System.Text.Encoding]::Unicode.GetBytes($remoteCommand))
$ssh = "ssh -o ServerAliveInterval=60 -o ServerAliveCountMax=30 $($Worker.SSHArgs) `"powershell -NoLogo -NoProfile -EncodedCommand $encoded`"" $sessionScript = New-SheepItSessionScript -Worker $Worker -EncodedCommand $encoded
$title = "$($Worker.Name) - SheepIt"
Write-Host "Connecting to $($Worker.Name)..." -ForegroundColor Cyan Start-SheepItTab -Title $title -Content $sessionScript
try { Write-Host "Opened SheepIt session for $($Worker.Name) in a new terminal tab." -ForegroundColor Green
Invoke-Expression $ssh
$exitCode = $LASTEXITCODE
if ($exitCode -eq 0) {
Write-Host "SheepIt launched on $($Worker.Name)." -ForegroundColor Green
} else {
Write-Host "Launch on $($Worker.Name) exited with $exitCode." -ForegroundColor Red
}
}
catch {
Write-Host "Connection to $($Worker.Name) failed: $($_.Exception.Message)" -ForegroundColor Red
}
} }
function Start-AllSheepIt { function Start-AllSheepIt {
Initialize-SheepItCredentials
$targets = $workers | Where-Object { $_.Enabled } $targets = $workers | Where-Object { $_.Enabled }
if (-not $targets) { if (-not $targets) {
@@ -101,7 +129,7 @@ function Start-AllSheepIt {
foreach ($worker in $targets) { foreach ($worker in $targets) {
Start-SheepItWorker -Worker $worker Start-SheepItWorker -Worker $worker
Start-Sleep -Seconds 1 Start-Sleep -Milliseconds 200
} }
} }
@@ -111,7 +139,7 @@ function Select-SheepItWorker {
Write-Host "Select a system:" -ForegroundColor Magenta Write-Host "Select a system:" -ForegroundColor Magenta
foreach ($worker in $workers) { foreach ($worker in $workers) {
$status = if ($worker.Enabled) { "ready" } else { "missing exe" } $status = if ($worker.Enabled) { "ready" } else { "disabled" }
$color = if ($worker.Enabled) { "Green" } else { "DarkYellow" } $color = if ($worker.Enabled) { "Green" } else { "DarkYellow" }
Write-Host ("{0}. {1} ({2})" -f $worker.ID, $worker.Name, $status) -ForegroundColor $color Write-Host ("{0}. {1} ({2})" -f $worker.ID, $worker.Name, $status) -ForegroundColor $color
} }
@@ -144,6 +172,8 @@ function Select-SheepItWorker {
} }
} }
Initialize-SheepItCredentials
while ($true) { while ($true) {
Show-Header Show-Header
Write-Host "Main Menu:" -ForegroundColor Magenta Write-Host "Main Menu:" -ForegroundColor Magenta