igneum/proto-cuda/windows-app/stop-igneum.ps1
igneum-labs faaea2fa74 Windows app: node and miners in one window, NODE card on the dashboard
proto-cuda/windows-app/: START-IGNEUM.bat starts igneumd, waits for sync, then runs the
miners; igneum-common.ps1 holds the dashboard, node, chain reader and miner functions once,
dot-sourced by start-igneum.ps1, start-mining.ps1 and start-node.ps1. STOP-IGNEUM.bat stops
everything in order. make-package.sh builds igneum-windows.zip.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-10-03 21:19:22 +00:00

54 lines
2.8 KiB
PowerShell

# Stops everything the Igneum launchers started, in order, for the case where the launcher window was closed instead of
# Ctrl+C (started by STOP-IGNEUM.bat). 3 October 2026.
# 1. The launcher scripts themselves (start-igneum.ps1, start-mining.ps1, start-node.ps1), so nothing gets restarted.
# 2. The miners and their GPU workers.
# 3. The node.
# 4. The newest launcher log and node log are uploaded with upload-log.bat when it is present.
$ProgressPreference = 'SilentlyContinue'
$ErrorActionPreference = 'Continue'
$root = $PSScriptRoot
Set-Location $root
function Stop-ByName([string]$name) {
$procs = @(Get-Process -Name $name -ErrorAction SilentlyContinue)
foreach ($p in $procs) { & taskkill.exe /T /F /PID $p.Id 2>$null | Out-Null }
return $procs.Count
}
$launchers = 0
try {
$mine = $PID
$ps = @(Get-CimInstance Win32_Process -Filter "Name='powershell.exe' OR Name='pwsh.exe'" -ErrorAction SilentlyContinue)
foreach ($p in $ps) {
if ($p.ProcessId -ne $mine -and $p.CommandLine -and $p.CommandLine -match 'start-(igneum|mining|node)\.ps1') {
& taskkill.exe /F /PID $p.ProcessId 2>$null | Out-Null
$launchers++
}
}
} catch { }
Write-Host "launcher windows stopped: $launchers"
$miners = Stop-ByName 'igneum-miner'
$workers = (Stop-ByName 'igneum-bench-cuda-devnet') + (Stop-ByName 'igneum-bench-cl-devnet')
Write-Host "miners stopped: $miners, GPU workers stopped: $workers"
Start-Sleep -Seconds 2
$nodes = Stop-ByName 'igneumd'
Write-Host "node processes stopped: $nodes"
$uploader = Join-Path $root 'upload-log.bat'
if (Test-Path $uploader) {
$machine = $env:COMPUTERNAME
$newest = Get-ChildItem -Path $root -Filter '*.log' -ErrorAction SilentlyContinue | Where-Object { $_.Name -match '^(igneum|launcher|node-launcher)-[0-9]{8}-[0-9]{6}\.log$' } | Sort-Object LastWriteTime -Descending | Select-Object -First 1
if ($newest) {
$runStamp = $newest.BaseName.Substring($newest.BaseName.Length - 15) # yyyyMMdd-HHmmss
$label = $newest.BaseName.Substring(0, $newest.BaseName.Length - 16) + "-$machine" # igneum-<PC>, launcher-<PC>, node-launcher-<PC>
$o = cmd /s /c "`"$uploader`" `"$($newest.FullName)`" $label $label-$runStamp" 2>&1
Write-Host ("uploaded " + $newest.Name + ": " + ($o -join ' '))
}
$nodeLog = Get-ChildItem -Path $root -Filter 'node-*.log' -ErrorAction SilentlyContinue | Where-Object { $_.Name -notmatch '^node-launcher' } | Sort-Object LastWriteTime -Descending | Select-Object -First 1
if ($nodeLog) {
$o = cmd /s /c "`"$uploader`" `"$($nodeLog.FullName)`" nodelog-$machine nodelog-$machine-stop" 2>&1
Write-Host ("uploaded " + $nodeLog.Name + ": " + ($o -join ' '))
}
} else { Write-Host 'no upload-log.bat here; the logs stay local' }
Write-Host 'done. Start again with START-IGNEUM.bat.'