Files
skillfactor-pipeline/push_loop.ps1
skillfactor-pipeline af05383bb1 chore: v1 baseline - full 3,039-package catalog with AI-skill enrichment and O*NET backfill
Snapshot before the quality program (relevance gates, tiered mapping,
QA linter). v1 is the immutable before/after reference; evidence crawl
was at ~175/3039 occupations when tagged.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01PDKeXvpT6tENSvyQGLV1Uq
2026-07-09 05:32:49 +02:00

56 lines
1.9 KiB
PowerShell

# push_loop.ps1 — Resilient push runner: restarts batch_run.py on crash,
# stops when all packages are done or budget exhausted.
# Usage: .\push_loop.ps1 (run from C:\dev\skillfactor)
Set-Location C:\dev\skillfactor
$python = "C:\dev\skillfactor\.venv\Scripts\python.exe"
$script = "pipeline/batch_run.py"
$logBase = "docs\logs\pushloop"
$run = 0
while ($true) {
$run++
$logOut = "${logBase}_run${run}.log"
$logErr = "${logBase}_run${run}-err.log"
# Check if work is done
$prog = Get-Content "data\progress.json" | ConvertFrom-Json
$occs = $prog.occupations | Get-Member -MemberType NoteProperty | Select-Object -ExpandProperty Name
$done = ($occs | Where-Object { $prog.occupations.$_.package -eq 'done' }).Count
$total = $occs.Count
Write-Output "[$(Get-Date -f 'HH:mm')] Run $run start: $done done / $total entries"
if ($done -ge 3039) {
Write-Output "Alle 3039 Pakete gepusht. Push-Loop fertig."
break
}
# Start batch_run with stdout unbuffered
$proc = Start-Process -FilePath $python `
-ArgumentList "-u $script --stage packages" `
-WorkingDirectory "C:\dev\skillfactor" `
-RedirectStandardOutput $logOut `
-RedirectStandardError $logErr `
-WindowStyle Hidden -PassThru -Wait
$exitCode = $proc.ExitCode
$newDone = (Get-Content "data\progress.json" | ConvertFrom-Json).occupations |
Get-Member -MemberType NoteProperty | Select-Object -ExpandProperty Name |
Where-Object { (Get-Content "data\progress.json" | ConvertFrom-Json).occupations.$_.package -eq 'done' }
$newDone = @($newDone).Count
Write-Output "[$(Get-Date -f 'HH:mm')] Run $run exit=$exitCode done=$newDone"
if ($exitCode -eq 2) {
Write-Output "Budget erschoepft. Stop."
break
}
if ($newDone -ge 3039) {
Write-Output "Alle 3039 fertig. Stop."
break
}
# Brief pause before retry
Start-Sleep -Seconds 3
}