fix(perception): run Worker build interactively

This commit is contained in:
DCCONSTRUCTIONS
2026-08-26 18:32:22 +03:00
parent 1cc87e1836
commit b445745d27
2 changed files with 66 additions and 0 deletions
@@ -0,0 +1,62 @@
[CmdletBinding()]
param(
[Parameter(Mandatory = $true)]
[string]$ReleaseRoot,
[Parameter(Mandatory = $true)]
[ValidatePattern("^[A-Za-z0-9._-]{1,96}$")]
[string]$RunId
)
$ErrorActionPreference = "Stop"
$taskName = "MissionCore-M49T1GSeg3D"
$release = (Resolve-Path -LiteralPath $ReleaseRoot).Path
$payload = Join-Path $release "payload"
$runner = Join-Path $payload "Invoke-M49T1GSeg3DQualification.ps1"
if (-not (Test-Path -LiteralPath $runner -PathType Leaf)) {
throw "M49 T1 runner is missing"
}
$existing = Get-ScheduledTask -TaskName $taskName -ErrorAction SilentlyContinue
if ($existing -and $existing.State -eq "Running") {
throw "$taskName is already running"
}
$powerShell = "$env:SystemRoot\System32\WindowsPowerShell\v1.0\powershell.exe"
$arguments = @(
"-NoLogo", "-NoProfile", "-NonInteractive", "-ExecutionPolicy", "Bypass",
"-File", "`"$runner`"",
"-BuildContext", "`"$payload`"",
"-RunId", "`"$RunId`""
) -join " "
$userId = [System.Security.Principal.WindowsIdentity]::GetCurrent().Name
$action = New-ScheduledTaskAction `
-Execute $powerShell `
-Argument $arguments `
-WorkingDirectory $payload
$principal = New-ScheduledTaskPrincipal `
-UserId $userId `
-LogonType Interactive `
-RunLevel Limited
$trigger = New-ScheduledTaskTrigger -Once -At ((Get-Date).AddMinutes(30))
$settings = New-ScheduledTaskSettingsSet `
-AllowStartIfOnBatteries `
-DontStopIfGoingOnBatteries `
-StartWhenAvailable `
-ExecutionTimeLimit ([TimeSpan]::FromHours(3))
Register-ScheduledTask `
-TaskName $taskName `
-Action $action `
-Principal $principal `
-Trigger $trigger `
-Settings $settings `
-Description "One-shot M49 T1 pinned GSeg3D upstream qualification." `
-Force | Out-Null
Start-ScheduledTask -TaskName $taskName
[pscustomobject]@{
task_name = $taskName
run_id = $RunId
release_root = $release
state = (Get-ScheduledTask -TaskName $taskName).State.ToString()
} | ConvertTo-Json -Compress
@@ -19,6 +19,10 @@ SOURCES = (
Path("experiments/perception/worker/m49_t1_gseg3d/Dockerfile"),
Path("experiments/perception/worker/m49_t1_gseg3d/qualify.sh"),
Path("experiments/perception/worker/Invoke-M49T1GSeg3DQualification.ps1"),
Path(
"experiments/perception/worker/"
"Invoke-M49T1GSeg3DQualificationAsInteractiveUser.ps1"
),
Path("config/perception/m49-traversability-candidate-manifest-v1.json"),
Path("config/perception/m49-camera-lidar-traversability-v1.json"),
)